CoDeSys Tutorial: Automate using Codesys Scripting Part 1

Поділитися
Вставка
  • Опубліковано 24 лис 2024

КОМЕНТАРІ • 23

  • @marcaltort6723
    @marcaltort6723 18 днів тому

    Thanks a lot for this video. Really interesting! It's possible to write some lines on the new POU? And it's possible to open a POU that exists to write new lines?

    • @jugaadtech12
      @jugaadtech12  17 днів тому

      Thanks if it helped ….
      Yes , it’s possible too …
      Creating new POU/DUT , updating POU/DUT etc…

  • @Дмитрий-ю5я2п
    @Дмитрий-ю5я2п 3 місяці тому

    Thank you. This is interesting informative content. Can you tell me, did you add the ipt scripts based on codesys documentation or can they be downloaded?

    • @jugaadtech12
      @jugaadtech12  3 місяці тому +1

      Thanks .. 🤝
      Stubs comes when we install the Codesys so all scripting details is there in stubs folder…
      We can refer also documentation of Codesys Scripting …
      Rest all code we need to write for our use cases … that is where I am trying to cover basics first so anyone can start …Codesys has provided some of the examples

    • @Дмитрий-ю5я2п
      @Дмитрий-ю5я2п 3 місяці тому +1

      @@jugaadtech12 Thank you.! Found them.

  • @seanpeterson4673
    @seanpeterson4673 Місяць тому

    Great video, thank you for sharing this tutorial, it helped me a lot. I have a question:
    I want to use some functionality that is contained in other classes, such as ScriptIIecLanguageObjectContainer.pyi. what I cannot figure out is is this library is instantiated in the codesys interpreter anywhere, or what its name is.
    or for instance, how to add a library to a project. librarymanager.add_library() does not work because the scriptlibmanobject class does not exist inside the librarymanager instantiation in Codesys.
    Their documentation is not clear on this subject

    • @jugaadtech12
      @jugaadtech12  Місяць тому

      Thanks ✌️
      Codesys by default provide objects to do this …
      If get correctly your question you want to add Library into project through scripting ?

    • @seanpeterson4673
      @seanpeterson4673 Місяць тому

      @@jugaadtech12 yes that is correct, but I am struggling with the syntax

    • @jugaadtech12
      @jugaadtech12  Місяць тому

      Ok will check and let you know how you can achieve

    • @seanpeterson4673
      @seanpeterson4673 Місяць тому

      @@jugaadtech12 thank you so much!

    • @jugaadtech12
      @jugaadtech12  Місяць тому +1

      @seanpeterson4673 here you go/
      www.shaswatraj.com/post/unveiling-the-power-of-codesys-scripting-automating-project-creation-device-addition-and-program

  • @asv5769
    @asv5769 3 місяці тому

    Great tutorial, thank you for sharing your knowledge. Codesys is supposed to support IronPython, but in Vs Code I can see you are using Python 3.12, so is this IronPython or CPython?

    • @jugaadtech12
      @jugaadtech12  3 місяці тому +1

      Thank for your kind words ... Yes this scripting part was untouched for many developers so thought to share how they can start and will providing all the different options and then going in advance level...
      So Codesys is using IronPython interpreter and they need to be compatible with .Netframework ... i am using python 3.12 to write the script part using stubs they have provided....

    • @asv5769
      @asv5769 3 місяці тому

      @@jugaadtech12 ok, that means I don’t need to download IronPython and use it in my VS Code?

    • @jugaadtech12
      @jugaadtech12  3 місяці тому

      Yes , in vs code we can use the stubs and no need for Ironpython

  • @Дмитрий-ю5я2п
    @Дмитрий-ю5я2п 3 місяці тому

    I am trying to create about 400 CAN devices in my project. 100 per PLC. When running the script, codesys hangs for 30 minutes. It will be interesting to see in one of your next videos how to add a large number of modules to different PLCs in the project.

    • @jugaadtech12
      @jugaadtech12  3 місяці тому

      Interesting.. it should work

    • @jugaadtech12
      @jugaadtech12  Місяць тому

      Codesys Tutorial : Codesys Scripting using Command Line Part 2
      ua-cam.com/video/Ms7euiQXSvw/v-deo.html
      Check this out …

  • @Дмитрий-ю5я2п
    @Дмитрий-ю5я2п 3 місяці тому

    Is it possible to do global refactoring of variables using scripts? For example, reading global lists of variables and changing them throughout the project.

    • @jugaadtech12
      @jugaadtech12  3 місяці тому

      I think it can be done using find and replace option …

  • @yosefelsheibani159
    @yosefelsheibani159 2 місяці тому

    rookie error here, when trying to replicate your video i cant create any files or folders inside the sub, it prompts me with no permission although i am an admin on this machine

    • @jugaadtech12
      @jugaadtech12  2 місяці тому

      No worries it can be some issue with Admin rights … try by running vs code as admin it may allow then.
      You can copy the stub folder outside and then create project there … it is needed only for reference …