CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Oct 22, 2019 12:38 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Oct 08, 2019 6:31 pm 
Offline

Joined: Sat Feb 27, 2016 5:01 am
Posts: 17
Hello,

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.

Thanks,
Max

Code:
found = proj.find('Device', False)
assert(found is not None and len(found) == 1, 'No object with the name Device found')
assert(found[0].is_device, 'Found object is not a device')
device = found[0]

# Add CANbus device using the type, ID and version instead of a DeviceID
device.add('CANbus', 15, '181015', '3.5.15.0')
can1 = device.find('CANbus', False)[0]
can1.add("CANopen_Manager", 16, id="181016", version='3.5.15.0')
can1_mgr = can1.find("CANopen_Manager", False)[0]
aoutId = device_repository.create_device_identification(18, '55_AA030521', '3.5.1.0')
print(aoutId)
aout_dev = device_repository.get_device(aoutId)
can1_mgr.add('1AOUT', aoutId)
# can1_mgr.add(name='1AOUT',type=18, id='55_AA030521', version='3.5.1.0')


You do not have the required permissions to view the files attached to this post.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited