LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Property node of a control inside of cluster inside an array

Solved!
Go to solution

Property node of a control inside of cluster inside an array - Discussion Forums - National Instruments

altenbach said:

Whatever you are doing seems extremely convoluted. Can you attach all code, incl. the caller and global. (... after starting a new thread)

 

I am having a strange issue with references and property nodes of a cluster in a 2D array.  When I run the attached code I get data written to unexpected array elements.  For example, code calls for index 0,0 but data is written to 0,3.  I am starting with the array initialized as completely empty.  I have possibly solved this by deleting the array and recreating it from scratch.  However, this is not the first time I have had to do this.  Sooner or later, I end up saving the top level VI with the array with something modified and the issue occurs again.  I am not aware of what property of the array I could be changing however. 

Attached is a simplified version of code that demonstrates the issue.  If you drag a copy of the cluster out, delete the array, then drop the cluster into a new array, the problem goes away.  The only thing I can think of is that the vertical scroll bar has something to do with this? I really need the scroll bar for users to view the entire array while running.  

 

 

0 Kudos
Message 1 of 26
(2,671 Views)

So...

  1. Assuming we just press the run button ...
  2. What do you see that bothers you?
  3. What do you want to see instead?
0 Kudos
Message 2 of 26
(2,668 Views)

I see what is in the attached image.

Are you saying that when you run on your system the 0,0 shows in the 0,0 square?

On my system everything is shifted +1 row and column

0 Kudos
Message 3 of 26
(2,656 Views)

See the other thread where I answered riddle.

 

If you read the Nugget I linked in the OTHER thread you will see that I resized the array down to a single visible element, wrote the value and then resized it back to the original size.

 

"DeferFPUpdat" can be used to hide the resizing so that the User does not see it... if you are using a normal VI to display the array. All bets are off if using a Global since I never use them and can not say if deferring the updates of a Global can be done or works.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 26
(2,655 Views)

You've taken something beautiful (LabVIEW code) and turned it into something ugly (ActiveX programming by reference).  I'm not sure what this is supposed to do but I see some strange things:

  • Indexing of an array using DBL index value. 
  • Floating bits of code that don't contribute to the overall function of the program
  • Random constants driving for loops that seemingly have no meaning or description (especially to those of us trying to debug)
  • Extreme overuse of property nodes
aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 26
(2,654 Views)

Seems like you want to update individual elements of the array by reference - I could be wrong, but I dont think there is any easy way to do this. Instead of using VI server, why not just modify the data directly, then write to the indicator?

0 Kudos
Message 6 of 26
(2,651 Views)

@paul.r wrote:

Seems like you want to update individual elements of the array by reference - I could be wrong, but I dont think there is any easy way to do this. Instead of using VI server, why not just modify the data directly, then write to the indicator?


You are correct there is no easy way but it can be done.

 

Key to doing it is to realize the array element in the top left corner is the element that gets the update.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 26
(2,640 Views)

IndexVals property node only sets that particular cell as the top left cell in the visible array.  It has nothing to do with selecting an element to get a value.  ArrElem doesn't index a value from the array either. 

2018-11-29_14-12-14.png

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 8 of 26
(2,639 Views)

The code I posted is meant only as example of the issue I am having. Criticizing is pointless.

Everything except for the references and the 2 sub VIs is simulated values.  I can't upload my project because it is several hundred Mb and my company would not appreciate me sharing it.

 

 

 

0 Kudos
Message 9 of 26
(2,635 Views)

See the second part of that Nugget I linked see here under the section named "How to index the array?"

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 26
(2,621 Views)