News:

  • July 01, 2026, 08:29:08 AM

Login with username, password and session length

Author Topic: Modbus/TCP Server problems  (Read 45906 times)

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #15 on: December 03, 2014, 02:43:08 PM »
Even when running the Modbus slave on my PC, it takes 2 scans before I can get a code into the client if the scanner has been idle.
Still can't get to tech support at Datalogic... :(
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus/TCP Server problems
« Reply #16 on: December 03, 2014, 02:56:16 PM »
If you bump up the idle disconnect time on the DM1, does it still fail there?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #17 on: December 03, 2014, 02:57:37 PM »
I have attached one more trace just to show what is happening with a working Modbus slave.
There are 3 scans in this trace. One scan, and then a pause, and then 2 successive scans (AG108 is the data).

This is using a Matrix 300 that has been reset to factory defaults, and then the imaging calibrated, and the only other settings I changed was enabling the Modbus Client, and setting the Modbus addressing.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #18 on: December 03, 2014, 03:11:32 PM »
If you bump up the idle disconnect time on the DM1, does it still fail there?

The fail is directly tied to the DM1 timeout setting. I will see if I can figure out something with Datalogic. Their documentation for Modbus covers less than one page in the manual.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Modbus/TCP Server problems
« Reply #19 on: December 03, 2014, 04:24:37 PM »
Not sure how the Datalogic side works, but what if you did something to keep the link active? Either read or write data that is constantly changing, like a heartbeat pulse?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus/TCP Server problems
« Reply #20 on: December 03, 2014, 04:24:56 PM »
Then I'd say it is what I suspected; DataLogic isn't handling the disconnect. Bad form, but I understand the issue having solved it for Do-more.

The biggest issue I see is that they don't appear to be making much of an effort to retry the operation when it fails. That might fly in the scanner world, but it would be sternly frowned upon in control.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus/TCP Server problems
« Reply #21 on: December 03, 2014, 04:25:14 PM »
Not sure how the Datalogic side works, but what if you did something to keep the link active? Either read or write data that is constantly changing, like a heartbeat pulse?

DataLogic is the master.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #22 on: December 03, 2014, 05:13:06 PM »
I know there is a heartbeat setting for the Datalogic, but I really don't want the overhead on my network if I can get by without it.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Modbus/TCP Server problems
« Reply #23 on: December 03, 2014, 05:41:20 PM »
Most of those transmit once a second or maybe you can set it? I doubt it would affect anything and you can monitor it in the DoMore to check the integrity of the link. Keeping data going through the port may keep it open. Try it.

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #24 on: December 04, 2014, 01:54:25 PM »
Spent all morning with Datalogic tech support. There is a problem with their implementation of Modbus TCP. Also, the heartbeat will not work on Modbus (it is supposed to, but it is broke). They do have a TCP Data Socket that I am going to try to use until they get me a Firmware update.
Thank you guys for the support!
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #25 on: December 05, 2014, 08:32:50 AM »
Are their any monitoring bits/registers in DMD that I could look at to see the status of the Modbus server?

Also, what are the dangers in setting the Modbus server's timeout to 2 hours?
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #26 on: December 08, 2014, 12:09:49 PM »
I got a new switch so I can mirror ports now ;D
Here is a sample trace between DMD and Datalogic. The barcode data that is being sent is 'AG108'.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #27 on: December 08, 2014, 03:32:31 PM »
I am learning to use Wireshark, and am trying to cut out the extraneous data in the trace files. Here is the latest that records everything to and from my H2-DM1E and the Datalogic from power-up until I make several scans (notice the first scan was a no-read).
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus/TCP Server problems
« Reply #28 on: December 08, 2014, 05:13:26 PM »
Key parts of the trace:

1. DataLogic (DL) does an odd thing at the start. He sends out a gratuitous ARP, which essentially announces to the network that he 10.0.0.26. He then issues 4 ARP requests for the PLC in 2us. Not hurtful, but odd to burst off 4 requests without waiting for a reply.
2. Upon receiving the first response from the PLC, he opens a connection.
3. After about 1 minute, the PLC closes it due to inactivity, and DL ACKs him indicating that he at least saw the close request.
4. 15 seconds after that, DL sends a Modbus write.
5. DL immediately follows it with a connection close and a RST/ACK...doesn't wait for a response. It feels like the socket is goofed up at this point.
6. PLC says, huh? (resets the connection)
7. 6 seconds later, DL opens a new connection and successfully speaks Modbus.

Basically, he gets flustered when the server drops the line on him. He eventually recovers, but doesn't appear to retry the failed comm.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus/TCP Server problems
« Reply #29 on: December 09, 2014, 01:18:23 PM »
I have implemented Datalogic's Data Socket protocol instead of Modbus. It is working great!
THANK YOU Host for giving us these great protocol development tools!!!

I will continue to work with Datalogic on getting their Modbus protocol working, and will update this thread with the results.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com