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 Wed Feb 26, 2020 3:09 pm

All times are UTC+01:00

Post new topic  Reply to topic  [ 1 post ] 
Author Message
 Post subject: Import of .gdc files
PostPosted: Tue Dec 25, 2018 11:27 am 

Joined: Tue Sep 04, 2018 7:54 am
Posts: 5
Cannot import .gdc file using scripts.

Code given below...

#---------- Import handler class
class Handler(NativeImportHandler):
def conflict(self, name, obj, guid):
print("Object already exists: ",name)
return NativeImportResolve.skip

def progress(self, name, obj, exception):
print("in progess: ", name)

def skipped(self, list):
for obj in list:
print("Skipped: ", obj.get_name())
def importFilter(name, guid,type,path):
return True;

handler = Handler()

proj = projects.primary

found = proj.find("Application", True)
app = found[0]

##Select Ethercat
drbus = proj.find('EtherCAT_Master', True)[0]
Drive_1 = drbus.find("Drive1",True)[0]
if Drive_1:
Drive_1.import_native("C:\\Users\\Aritra\\Desktop\\Exported files\\Drive1.gdc", importFilter, handler)
print("Drive Not Found")

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