Modbus array of values input

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

Moderator: Benj

Post Reply
dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times

Modbus array of values input

Post by dannyvanneijenhoff »

Hello

I have trouble to use the field CoilData in "Force mutilpe coils" in modbus master, type BYTE[]

Nothing (sofar) is working, maybe something easy :shock:
Knipsel.JPG
Knipsel.JPG (21.3 KiB) Viewed 3920 times
Attachments
Knipsel.JPG
Knipsel.JPG (41.22 KiB) Viewed 3919 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 array of values input

Post by Benj »

Hello,

You need to create a byte array for the parameter.

So make a byte variable and name it something like array[5] where 5 is the number of bytes in the array.

You can then just use array as your parameter. i.e. without the square brackets.

5 * 8 allows you to control up to 40 coils.

Hope this helps.

dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times

Re: Modbus array of values input

Post by dannyvanneijenhoff »

Thanks for the reply,


i can fill in the VAR "array" now ( not array[2] ) in the component but the data output is not correct, i am missing the data from VAR "array"

wrong data : 2 15 0 0 0 8 0 .. 63 255 (from flowcode)
correct data: 2 15 0 0 0 8 0 7 127 84

the VAR array[2] var is working in another component
Attachments
array2.JPG
array2.JPG (21.48 KiB) Viewed 3581 times
array.JPG
array.JPG (28.09 KiB) Viewed 3581 times

Post Reply