FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
12-12-2022 04:25 PM
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,
Solved! Go to Solution.
12-13-2022 09:19 AM - edited 12-13-2022 09:21 AM
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