st-one-io / node-red-contrib-cip-ethernet-ip

A Node-RED node to interact with Allen Bradley / Rockwell PLCs
GNU General Public License v3.0
51 stars 26 forks source link

Not a PLC, but Ethernet-IP Protocol #34

Open YitzHandel opened 1 year ago

YitzHandel commented 1 year ago

Hi. We are reading successfully in python from a Televac pressure meter. There are no named tags that I am aware of, only numbers. I use pycomm3 to read as such, but do not understand how to do the same thing in node-red:

from pycomm3 import CIPDriver, Services, ClassCode, INT, Array, USINT, SHORT_STRING, REAL

host = '192.168.10.31'

def get_real(instance_var): with CIPDriver(host) as plc: response = plc.generic_message( service=Services.get_attribute_single, class_code=162, instance=instance_var, attribute=5, data_type=REAL, connected=False, unconnected_send=False, route_path=True, )

if response:
    return (response.value)
else:
    print(f'error - {response.error}')

try: meter1 = get_real(101)

thalesmaoa commented 1 year ago

How did you managed to map all those infos?