Page tree
  • Create a "Standard project" and select CODESYS Control Win V3 as the device.
  • Define the target system by means of the Network scan.


  • Adapt the POU PLC_PRG as follows:



    Declaration

    VAR
        verCompiler   : Version;
        verRuntime    : Version;
        i1, i2, i3, i4: INT;
    END_VAR




    Implementation

    verRuntime := __SYSTEM.Constants.RuntimeVersion;
    verCompiler := __SYSTEM.Constants.CompilerVersion;
    
    // as pragma
    {IF RUNTIMEVERSION(>=,'3.5.16.20')}
       i1 := i1 + 1;
    {ELSE}
       i2 := i2 + 1;
    {END_IF}
    
    
    {IF COMPILERVERSION(=,'3.5.16.20')}
       i3 := i3 + 1;
    {ELSE}
       i4 := i4 + 1;
    {END_IF}





  • Load the project to the controller and start it.