Modbus slave on USB serial macro
Moderator: Benj
-
- Posts: 65
- Joined: Thu Jan 31, 2019 3:46 pm
- Has thanked: 11 times
- Been thanked: 12 times
- Contact:
Modbus slave on USB serial macro
Hi.
Is there a way to use USB serial macro on and ECIO40 as the serial port for the Modbus Slave Macro?
Kind regards
James
Is there a way to use USB serial macro on and ECIO40 as the serial port for the Modbus Slave Macro?
Kind regards
James
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus slave on USB serial macro
Hi James,
We can't do this at the moment but it certainly should be possible.
I can't really look into it today for you but I'll have a crack at it next week if that's ok.
We can't do this at the moment but it certainly should be possible.
I can't really look into it today for you but I'll have a crack at it next week if that's ok.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 65
- Joined: Thu Jan 31, 2019 3:46 pm
- Has thanked: 11 times
- Been thanked: 12 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus slave on USB serial macro
Hi James,
I was wrong, I managed to fit it in for you today and wasn't as much work as I thought it might be.
It should now be available via the v8 update system. Let me know how you get on and if it works ok I'll add it into v9 too.
I was wrong, I managed to fit it in for you today and wasn't as much work as I thought it might be.
It should now be available via the v8 update system. Let me know how you get on and if it works ok I'll add it into v9 too.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 65
- Joined: Thu Jan 31, 2019 3:46 pm
- Has thanked: 11 times
- Been thanked: 12 times
- Contact:
Re: Modbus slave on USB serial macro
Thank you Ben, thats very much apreciated. My system isnt finding any updated components yet but ill give it a bit, maybe its not availble yet.
Best Regards
James
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus slave on USB serial macro
Hi James,
Make sure you do a full database update and it should be there.
Make sure you do a full database update and it should be there.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 65
- Joined: Thu Jan 31, 2019 3:46 pm
- Has thanked: 11 times
- Been thanked: 12 times
- Contact:
Re: Modbus slave on USB serial macro
Perfect, Thankyou Ben.
I have had a good go but I am afraid I cannot get this working in either simulation or on hardware.
In simulation, I have taken a known working (on hardware and simulation) program and changed the macro’s from Modbus Slave to Modbus Slave USB. On the USB serial 1 console I Get mostly TX timeout, with occasional data revieved. There is nothing in the Modbus slave window.
With the working program, in UART 1 I Get:-
And In the Modbus slave window:-
There are no differences between the programs except changing the Modbus Slave macro's to Modbus Slave USB, i am not sure if there is more i need to do? The modbus master is running unchanged between the two
Testing on hardware, the modbusslaveUSB initialise block returns success, but the ECIO40 hangs once the check for incoming macro is called, it never returns a fail or success.
One the only real difference it see is i can set the baud rate for the serial modbus slave, but here is no option for this in the USB serial macro. The master is set to 9600 for both, and i have used the standard usbserial macro on ECIO40 at 9600 without issue?
Kind Regards,
James
I have had a good go but I am afraid I cannot get this working in either simulation or on hardware.
In simulation, I have taken a known working (on hardware and simulation) program and changed the macro’s from Modbus Slave to Modbus Slave USB. On the USB serial 1 console I Get mostly TX timeout, with occasional data revieved. There is nothing in the Modbus slave window.
With the working program, in UART 1 I Get:-
And In the Modbus slave window:-
There are no differences between the programs except changing the Modbus Slave macro's to Modbus Slave USB, i am not sure if there is more i need to do? The modbus master is running unchanged between the two
Testing on hardware, the modbusslaveUSB initialise block returns success, but the ECIO40 hangs once the check for incoming macro is called, it never returns a fail or success.
One the only real difference it see is i can set the baud rate for the serial modbus slave, but here is no option for this in the USB serial macro. The master is set to 9600 for both, and i have used the standard usbserial macro on ECIO40 at 9600 without issue?
Kind Regards,
James
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus slave on USB serial macro
Hi James,
Thanks for letting me know. I think I have now fixed the hardware problem for you, i'll investigate the sim problem.
Thanks for letting me know. I think I have now fixed the hardware problem for you, i'll investigate the sim problem.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 65
- Joined: Thu Jan 31, 2019 3:46 pm
- Has thanked: 11 times
- Been thanked: 12 times
- Contact:
Re: Modbus slave on USB serial macro
Morning Ben,
Testing on hardware I seem to have the same issue, a lockup at check for incoming. Please see attched in case I am doing something silly.
Kind regards,
James
Testing on hardware I seem to have the same issue, a lockup at check for incoming. Please see attched in case I am doing something silly.
Kind regards,
James
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus slave on USB serial macro
Hi James,
Hmm I changed the default property inside the component but looks like it maybe hasn't stuck.
For now you can do the following to hopefully rectify the problem.
Click on View -> Component Debugger
Check the tickbox "Expose full component tree"
In the property window click the drop down right at the top of the window and select the USB_Serial1 component
Change the Return type property from 8-bits to 16-bits
Untick the tickbox "Expose full component tree"
Try to do a compile to target now and hopefully the lockup problem will be resolved.
I'll see if I can force the property to be the correct setting via an update to avoid this problem in future.
Hmm I changed the default property inside the component but looks like it maybe hasn't stuck.
For now you can do the following to hopefully rectify the problem.
Click on View -> Component Debugger
Check the tickbox "Expose full component tree"
In the property window click the drop down right at the top of the window and select the USB_Serial1 component
Change the Return type property from 8-bits to 16-bits
Untick the tickbox "Expose full component tree"
Try to do a compile to target now and hopefully the lockup problem will be resolved.
I'll see if I can force the property to be the correct setting via an update to avoid this problem in future.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 65
- Joined: Thu Jan 31, 2019 3:46 pm
- Has thanked: 11 times
- Been thanked: 12 times
- Contact:
Re: Modbus slave on USB serial macro
Hi Ben,
That worked and the macro is now working well on hardware. Thankyou for your help!
KInd regards
James
That worked and the macro is now working well on hardware. Thankyou for your help!
KInd regards
James
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus slave on USB serial macro
Excellent, thanks for letting me know.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel