08-27-2012 02:10 AM
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?
Solved! Go to Solution.
08-27-2012 02:40 AM
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 !
- 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.
08-27-2012 03:09 AM
Here is the VI.
I get the data in data string after every 250ms (approximate).
How can i reduce it to 2ms?
08-27-2012 03:20 AM
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.
08-27-2012 05:27 AM
That means if I want data on waveform chart to be updated every 2ms, it won't will be updated?
08-27-2012 06:49 AM
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?
08-27-2012 07:35 AM
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?
08-27-2012 10:42 AM
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.
08-27-2012 11:21 PM
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
08-27-2012 11:34 PM