Hello,
I need to be able to change the Slave Address of the Modbus Slave COM Port object from within the program at runtime.
Usually the Slave address would be set as a fixed value in the General tab of the object, but I need to change it dynamically.
Would you please advise how this can be done.
Thank you.
George Janiszewski.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Enter name of your component (default: Modbus_Slave_COM_Port) in code editor and use '.' operator to see internal variables and methods.
You can use property SlaveAddress:
Originally created by: georgejaniszewski
Hello,
I need to be able to change the Slave Address of the Modbus Slave COM Port object from within the program at runtime.
Usually the Slave address would be set as a fixed value in the General tab of the object, but I need to change it dynamically.
Would you please advise how this can be done.
Thank you.
George Janiszewski.
Hi.
Enter name of your component (default: Modbus_Slave_COM_Port) in code editor and use '.' operator to see internal variables and methods.
You can use property SlaveAddress:
Modbus_Slave_COM_Port.SlaveAddress := <value>;</value>
You should to call this code also after reboot of PLC because in this case PLC get again "fixed value from the General tab".
Originally created by: georgejaniszewski
Thank you e.kislov for your assistance.
George.