Author Topic: NumericFormat - using #  (Read 2273 times)

StuartBrown

  • Newbie
  • *
  • Posts: 6
    • View Profile
NumericFormat - using #
« on: August 29, 2019, 11:03:57 PM »
Hi All,

I'm very new to this AdvancedHMI / VisualStudio etc, so please excuse me if this is a dumb question.
(I have searched the forum with no results that popped out at me).

I have built a Production Board display with AdvancedHMIv399x following the QuickStart instructions that connected to a AB Controllogix L61 with v16 firmware. This has about 80 BasicLabel objects, around half with just PLCAddressHighlight parameters set, and the other half has PLCAddressHighlight, PLCAddressValue and PLCAddressVisible parameters set. Also has a few generic Labels and PictureBox objects. This was deployed on a RaspberryPi 3b+.

While I was building it up I had it all working correctly, then decided to add some formatting to the displayed numbers.
After I put in NumericFormat ##,### several numbers disappeared off the runtime display (both on the PC and Pi). I removed some of the formatting off areas where the value rarely ever gets above 4 digits and it all started working again, so I installed it as is.

Recently I changed the L61 v16 formware processor out for a L71 v20 firmware and started getting values missing off the screen again (blank space where there should be a number). There was an L61 v17 firmware in the same rack, so I copied the data values to it and changed the slot in EthernetIPforCLXcom, but that still looks the same with missing values. I tried copying some objects and changing them to look at the second processor (mainly items that were missing), but they still didn't show up.

I'm not sure if this is a display limitation, a comms limitation, or a combination of both.
Any suggestions would be greatly appreciated.

Stuart

« Last Edit: September 03, 2019, 08:38:53 PM by Archie »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Maximum number of displayed items from EthernetIPforCLXcom
« Reply #1 on: August 30, 2019, 12:36:35 AM »
Just a simple suggestion, go back to what was working for you since then you couldn't suggest any limitations.
Things seem to be happening for you when you make certain changes.

Also, experiment with the latest beta version to see if it makes any difference.

Try changing PollRateOverride and/or Timeout of the driver itself.
« Last Edit: August 30, 2019, 12:52:43 AM by Godra »

StuartBrown

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Maximum number of displayed items from EthernetIPforCLXcom
« Reply #2 on: August 30, 2019, 01:37:24 AM »
Thanks for the reply.
Unfortunately I can't go back to what had been working. Due to other physical changes that were happening at the same time.

The production board is a non core function of this PLC system, and the AdvancedHMI issue was only noticed after everything else was verified to be working after the changes had been made.

AdvancedHMI version (from first message) AdvancedHMIv399x.

Changing the formatting initially showed the symptoms, undoing the change fixed it. (Repeated twice to confirm this was the cause/solution).
Changing the PLC processor caused the symptoms to come back, but I can't go back to what I had before.
Copying the data to two other processors and reading it from there doesn't fix the issue.
Splitting the load between two processors doesn't fix the issue.
 
Doubling PollRateOverride and/or Timeout of the driver didn't make any difference.

StuartBrown

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Maximum number of displayed items from EthernetIPforCLXcom
« Reply #3 on: August 30, 2019, 02:03:22 AM »
OK - Some more info that rules out the PLC change causing this issue.

Playing with one of the copied data sets in another PLC, I have found that all of the values that have disappeared off the display are currently zero. When I change the number to non-zero the value appears.
I never considered this before as other zero values are appearing on the screen.
When I tried this on the real data (temporarily) it also displays the value.

These values being zero just happens to coincide with the PLC change as we are in a major maintenance shutdown and there is zero production to report.


Is there a parameter within the BasicLabel object that can force it to display a zero value rather than hiding it?


PS. This doesn't explain why adding formatting to some objects stopped other objects displaying, but I can live with that one.


StuartBrown

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Maximum number of displayed items from EthernetIPforCLXcom
« Reply #4 on: August 30, 2019, 02:21:53 AM »
This seems to be the same issue as Message 5083 "When value is 0, BasicLabel shows nothing ", which hadn't been resolved yet.

Further testing shows that the NumericFormat is causing the issue:-

    NumericFormat =  ##,### the issue occurs.
    NumericFormat =  <Blank> the issue is gone.
    NumericFormat =  ##,##0 the issue is gone - zero values display correctly and non-zero values still display correctly.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Maximum number of displayed items from EthernetIPforCLXcom
« Reply #5 on: August 30, 2019, 04:20:41 AM »
My guess is the BasicLabel is trying to show an error, but does not have enough space or size to do so. You can test that by putting a BasicLabel on the form with AutoSize set to True and make sure nothing is close to it.

According to the page on formatting, you only need "#,#"

https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings

StuartBrown

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Maximum number of displayed items from EthernetIPforCLXcom
« Reply #6 on: September 03, 2019, 08:17:57 PM »
Thanks Archie,

I tried putting a BasicLabel on the form with AutoSize set to True.
With format set to #,# and a data value of 0 (zero), nothing is displayed. No background is shown.
When I added a Fixed3D border I got a  vertical bar that looked two pixels wide, grey on one side, white on the other.
ie the outside pixels of the border show, but the bit in the middle has a zero pixel width.

Once I changed the format to #,#0 everything looks correct - background, border, autosize etc.

Looking further at the format strings link that you sent under the "#" Custom Specifier heading it says :-
"Note that this specifier never displays a zero that is not a significant digit, even if zero is the only digit in the string. It will display zero only if it is a significant digit in the number that is being displayed."
Therefore we need to use the "#,#" format combined with the "0" format to correctly show comma separated thousands and 0 when the data has a zero value.

Should this thread be renamed to correctly reflect the issue and solution so that future searchers may find it.