Hello,
Is it possible to change the Ip adress of the XF51 port and the date/time of the Core through the PLC?
Many thanks,
Hello,
Is it possible to change the Ip adress of the XF51 port and the date/time of the Core through the PLC?
Many thanks,
At the moment changing them is only possible via the REST API named "ctrlX CORE - Connectivity API" and "ctrlX CORE - System API" via https communication. So could implement a corresponding library and do the requests as described in our Swagger documentation that can be found on your ctrlX CORE WebUI:
See also the blog post "Using the REST API of ctrlX CORE [DOCU] - [VIDEO]" in our ctrlX AUTOMATION Community for some general information.
You can add dynamic IPÂ addresses via the "SysSocket_Implementation" library:
Declaration:
Â
PROGRAM PLC_PRG
VAR
IPAdress: SysSocket_Implementation.INADDR;
NetMask: SysSocket_Implementation.INADDR;
AdapterName: WSTRING := "eth0";
bSetIP: BOOL;
END_VARÂ
Implementation:
Â
If bSetIP then
bSetIP := FALSE;
AdapterName;
IPAdress.S_un_b.s_b1 := 192;
IPAdress.S_un_b.s_b2 := 168;
IPAdress.S_un_b.s_b3 := 0;
IPAdress.S_un_b.s_b4 := 55;
NetMask.S_un_b.s_b1 := 255;
NetMask.S_un_b.s_b2 := 255;
NetMask.S_un_b.s_b3 := 255;
NetMask.S_un_b.s_b4 := 0;
SysSockSetIpAddressAndNetMask(wsAdapterName:= AdapterName, IpAddr:= IPAdress, NetMask:= NetMask);
END_IFÂ