LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

elapsed time

Solved!
Go to solution

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 Kudos
Message 1 of 16
(3,519 Views)

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 Kudos
Message 2 of 16
(3,517 Views)

Here is the VI.

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

How can i reduce it to 2ms?

 

0 Kudos
Message 3 of 16
(3,512 Views)

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 :

http://www.ni.com/white-paper/3023/en

 

Regards,

Eric

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

0 Kudos
Message 4 of 16
(3,506 Views)

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

0 Kudos
Message 5 of 16
(3,491 Views)

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 Kudos
Message 6 of 16
(3,483 Views)

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 Kudos
Message 7 of 16
(3,469 Views)

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 Kudos
Message 8 of 16
(3,453 Views)

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 Kudos
Message 9 of 16
(3,441 Views)
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 Kudos
Message 10 of 16
(3,433 Views)