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 Feb 18, 2020 8:27 am

All times are UTC+01:00

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

Joined: Sat Feb 27, 2016 5:01 am
Posts: 18

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[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', '')
can1 = device.find('CANbus', False)[0]
can1.add("CANopen_Manager", 16, id="181016", version='')
can1_mgr = can1.find("CANopen_Manager", False)[0]
aoutId = device_repository.create_device_identification(18, '55_AA030521', '')
aout_dev = device_repository.get_device(aoutId)
can1_mgr.add('1AOUT', aoutId)
# can1_mgr.add(name='1AOUT',type=18, id='55_AA030521', version='')

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

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 3 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