Skip to content
< All Topics

Startup guide for Codesys and Experior

Start Codesys. This window should show.

Either open a project or make a new one.

  • File -> Open -> Project
  • File -> New -> Project

Choose Standard project, give your new project a name and click OK:

In Device choose the CODESYS Control Win V3.

Choose your preferred Programming language. Click OK.

Double click the PLC_PRG and the programming window appears.

Write your program.

Program example:

In the Devices window right click Applications, select Add object -> Symbol configuration

Click Add.

In the Symbol configuration tab press Build.

After the build you can expand PLC_PRG by clicking the plus sign.

You should be able to see your variables. Mark them by clicking the square box and press build again.

In the systray (located in the right corner) right click the CoDeSys PLC symbol and click “Start PLC”

Then left click the Gear button in CoDeSys.

Click Yes.

This Device window will show and a scan will start. If you have more than one PLC on the computer select the one that is active.

Left click the Gear button again.

Click Yes.

Click the Play button to put the Soft PLC in RUN mode.

In the bottom of the window CoDeSys should display RUN.

Some problems may occur and we are aware of them and currently have following solutions:

Problem

The issue is related to OPC communication between the SoftPLC and Experior and it occurs when network connectivity changes on the PC running CoDeSys SoftPLC and one of the following two may happen:

  • Case 1: The SoftPLC could be started from the system tray and In CoDeSys development system you can get connected to the it and download the PLC program and Symbols on it, but the symbols are not accessible in Experior.
  • Case 2: The SoftPLC could not be started from the system tray at all.

Solution

Case 1: In this case you need to change the OPC server settings.

  1. Start the soft PLC and then In CoDeSys software establish connection to the SoftPLC and then determine the Device address. On my system it is 0001.A15C

2. Stop the SoftPLC from the system tray.

3. Stop the CoDeSys Gateway from the system tray.

4. From the installation folder of CoDeSys in start menu find the program named “OPC Configurator” and run it. The “OPC Configurator” might not be in your startmenu but it should be in the root folder of your CoDeSys installation. Eg. C:\Program Files (x86)\Festo\CODESYS OPC Server 3\OPCConfig.exe

5. Click on the connection node in the tree on the left side.

6. On the right side click edit and in the opened window change the value of “PLC name or address” to the address from step 1.

7. Confirm and dialogue.

8. Use the file menu and click save to save the settings and then exit “OPC Configurator”

9. Now run the CoDeSys Gateway and CoDeSys SoftPLC from the system tray. And continue using it in the normal manner.

Case 2: In this case first you need to terminate all the relevant instances of CoDeSys SoftPLC and CoDeSys gateway running.

  1. Open Task Manager and go to “Details” tab
  2. End the following tasks
  3. CoDeSysControlService.EXE
  4. CoDeSysControlSysTray.EXE
  5. GatewayService.EXE
  6. GatewaySysTray.EXE
  7. Then from the installation folder of CoDeSys in the Start menu run the followings:
  8. CoDeSys Control V3 SysTray
  9. CoDeSys Gatway V3
  10. Now follow the steps related to Case 1 from the first step to the last one.

 

Start up Experior and the model you wish to interact with.

Select the communication bar.

Right click in the field and select OPC.

Left click the OPC CON1.

On the right in the properties window click host -> server and select the CoDeSysOPCDA

In the Communications tab the OPC status will be Connected.

Right click the OPC and select “Refresh Tags”

Click a component. Could be a pushbutton.

On the right side in the Properties window find “PLC Input”. Under Symbol expand the Root folder (if you don’t have the Application -> PLC_PRG folder follow the Case1 in CoDeSys Problems). Select the symbol you want to interact with the button. In this case the “bStartbutton”.

Follow the same procedure for all the interactions with the Soft PLC. Put Experior in RUN mode (Ctrl + R) or the Green arrow.

Then when you interact with eg. the push button the symbol in CoDeSys will be TRUE.

Was this article helpful?
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.