Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Import of IO_Modules using .export files

aritra666
2018-09-17
2020-02-06
  • aritra666 - 2018-09-17

    Hi,

    Am using the following code to import an ".export" file type for IO_Module using scripts but getting the error "Object GUID is not valid".

    ----CODE----
    import sys, io

    system.trace = True

    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()
    projects.primary.import_native(r"C:\Users\BANNERJEE\Desktop\S300.export", importFilter, handler)

    S300.zip [15.88 KiB]

     
  • kmckinney - 2020-02-06

    Were you able to get this to work. I'm interested in doing this for a current project. Would appreciate any input you might have.

    Thx

     

Log in to post a comment.