Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • 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:



    Section
    Column
    width7

    Declaration

    Column
    width93
    Code Block
    themeConfluence
    VAR
        verCompiler   : Version;
        verRuntime    : Version;
        i1, i2, i3, i4: INT;
    END_VAR




    Section
    Column
    width7

    Implementation

    Column
    width93
    Code Block
    themeConfluence
    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.

...