Comments (5)
Answering my own question..
Yes you can.
What threw me was that a product na,e of "1756-EN2TR" is reported from the Identity query not the CPU part number but reading a tag from the ethernet module IP address still works
from cpppo.
Ok wonder if someone can help me here. ]
I can read tags fine with the client.connector.parse_operations with:
host = "192.168.1.5" # Controller IP address
tags = [ "TestTag_DINT" ,"dummy", "TestString2[1-10]" ]
with client.connector( host=host ) as conn:
for index,descr,op,reply,status,value in conn.pipeline(
operations=client.parse_operations( tags ), depth=2 ):
print( "%s: %20s: %s" % ( time.ctime(), descr, value ))
but when I use connector,read:
value = conn.read ("TestTag_DINT")
I just get the attributes of the tag returned to value.
And when I try to write it doesn't change the tag value:
req1 = conn.write( "TestTag_DINT", data=1234 )
What am I doing wrong. Tags are read/write and can be changed from Studio 5000.
Any help appreciated. Thanks in advance
from cpppo.
I would recommend using the cpppo.server.enip.get_attribute "proxy" API. The cpppo.server.enip.client "connector" API is very low-level; it is designed for issuing and harvesting a stream of requests to/from a device, in a pipelined fashion. Usually, this is a bit lower level than you'd want to be operating...
See server/enip/poll_example_many_with_write.py for an example of how to repetitively poll values from a device, and occasionally write new values without interrupting the polling. Of course, you can just perform the writes without the polling...
Hope that helps!
from cpppo.
@pjkundert Do you have any examples of just writing to a device? I can read from a device quite easily using a symbolic tag, but I am having trouble trying to write to a CompactLogix PLC using get_attribute proxy.
from cpppo.
Take a look at the documentation at https://github.com/pjkundert/cpppo, and search for "proxy.write". You can use the proxy API to write, by supplying a "Tag = ", instead of just "Tag".
from cpppo.
Related Issues (20)
- Connection manager: unconnected send
- Receiving (not pulling or writing) data from AB Compact GuardLogix PLC
- Question: Getting single attribute
- Question: read an array of structures in one request
- Question: write to structure field
- CIP Class 0x66
- AssertionError on harvest HOT 1
- Simulate Omron Adapter
- (Question) Duplicate Responses to CIP Discovery Packet HOT 3
- Sending SINT write request using client results in error
- Python 3.11 import problem HOT 1
- Question: What is the meaning of "Tag communications capability"
- Question: CPPPO Server configuration as Generic Ethernet Module in Studio 5000
- Client import problem HOT 1
- SMC JXC91 write HOT 5
- Question: How to call vendor specific services?
- Question: How to send Instance Service "reset (0x05)" instead of "get_attributes_all (0x01)" using Cpppo? HOT 1
- AssertionError: Failed to receive any response
- Implicit (cyclic) communication for lower latency
- Can we have a simple example of writing a single register to a ControlLogix please
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpppo.