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

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: BasicLabels not being updated
« Reply #15 on: October 01, 2016, 06:23:52 PM »
Archie,

The driver in v3.99r allows me to read 2 elements from ST table with the BeginRead function (example of the elements would be ST9:0 and ST9:1). This works even with 2 BasicLabels on their own.

According to the manual, each of these elements is 42 words in length.

Also, according to the manual, the string length is in the range 0 to 82 characters.

Does this info help in any way?
« Last Edit: October 01, 2016, 06:30:26 PM by Godra »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #16 on: October 01, 2016, 06:48:38 PM »
The one thing I discovered, but don't think it is the same issue, is that when I completely fill the string with 82 characters, the BasicLabel will not show the value.

The reason I don't think it is related is because I can put another BasicLabel on the form for N7:0 and it will update the value.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: BasicLabels not being updated
« Reply #17 on: October 02, 2016, 12:34:34 PM »
I tried using 3 labels with different ST addresses and the driver did provide response for each. These 3 elements seem to be the maximum allowed since their size is slightly less than 255 allowed for unsigned byte.

One of the labels did show an 82 character string as well.

BeginWrite function appears to only work for 1 address (out of an array of 3 strings it did write only the first one which was 82 characters).
« Last Edit: October 02, 2016, 12:37:15 PM by Godra »

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #18 on: October 03, 2016, 09:49:05 AM »
I added 2 labels, with addresses ST20:0 and ST20:1 - They both worked fine and update immediately. I then add a 3rd label, ST20:2 and none of the labels update.

I let it just sit and run for a few minutes and I get ST20:0 to update with the message: Value was either too large or too small for an unsigned byte.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #19 on: October 03, 2016, 10:10:28 AM »
What PLC are you communicating with? Godra may have stumbled across the root of the problem. There is a limitation on the packet size and different PLCs have different limitations. When reading multiple strings, it may be exceeding that packet size.

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #20 on: October 03, 2016, 10:27:46 AM »
Allen-Bradley Micrologix 1100

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #21 on: October 03, 2016, 10:35:31 AM »
It appears the problem is in the driver's optimizer that groups as much as possible into each read. The communication packet limit for the ML1100  is 236 bytes. The optimizer will group up to 20 elements. With strings it is easy to exceed that packet length in just a few string values.

I'm going to do some testing with this tomorrow and see if I can come up with a patch to fix the problem.

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #22 on: October 06, 2016, 09:45:20 AM »
Hi Archie,

I just wondered if you had a chance to look more into this? Thanks again.

Alan

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #23 on: October 06, 2016, 10:03:13 AM »
There is a new patch that addresses some issues with reading large amounts of data, such as 3 or more strings. Try this patch to see if it helps:

1) Download and extract Patch 3 for V3.99r

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/Patches/

2) In Visual Studio, go to Solution Explorer
3) Expand down the AdvancedHMIDrivers project
4) Right click the Support folder and select Add->Existing Item
5) Browse to and select the file you extracted in step 1
6) It will ask to replace an existing file, select Yes
7) Build->Rebuild Solution

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #24 on: October 06, 2016, 11:26:30 AM »
Hey Archie, All 5 labels are now being read! Thanks!

When I added the file to the support folder it didn't ask to replace an existing file, thought you'd want to know.

Thanks again,
Alan

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #25 on: October 06, 2016, 11:44:16 AM »
When I added the file to the support folder it didn't ask to replace an existing file, thought you'd want to know.
In Solution Explorer, right click the Support folder and select Open Folder in File Explorer. Check the file date to see if it is from October.

Astabi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: BasicLabels not being updated
« Reply #26 on: October 06, 2016, 01:53:23 PM »
Yes, it is from October 6th, 2016

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicLabels not being updated
« Reply #27 on: October 06, 2016, 02:06:06 PM »
Yes, it is from October 6th, 2016
Ok. Not sure why it didn't prompt for replacing an existing file.