Author Topic: BasicLabels not being updated  (Read 4163 times)

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
BasicLabels not being updated
« on: September 27, 2016, 03:35:08 PM »
Hello,

Just wondering if I'm doing something wrong. When starting up a new project with AdvancedHMIBeta399a all I needed to do was add the EthernetIPforSLCMicroCom1 driver to my form, set the IP address of the PLC, add a BasicLabel, set the PLC address value and it just works! I have a value that changes.

I simply do the same with either AdvancedHMIv399r and even tried AdvancedHMIv399p and I get no change to the label, the text stays the same. I have tried other controls and the datalogger2 with similar results. No changes unless I use the older beta version.

I'm using MS Visual Studio 2015 and changing the controls right in the properties, no extra code at all.

Any help would be appreciated, I'm getting back to my project after some time off and an still very new at this!

Thanks,
Alan

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #1 on: September 27, 2016, 04:19:49 PM »
It sounds like you are doing everything right. Can you run a Wireshark packet capture?

Godra

  • Hero Member
  • *****
  • Posts: 1439
    • View Profile
Re: BasicLabels not being updated
« Reply #2 on: September 27, 2016, 07:20:27 PM »
I just tried the same steps with the same driver in v3.99r and the label was updating properly.

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #3 on: September 28, 2016, 03:45:42 PM »
Ok, trying to figure out how to use wireshark and haven't quite got it yet but it looks like the session in the working program was registered as a success. I attached the 2 packet captures.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #4 on: September 28, 2016, 03:51:18 PM »
The "NotWorking" shows no attempt at all to connect. Make sure the DisableSubscriptions property of your driver is set to False.

Try this:

- In a blank area of your form, double click. This will take you back to code
- Enter this code:

Me.Text=EthernetIPforSLCMicroCom1.Read("N7:0")


Run the application with a Wireshark capture running.

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #5 on: September 29, 2016, 09:39:19 AM »
Hi Archie,

The DisableSubscriptions property of the driver is set to False. Here is a wireshark run after adding the code to the form as you requested. Thank you for your assistance!

I just noticed that inserting the code changed the title bar from reading AdvancedHMI v3.99r to now reading the number 3 !
« Last Edit: September 29, 2016, 09:49:23 AM by Astabi »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #6 on: September 29, 2016, 10:01:40 AM »
I just noticed that inserting the code changed the title bar from reading AdvancedHMI v3.99r to now reading the number 3 !
This means communication with the PLC is good, but the subscriptions to update the labels are not starting. For your BasicLabel, what do you have in PLCAddressValue? Also check the ComComponent property to make sure it has EthernetIPforSLCMicroCom1


Let's try a manual subscription via code...... In the place you added the previous line of code, replace that code with this:

        EthernetIPforSLCMicroCom1.Subscribe("N7:0", 1, 500, AddressOf DataChanged)


Now just 2 lines down, below the End Sub, add these lines of code:

    Private Sub DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs)
        MsgBox("N7:0=" & e.Values(0))
    End Sub



Now run the application again with another Wireshark capture and let me know if you get a message box pop up.

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #7 on: September 29, 2016, 12:36:30 PM »
In the PLCAddressValue, for the first BasicLabel I have set up is ST20:18. I do not get a message box pop up, also I've attached another wireshark capture.

I did notice if I leave the application running for a while one of the BasicLabel's text changed to Value was either too large or to small for an unsigned byte, it has a PLCAddressvalue of ST20:0.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #8 on: September 29, 2016, 12:51:06 PM »
I found some old debug code that could potentially cause this.

- In Solution Explorer, expand down the AdvancedHMIDrivers project
- Expand down the \AllenBradley folder
- Right click EthernetIPForSLCMicroCom.vb and select View Code
- Go down to line 263
- Delete these 3 lines of code:
Code: [Select]
            If e.Values(0) Is Nothing Then
                Dim dbg = 0
            End If

Rebuild the solution and try again

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #9 on: September 30, 2016, 12:57:55 PM »
Hi Archie, Once again thank you greatly for your help!

I found the code and commented it out. The code wasn't in AdvancedHMIv399p but was in in the AdvancedHMIv399r. If I add more than one label it doesn't update so I'm not sure the removal had anything to do with it because I've had 5 labels installed the whole time.

To recap: Using AdvancedHMIv399r, I commented out the code you suggested but it doesn't matter, as soon as I add more than 1 label I get no updates on either one.

Here are 2 captures, filtered on the build computer as source the other using plc as source.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #10 on: September 30, 2016, 01:04:06 PM »
What if you use 2 labels with the same address? For example 2 BasicLabels with PLCAddressValue both set to N7:0

If that works, then try 2 consecutive addresses of N7:0 and N7:1

In the Wireshark captures I still see only a single read of N7:0, but nothing else.

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #11 on: September 30, 2016, 03:36:24 PM »
Hi Archie,

It seems like it depends on the combination of addresses used. Here are some of the results of my trials:

2 or more labels: Same address in each label: always works
2 labels: addresses N7:0 and  N7:1: works
2 labels: addresses ST20:0 and ST20:1: NOT Working

I tried 5 consecutive labels N7:0 to N7:5 and had great results.
I tried ST20:0, ST20:1, ST20:2, ST20:18, ST20:19 and nothing updates.

When I use the same addresses in the beta version it works fine.

The other thing is when I capture the data with wireshark I easily see data when it's working as you can see by my good capture attached. When I'm using labels with addresses that aren't working there is little to no data to capture. One last thing, if I place the addresses I need data for into the labels they all work by themselves, for example, I place ST:20:0 in all 5 labels they all update with the same data. Next, I place ST20:1 in all 5 and it works, and so on.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #12 on: September 30, 2016, 04:09:27 PM »
Not sure if this is the same thing, but I did find if a string has 82 characters in the PLC, it will not show in the BasicLabel. How long are the values in your strings?

Godra

  • Hero Member
  • *****
  • Posts: 1439
    • View Profile
Re: BasicLabels not being updated
« Reply #13 on: September 30, 2016, 04:57:27 PM »
Archie,

If v3.99a has no issues like this then what change in the driver of the new versions could actually cause this?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #14 on: September 30, 2016, 05:09:55 PM »
If v3.99a has no issues like this then what change in the driver of the new versions could actually cause this?
In version 3.99e, there was a major restructure of the driver architecture for the SLC/Micro/PLC5 in order to make it comply with the latest architecture.

This seems to be related to reading strings, but the closest I have been able to come to reproducing is to put 82 characters in the strings. Even when I do that, the other BasicLabels pointing to N7:0 will continue to update.