CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Thu Jul 27, 2017 1:28 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Adding IO Module to Kbus
PostPosted: Thu Sep 08, 2016 1:36 am 
Offline

Joined: Tue Mar 11, 2014 2:43 am
Posts: 5
I would like my python script to add an IO Module (8in/8out) to the k-bus. Here is my code:

Code:
PROJECT = r"C:\Projects\WAGO_Test.project"
proj = projects.create(PROJECT)
proj.add("CODESYS_Control_for_PFC200",4096,"0000 0013","3.5.8.10")
found = proj.find('CODESYS_Control_for_PFC200', False)
device = found[0]
kbus = device.find('Pfc200Bus', True)[0]
kbus.add('_750-1506', 288, '0000 0001', '3.5.8.10')  #   <-- ERROR HERE
proj.save()


This gives an error however:
'Exception was raised: The device cannot be added or inserted here'

What am I doing wrong?
What method do I use to add an IO device? (I have tried 'kbus.plug =' and that also did not work.)

Thanks!


Top
   
PostPosted: Thu Sep 08, 2016 10:00 am 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 202
Hi WAGOKurt.

WAGOKurt wrote:
What am I doing wrong?
What method do I use to add an IO device? (I have tried 'kbus.plug =' and that also did not work.)

I tried to reproduce your scenario and it seems you forgot to add the module ID.

Code:
kbus.add('_750-1506', 288, '0000 0001', '3.5.10.0', '880F_750_1506')

BR
Martin

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


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