Author Topic: DataSubscriber2 Error  (Read 4358 times)

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
DataSubscriber2 Error
« on: February 22, 2016, 07:22:53 AM »
Hey Guys,

I've been working with DataSubscrber2 where I've called an Boolean array of 800 called "ALARM" but whenever datasubscriber2 is called and array no is greater then 0 the below attached error pops up. Please guide me as to what's wrong and how to correct the mistake
« Last Edit: February 22, 2016, 07:25:36 AM by aquilmustafa »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: DataSubscriber2 Error
« Reply #1 on: February 22, 2016, 08:09:35 AM »
The NumberOfElements is not yet supported with subscriptions/DataSubscribers. You would need to add a timer to your, then in the event handler use this code:

Dim alarms() as string=EthernetIPforCLXCom1.Read("ALARM[0]",800)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: DataSubscriber2 Error
« Reply #2 on: February 22, 2016, 09:49:43 PM »
Version 3.99c has been posted. This version will now return all elements. A DataChanged event will only fire when the first element changes, so you will need to use the DataReturned event.

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Re: DataSubscriber2 Error
« Reply #3 on: February 23, 2016, 12:22:29 AM »
Hey Archie,

I'm just installing 3.99 c version. Only one more request can you please provide us with a list of updates made in 3.99 C I've downloaded 3.99 b but could not find the details of the update.

Thanks a lot again.



Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: DataSubscriber2 Error
« Reply #4 on: February 23, 2016, 02:37:43 AM »
The changes are listed in the ReleaseNotes.txt that is part of the AdvancedHMI project.

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Re: DataSubscriber2 Error
« Reply #5 on: February 23, 2016, 06:19:59 AM »
Hey Archie,

When i try to open AHMI-3.99 C in VS-2010 the CLX Drivers and Micro-800 drivers does not form a component they appear in the form of .vb file and on double click opens the code.

Please help me to get these drivers up and running.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: DataSubscriber2 Error
« Reply #6 on: February 23, 2016, 06:40:25 AM »
Have you tried it in VS 2015?

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Re: DataSubscriber2 Error
« Reply #7 on: February 23, 2016, 07:06:18 AM »
Hey Archie,

My Application has been completely developed in vb2010 and it is in the installation stage. At this stage i cannot convert it to VS2015

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: DataSubscriber2 Error
« Reply #8 on: February 23, 2016, 08:08:06 AM »
VS2015 will open VS2010 applications without updating them, so they can still be opened in 2010 after working with them in VS2015. VS2015 also targets all the same .NET frameworks. In other words, as of VS2010, the version of Visual Studio you use does not play a role in the compatibility of the final application.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: DataSubscriber2 Error
« Reply #9 on: February 23, 2016, 08:18:41 AM »
I opened the same application in 3 different versions (2010, 2013, and 2015) of Visual Studio to verify they all work the same

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Re: DataSubscriber2 Error
« Reply #10 on: February 26, 2016, 01:01:55 AM »
Thanks Archie for the upgraded version. Could bee please guide me as to how to compare boolean values coming in datasubscriber2. I've tried everything i knew but couldn't make it work. Please guide me I'm using v3.99C

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: DataSubscriber2 Error
« Reply #11 on: February 26, 2016, 04:31:44 AM »
Thanks Archie for the upgraded version. Could bee please guide me as to how to compare boolean values coming in datasubscriber2. I've tried everything i knew but couldn't make it work. Please guide me I'm using v3.99C
Can you give me more details of exactly what you want to do

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Re: DataSubscriber2 Error
« Reply #12 on: February 26, 2016, 05:14:55 AM »
I'm trying to compare the boolean values of the array coming from datasubscriber2. The code I've written is as follows

Private Sub DataSubscriberAlarm_DataReturned(ByVal sender As Object, ByVal e As Drivers.Common.PlcComEventArgs) Handles DataSubscriberAlarm.DataReturned
If e.PlcAddress = "ALARM" Then
            If e.Values(0) = True Then
                Alarm_status_Patti.Text = "EMERGENCY PRESSED AT STATION-1"
                AlarmPanel.Visible = True
            ElseIf e.Values(1) = True Then
                Alarm_status_Patti.Text = "EMERGENCY PRESSED AT STATION-2"
                AlarmPanel.Visible = True
            ElseIf e.Values(2) = True Then
                Alarm_status_Patti.Text = "EMERGENCY PRESSED AT STATION-3"
                AlarmPanel.Visible = True
            ElseIf e.Values(3) = True Then
                Alarm_status_Patti.Text = "EMERGENCY PRESSED AT STATION-4"
                AlarmPanel.Visible = True
            ElseIf e.Values(4) = True Then
                Alarm_status_Patti.Text = "EMERGENCY PRESSED AT STATION-5"
                AlarmPanel.Visible = True
            ElseIf e.Values(5) = True Then
                Alarm_status_Patti.Text = "EMERGENCY PRESSED AT STATION-6"
                AlarmPanel.Visible = True
            Else
                AlarmPanel.Visible = False
            End if
End sub

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: DataSubscriber2 Error
« Reply #13 on: February 26, 2016, 07:52:42 AM »
e.Values is an array of string, so try putting the True in parentheses:

 If e.Values(0) = "True" Then
                Alarm_status_Patti.Text = "EMERGENCY PRESSED AT STATION-1"
                AlarmPanel.Visible = True

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Re: DataSubscriber2 Error
« Reply #14 on: March 07, 2016, 10:29:02 AM »
Hey Archie,

I've updated my application from V35-a to V35-d and but now EthernetCLXCom1.Read("ALARM[0]", 800) is also not working. Please guide me as to what is to be done DataSubcriber2 is also not working. Please guide me.