Re: Ethernet/IP - read structured tag templates

267 views
Skip to first unread message

Kyle Hayes

unread,
Mar 23, 2021, 10:27:18 AM3/23/21
to Jochen Haar, libplctag
Hi Jochen,

There is no documentation that I have found.  Please let me know if you find any!  So far it is only tribal knowledge :-(

I am able to read program tags.  You need to modify the request so that you include "Program:<program name>" in the request.   See the packet dump when using list_tags.   I found out how to do it from Dustin's pylogix.   I think he found it via Wireshark or from some other library.

In libplctag, the special @tags tag is supplemented by another form that mirrors what I noted above.   You can have "Program:<program name>.@tags" as the tag name and the library will correctly set that up and do the request.

Best,
Kyle


On Mon, Mar 22, 2021 at 10:02 AM Jochen Haar <joche...@t-online.de> wrote:

Hi Kyle,

 

do you know a document where I can find how to read the Program tags/symbols?

 

In the document: 1756-PM020G-EN-P.pdf is just described how to read the controller tags/instances.

 

I know, that the controller tag instance 4200 (decimal) indicates a program symbol. With the ANSI tag name of that symbol it must be possible to explore the program tag instances, but I didn’t find a description how the service call has to look like and how the response packet is structured.

 

Thanks in advance

Jochen

 

Von: Kyle Hayes <kyle....@gmail.com>
Gesendet: Donnerstag, 18. März 2021 15:35
An: Jochen Haar <joche...@t-online.de>
Betreff: Re: Ethernet/IP - read structured tag templates

 

Hi Jochen,

 

You can post to the group, if it is helpful to some people, it is good for everyone!  I also suggest raising an issue in the libplctag.NET project.  They build a C# wrapper around the C library and would probably be able to use your code as a base when I release the C support.  

 

Thanks for this work!

 

Best,

Kyle

 

 

On Wed, Mar 17, 2021 at 6:38 AM Jochen Haar <joche...@t-online.de> wrote:

Hi Kyle,

 

this direct mail is just for information. Please find attached my two classes to read the templates of structured tags.

 

I will not post it into the group as I don’t want to undermine your fantastic work and the upcoming solution regarding this topic by you.

 

No clue, if it is worthwhile for you. If not, just throw it away. For me it works fine with CMX and CLX directly connected to the on-bord PLC Ethernet adapter.

 

Thanks you for your support and your fast responses.

 

Best regards

Jochen

Jochen Haar

unread,
Mar 23, 2021, 1:59:03 PM3/23/21
to libplctag
Hi Kyle,

Thanks for your quick response.

It is solved. I am able to read the program tags as well - see attached screenshot.

The trick is the following:

        /// <summary>
        /// Reads the tags which are in Program scope only
        /// </summary>
        //---------------------------------------------------------------------------------------------
        private void ReadProgramTags()
        //---------------------------------------------------------------------------------------------
        {
            List<string> programTags = new List<string>();
            foreach (var pair in this.TagNameCollection) if (pair.Value.SymbolType == EipConstants.PROGRAM_SYMBOL_TYPE) programTags.Add(pair.Value.SymbolName);
            foreach (string programName in programTags) this.ReadTags(0, programName);
        }

Best regards
Jochen

EipDeviceScanner.PNG

Jochen Haar

unread,
Mar 24, 2021, 5:19:07 AM3/24/21
to libplctag
All,

please use the following link to get an updated version of the C# wrapper class: https://groups.google.com/g/libplctag/c/juEsM1hywi0/m/rUo-RxJUAwAJ

Best regards
Jochen

Reply all
Reply to author
Forward
0 new messages