03-18-2013 02:18 PM - edited 03-18-2013 02:40 PM
Write to a local variable of the array as already discussed.
The above discussion was about clearing the array (making the lenght zero), but it seems you want to keep the array at the same size, and just set the elements to zero. You can for example modify the above example by NitzZ as follows:
(Ignore the example by chips. It is flawed and convoluted)
03-18-2013 02:40 PM
Thanks for the fast response!!!
Being more specific: What would you do for clearing to zero all elements of the attached ctl?
03-18-2013 02:46 PM - edited 03-18-2013 02:47 PM
Well, that's not a simple array, but a more complicated data structure (cluster of mixed clusters (numerics and boolean)). Simply click on the terminal and "create constant" (assuming that the array currenty only contains zeroes).
Now wire that to a local variable as before in the reset case.
03-18-2013 02:58 PM
This is a control 'thing'. Sorry, I sent you the ctl I forced to be an indicator. The one I have to work with is a control 'device'; it has only ouput.
The tricky part for me is that this does not have an input.It allows to enter values in the control panel (manually) but in the block diagram does not have an input.
Any other suggestion?
03-18-2013 03:05 PM
Sorry, I don't understand. The control you sent can be a control or indicator. I don't know what a "control device" is. Is this a program element or something external?
In the above example, it is a control, but the local variable of it is set to write, which allows writing to the associated control.
Please attach your actual code so we can see what you are trying to do.
03-18-2013 03:52 PM
Ok here is the challenge:
Attached you'll see a control panle with 2 clusters: Origing and Destination. Also there is a Origing index and Destination Index.
This VI is for organizing X-Y-Z points of one motion axis for a try and error test or as a learning procedure. The VI will move what is in Origing at Origing Index to Destination at Destination Index. Once all the numbers are moved from Origing to Destination, we want to make zero all the elements of Origing. I can use another array instead of the two indexes, or a pointer array, for the moving. The way of moving the values is not my concern at this point.
This is going to be a sub VI that will be used several times in the main program,
We want the Origing to be cleared every time we open the sub VI, the question then is how.
I don't need you to do the whole task, I just need to know how to clear all the elements of Origing after the execution of the main task.
Any thoughts?
03-18-2013 04:23 PM
@23r23 wrote:
We want the Origing to be cleared every time we open the sub VI, the question then is how.
You changed the control. Now it is an array of such clusters. What is the definition of "open the subVI". Do you mean whenever it is freshly called?
You can clear it first thing when the VI is called or last thing when the subVI completes using the local variable method mentioned.
Another option would be to assign it to a connector and wire a blank constant to it whenever it is called.
03-19-2013 01:56 PM
Thanks for all the help provided. I'll work on this deeper before asking in the forum again.
Thanks again.
03-25-2013 05:00 PM
I figured how to clear the all the entries of that approach plate. As you recommended, I am using a local varaible assigned to the approach plate. This is a sub Vi already. Thank you very much for your suggestions.
The second challenge is to copy all the elements of the approach plate, in a different order, to another combination of arrays and clusters the same as the apporach plate (destinatuion plate). For this I need a third 1D array as pointers for moving values from the appoach plate to the destination plate. There are some new conditions as well: The apporach plate can have a variable lenght (index). The destination plate has to have the same size after copied all elements from the approach plate. This can be a second sub Vi.
In a few words:
The elements 1 to 30 of index 0 in approach plate can end up as elements 1 to 30 of index 5 in the destination plate,
The elements 1 to 30 of index 1 in approach plate can end up as elements 1 to 30 of index 200 in the destination plate,
and so forth. The 1D array indexing then will have index 0 = 5, index 1 = 200, etc.
I have been trying hard but I haven't get it working as I want.
Any help would be appreciated.
04-05-2013 12:18 PM - edited 04-05-2013 12:22 PM
Hello,
I have a similar problem which I not being able to resolve. I need a button to reset an array (delete array without replacing with zeros).
I'm building a graph that shows real time measurements over a pre-build VI which was made by the manufacture of my measurement system, so it is very complex. But the part I want to build I think is very simple.
The signals are being recorded correctly in real-time however I can't reset/erase the array and the time elapsed. These values are being appended to an array and cluster together. So when I start a new aquisition the new data appears with previous data.
I would like to have 4 buttons: 1)Start aquisition and graph, 2) Stop , 3) Save, 4) Clean data and graph.
Of course 1) and 4) could be together. Can anyone help?