LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the System Clock?

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(2,590 Views)

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

 

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3
(2,578 Views)
Solution
Accepted by topic author YSinno

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 3
(2,566 Views)