I am attempting to use a python script to add a CANbus device, CANopen Manager, and various CANopen slaves to a project.
My script keeps failing when trying to add the slave device. It tells me that "No device found with the following device identification". I have tried creating a device object as well as manually entering the type, id, and version, directly from the device details.
I have attached my code and screenshots showing the device details and the error I am receiving. Any help would be appreciated.
found = proj.find('Device', False)
assert(found is not None and len(found) == 1, 'No object with the name Device found')
assert(found.is_device, 'Found object is not a device')
device = found
\# Add CANbus device using the type, ID and version instead of a DeviceID
device.add('CANbus', 15, '181015', '126.96.36.199')
can1 = device.find('CANbus', False)
can1.add("CANopen_Manager", 16, id="181016", version='188.8.131.52')
can1_mgr = can1.find("CANopen_Manager", False)
aoutId = device_repository.create_device_identification(18, '55_AA030521', '184.108.40.206')
aout_dev = device_repository.get_device(aoutId)
\# can1_mgr.add(name='1AOUT',type=18, id='55_AA030521', version='220.127.116.11')
Log in to post a comment.