Unable to get Modbus to work with VNET

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

Moderator: Benj

Post Reply
Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Contact:

Unable to get Modbus to work with VNET

Post by Zane »

Hi Ben,

I have tried getting the Modbus components working, a master sending data to a slave and looking for the confirmation back at the master. In the master flowchart in the console you can see Modbus data being generated and the data in the Modbus master - Vnet that is being sent to the slave. When you look in the console for the slave flowchart you can see the incoming data in the Modbus slave - Vnet but in the Modbus slave data this is empty. The macro "check for incoming" appears to be always returning 0 for no data detected.

I think i have configured everything correctly?

Thanks
Attachments
Master.fcfx
(9.06 KiB) Downloaded 78 times
Slave.fcfx
(9.41 KiB) Downloaded 80 times

User avatar
Benj
Matrix Staff
Posts: 15008
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: Unable to get Modbus to work with VNET

Post by Benj »

Hello,

I have spent a bit of time on this now and have things semi working. The master command to the slave is now working correctly but the reply to the master is not correct.

I did a big overhaul of how communications were handled moving from v7 to v8 to get away from these types of bugs and to improve reliability for simulation comms with injectors etc. So I unfortunately cannot simply copy the v8 code into the v7 components because certain features just are not there in v7.

Here is a new slave component.
ModbusSlave.fcpx
(91.93 KiB) Downloaded 88 times
And here are your example files slightly tweaked.
Master.fcfx
(9.65 KiB) Downloaded 90 times
Slave.fcfx
(13.64 KiB) Downloaded 88 times
Let me know how you get on.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Contact:

Re: Unable to get Modbus to work with VNET

Post by Zane »

Thanks for your work on this, I am away for the next few days. When I get back I will try this out and let you know how we get on.

Thanks

Zane

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Contact:

Re: Unable to get Modbus to work with VNET

Post by Zane »

Hi Ben,

The simulation is working as you mentioned. I understand about the compatibility issues, no worries there. I have some hardware arriving soon so can try with that. Once again thank you for your help, its always appreciated. Cheers

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Contact:

Re: Unable to get Modbus to work with VNET

Post by Zane »

Hi Ben,

I have tried using the modbus master function and i am getting the results i expect.

Thanks

Post Reply