Showing results 1 to 2 of 2

Thread: Import XML - Zenon Logic

  1. #1
    Join Date
    03.02.2020
    Posts
    1

    Default Import XML - Zenon Logic

    Hi,

    Is it possible to import an XML inside Zenon Logic with the API?
    Attached is a screenshot of the action I would like to perform.

    Many thanks in advance.
    Attached Thumbnails Attached Thumbnails Import XML - Zenon Logic.png  

  2. #2
    Join Date
    15.05.2020
    Posts
    1

    Default Re: Import XML - Zenon Logic

    Hi!

    Currently, you have two choices of doing so (not via the Add-In Framework though):
    • Import the project with K5B.exe/K5PRP.dll calls
    • Use our not yet fully finished and not yet documented Logic XML API from our GitHub Repository

    For the first option, you need to call the K5B.exe from the zenon installation directory, e.g.:
    Code:
    "C:\Program Files (x86)\COPA-DATA\zenon 8.20\K5B.exe" XMLMERGE <ZenonLogicProjectPath> <XmlFileForImport>
    If you call the .exe without arguments, you see a list of supported commands.
    In C# you could call it like that:
    Code:
    ProcessStartInfo psi = new ProcessStartInfo(K5BexeFilePath, $"XMLMERGE {YourZenonLogicProjectDirectory} {YourXmlFilePathToImport}");
    Process process = new Process { StartInfo = psi };
    process.Start();
    process.WaitForExit();
    The second option basically does the same, but wraps the XML in a typed object model, which makes modifying the content easier and does not require you to know where the Logic/zenon binaries are, what all the entities in the XML describe, etc.
    The source code of the latest version is currently available here: https://github.com/CDMathiasLackner/zenonLogicAPI
    In there, you will find a ready-to-run sample project, which creates and modifies a new project and imports it in zenon.

    Best regards,
    Mathias

Similar Threads

  1. Zenon Logic to check if a Zenon Variable is online
    By doublem in forum zenon Energy Edition
    Replies: 3
    Last Post: 28th March 2019, 13:06
  2. zenon logic
    By nikabena in forum straton / zenon Logic
    Replies: 2
    Last Post: 26th March 2015, 21:44
  3. zenon logic doesn't communicate with external variables in zenon
    By mashjj in forum straton / zenon Logic
    Replies: 6
    Last Post: 27th February 2015, 13:10
  4. Re: zenon logic doesn't communicate with external variables in zenon
    By anjali.gk.nair@gmail.com in forum straton / zenon Logic
    Replies: 2
    Last Post: 22nd August 2014, 10:51

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •