Code Monkey home page Code Monkey logo

Comments (6)

pjkundert avatar pjkundert commented on July 20, 2024

Hi, Johan; Thanks for the report.

How were you doing the REAL Tag writes and reads? If you use the cpppo.server.enip and cpppo.server.enip.client modules, it seems to work:

$ python -m cpppo.server.enip --print -v SCADA=REAL[100]

(in another window):
$ python3 -m cpppo.server.enip.client -p 'SCADA[0]=(REAL)1.234' SCADA[0]
SCADA[ 0-0 ] <= [1.234]: 'OK'
SCADA[ 0-0 ] == [1.2339999675750732]: 'OK'

Since the value contains decimal points, the cpppo.server.enip.client will automatically deduce that it should write REAL values (otherwise, if all the values are integer, it will default to INT).

Can you tell me more details about the failure?

Thanks!

from cpppo.

johanfforsberg avatar johanfforsberg commented on July 20, 2024

In that case it works fine, but try the same thing with a length 1 array, e.g.:

$ python -m cpppo.server.enip --print -v SCADA=REAL[1]

$ python3 -m cpppo.server.enip.client -p 'SCADA[0]=(REAL)1.234' SCADA[0]
SCADA[ 0-0 ] <= [1.234]: 'OK'
SCADA[ 0-0 ] == [1.0]: 'OK'

from cpppo.

pjkundert avatar pjkundert commented on July 20, 2024

Confirmed; working on a fix now. I am treating "scalar" values different than "vectors" (because assignment to vectors can be intercepted with getitem/setitem, to support remote access in the PLC back-end). I incorrectly used the Python type of the default value to cast the incoming value -- and provided an integer default for REAL scalars. I'm re-engineering the handling of data types now, to ensure that it correctly handles current (SINT/INT/DINT/REAL) and future EtherNet/IP data types correctly. Should have a fix later today.

from cpppo.

johanfforsberg avatar johanfforsberg commented on July 20, 2024

Great! BTW, is there a reason there is no BOOL type? It seems to be present in the EtherNet/IP standard. (A different issue, perhaps...)

from cpppo.

pjkundert avatar pjkundert commented on July 20, 2024

There are a multitude of data types in the EtherNet/IP standard that are not (yet) supported. No particular reason -- just have not had a client use-case for them, yet.

from cpppo.

pjkundert avatar pjkundert commented on July 20, 2024

Fixed in version 3.4.1

from cpppo.

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.