LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI time/duration issue/Data Aquitsition

Hey gerd,

Is that a initialize array after the division?

0 Kudos
Message 11 of 17
(1,274 Views)

Hi Xx,

 

no, it's a BuildArray. You really should take the free online courses offered by NI on their website!

 

You will find example VIs in the example finder. And the example finder is located in the help menu of LabVIEW. No need to search example VIs on any website…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 17
(1,269 Views)

Hey gerd,

Found it. seems like they have examples for daq assist. which is very helpful. I will try to follow through. I appreciate your patience, its tough learning all the stuff in lab view. Something that will defintely take time and a lot of trial and error. 

0 Kudos
Message 13 of 17
(1,261 Views)

Hey Gerd,

I had some questions concerning your set up. I took some time to understand what you did and how you did it. Looking at the image attached, i had some questions when i ran the program. Default i had the wait timer set at 1000 ms. dt was set to 1 and the loop was at 30. So for 30 seconds there would be 30 recording with a 1 second time distance. This test ran complete with no issues. However, if i wanted to do a 60 second durtation with 10 seconds time distance why do i have to change the wait timer to 10000ms and dt to 10. I also have to change the >= on the compare to 6.  this is because it has 6 loops with a 10000ms delay = 60 seconds. The test comes out fine but im not sure if this is correct. So what im really asking is shouldnt i just be changing dt to 10 and the compare loop to 60? Also if i hit the stop button it doesnt stop right away. it waits till the delay timer finishes. So it wont stop the test immediatly until after the current itteration is done.

thanks,

link

Download All
0 Kudos
Message 14 of 17
(1,226 Views)
You need to get a grasp of the basics. The dt is the sample rate and you need to set that to accurately capture your signal. You should know that it needs to be at least twice the frequency you wish to capture. Ten times the input frequency would be more common. Select the dy and leave it alone. The time it takes to acquire is solely based on the number of samples you request. It's simple arithmetic with sample count divided by samples per second. You do not use a wait on the loop unless you are doing interval sampling which will have gaps in your acquisition. For continuous sampling, the st and number of samples is all that you need. For a responsive front panel, you would want a low sample count. Obviously, if the number of samples requires x number of seconds to acquire, it will take x number of seconds for a stop to be processed. You can calculate time to acquire and use that to determine how many loop iterations to perform. For example, if each read takes 100 me to acquire and you want 6 seconds of data, you can stop when the iteration terminal value is GE 60. You could also use a for loop with a stop terminal.
0 Kudos
Message 15 of 17
(1,205 Views)

Hi Dennis,

Thanks for the details. It clears up some questions i had. Now i know why my program works that way. Since the timer is still running in the while loop, an immediate stop wont work till it finishes that iteration. So, just to clarify, if im taking samples every 5 minutes for 1 hour, should i be using n samples instead of continious, right?

Perhaps i should just use a for loop for my time duration like you said.

Thanks,

link

0 Kudos
Message 16 of 17
(1,197 Views)
If you don't want gaps in the 5 minute acquisition, you want continuous mode. N samples would work only if you set the number of samples to be the total number for that time and you already said you don't like the fact that you can't stop it in a reasonable time.

A while loop where you compare the iteration count to some number or a for loop where you explicitly set the iteration count ahead of time will work the same.
0 Kudos
Message 17 of 17
(1,185 Views)