From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trying to write current aquired data to file while a continuous aquisition is occurring.

I have a vi named pj_pushbutton.vi in the attached library. The vi is aquiring data continuously. I have a button that when pushed will write the data to the file. It does this fine except that it seems to be writing the samples from the buffer immediately. I guess I want to aquire the latest samples not all the samples that are n the buffer so that I get the real time aquisition. When I push the button I have it set up to read the number of samples based on time on the front panel. I want to sample 2 seconds and it calculated the sample rate multiplies by the seconds to give me the number of samples. When I run the program the push the button to write the data to the file
it seems to be writing from all the recodes in the buffer not just the most current. So instead of taking 2 seconds to write the data it writes whatever is in the buffer immediately. How do I keep it from doing this? My file is attached in a zip. Thanks for your help.
0 Kudos
Message 1 of 3
(2,235 Views)
Hi HAL,

I don't have time to figure out exactly what you are asking but I can offer this tid-bit that may be handy to know.

"Delete from array" will by default return the last eelement in an array. This is ewasier and cleaner than iterating through all the elements and just keeping the last.

Add some comments (fre labels) showing me where to look if you want me to be of more help.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(2,235 Views)
I have added some comments and have removed some clutter that should help make more clear what I am after. I tried the array delete bu tit din't seem to help.
0 Kudos
Message 3 of 3
(2,235 Views)