I have set up Modbus TCP Client in Codesys 3.5.12 to read/write to are remote IO and I want to be able to change the IP of a Modbus TCP server (slave) in Codesys if the IP of the remote IO changes.
The change of the slave IP should be made through a HMI or WebVisu.
Modbus TCP slave has a method called UpdateCommunicationSettings with IP and Port as parameters.
It says that "Fails (return value !=0) if TCP connection is currently established. (-->Use Enable Property to connect/abort)".
Where do I find this Enable property?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem is tha I can't see xEnable property in the inputs and outputs list of the FB at all.
My Modbus TCP Slave name is IO_Board and I get an error when I type IO_Board.xEnable.
I have set up Modbus TCP Client in Codesys 3.5.12 to read/write to are remote IO and I want to be able to change the IP of a Modbus TCP server (slave) in Codesys if the IP of the remote IO changes.
The change of the slave IP should be made through a HMI or WebVisu.
Modbus TCP slave has a method called UpdateCommunicationSettings with IP and Port as parameters.
It says that "Fails (return value !=0) if TCP connection is currently established. (-->Use Enable Property to connect/abort)".
Where do I find this Enable property?
You can find it in the online help
https://help.codesys.com/webapp/_mod_li ... ion_editor
Modbus TCP slave instance name .xEnable
The problem is tha I can't see xEnable property in the inputs and outputs list of the FB at all.
My Modbus TCP Slave name is IO_Board and I get an error when I type IO_Board.xEnable.
[ERROR] FB_CoolingUnit: FAULTS_CHECKING Device: PLC Logic: Application: C0018: 'IO_Board.xEnable' is no valid assignment target
[ERROR] FB_CoolingUnit: FAULTS_CHECKING Device: PLC Logic: Application: C0004: 'xEnable' is no component of 'MODBUSTCPSLAVE'
Compile complete -- 2 errors, 0 warnings
So in order for the Enable property to be shown, the option "EnableDiagnosis for devices" in PLC Settings has to be activated.
Great! So is it all working now?
Yes.
Thanks for the tips.