取消
显示结果 
搜索替代 
您的意思是: 

Save data

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

alhabeeb_0-1737565626420.png

 

0 项奖励
11 条消息(共 47 条)
1,239 次查看

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 项奖励
12 条消息(共 47 条)
1,224 次查看

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 项奖励
13 条消息(共 47 条)
1,222 次查看

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 项奖励
14 条消息(共 47 条)
1,215 次查看

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 项奖励
15 条消息(共 47 条)
1,215 次查看

@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 项奖励
16 条消息(共 47 条)
1,213 次查看

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 项奖励
17 条消息(共 47 条)
1,197 次查看

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 项奖励
18 条消息(共 47 条)
1,194 次查看

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

0 项奖励
19 条消息(共 47 条)
1,186 次查看

Then how to wire it to the Write to Text? 

Like this 

alhabeeb_0-1737621312545.png

 

0 项奖励
20 条消息(共 47 条)
1,181 次查看