Author Topic: Subscription list  (Read 1433 times)

AAN160

  • Newbie
  • *
  • Posts: 3
    • View Profile
Subscription list
« on: December 27, 2015, 12:07:04 PM »
Is there a way to access the subscription list for each driver?  Currently I am just looking to get the modbus tcp sub list.  I found it in modbus base but how can I access it at run time.  I will most likely put it in a listbox at run time on a click event.

thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Subscription list
« Reply #1 on: December 27, 2015, 03:28:02 PM »
In ModbusBase.vb, go to about line 290 and look for this code:

Private SubscriptionList As New List(Of SubscriptionInfo)

and change the Private to Public

You can then see the list

for i=0 to ModbusTCPCom1.SubscriptionList.Count-1
     Console.WriteLine(ModbusTCPCom1.SubscriptionList(i).Address.Address)
Next

AAN160

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Subscription list
« Reply #2 on: December 27, 2015, 03:39:34 PM »
Thank for the reply archie, but I have already tried that.  It says "Subscriptionlist cannot expose type  modbusbase.subscriptioninfo in name space advancedhmidrivers through class modbusbase".

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Subscription list
« Reply #3 on: December 27, 2015, 04:37:52 PM »
Go 2 more lines down and make this Public also:

Private Structure SubscriptionInfo