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.




  • Open the Library Manager and add the following libraries:
    Net Base Services




  • Edit the PLC_PRG POU as follows:



    Section
    Column
    width7

    Declaration

    Column
    width93
    Code Block
    themeConfluence
    VAR
    	fbAsyncProperty		: NBS.AsyncProperty := (tnTaskName := 'itfAsyncTask', usiTaskPrio := 75, udiTaskInterval := 1000);
        fbResolveHostname	: NBS.ResolveHostname := (itfAsyncProperty := fbAsyncProperty);
        xResolve			: BOOL;
        ipAddress			: NBS.IPv4Address;
        itfIpAddress		: NBS.IIPAddress := ipAddress;
    END_VAR




    Section
    Column
    width7

    Implementation

    Column
    width93
    Code Block
    themeConfluence
    fbResolveHostname(xExecute:= xResolve, 
    					udiTimeOut:= 10000000, //10sec10 seconds
    					sHostname:= 'www.codesys.com', 
    					itfIPAddress:= itfIpAddress);
    
    IF fbResolveHostname.xDone THEN
    	xResolve := FALSE;
    END_IF





  • Load the project to the controller and start it. Set The variable xResolve to TRUE.