MicroLogix 1400 and reading Binary Files (e.g., B3:0/1 or B45:0/11)

257 views
Skip to first unread message

Cory Podojil

unread,
Sep 15, 2021, 6:59:43 PM9/15/21
to libplctag
Kyle (and pals)!! Absolutely digging you hard work here, great stuff! Very much appreciated.

I find myself stuck while attempting to read bit values from a MicroLogix 1400 PLC. Here's the tags:
B3:1/3
B45:0/11
B3:0/14

I am able to perform a plctag.plc_tag_get_bit(id, 0) to return 0/1 but if I add change the offset I get a 'Data offset out of bounds!' error. Using the .NET wrapper, it's always false (unit8 conversion issues?). 

Background: using the libplctag.NET C# library, works exceptionally well for ControlLogix but no luck thus far with MicroLogix 1400/SCL500.

Debug logs attached for B45:0/11:
WithOffset.txt - offset == 11
WithoutOffset.txt - offset == 0

Thoughts/guidance?

Thanks,
-Cory
WithOffset.txt
WithoutOffset.txt

Kyle

unread,
Sep 17, 2021, 11:08:18 PM9/17/21
to libplctag
There seems to be a problem with MicroLogix and binary files.   I just got a MicroLogix (today!) so I hope to figure out how to get it working and then I can test this.   I was able to get some dumps before and one of the things I saw is that the library is requesting only one byte and should be two.  

When a single bit is being accessed the library needs to read a full INT (2 bytes) and then mask off the right bit.   This is not well supported yet.  It is on the list to fix and does appear to work correctly on PLC/5 systems.

Best,
Kyle

Cory Podojil

unread,
Sep 18, 2021, 3:56:08 PM9/18/21
to libplctag
Oh sweet! Glad you got your hands on the device! Let me know if I can help with testing or more debug logs.

Kyle

unread,
Sep 22, 2021, 12:20:10 AM9/22/21
to libplctag
Still trying to find time to set it up.  I have MicroLogix 1100.  That was the cheapest thing I could find with Ethernet.

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