LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clearing array on button click

i have a problem in clearing array.
1. i have a vi witch on a button click add element in array ,and plot the values on graph.
2. second time when i run vi on graph i get all the values witch i got in first run pluse the values on second run
2. i want my graph should not plot values i got in first run
3. if I initialise the shift reg.then at every button click it plots only one point on graph.
4. I want all the points witch I added in my array at second run

so please help me
Shital"
0 Kudos
Message 1 of 9
(3,593 Views)
Hi Shital,

The only thing you have to do is initialize your array and your graph as shown on the attached VI. You can use a sequence structure to do that before the while loop.

Hope this helps !
0 Kudos
Message 2 of 9
(3,591 Views)
Just instead make two shift registers - one boolean (initialized at start to FALSE, and passing TRUE constant in the loop) and the other - with your growing array. Monitor boolean register and clear your array on FALSE state. If your data accumulation vi is a SubVI, you can implement a sort of initialisation terminal.
0 Kudos
Message 3 of 9
(3,591 Views)
hi gijadjok
thanks for your time & ans.
i understood the logic in your ans.
but unable to implement it.I am very new to LabView
can you send example vi. please
i don't know how to initialise shift reg.
i don't know how to implement
(initialized at start to FALSE, and passing TRUE constant in the loop) these things in braket

waiting for reply
0 Kudos
Message 4 of 9
(3,591 Views)
hi julion
thanks for your ans. I understood what u did.
but this is not working with my problem,
but it's a good one

my problem is
now i will try to explain you the difference between your example & my problem
in my case
1.on button click i am entering values in array using build array function.
2.on first run every thing is fine,
3.on second run, on button click all previous values are ploted.
4.when i use your logic it is giving me only single point ,
5.i want all the point in second run on my plot.


think on what Diadijok says.
if you have any example vi ,for what Diadiji's suggestion then please send it to me

once again thanks for ans
Shital
0 Kudos
Message 5 of 9
(3,591 Views)
ok, so we will start from a simple shift register initialisation with an emty array (without any additional booleans). Is attached example is what you want?
0 Kudos
Message 6 of 9
(3,593 Views)
hi Djadjok
your ex. is a guideline for new commer like me
but still i am in trouble.
i understood the use of local veriable
In my case
i have 2 different array
to plot graph i use one array for x values
one array for y value.
now my problem is how to asign local variables for
X,Y values of the graph.

sorry for troubling u so frequently
if possible send ex, vi
waiting for reply
0 Kudos
Message 7 of 9
(3,591 Views)
Ok, so we have an XY graph. Here I've attached two examples of the same approach as earlier (just second one use only one array of x-y pairs to store data). Local variables used only for cleaning graph display BEFORE any new points will be added (after first point you add, it will be also initialized). So this is just for cosmetic reasons 🙂
0 Kudos
Message 8 of 9
(3,593 Views)
thanks for your ans. it is working nicely
0 Kudos
Message 9 of 9
(3,593 Views)