Author Topic: How to access data registers read by modbus tcp component  (Read 2142 times)

viper_lasser

  • Newbie
  • *
  • Posts: 9
    • View Profile
How to access data registers read by modbus tcp component
« on: July 12, 2014, 04:49:21 PM »
How to access data registers read by modbus tcp component i.e for data trends or alarms ?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: How to access data registers read by modbus tcp component
« Reply #1 on: July 12, 2014, 06:26:20 PM »
Not sure if this is what you are looking for, but here is how to read a value in code:

        Dim value As String
        value = ModbusTcpCom1.Read("40001")


viper_lasser

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: How to access data registers read by modbus tcp component
« Reply #2 on: July 14, 2014, 03:57:35 PM »
I mean that I would like to periodically read some data and log some alarms if they occured.

Can I periodically read same datas from modbus in independent thread and in the same time all controls are updated periodycally ?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: How to access data registers read by modbus tcp component
« Reply #3 on: July 14, 2014, 06:37:39 PM »
You can perform reads on the same data or you can look at the value of the control. For example

1) Add a BasicLabel
2) Set the PLCAddressValue to 40001
3) Add a standard Button
4) Double Click the button to get back to code
5) type the code :  Button1.Text=BasicLabel1.Text
6) Run the app and click the button