Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Change Modbus_TCP_Slave attribute in plc code

Change Modbus_TCP_Slave attribute in plc code 1 year 1 month ago #10389

  • george
  • george's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Hi All,

I have setup a Modbus_TCP_Slave connected to a Delta PLC.

There are no problems sofar but i would like to know if its possible to change attributes of the the Modbus_TCP_Slave object in the node tree from within a PLC program during runtime. For instance change the state of DisableSlave or IP Address.

It may be possible to do it via script but i would prefer to do it in a the plc program and change it from a graph.

George
The administrator has disabled public write access.

Change Modbus_TCP_Slave attribute in plc code 1 year 1 month ago #10391

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 2799
  • Karma: 0
Hi George,

You shoud be able to change DisableSlave with for example a CStoIp and Address with a CStoSp. Set DisableSlave to 2 to close the socket to the slave. Then set 0 to reconnect.

/Claes
The administrator has disabled public write access.

Change Modbus_TCP_Slave attribute in plc code 1 year 2 weeks ago #10407

  • george
  • george's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Hi Claes

Thank you for that info, i finally got round to testing it with success. I wrongly assumed CStoIp could only change Plant hierarchy attributes.

George
The administrator has disabled public write access.

Change Modbus_TCP_Slave attribute in plc code 4 weeks 1 day ago #10762

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Karma: 0
I would like to use this functionality, but I have not been able to come up with the syntax required by CStolp to reference the Modbus_TCP_Slave's DisableSlave attribute.

I have (for example) under a $Nodes name of "1050Display" a Modbus_Master named Mast1 with a Modbus_TCP_Slave named Ctrlr1.
For CStolp's Object I have tried variations around "Nodes-1050Display-IO-Mast1-Ctrlr1-DisableSlave" but so far I always get a result of "Input syntax error"

Could someone provide an example of a correct reference?
The administrator has disabled public write access.

Change Modbus_TCP_Slave attribute in plc code 4 weeks 1 day ago #10763

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 2799
  • Karma: 0
Hi Bruce,

The correct syntax is

Nodes-1050Display-IO-Mast1-Ctrl1.DisableSlave

You can also select the Disable attribute in the configurator, and insert into the CStoIp with Ctrl+DoubleClick.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: Bruce@Spang

Change Modbus_TCP_Slave attribute in plc code 2 days 19 hours ago #10797

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Karma: 0
For a ModbusTCP write, I wish to set SendOp of a Modbus_Module (Continuous is set to No) to TRUE in PLC
A StoDpPtr seems to accept the attribute of the Modbus_Module, but does not actually seem to set the value.

What should I be using??
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 3.104 seconds