Open MarcelloDavis opened 1 year ago
Hi @MarcelloDavis,
Did you try to call master.config_init()
prior to accessing the device? This is required to establish any communication.
Just try sleep() func. after "EL1809 = master.slaves[1]" after this. Cause if u open ethercat com,just register is going out.
for this solution.sleep() function.3 sec is enough i tried.
try this:
`import pysoem
import ctypes
master = pysoem.Master()
master.open('eth1')
if master.config_init() > 0:
for device in master.slaves:
print(f'Found Device {device.name}')
pav=device.sdo_read(0x1008, 0).decode('unicode_escape')
pav2 = ctypes.c_uint32.from_buffer_copy(device.sdo_read(index=0x6064, subindex=0x00)).value
print(pav)
print(pav2)`
replace index with register address you want to read.
Hello,
i was just trying to simply read out the slave device's name via sdo_read. The lines of code I used are:
However, when I ran these lines of code, the output says: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte Do you have any guesses as to what might be the problem?