...
- 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 width 7 Declaration
Column width 93 Code Block theme Confluence 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 width 7 Implementation
Column width 93 Code Block theme Confluence 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.