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

elapsed time

已解决!
转到解答

Using elapsed time function is it possible to capture data every 100ms?

Right now I am getting the elapsed time after every 328ms. I want to make it to every 100ms.

If not this then which function can be used just to record the elapsed time every 100ms?

0 项奖励
1 条消息(共 16 条)
4,371 次查看

Hey Sunny,

 

I'm not too sure about what you want to do every 100ms, but here are 2 major ways to time a code :

- The timing functions return when they reach the count wired to their input to make it short. So something very simple just as following will do !

100ms_Exec.png

- The hardware-timed codes are more used when notably using DAQmx. You might want to go and check some examples in the Example Finder (Help -> Example Finder -> Hardware I/O -> DAQmx...) and see how they work.

 

Caveat : In the first solution, if your code takes more than 100ms to execute, let's say 253ms, then the timer is pointless and you'll have to optimize your code to execute in less than 100ms.

 

Regards,

Eric

Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.

0 项奖励
2 条消息(共 16 条)
4,369 次查看

Here is the VI.

I get the data in data string after every 250ms (approximate).

How can i reduce it to 2ms?

 

0 项奖励
3 条消息(共 16 条)
4,364 次查看

Sunny,

 

The serial communication will prevent you from having such a fast execution time. You can still work on your execution time by doing your file Write/Read in an other loop. Also, the Elapsed time VI is for benchmarking, not for timing your acquisition, I suggest you use it differently, or maybe remove it.

 

About the parallel file I/O :

https://www.ni.com/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labvie...

 

Regards,

Eric

Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.

0 项奖励
4 条消息(共 16 条)
4,358 次查看

That means if I want data on waveform chart to be updated every 2ms, it won't will be updated?

0 项奖励
5 条消息(共 16 条)
4,343 次查看

I am really in a bind.

Please can someone help me with the above VI and plot the data every 2ms?

I am sorry can please someone help?

0 项奖励
6 条消息(共 16 条)
4,335 次查看

Is this the problem of VISA functions that comes with the labview?

I mean if I use a DAQ with it will function even at 2ms, am I right?

0 项奖励
7 条消息(共 16 条)
4,321 次查看

Your limitation is whatever instrument you are using. If you remove all of the file write code, what is your iteration rate? Obviously, there are DAQ boards that can sample at or much faster than 2ms. You have not mentioned what sort of hardware you are using right now so it is impossible to say how fast it can run but a 2ms rate over serial is hard to accomplish.

0 项奖励
8 条消息(共 16 条)
4,305 次查看

The VISA write and read functions well I get the data what I want.

The only case is I want the speed data that to be plotted on the graph every 2ms or written in the tdms or any type of file in 2ms

0 项奖励
9 条消息(共 16 条)
4,293 次查看
You keep saying you you want 2ms but you don't seem to realize that you probably have a very basic hardware limitation. Have you looked at the specs of the device? Have you even tried to see how fast it runs without the file write? Do that and accept that as the fastest you can go.
0 项奖励
10 条消息(共 16 条)
4,285 次查看