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

How to Create Archive (SDK question)

BobbieB
2015-04-13
2015-05-19
  • BobbieB - 2015-04-13

    Ive looked at the SDK help file, and Im trying to figure out how to make an instance of "_3S.CoDeSys.ProjectArchive.IProjectArchiveService"
    so I can Archive the currently loaded project.
    Can some one help or send me an example.

    Ive tried the following, which didnt work (C#)

    var archiveService = ComponentManager.Singleton.InstanceFactory.GetSystemInstance(typeof(_3S.CoDeSys.ProjectArchive.IProjectArchiveService).FullName);

     
  • mkeller - 2015-04-14

    Hi BobbieB.

    There is no system instance for IProjectArchiveService in CODESYS. You have to create your own instance of the "service" with CreateInstance().

    For CODESYS V3.5 SP5 or older:

    IProjectArchiveService pas = (IProjectArchiveService)ComponentManager.Singleton.CreateInstance(new Guid("{F23B52AD-F5EC-4785-BC13-F1FB7F998DB5}"));
    

    For CODESYS V3.5 SP6 or newer:

    IProjectArchiveService pas = ComponentManager.Singleton.CreateInstance<IProjectArchiveService>(new Guid("{F23B52AD-F5EC-4785-BC13-F1FB7F998DB5}"));
    

    BR
    Martin

     
  • BobbieB - 2015-05-19

    Thanks for your help. Ive figure out how to create an archive and it appears to work well.

     

Log in to post a comment.