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

Testing of Codesys program

ofey
2023-12-07
2023-12-08
  • ofey - 2023-12-07

    Hi! I thought to hear what you guys think is the best way to test the program in my scenario.
    I have some PLC programs that have been made and deployed on different PLC's. The program has added the specific devices and IO that is applicable. I have made a test environment for everything outside of the PLC, ie. the same SCADA system that is talking to the PLC, and a program running locally is simulating the plant (level regulation of different tanks).
    Pr. now I have had to manually change the variables that are reading/writing values from the IO so they read/write via OPC instead. I also have to change the device tree from the specific PLC rack, to the soft PLC. So I kind of end up with two different programs that I have to maintain.

    I was just wondering if you believe there is an easier way to do this. So I can have the exactly same program and kind of switch between the soft mode, and the "real" mode.

     

    Last edit: ofey 2023-12-07
  • jegerjon - 2023-12-07

    I have a simulation function that toggle xSimActive.

    I map all IO variables to "IO GVLs" when xSimActive=0.
    I map IO corresponding SimIO GVL to "IO GVLs" when xSimActive=1.

    Then I write code for the simulation program that runs when xSimActive=1.
    Typically increase flow corresponding to pump speed, simulate tankfilling corresponding to flow and so on.

    I made a FC that require a correct code to activate simulation to avoid unintended activation by service dept.
    When comissioned remove any possibility to activate simulation.

    Super when officetesting and supporting service dept.
    + cheap as it requires no additional equipment, and it is easier to support customer later on in the life cycle as you can test proposed changes without setting up a testlab.

     
  • jegerjon - 2023-12-07

    I have a simulation function that toggle xSimActive.

    I map all IO variables to "IO GVLs" when xSimActive=0.
    I map IO corresponding SimIO GVL to "IO GVLs" when xSimActive=1.

    Then I write code for the simulation program that runs when xSimActive=1.
    Typically increase flow corresponding to pump speed, simulate tankfilling corresponding to flow and so on.

    I made a FC that require a correct code to activate simulation to avoid unintended activation by service dept.
    When comissioned remove any possibility to activate simulation.

    Super when officetesting and supporting service dept.
    + cheap as it requires no additional equipment, and it is easier to support customer later on in the life cycle as you can test proposed changes without setting up a testlab.

     
  • snhatton - 2023-12-08

    There is a tool called test manager that is part of the Professional Developer's Edition of CODESYS. I would take a look at this tool for your testing purposes. There is a free 30-day trial so you can evaluate if the tool will meet your needs before investing in the license.

     

Log in to post a comment.