LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating an Array of Clusters of Indicators Issue

I have an array of clusters containing indicators and value fields, one for each sensor in my system.   The container for this array has a scrollbar so that data from many installed sensors can be viewed in the container sized for 4 array elements.  It works fine except as follows:   When the number of sensors is less than 4, I get the following undesired behavior:  1) LabView control array displays enough elements to fill the container, even if the real size of the array is smaller, and 2) for some reason extends some (but not all) values written into the last valid row of indicators into the "greyed out" rows.  This seems to only happen for numeric indicators, not boolean indicators or string indicators for some reason.    I'm using a DVR to store the data and periodically update the UI.

I have verified that the control array is the same size as the number of sensors.  I'm including a screenshot to help illustrate the issues.

Is there a way to display only the number of actual array elements?   Why are the numeric indicators for the "greyed" elements being updated (see values circled in red--they are extended from the data in the first row)?

LabViewIndicatorArrayIssue.png

Thanks in advance,

John

 

0 Kudos
Message 1 of 14
(3,749 Views)

It's not "extending" any data to the unused rows.  It is showing the default data for all of those controls.  Usually False for booleans, empty strings for strings, and 0 for numerics.  However, if when you first created the array by dragging in a cluster that had data entered in it, like the -1 in some numerics, that becomes the default data for that element.  The "greyed out" rows are the indication that there is no data in those rows.

 

If you don't want to see those greyed out rows, you can resize the array container to be the minimum of the number of elements in the array and 4. and write that to the NumRows property node for that array.

Message 2 of 14
(3,721 Views)

Unused array elements show the default value for the element (greyed out). In your case, the default value seems to be -1. You can change it to something else if you want.

 

You can resize the container to the array size or 4, whatever is smaller. (Use min&max)

Message 3 of 14
(3,719 Views)

Thanks to you both for the suggestion of resizing the array container.  That could be a good solution if it doesn't leave empty space between the array container and the one below.

 

However the values in the screenshot are not the default values, but are the values read from the sensor and written to array index zero (I know the -1 looks like a default, but it's not). As the VI runs, any value written to index 0 also appears at index 1,2,3 in this case. Also, when two sensors are present, it's the values at index 1 that are repeated at index 2 and 3.

 

Even more puzzling is that the VI has been running "correctly" without this issue for quite some time and across numerous versions. The VI front panel (only) went through cosmetic changes by another designer and this issue showed up. I have switched between two versions of this VI in a larger project and I can see the issue come and go.  Here's a screenshot of the previous version that works "correctly".  In this case the greyed out rows display the default values, which have not changed in the new version:

LabViewArrayOfClusterOfIndicators.png

 

0 Kudos
Message 4 of 14
(3,677 Views)

Can you attach a simplified version of your VI (e.g. only containing the control/indicator in question.

 

You need to be careful when defining defaults. Are you setting the default for the various inner parts or for the array element as a whole. they can differ.

0 Kudos
Message 5 of 14
(3,665 Views)

I have some additional info that might provide some insight.   When I open the latest VI that has the issue and compare visually to the previous version VI that does not have the issue, I see that in the latest version, some elements are not greyed and I can scroll down through the array and then see some elements that are not greyed.   In the previous version that doesn't have the issue, all elements are greyed.   I'm not sure how to recover from this.     Here's a screenshot of the 2 VIs (not running), and I will upload the VI and control typedef for the cluster.

LabViewArrayOfClusterOfIndicators2.png

 

Thanks for your persistence on my problem.

John

0 Kudos
Message 6 of 14
(3,657 Views)

Your array is not empty by default.

 

Ungroup twice so you have access to the array.

right-click array container...data operations...empty array

right-click array container...data operations... make current value default.

Message 7 of 14
(3,647 Views)

Thanks!  I updated the array per your instructions and now the array is clearly empty when not running.   Default values for the numeric indicators are zero.

However testing the updated VI, I still have the same issue as before.   Here's a screenshot, this time with 2 sensors, and the data from the second sensor is extended into the greyed rows.

(Sensor on top row is not sending data so default value of 0 remains)

LavViewIssue2sensors.png

 

0 Kudos
Message 8 of 14
(3,644 Views)

I'm wondering if your VI is corrupt.

 

I opened your VI and the one .ctl file attached.  (It was still looking for other files that weren't included.)

 

I wanted to run a block diagram cleanup so I can more clearly see which sections of code are dependent on others.  It caused my LabVIEW 2016 to crash.  Twice.

0 Kudos
Message 9 of 14
(3,640 Views)

Here's an earlier version of the main VI file.   I worked with the other one I posted in LV2014 SP1 with no crashes.   I could successfully build an executable from both VI versions.  Is there some way to validate a VI to check if it's corrupt?

If its helpful I could provide the additional files but there's quite a few of them in the project.

0 Kudos
Message 10 of 14
(3,628 Views)