LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data

thanks for the info., but the case never executed! 

alhabeeb_0-1737565626420.png

 

0 Kudos
Message 11 of 47
(238 Views)

Use the "time has elapsed" boolean output to switch the case structure. (and yes, there are simpler solutions that don't require express VIs)

 

altenbach_0-1737570632650.png

 

 

It is very unlikely (=impossible!) that the final elapsed time is exactly 300 and nobody should ever do equal comparisons on floating point values!

 

 

0 Kudos
Message 12 of 47
(223 Views)

It is NEVER a good idea to use an EQUALS comparison on floating point numbers due to rounding errors. Machine epsilon - Wikipedia

 

 In your case, it's even worse since you have to wait on your DAQ to collect its data.  You are just skipping over the 300.  Why didn't you just connect the Time has Elapsed boolean to you case structure?  The Auto Reset function defaults to True, so it should work as is.

 

Or, you could change the EQUALS to GREATER or EQUALS.

 

EDIT: Altenbach beat me to it. 😎

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 13 of 47
(221 Views)

BTW, you should also feed the DAQ reference out the right side of the loop and close it.  Just like you did with the file reference.  😉

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 14 of 47
(214 Views)

your code will only execute when elapsed time is exaclty 300, if by any reason the loop time is different from that it will not execute. 

As an alternative, take a look on the example I attached, you can modify and include part of that on your code.

 

At every time the the saving happens, you need to reset the elapsed time .

0 Kudos
Message 15 of 47
(214 Views)

@altenbach wrote:

(and yes, there are simpler solutions that don't require express VIs)!


and I typically use the high resolution time so we have units in seconds.

 

altenbach_0-1737572549194.png

 

 

0 Kudos
Message 16 of 47
(212 Views)

Thanks all for your help.

But I have this problem now "The application is not able to keep up with the hardware acquisition.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem."

Also, I would like to add headers.

alhabeeb_0-1737617339691.png

 

0 Kudos
Message 17 of 47
(196 Views)

I was connected the time elapsed with shift register in true case

but now is OK

alhabeeb_0-1737617788528.png

How can I add headers?

0 Kudos
Message 18 of 47
(193 Views)

You can write the headers before the loop, right after opening the file.

0 Kudos
Message 19 of 47
(185 Views)

Then how to wire it to the Write to Text? 

Like this 

alhabeeb_0-1737621312545.png

 

0 Kudos
Message 20 of 47
(180 Views)