01-05-2009 06:15 PM
I thought this would be a simple task, and it still might be but i'm not seeing it. On my front panel I have an array control which contains a cluster of three elements. During run-time, the user is expected to fill in the array of clusters prior to clicking the "Run Test" button. The number of elements in the array is arbitrary. If a mistake is entered and an element needs to be cleared, or the entire array needs to be emptied, this is easy to do in Edit-mode by right clicking on the array control --> Data Operations --> Delete Element/Empty Array. When my VI is in run-mode, right clicking seems to do nothing. What is the best way to go to allow the user to both 1) remove a particular element and 2) Empty the entire array.
Thanks
01-05-2009 06:18 PM
You need to write the desired shortened array to a local variable of the array control.
For example, to make the control an empty array, feed an empty array constant of the correct type to the local.
01-05-2009 06:22 PM - edited 01-05-2009 06:22 PM
Ok, so the just of it is, there is no option to allow the right click menu to delete/empty array during run mode.
If I have to do it programatically, I was going to make two buttons, one for delete element and one for empty array. The empty array button would do just as you suggested, basically an event would trigger that wrote an empty array constant into the local variable of this control.
But how about the "Delete Element" button? I would imagine there is a property value that I can pick off which would tell me the current array element the user is currently viewing, and I would use that to feed to "Delete From Array" and then write back the altered array to the array control's local variable?
01-05-2009 06:36 PM
Acutally, I just tried and the "data operation menu" is available in run mode (LabVIEW 8.5) so you should not have any problems.
What is your LabVIEW version? Can you attach a simplified version of your VI showing the exact data structures?
01-05-2009 06:42 PM - edited 01-05-2009 06:43 PM
See image below. What do you see?
If the array element is a cluster, you should right-click on the array element border instead of on one of the cluster elements to get the desired effect. The active area is a bit small, but it seems to work just fine if you hit it right. 🙂
01-05-2009 06:46 PM - edited 01-05-2009 06:49 PM
Shoot, we are locked into LabVIEW 8.2 and right clicking anywhere on that control does not pop up anything.
Here is a picture of the front panel with the two buttons for programmatic delition. The "Error Table" is the one in question.
1) The "Empty Table" button works just fine
2) I'm having a hard time finding the location of the propery node that will give me the index of the currently visible element. I could always resort to just putting another numeric control and have the user input the element they want to delete, but it would be much nicer if they could just press the button to delete the currently visible one.
*Note, not sure why there is that light-gray box on the left hand side, I don't see it normally. Must be some bug with the CCT.
01-05-2009 06:50 PM
See if the runtime menu is disabled for the array control.
(right-click the array container...advanced...runtime shortcut menu...)
01-05-2009 06:59 PM - edited 01-05-2009 07:01 PM
Interesting, never knew about that Run-time Shortcut option in Advanced. In anycase it shows me "disable" in the menu which leads me to conclude that it's currently enabled. When I go to Edit, the default case shows "Description and Tip" and that's it. Going to the custom drop down doesnt seem to let me add Empty Array/Delete element. It looks like this right-click menu is a new feature for 8.5.
In anycase I found my property node that I was lookign for. The following seemed to do the trick for the "Delete Element" button.
01-05-2009 08:24 PM
SiegeX wrote:... In anycase it shows me "disable" in the menu which leads me to conclude that it's currently enabled....
... It looks like this right-click menu is a new feature for 8.5.
It is disabled if there is a checkmark next to the word disable, else it is enabled. I tried the same in LabVIEW 8.2.1 and everything still seems to work just fine.
You must have something misconfigured if the right-click menu is not available in run mode in your case. Can you copy your control to a new VI and attach it here?
01-06-2009 01:02 AM
From the appearance of your UI(VI), I can understand that this option in the VI Properties >> Window Appearance Category, might be unchecked.
See to the attached pic.