Modbus TCP/IP packets issue in T4 | LabJack
 

Modbus TCP/IP packets issue in T4

9 posts / 0 new
Last post
Mattias
jerrymattias's picture
Modbus TCP/IP packets issue in T4

We seem to hit some sort of issue when we try to query separate modbus registers in separate requests in a pretty shorte timeframe.

It works when only polling one register but when query 2 registers in sparate calls LabJack seem to start mixing up to mix up the data. 

In packet 165 with transaction ID 45 we ask for the value of register 2007, the answer with ID 45 in packet 168 contains the value of register 3508.

The packet no 166 with ID 46 where we actually ask fot the value in register 3508 never gets an answer. 

 We poll about 30 times/second per register.

Is this the expected behaviour at this speed?

The device is H/W 1.02 and F/W is 1.0022

LabJack Support
labjack support's picture
The Ethernet 502 ports work

The Ethernet 502 ports work in a commend-response mode. Once a command has been received any additional data received will be discarded. That is usually fast enough to send 1000 packets per second, depending on the requested operations. If you need to squeeze in more register operations then we need to use the Feedback modbus command or a stream-mode.

Mattias
jerrymattias's picture
Thank you for a quick

Thank you for a quick response.  According the Modbus TCP  implementation guide it should be possible for a client to initiate several parallell command/request transactions over TCP and this should be handled serverside using the MODBUS transaction identifier to keep them apart. 

Even if we in theory could address this issue in client application side by sending one request at the time we rather not as it would not follow the implementation guide. (Page 10, implementation rules). 

http://www.modbus.org/docs/Modbus_Messaging_Implementation_Guide_V1_0b.pdf

Using the out of specification feedback modbus command or a stream-mode is a bit to vendor specific for us to implement unless we see a very strong reason that cannot be delivered by "COTS"-devices.

LabJack Support
labjack support's picture
Is this the only register

Is this the only register pairing that you are able to reproduce this problem with or are you able to do so with other registers?

How do you have the digital I/O extended feature configured?

We performed a quick test with reading AIN channels and the LJM library which utilizes the Modbus Feedback command function and were not able to reproduce this issue.

Mattias
jerrymattias's picture
I have not done done any

I have not done done any tests on other registers, this happened all the time and was easy to reproduce with the registers seen in the wireshark capture. 

We have a quadrature encoder wired to FIO04 and FIO05 with the following config:

DIO4_EF_INDEX=10

DIO5_EF_INDEX=10

DIO4_EF_ENABLE=1

DIO5_EF_ENABLE=1

The encoder and the value works as expected as long as we only send commands to one register. However, i suspect that this issue with mixing up data between the modbus transaction ID´s can happen without us notice as long as the register are the same. I don't think the client would have any issues with that, just the data will be slightly wrong and in this case with asking for a absolute linear position the position will jump back and forth i few pulses. 

 

 

LabJack Support
labjack support's picture
We changed firmware to allow

We changed firmware to allow multiple packets to be sent without first requiring a response. You can try beta firmware 1.0288.

During my testing I was able to send two modbus packets in a single Ethernet packet, but I have not been able to get any of my software to send a second Ethernet packet before getting a response. I will keep trying. In the meantime, please let me know how the new firmware works for you.

Mattias
jerrymattias's picture
I wanted to test this today

I wanted to test this today but discovered that the beta F/W is made for T7, I happen to use a T4 so unfortunatly I am not able to test and verify that the firmware solves this issue. Any chance to push this fix into the T4 F/W?

LabJack Support
labjack support's picture
OK T4 1.0027 is now available

OK T4 1.0027 is now available. Sorry about the mixup.

https://labjack.com/support/firmware/t4

Mattias
jerrymattias's picture
I have now tested with 1.0027

I have now tested with 1.0027 beta and the issue seem to be solved! We can now poll multiple registers in random order and the data is returned with the right transaction IDs.

Thanks, great support!