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

Read PowerFlex 525 tags #68

Open KaloyanR opened 5 years ago

KaloyanR commented 5 years ago

from future import print_function

import time

from cpppo.server.enip.client import connector from cpppo.server.enip.get_attribute import attribute_operations

host = "192.168.0.14" # Your MicroLogix IP address send_path = '' route_path = False attributes = ['@147/1/9'] timeout = 1.0 depth = 1 multiple = 0

with connector( host=host ) as connection: operations = attribute_operations( attributes, send_path=send_path, route_path=route_path ) for idx,dsc,op,rpy,sts,val in connection.pipeline( operations=operations, depth=depth, multiple=multiple, timeout=timeout ): print( "%s: %3d: (%-8s) %s == %s" % ( time.ctime(), idx, sts if sts else "OK", dsc, val ))

It works with small numbers, but Output Freq is 60.00 (internal value 6000) With cpppo result I have:


> Thu Feb  7 20:03:45 2019:   0: (OK      ) Single G_A_S      @0x0093/1/9 == [112, 23]
> [Finished in 0.2s]

What means [112, 23]? Output Freq is 60.00 (internal value 6000)

tholo commented 5 years ago

23 * 256 + 112 = 6000