pjkundert / cpppo

Communications Protocol Python Parser and Originator -- EtherNet/IP CIP
https://hardconsulting.com/products/6-cpppo-enip-api
Other
328 stars 108 forks source link

Question: Getting single attribute #102

Open TinFoilHatFrog opened 2 years ago

TinFoilHatFrog commented 2 years ago

Im trying to create a script that queries attributes on different objects. The following works, but it requires data type: proxy_simple(ip).read([ (f"@1/1/1", "UINT")])

However some attributes are marked as "Array of bytes" etc which dont seem to have data type associated to them in CPPPO. Leaving out the data type always returns "NONE".

Im able to get the correct output with the following command but i have no clue how to do this in script: python -m cpppo.server.enip.get_attribute @1/1/5 -a 10.0.0.9 -S

So my question is how to get the output what python -m cpppo.server.enip.get_attribute @1/1/5 -a 10.0.0.9 -S returns but through library functions. I only need to get the raw data. Ive tried looking through the docs but i havent found a solution.

I tried copy pasting relevant parts of get_attribute.py to no avail.