Giter Club home page Giter Club logo

Comments (10)

kyle-github avatar kyle-github commented on July 22, 2024

Can you please modify the tag string to include "&debug=1", capture the output and add that to the issue? This will print out everything that is going back and forth between the PLC and the PLC (and a lot more).

-33 means that the PLC returned an error to the library. It is possible that there is a bug in the parsing, but that will show up in the packets.

Thanks for the bug report!

from libplctag.

rh2ygit avatar rh2ygit commented on July 22, 2024

Thanks, I will add the &debug=1 tomorrow and report back. By the way, THANKS for actively developing this much needed library!

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

I had another thought. What CPU and firmware version are you running? I thought I read somewhere that AB has started to enforce the restrictions on tag access more.

I also have a question to ask: what is the next protocol that I should add? I am leaning toward Modbus TCP. There are some internal simplifications and changes I want to make to the library first.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

Ah, in looking in the code, I am not handling ":" characters at all!

Oops!

Can you copy the debugging output of TuxEIP too? I need to see how to encode that. My guess is that I encode it much like I handle "." which is just skipping over it and putting down the remaining parts as ASCII names, but I need to make sure. AB is not the most consistent...

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

I found the TuxEIP code and looked at how they are doing it. It looks like they do not handle colons at all! So, maybe it is copied directly into the name. I modified my code and checked it in to GitHub. Please give that a try.

I also saw another difference: they handle multiple values within arrays but I do not.

TuxEIP: fooTag[12,42]
libplctag: fooTag[12][42]

I may modify libplctag if it is enough of a problem.

from libplctag.

rh2ygit avatar rh2ygit commented on July 22, 2024

Ok, I had to modify cip.c to also allow ':' characters in the case NAME: clause of the switch/case in cip_encode_tag_name(), but now it works!

I'm no expert at github, so if you want to make the change shown below and check it in, that would be great!

while(p) {
switch(state) {
case START:
/
must start with an alpha character. _/
if(isalpha(_p) || (p == '') || (_p == ':')) {
state = NAME;
} else if(_p == '.') {
state = DOT;
} else if(_p == '[') {
state = ARRAY;
} else {
return 0;
}

          break;

        case NAME:
            *dp = 0x91; /* start of ASCII name */
            dp++;
            name_len = dp;
            *name_len = 0;
            dp++;

            while(isalnum(*p) || (*p == '_') || (*p == ':')) {  /// ADD COLON SUPPORT HERE TOO
                *dp = *p;
                dp++;
                p++;
                (*name_len)++;
            }

[ ... ]

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

D'oh, I forgot the second one! I will make sure that that is in GitHub. Give me a little while, I'm on a conference call.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

OK, I updated GitHub. Can you please repull and do the test again?

Thanks again for the bug report!

from libplctag.

rh2ygit avatar rh2ygit commented on July 22, 2024

Done. New code pull works like a charm. Thanks!

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

I will close this now. Thanks for the bug report!

from libplctag.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.