disclaimer- 1,no one in their right mind would pick this configuration but I want to try and get it working. 2, my MB knowledge is sketchy at best.
I have the PLC setup as a master and the hmi as slave.
There are 3 blocks in the software, read_var, write_var and write_read_var
I want to press a button on the HMI and have that set a bit in the PLC, which function code should I use? (snip1)
I am assuming that I will want to write data so that would be FC 5 or 15. Lets go with 5 for a single coil..
when I do that i set up the block to read the variable in the PLC as so (snip2)
objtype- 1 for digital input
firstobj as 20 as it was addresed at 20 in the hmi software ( have also tried 19)
quantity- 1 as it is 1 bit
index data- 5 (%mw5, just a home for it)
The error being returned is bad length (snip3)
I am thinking I am putting a bit into a word.. so that should be ok?
Where am I going wrong?
Cheers!
snip4 plc prg
I have the PLC setup as a master and the hmi as slave.
There are 3 blocks in the software, read_var, write_var and write_read_var
I want to press a button on the HMI and have that set a bit in the PLC, which function code should I use? (snip1)
I am assuming that I will want to write data so that would be FC 5 or 15. Lets go with 5 for a single coil..
when I do that i set up the block to read the variable in the PLC as so (snip2)
objtype- 1 for digital input
firstobj as 20 as it was addresed at 20 in the hmi software ( have also tried 19)
quantity- 1 as it is 1 bit
index data- 5 (%mw5, just a home for it)
The error being returned is bad length (snip3)
I am thinking I am putting a bit into a word.. so that should be ok?
Where am I going wrong?
Cheers!
snip4 plc prg