Modbus slave on USB serial macro

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
jhill
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

Post by jhill »

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

User avatar
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

Post by Benj »

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.

jhill
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

Post by jhill »

Benj wrote:
Fri Dec 04, 2020 1:07 pm
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.
That would be perfect thankyou! :D

Kind regards

James

User avatar
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

Post by Benj »

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.

jhill
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

Post by jhill »

Benj wrote:
Fri Dec 04, 2020 4:26 pm
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.
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

User avatar
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

Post by Benj »

Hi James,

Make sure you do a full database update and it should be there.
UPdates.jpg
UPdates.jpg (56.87 KiB) Viewed 4176 times

jhill
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

Post by jhill »

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.
Capture4.PNG
Capture4.PNG (35.78 KiB) Viewed 4162 times
With the working program, in UART 1 I Get:-
Capture5.PNG
Capture5.PNG (107.42 KiB) Viewed 4162 times
And In the Modbus slave window:-
Capture6.PNG
Capture6.PNG (12.88 KiB) Viewed 4162 times
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

User avatar
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

Post by Benj »

Hi James,

Thanks for letting me know. I think I have now fixed the hardware problem for you, i'll investigate the sim problem.

jhill
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

Post by jhill »

Hi Ben,

Thankyou, I will give that a try.

Kind Regards

James

jhill
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

Post by jhill »

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
USB Modbus Test.fcfx
(18.21 KiB) Downloaded 161 times

User avatar
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

Post by Benj »

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.

jhill
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

Post by jhill »

Hi Ben,

That worked and the macro is now working well on hardware. Thankyou for your help!

KInd regards

James

User avatar
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

Post by Benj »

Excellent, thanks for letting me know. :D

Post Reply