1.12. Migrating from CODESYS Control Version 2 to Version 3ΒΆ

To migrate from CODESYS Runtime System 2.x to V3, you have to do some adaptations. In this chapter you will find some hints to move to CODESYS Control 3.

  • Target-Settings / Device Config Files: The device configuration files from CODESYS V2.x have completely changed in CODESYS V3. All information about a target and a device are stored in Device-Description XML-files. See see I/O Configuration for detailed information about the content and structure of a device description.

  • Custom- and IO-Driver Interface: IO-drivers must be ported to CODESYS Control V3. In CODESYS Control 3 you have the possibility to write an IO-driver classical in ANSI-C, but also in IEC!
    The migration of an IO-driver from CODESYS 2 to 3 has to be done in 3 steps:
  1. Integration of the new component interface

  2. Implementation of the new interfaces (at least Ibase and IcmpIoDrv)

  3. Adaptation to the new IO-configuration structure (connectors and

    parameters) and the new IO-update

  • Hooks: Hooks from CODESYS Control 2.x are split into 3 different types of functionalities.
    Events are used to notify special component about an event in the runtime system.
    Hooks are only used in CODESYS Control V3 to notify every component about an event, like the start up and shutdown sequences.
    The old hooks that are changing settings and configurations in the runtime system are completely replaced by the settings component. So the behavior of a runtime is only dependant of a defined set of settings and not, which custom component changes which hook!
  • External Libraries: In CODESYS Control V3, no external library list must be provided by the component that implements the library functions. You can specify now for each function, if it is exported as an external library or not. The second main difference to CODESYS Control 2.x is that all library functions in CODESYS Control V3 have only one pointer to a parameter structure! This must be changed during migration.

  • Custom services: The level 7 services have been changed in CODESYS Control V3 to a tagged binary format. So here, all services must be adapted to this new tagged format.

  • PLC Browser: The PLC-Browser is available in CODESYS Control 3.4 with the component named CmpPlcShell.

    The interface of defining own command has changed. But there is a template component under $\Templates\CmpPlcShellHandler, that illustrates the handling of commands in own components.

    Additionally to handle commands in a runtime component, in V3 you can handle own commands in IEC (e.g. in Libraries or IO-drivers).

  • RtsSym: This module is replaced by the CmpIecVarAccess interface. The functions are comparable. The only big difference is browsing the list of variable. In CODESYS Control 2 you got one big list with all variables. In CODESYS Control 3 you can browse in a hierarchical order through all symbols.

    Gateway, ARTI, PLCHandler: The Gateway and the ARTI interfaces are no longer supported. They must be replaced by the PLCHandler. The PLCHandler provides the possibility, to use connections to CODESYS Control 2.x and V3 runtime versions!
    The Gclient interface can be replaced by the GwClient interface to use an entry interface in the CODESYS Control V3 network. But here no symbolic information is available.

    OPC Server: We provide an OPC server (CODESYS OPC Server V3), that enables connections to runtime systems generation V2.3 and V3 and is released.