I'm trying to get my T1K-EBC100 to work with a PLC from Opto22 via Modbus/TCP. So far all of the commands work except 15 (force multiple coils). I've worked with their tech support but have not been able to resolve the problem. At this point I'm making sure that I check all of the possible problem areas before digging any deeper, hence the inquiry here.
Here's what I know:
- If a coil is already set--either by another program or by funcion 05--the call to function 15 clears all of the coil bits, turning all the coils off.
- The tech at Opto22 was able to get one of their field I/O units (Opto22 brand) to work with the same Modbus/TCP function 15.
- Adjusting the number of coils (bit count), starting coil and other parameters in the control program has no effect.
- Packet sniffing on the network has turned up some interesting behavior from the PLC, namely a byte count of zero:
Modbus/TCP
transaction identifier: 1
protocol identifier: 0
length: 14
unit identifier: 1
Modbus
function 15: Force Multiple Coils
reference number: 0
bit count: 50
byte count: 0
Data
0030 4b 1c 3b 62 00 00 00 01 00 00 00 0e 01 0f 00 00 K.;b............
0040 00 32 00 03 00 00 00 00 00 00 .2........
When I send function 15 from a LabVIEW ModbusTCP app, the byte count is non-zero and the coils behave as expected:
Modbus/TCP
transaction identifier: 0
protocol identifier: 0
length: 8
unit identifier: 0
Modbus
function 15: Force Multiple Coils
reference number: 0
bit count: 4
byte count: 1
Data
0030 ff 04 bb 4e 00 00 00 00 00 00 00 08 00 0f 00 00 ...N............
0040 00 04 01 01 ....
Is the implementation of the byte count field optional? That's the only difference that I can see between the two packets. The developer at Opto22 states that the library was developed against a standard Modbus device, and that they haven't had reports of this problem from other Modbus devices.
Both myself and the tech at Opto22 are stumped, so any input would be greatly appreciated.
*edit* Marked as solved.