Omron NX-NJ Multiple-request packets - help

176 views
Skip to first unread message

Jonathon Stevens

unread,
Sep 22, 2021, 6:03:34 PM9/22/21
to libplctag
Hi everyone,

Firstly thanks to everyone that has contributed to make this library what it is today. I am currently trying to use/edit this library to allow multiple-request packets for an Omron nx-nj (specifically Omron NX1P2) to increase the communication speed of my program. Currently I am sending a single request packet from a linux system in 7 ms with on average 3 ms ping.

I have currently tried to edit the AB_PLC case to allow packing and alter the element count to allow for the 4 packets I need to send. Was going to start investigating setting up the tags and writing them in arrays and see if that works but maybe I am missing something. Have tried looking into async.c example but believe it isn't the same as what I am trying to accomplish.

Any help or suggestions with this would be appreciated.

Cheers,
Jonathon

Kyle

unread,
Sep 22, 2021, 8:47:48 PM9/22/21
to libplctag
Hi Jonathon,

You can try to talk to the Omron using the ControlLogix PLC type.   I am trying to remember all the problems.  I think they are these:
  • You must use a path that points to the Omron itself as if it was being bridged.  So the path might look like "path=18,192.168.1.100" if your Omron was at address 192.168.1.100.
  • You always use an elem_count of 1: "elem_count=1".   The Omron will send back the entire tag even if it an array.
  • Omron appears to not support fragmented reads.  The ControlLogix code defaults to doing fragmented reads.  This might be a problem trying to emulate it.

The Omron code was donated by a kind user and I do not have one, so I do not know much about it.   The code he donated was modified in several places from the original *Logix code.   I separated it out a bit but generally it is just using the same code as *Logix.

Try using the tag_rw2 test program to get the correct tag attribute string.  If that works, you can use that in something like the async.c example to see if you can send a multi-request packet.  The one thing that might stop this idea is the last point above.   I default to using fragmented reads (writes are only fragmented if you really need them to be).

Note that a lot of the non-Rockwell PLCs that claim to support EIP/CIP do not support all of Rockwell's extensions.  Even Rockwell does not support all of Rockwell's extensions.   IIRC, the Micro800 series does not support multi-request packets.  Are you certain that the Omron supports multi-request packets?  It apparently does not support fragmented reads or writes.  It would be great if it does!

Best,
Kyle

Jonathon Stevens

unread,
Oct 11, 2021, 3:46:52 PM10/11/21
to libplctag
Hi again,

Just to close off this thread, could not figure out how to send multiple request packets for the Omron PLC or even if it is compatible. We manage to sort it out by creating an Omron datatype (or struct) and sending that. We found that a python library called aphyt was particularly suited to this application and we are now using this library. Did not look to see if we could do this with libplctag however.

If anyone has any questions or comments I will try and help/inform where I can but my knowledge of aphyt and Omron PLC's is pretty limited.

Thanks all

Kyle

unread,
Oct 12, 2021, 11:32:26 PM10/12/21
to libplctag
Thanks for the update!

I would reach out to the authors of pylogix and pycomm3.   Both of those libraries support EIP/CIP PLCs and are stable and mature.  From the description of aphyt, it looks like the Omron does support tag listing. I will need to dig into their code to see if they use the same CIP commands that are used for AB PLCs.   Thanks for the tip!

Best,
Kyle
Reply all
Reply to author
Forward
0 new messages