Read tag list on Micro820

452 views
Skip to first unread message

vern van leuven

unread,
Nov 29, 2021, 12:09:19 PM11/29/21
to libplctag
The following fails with "ErrorBadParam". Any ideas how to read the tag list on the Micro8xx? I am able to read tag values with these settings and Name set to a known tag.

                tags = new Tag<TagInfoPlcMapper, TagInfo[]>()
                {
                    Gateway = "192.168.5.11",
                    Path = null,
                    PlcType = PlcType.Micro800,
                    Protocol = Protocol.ab_eip,
                    Name = "@tags"
                };

                tags.Read();

Kyle

unread,
Dec 1, 2021, 12:15:31 AM12/1/21
to libplctag
Hi,

Currently the library only turns on tag listing for Logix-class PLCs.   ControlLogix and CompactLogix.   Do Micro800-series PLCs support tag listing?   If they do, I can turn it on for those in a branch and you can test it.

Best,
Kyle

vern van leuven

unread,
Dec 1, 2021, 8:57:03 AM12/1/21
to libplctag
Hi Kyle,

Thanks for the reply. I'm not sure that the Micro800 supports tag listing. The CIP messaging manual I found lists a symbol object (page 60, link below), but I'm not sure if this can be used to get the tag listing. I would be happy to test if you think tag listing is possible.


Another curiosity of the Micro800 is that it doesn't seem to expose program scope variables. I can only read global scope variables. The image below shows an overview of programs and variables. Setting name="Programs:Prog1.var2" fails to read with ErrorBadParam. Maybe I don't have the correct syntax, but I've tried every permutation I can think of. Would love to hear if anyone else has figured this out.

Thanks, Vern

Capture.JPG

Kyle

unread,
Dec 3, 2021, 1:12:33 AM12/3/21
to libplctag
Thanks for the pointer to the doc!

It looks like the Micro800 only partially supports tag listing.   There are two parts on a ControlLogix system: 1) list out all the tag/symbol instances, then 2) get all the definitions of the UDTs.   Can you make UDTs on a Micro800? 

This looks similar to Omron as well.  

Can you capture debugging out put with debugging level 4?   That will let me see what is happening when you try to read a program-level tag.   Your syntax looks right to me.   On my ControlLogix, I use a tag string like this:

```text
./tag_rw2 --type=sint32 '--tag=protocol=ab-eip&gateway=10.206.1.40&path=1,4&plc=ControlLogix&elem_size=12&elem_count=1&name=Program:MainProgram.Count'
```

This reads a tag named "Count" which is a counter in the program MainProgram.

Best,
Kyle

vern van leuven

unread,
Dec 3, 2021, 2:01:52 PM12/3/21
to libplctag
Hi Kyle,

It doesn't appear possible to create UDTs on the Micro800. 

I've attached text files showing output for attempts to read tag info and program scope variable. 

Thanks, Vern

TagList.txt
ProgVar.txt

Kyle

unread,
Dec 3, 2021, 10:22:13 PM12/3/21
to libplctag
Thanks for the debugging output.   For the program vars, the PLC is definitely unhappy.  The error definitely shows that the PLC is not able to parse the program tag name.   From that I would guess that Micro800-series do not support getting program vars.   That seems like a big miss, but there are a lot of strange things about the Micro800.  

For the tag list, the PLC type is causing the library to not check for special tag names.   I will need to enable the library to treat these specially as it does for ControlLogix.

I will try to get a prerelease of that change out this weekend.

Best,
Kyle

Kyle

unread,
Dec 23, 2021, 9:56:52 AM12/23/21
to libplctag
Hi Vern,

The latest release should allow better (not great) support for tag listing.

Can you give this a try?

Also, can you modify the test_raw_cip.c program so that it uses your Micro820?   It just does one attempt at reading tags (it does not decode them).  If that program succeeds then there is something we can work with.

Do you know where I could get a used Micro8xx?  Like Omron, it seems that CIP support differs a lot from Control/CompactLogix PLCs.

Best,
Kyle

vernt...@gmail.com

unread,
Dec 28, 2021, 1:39:37 PM12/28/21
to Kyle, libplctag

Kyle,

 

Attached are results from a DINT read of the variable “Test”, and an attempt to read tag listing with “@tags”.

 

I had to remove the “Path” field to get any success with the DINT read.

 

I could loan you my Micro820 if you like.

 

Thanks, Vern


On Tuesday, November 30, 2021 at 10:15:31 PM UTC-7 Kyle wrote:

Hi,

 

Currently the library only turns on tag listing for Logix-class PLCs.   ControlLogix and CompactLogix.   Do Micro800-series PLCs support tag listing?   If they do, I can turn it on for those in a branch and you can test it.

 

Best,

Kyle

 

 

On Monday, November 29, 2021 at 9:09:19 AM UTC-8 vernt...@gmail.com wrote:

The following fails with "ErrorBadParam". Any ideas how to read the tag list on the Micro8xx? I am able to read tag values with these settings and Name set to a known tag.

 

                tags = new Tag<TagInfoPlcMapper, TagInfo[]>()

                {

                    Gateway = "192.168.5.11",

                    Path = null,

                    PlcType = PlcType.Micro800,

                    Protocol = Protocol.ab_eip,

                    Name = "@tags"

                };

 

                tags.Read();

 

--
You received this message because you are subscribed to a topic in the Google Groups "libplctag" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/libplctag/qeMe_jN8U28/unsubscribe.
To unsubscribe from this group and all its topics, send an email to libplctag+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libplctag/e444ac81-376a-4072-b583-8a73101953a7n%40googlegroups.com.

@Tags Read.txt
DINT Read.txt

Kyle

unread,
Dec 28, 2021, 2:57:32 PM12/28/21
to libplctag
Hi Vern,

Thanks for testing.

I see that you are using the test_raw_cip.c program.   One of the things about that program is that it uses plc_tag_write() to send a request to a PLC.   The "magic" tag "@tags" does not support writes.   So that fails almost immediately before an attempt to open a TCP connection to the PLC even starts.  

You can use the tag_rw2 tool to get raw tag listing data (no interpretation of it is done) by using:

tag_rw2.exe --type=uint8 '--tag=protocol=ab-eip&gateway=10.206.1.40&path=1,4&plc=lgx&name=@tags' --debug=4 > log.txt 2>&1

It will dump out all the bytes that it gets back.   These will be the tag listing entries.   You will need to modify the tag string as you did with test_raw_cip.c.   I showed it here with the output redirected to a file "log.txt".  If you get any output data at all, then something worked.

I appreciate your offer of a loan of the Micro820.  I am going to see if I can find one locally.   Someone must have a damaged one.  All I need is one that will still boot and run well enough to connect to.   I got a Micrologix recently and it has been a huge help in making sure that I can support SLC and Micrologix PLCs.

Thanks for your help on this problem!

Best,
Kyle

vernt...@gmail.com

unread,
Dec 28, 2021, 3:27:38 PM12/28/21
to Kyle, libplctag

Hi Kyle,

 

No problem, really appreciate you working on this. I’ve attached the tag_rw2 output.

log.txt

Kyle

unread,
Dec 28, 2021, 7:53:53 PM12/28/21
to libplctag
Ahhh.   OK.  We are getting closer.   It looks like I missed changing some code in the Micro8x0 and Omron cases.  I will need to build another prerelease.   I can see that the request being built is not correct.  It looks like this could have impacted what happens internally with raw tags too.  I was looking at the raw tag example and not realizing that it would have built the right request (though the prefix was wrong) and that was throwing me off.   Using tag_rw2 made the problem more clear.

I will try to get a prerelease build done tonight.

Best,
Kyle

Krister Johnson

unread,
Dec 28, 2021, 8:34:14 PM12/28/21
to Kyle, libplctag
Kyle and this library are like the embodiment of that xkcd comic about open source maintainers 

Sent from my iPhone

On Dec 28, 2021, at 6:53 PM, Kyle <kyle....@gmail.com> wrote:


You received this message because you are subscribed to the Google Groups "libplctag" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libplctag+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libplctag/a4332e49-bbdd-4573-8095-c81ab023e57cn%40googlegroups.com.

Kyle

unread,
Dec 28, 2021, 8:38:51 PM12/28/21
to libplctag
I have a possible set of fixes in the prerelease branch.  Can you build from Git?   I can cut a prerelease drop if needed.   I try not to do those unless I have to because I have found that people pick them up but do not understand that they are not necessarily stable.

The test_raw_cip.c program can be changed to run just a tag listing, but still using the @raw tag.   The raw CIP request it makes _is_ a tag listing.   I should have had you check that first because it does the absolute bare minimum.

Change the tag string to be "protocol=ab-eip&gateway=192.168.5.11&plc=Micro800&name=@raw".  Notice that the magic tag name is still "@raw".  

Please try that and see if it works.  If it returns data, then please try the same tag_rw2 test again.   If that works, then perhaps the list_tags.c program will work.   *crosses fingers*

Best,
Kyle

vernt...@gmail.com

unread,
Dec 28, 2021, 9:23:12 PM12/28/21
to Kyle, libplctag

Yes I can.  I’ll give it a try and report back.

vernt...@gmail.com

unread,
Dec 28, 2021, 9:53:19 PM12/28/21
to Kyle, libplctag

Kyle,

 

Here’s the results. Looks like progress.

 

Regards, Vern

test_raw_cip.txt
tag_rw2 log.txt
list_tags_c log.txt

Kyle

unread,
Dec 28, 2021, 11:59:14 PM12/28/21
to libplctag
Hi Vern,

Looks like you are using the previous version.   I see it printing 2.4.8 and the current prerelease version is 2.4.9.   I have added a bit more debugging to see if I can determine where the tag vtable is being set as it looks like something might be overwriting it from the correct value to a generic CIP vtable.

Best,
Kyle

Jody Koplo

unread,
Dec 29, 2021, 1:27:47 AM12/29/21
to Kyle, libplctag
This has been on my mind a bit, but I think it's possible to cobble together a wireguard network with a layer 4 proxy and give someone across the country/world the ability to access a PLC... 

I've definitely used nginx and other proxies to route PLC traffic between networks without a NAT. Should work combined with wireguard and I've been looking for an excuse to play with wireguard networks.

Not something I'd rely on in a production scenario, but could be a good fit for some packet testing against a PLC.

Anyone interested in trying it out?

Jody

You received this message because you are subscribed to the Google Groups "libplctag" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libplctag+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libplctag/d4f4b6b0-9495-4023-a682-4f8c8a0d24a7n%40googlegroups.com.

vernt...@gmail.com

unread,
Dec 29, 2021, 8:22:26 AM12/29/21
to Kyle, libplctag

Kyle,

 

Sorry about that. I think I misunderstood what I could do with Git

 

This morning I used the prerelease and it looks like it works!

tag_rw2 log.txt
test_raw_cip log.txt

Kyle Hayes

unread,
Dec 29, 2021, 11:08:48 AM12/29/21
to vernt...@gmail.com, Jody Koplo, libplctag
@Jody Koplo
  There was a company in Denmark that gave me access to a Micro8x0 via OpenVPN several years ago.   It was a little shaky but it worked fine.  But I have found that there is really no substitute for having the real thing sitting in my test rack.  Just having the Micrologix I got a few months ago has already prevented me from regressing once.

If anyone has a cheap Micro8x0...

Vern, this is very good.  It looks like valid tag listing data to me.   I will need to make a version of list_tags.c that does not require a path or is specific to Micro8x0.  I will work on that next and push another prerelease in the next day or two.

Thanks for your help testing!

Best,
Kyle


Kyle

unread,
Dec 29, 2021, 11:57:04 AM12/29/21
to libplctag
Hi Vern,

I split the list_tags.c example into one copy for ControlLogix and one for Micro8x0.   Then I found out that if I point to the IP address of the built-in Ethernet port on my ControlLogix L81 CPU module, I do not need a path!   So I can fake it being a Micro8x0, at least for this purpose.

I pushed another prerelease commit.   Can you do a pull and try the latest version?   You should see list_tags_logix.c and list_tags_micro8x0.c.

Best,
Kyle

vernt...@gmail.com

unread,
Dec 29, 2021, 12:32:09 PM12/29/21
to Kyle, libplctag
list_tags_micro8x0 log.txt

Kyle

unread,
Dec 30, 2021, 10:39:05 AM12/30/21
to libplctag
Thanks for testing!

I will push this out as a release today, if possible.

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