cpppo
cpppo copied to clipboard
Trying to write an INT array to an Ethernet/IP Slave
Hi all,
Well, i'm trying to write an array for my Ethernet/IP Slave. I know the address direction is "@4/150/3", and my data array is "(INT)512,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0", and i can read the parameters array, but i cannot write. I have this code
import logging
import sys
import time
import threading
from cpppo.server.enip import poll
from cpppo.server.enip.get_attribute import proxy_simple as device
params = [('@4/150/3','INT')]
outparams = ['@4/150/3=(INT)512,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0']
hostname = '192.168.1.50'
values = {}
poller = threading.Thread(
target=poll.poll, args=(device,), kwargs={
'address': (hostname, 44818),
'cycle': 1.0,
'timeout': 0.5,
'process': lambda par,val: values.update( { par: val } ),
'params': outparams,
})
poller.daemon = True
poller.start()
while True:
while values:
logging.warning( "%16s == %r", *values.popitem() )
time.sleep( .1 )
The output is NONE always None
WARNING:root:@4/150/3=(INT)512,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 == None
Any help to write on it? I prefer not to use tags
hey! I am having the same problem... Did you solve it?