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

Simulate PLC with CodeSys

Vision
2015-06-24
2015-09-02
  • Vision - 2015-06-24

    Hey I'm a beginner with Codesys and I want to simulate a WAGO PLC. I have only experience with Siemens Step 7 and I have used their PLCSIM as simulator, I have a good experience with it.

    I have found sim programs as SP PLCWinNT and and SP RTE, but I don't know how to use them and how I can manipulate the I/O. Also I can go online without selecting these programs as targets, that confuses me.

    I tried to search for it by myself, but I'm thinking in the wrong direction maybe.

    Thank you for your effort.
    Vision

     
  • shooter - 2015-06-24

    SP etc are not simprograms, but is a software PLC.

     
  • shooter - 2015-06-24

    under windows you will find simulation, put a mark in front of it, by clicking.

    in resources you can define the i/o of the target (wago)
    when running simulation click on a input and it will be set to ON.

    when running a simulation be aware of you can set a variable with by double clicking, when it gets red you can not force it, so the values on screen are not correct.

     
  • Vision - 2015-08-11

    Hey again! Thank you for your help.

    The simulation is working fine. But I need to simulate an OPC server (build-in WAGO plc), I suppose I need to fix an software PLC to download the OPC config on it?

     
  • shooter - 2015-08-11

    opc in PC is impossible to simulate however it is possible to run the software for 2 hours in online mode.

     
  • Vision - 2015-08-12

    Are you talking about PLCWinNT software plc then?

     
  • Vision - 2015-08-12

    Problem at the moment with PLCWinNT is when I select the target my PLC config is lost, thereby my program gives error so I can't go online anymore.

     
  • shooter - 2015-08-12

    programs and libs can be target specific, for example a PC can not have direct I/O so when you specify them it will give compile errors, the choice of target is therefore important before starting a project.

     
  • Vision - 2015-08-12

    But it must be possible to simulate the program without changing the PLC config I suppose? Is that not the whole matter of a software PLC to simulate the I/O?

     
  • shooter - 2015-08-12

    no sorry, the codesys software can run on a PC to have remote I/O, however you can simulate I/O even when remote, but not a driver as communication is very hard to simulate, you can however use a visualisation to simulate communication by sending commands via the vis to the program, and later on replace it with proper drivers.

     
  • Vision - 2015-08-21

    I added variables for the PLC I/O so I don't work with the PLC driver anymore.

    Now I want to get the OPC server start working, it's not clear for me if it will work in Simulation mode (Codesys) or maybe with PLCWinNT soft PLC.

    Vision

     
  • shooter - 2015-08-22

    if you run winnt then just start your program without using simulation. in demo it will run for 2 hours.

     
  • Vision - 2015-08-23

    Ok, great to hear that it's possible with PLCWinNT.
    Problem right now is that I can't load the program. When I select PLCWinNT as target and want to login it gives me an communication error.
    I changed the communication parameters to 'localhost' and gateway connection to local, like I found in this guide: https://www.yumpu.com/en/document/view/ ... idactic/11 m

     
  • Vision - 2015-08-23

    Nevermind, it's working right now. I needed to change to another TCP/IP configuration.

     
  • Vision - 2015-08-23

    Okay I think my OPC server is running. Now I want to communicate from LabView, but I'm wondering what the OPC url is.
    opc://localhost/"CoDeSys"/PLC1 it's probably something like this, but I want to change "CodeSys" in it, I have no idea where I can change this (I don't want to change every OPC-link in LabView).

    Thank you for every help already!

     
  • Vision - 2015-09-02

    I can access my OPC tags via opcda:///CoDeSys.OPC.02/{key} with Softing OPC client application. But Labview uses the opc://localhost/CoDeSys.OPC.02/PLC1:tag path and doesn't have a connection with the OPC server at the moment. I really don't know where to look.

     

Log in to post a comment.