Modbus Component

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

Moderator: Benj

Post Reply
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times

Modbus Component

Post by Steve001 »

Evening All

Just having a play with modbus component and reading wiki

The frame type is this only available on the master or is it available on the slave component also

Code: Select all

Frame Type
This property is of type Fixed list of ints and can be referenced with the variable name FrameType.
Switches between RTU and ASCII forms of Modbus
Is there an example on how to set it ?

Steve
Success always occurs in private and failure in full view.

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 Component

Post by Benj »

Hi Steve,

Both the Master and the Slave components should have the Frame type property allowing you to switch between RTU and ASCII communications methods for ModBus. There is currently no way to switch modes on the fly, is this what you were after?

The ASCII mode is probably less well tested by users so there is possibly bugs lurking that I'm not aware of.

Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times

Re: Modbus Component

Post by Steve001 »

Hi Ben

I was going to set the mode in a setup menu along with other things

Steve
Success always occurs in private and failure in full view.

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 Component

Post by Benj »

The only way I can think to allow this currently is to have two modbus master components in your program. One configured to be RTU and the other ASCII. You then decide which one to use based on which one has been specified.

I could allow it to be set in software using a single component but it will increase both the ROM and the RAM usage slightly. i.e. currently it only includes code for one method or the other but with a variable setting it would have to include code for both modes. Maybe I can add a third option to the property which is specified in software and this way it only adds bloat if you want to be able to switch between.

Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times

Re: Modbus Component

Post by Steve001 »

Hi Ben

Thank you for that, it was only a thought at the moment for playing with

Regards

Steve
Success always occurs in private and failure in full view.

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times

Re: Modbus Component

Post by EtsDriver »

If the framer could be set on the fly, the speed could also be set on the fly maybe? :)
Ill just keep the good work up!

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 Component

Post by Benj »

I'll have a play with the comms mode and see if it's a simple addition.

Speed change on the fly is certainly possible, it already exists in the CAL so we just need to expose it in the component.

Would you want these additions for both the master and slave?

Auto baud for the slave might be nice but would need to be added to the CAL for devices that support it, which certainly isn't all of them.

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 Component

Post by Benj »

Right here are the new components with the variable frame type and baud rate.
Modbus.fcpx
(19 KiB) Downloaded 389 times
ModbusSlave.fcpx
(90.62 KiB) Downloaded 357 times
Let me know how you get on.

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 Component

Post by Benj »

Just so you are aware, the Slave has had another couple of bug fixes here.
viewtopic.php?f=63&t=18424&start=25#p80279

Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times

Re: Modbus Component

Post by Steve001 »

hope to have a play this weekend

Cheers ben

Steve
Success always occurs in private and failure in full view.

Post Reply