LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clear array with boolean

thanks devchander... its sure a useful example... Smiley Wink

but i am still trying to integrate with my vi... hahaha... no luck.... Smiley Mad

Best Regards,

JQ

LV 8.0 user...
0 Kudos
Message 11 of 14
(1,592 Views)
devchander, i've tried to use your method of clearing the array and it worked... but the main problem lies in it doesnt work with multiple data... for example sensor 1, 2 and 3 readings are 1542.123, 1543.321 and 1545.654 respectively (the reading varies, they are not always the same although there is a chance)... when i use your code, i am only able to retrieve 1545.654 reading only... which loops itself 250 X 3... i guess its a static reading, meaning the reading wont change (i guess it just loops on that single reading it retrieves once and use that reading to fill the entire array)...
 
i've attached a screenshot of the area where i am having problem (this is the original code which doesnt clear the array Smiley Sad )...
 
all help is great appreciated... Smiley Very Happy
 
PS: my aim is to loop through all the available sensors in a channel and get 250 readings from each sensor... my original code works but only once Smiley Mad ... the 2nd time i press the save button, it doesnt work as it adds on to the previous readings... i hope to clear the array after it passes 250readings X 3sensors to prepare for the next click on the save button...

Message Edited by JQ on 12-07-2006 04:46 PM

Message Edited by JQ on 12-07-2006 04:49 PM

Best Regards,

JQ

LV 8.0 user...
0 Kudos
Message 12 of 14
(1,578 Views)
JQ,

If I understand your application correctly, I think that you should be using the Replace Array Subset VI rather than the Insert Into Array VI within your while loops. If you make this change, then each time your code works with the 2D array, it will replace the elements in the 1D array instead of appending the additional elements.

I am not sure what the rest of your application does, but it occurred to me that you might want to consider using For loops. You are accessing individual elements of an array during each loop iteration; you can use an auto-index tunnel that will perform the same action without having to calculate a stop condition. This suggestion just might make your code more logical to follow. I hope this information was useful for you!

Mike D.
National Instruments
Applications Engineer
Message 13 of 14
(1,551 Views)

thanks Mike.. i've changed my while loops to for loops and my codes became neater.. hahaha... but i've sticked on to devchander's example and finally got it to work... i've tried using Replace Array Subset but to no avail... i'll try it again after i'm more or less completed with this section and see if its more time efficient... Smiley Happy

once again thanks to all who had helped... your help is greatly appreciated Smiley Very Happy ...

Message Edited by JQ on 12-08-2006 02:22 PM

Best Regards,

JQ

LV 8.0 user...
0 Kudos
Message 14 of 14
(1,545 Views)