libplctag.NET: Read array tags for Omron PLC broken with v1.4.0

After upgrading from libplctag.NET 1.2.0 it is not possible to read arrays anymore.

PLC: Omron NX1P2

For example, I want to read a tag named “AlarmList”, datatype BOOL[64]

Code:

var tag = new Tag<BoolPlcMapper, bool[]>()
{
    Name = "AlarmList",
    Gateway = "192.168.250.1",
    Path = "1,0",
    PlcType = PlcType.Omron,
    Protocol = Protocol.ab_eip,
    ArrayDimensions = new int[] { 64 },
    Timeout = TimeSpan.FromMilliseconds(5000)
};

tag.Read();

This code works fine with version 1.2.0 but throws an exception “ErrorBadParam” with 1.3.0 and 1.4.0. I looked at the changelog but I couldn’t locate what has changed regarding arrays.

Logs level 4: logs.txt

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 88 (32 by maintainers)

Most upvoted comments

I am tracking known Omron problems in issue 469 in the core DLL project. If I have missed any, please let me know.

It is certainly less data when all the bits are packed into the bytes. But the fact that you get two different formats is really painful.

Starting with BOOLs seemed like a good idea. - https://github.com/libplctag/libplctag.NET/issues/381#issuecomment-2175719103

A DINT array would be more straightforward. BOOL arrays and strings seem to have a lot more variation. Even individual BOOL values are encoded differently for different devices.

Bad Param sounds like a core library error. Can you capture the logs and attach them? Use debug level 4 (detail). If the version of the .Net wrapper you are using uses version 2.6.0 of the core library, then that has a lot of small changes for Omron contributed by a user.