05-13-2014 01:24 AM - edited 05-13-2014 01:50 AM
Hi,
I am desiging a LabVIEW program that will measure data from an NI USB-6366, do some calculations and then output the corresponding data.
At the moment, I am just doing data acquisistion with a sampling rate of 20KHz. I am storing both the data and the corresponding relative time (in milliseconds) in an array. I have noticed that it is taking around 5-30 ms to get a few values. This is very slow for my project requirements ( I need a resolution of around 100 microseconds)
Some info:
- When running the code, barely any CPU resources are used)
- Attached is the vi
- I am using:
* LabVIEW 2013 (32-bit) Trial Version
* Windows 7 Enterprise (SP1) 64-Bit
* Intel Core i5 CPU with 2.40 GHz
* 4 GB RAM
Is there a way to set a faster system clock for the program execution?
Thanks
Solved! Go to Solution.
05-13-2014 02:10 AM
Sorry, but your code lacks some very basic things.
Most prominent example: Instead of using DATAFLOW, you are using sequence structure and local variables.
I assume that you are rookie to LV, but experienced in a language like C/C++. At least, your code looks like you are trying to incorporate textual coding concepts into the dataflow programming language LabVIEW.
Honestly, your code doesn't make much sense. Your "Start Time" has a race condition between writing and reading in the second, parallel running loop.
Also, you should get your timestamp information from the DAQ task, not the system. The system clock will always drift to the DAQ timing if the DAQ task is running for an extended time. Your DAQ assistant has an acquisition time of 5ms per iteration, continuously, but your "timing loop" stops the acquisition loop after 5ms, so one iteration. Why don't you simple configure DAQ to be finite then???
Norbert
05-13-2014 02:40 AM
I just received a PM from the OP asking for an example.
Simply put, there are two options:
a) Stick with DAQ assistant. Wire the dynamic data to a graph indicator directly or use the "From DDT" function from the Express>>Signal Manipulation palette. Configure it to extract a waveform to keep the DAQ timing information.
b) Preferred recommendation: Use the example finder to look for AI examples, finite and continuous. Open them and configure everything to your liking on the front panel and run the example(s). Look if it contains the info you are looking for. If it is like that, study the code. If not, come back here and describe what functions these examples are lacking for your purpose.
Norbert