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 Network Variable by Script

hhz
2017-12-07
2017-12-08
  • hhz - 2017-12-07

    Hello,

    i want to add some Netwerk Variable (Receiver and Sender) in my project by using script. There are some scripts (command or method) support this feature? I can find nothing about this issue in Script online help of CDS v3 sp11.

    Thanks for any replay!

     
  • Ingo

    Ingo - 2017-12-08

    Hi hhz,

    I am not sure if there is a scripting API for this, but depending on your use case there might be an easier solution.

    You can link every kind of a GVL (so also an NVL) to an external file. This is imported before compile. If you just want to push variable declarations into the project, this method is very easy.

    To do the link just right click on the NVL and open the properties.

    BR,
    Ingo

    Gesendet von meinem LG-H870 mit Tapatalk

     
  • hhz - 2017-12-08

    Hi Ingo,

    thanks for replays!

    In fact I do not want to use Import /Export function for creating new project. As my experience shown, Im-/export function does not works anytime and anywhere. My purpose here is to automatically generate a new project, incl. IEC code, configuration, parameter setting etc.. The similar as manually generating project the better.

    In that case, a scripting API is requested.

    BR.
    hhz

    Ingo Hornberger hat geschrieben:
    Hi hhz,
    I am not sure if there is a scripting API for this, but depending on your use case there might be an easier solution.
    You can link every kind of a GVL (so also an NVL) to an external file. This is imported before compile. If you just want to push variable declarations into the project, this method is very easy.
    To do the link just right click on the NVL and open the properties.
    BR,
    Ingo
    Gesendet von meinem LG-H870 mit Tapatalk

     

Log in to post a comment.