11-29-2018 01:42 PM
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.
Solved! Go to Solution.
11-29-2018 01:48 PM
So...
11-29-2018 01:57 PM
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
11-29-2018 02:02 PM - edited 11-29-2018 02:02 PM
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
11-29-2018 02:02 PM
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:
11-29-2018 02:04 PM
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?
11-29-2018 02:13 PM
@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
11-29-2018 02:14 PM
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.
11-29-2018 02:19 PM
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.
11-29-2018 02:29 PM
See the second part of that Nugget I linked see here under the section named "How to index the array?"
Ben