Author Topic: Correct use of Datasubcriber2  (Read 985 times)

carlos.lasan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Correct use of Datasubcriber2
« on: December 09, 2020, 09:19:11 AM »
Hi, I want to use DataSubcriber2 to take V and I measurements from a multimeter. I add the DataSubcriber2 to the Form and configure it to take values from 4 modbus addresses.
But my problem is that I don't know where those values are read.
I have only noticed that in "e.Values (0)" I have the value of the first loaded record. I thought that changing the index of e.value (index) would have the others, but it gives me an error.
my intention is that the measured values are displayed as a label text, beyond the text I was using.

     Private Sub DataSubscriber21_DataChanged (sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataChanged
         Label2.Text = e.Values (0) 'this if it gives the desired result
         Label3.Text = e.Values (1) 'from here I already have an error
         Label4.Text = e.Values (2)
          Label5.Text = e.Values (3)
     End Sub

Can you tell me what my mistake is?
Thanks a lot.

bachphi

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Correct use of Datasubcriber2
« Reply #1 on: December 09, 2020, 12:42:39 PM »
1.  Why did you have 2 drivers? did both drivers setup properly?
2.  Did you try the beginner steps? specifically, set a label with the address you've shown.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5270
    • View Profile
    • AdvancedHMI
Re: Correct use of Datasubcriber2
« Reply #2 on: December 09, 2020, 01:21:23 PM »
Is there any reason you are using a DataSubscriber instead of a BasicLabel?

carlos.lasan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Correct use of Datasubcriber2
« Reply #3 on: December 09, 2020, 01:36:23 PM »
Archie: Yes, it is that later I must do more processes with the subscribed data.
specifically, mathematical calculations, maximum and minimum alarms and logger.
But as a first step I wanted to have individualized data.
But I already found the answer in one of your previous Archie posts: "DataSubscriber2 Walk Through" thank you very much.
« Last Edit: December 09, 2020, 01:38:48 PM by carlos.lasan »