Modbus basic functions

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

Moderator: Benj

Post Reply
Walbeek
Flowcode v5 User
Posts: 68
Joined: Thu Mar 01, 2007 10:48 am
Location: Netherlands
Been thanked: 3 times
Contact:

Modbus basic functions

Post by Walbeek »

Hi there,

I'm trying to use the Modbus Master component in Flowcode V6.
With the "ReadHoldingRegister" I try to read the value of registers in the slave (PLC controller)
I use it with settings 1 (SlaveID), 40001 (RegAddress), 10 (RegCount)
I think the Master reads the data on registers with address 40001 .... 40010?
How can I use this data in the software, I want to copy the value's in Variables (Int)
For example, register 40001 to variable "Setpoint", register 40002 to "Status"...
Can you please help me out with this?
Greetings, Rinie
Flowcode V7 user

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 basic functions

Post by Benj »

Hello,

The holding register address runs from 0, so address 0 is register 40001, address 1 is 40002.

I'm going through the MODBUS component now to try and improve the help so it's more obvious what needs to be entered.

Walbeek
Flowcode v5 User
Posts: 68
Joined: Thu Mar 01, 2007 10:48 am
Location: Netherlands
Been thanked: 3 times
Contact:

Re: Modbus basic functions

Post by Walbeek »

Hello Ben,

Thanks for your response.
So I have tu use it with settings 1 (SlaveID), 0 (RegAddress), 10 (RegCount).
This will read data from register 0 to register 10?

I can't use the "GetResponce" command to check the data.
The "GetResponceByte" command can copy something in a Byte variable.
So when I use:

ReadHoldingRegister 1, 0, 10 ; reads 10 registers, starting with 40001
GetResponceByte 0, Setpoint ; copy's the data of register 40001, now byte 0 to byte Setpoint

Is this correct?

Another question, the Holding registers of a PLC are all Integer variables.
This doesn't fit in a Byte I assume.

Please let me know.

Rinie
Greetings, Rinie
Flowcode V7 user

Post Reply