LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems in synchronizing Timed Loop with a Timed source from a task

Hi everybody,
 
As usual I need help. I have attached my .vi to let you understanding the source of my first problem.
Sorry for the German names of the Vis.
I have a PCI 6289 installed on a  PC Desktop real time target.
I want to have the smaller jitter possible between Input and output. Since for the moment I have a jitter of 0.1 ms at 40 KHz sampling rate I thought that the cause of this random delay could have been the asynchronization between the While timed loop clock and the Hardware timing clock.
So I tried to synchronize them with the use of a Timing source.
Unfortunately the result is not the expected one.
When I press the execution arrow  all is happening is a millisecond or less of execution and then the program stops automatically without any error message,
Why the Vi is not working? Someone has an Idea?
Many thanks.
 
Principiant
0 Kudos
Message 1 of 8
(3,288 Views)
Hi Principiant,

I think the problem is related to the fact that the value in the numeric control "Rate" is set to 0 on the front panel. If I execute your VI in highlight mode I can see that an error message is generated by the DAQmx Timing VI. This error message is however not propagated to the General Error Handler VI at the "end" of your VI, since the Timed Loop never executes. If you change the VI as it is shown in the attached VI, you should also get the error message: "Error -200077 occurred at Property Node DAQmx Timing (arg 5) in DAQmx Timing (Sample Clock).vi:1..."

I hope I could help you.

Blase


0 Kudos
Message 2 of 8
(3,253 Views)
Hi Principiant,

sorry I forgot the attachement.

Blase


0 Kudos
Message 3 of 8
(3,247 Views)

Hi Blase many thanks for your reply.

Ok the problem rests not on the 0 rate but more deeply. The error is generated from the loop itself, so that' s why I hadn't messages. The error wire must be connected to the error in and output of the loop.

Ok now what says the error:

Error -200740

Task used as timing source of the timed loop was started before the timed loop was executed 

Let the timed loop start the task or use the task without the timed loop

 

I have then given a closed look to the Vi in the manual example and in fact the Read task lacks of the VI start task, something I didn't expected.

The Vi Attached is correct and works.

But now other problems arise since I have not resolved my original problem in this way. What I have is the following with or without driving the loop through the task.

I use my program to reproduce a simple signal in input and everything works fine until I reach the rate of 20 Ks.

When I try to raise up the sampling rate remains the same 20 Ks about.

The card I use should be able of a sampling rate of about 500Ks.

Someone has an idea how could I explot the potential rate of my card, where the problem comes from?

Many thanks still once more

 

Principiant.

 

0 Kudos
Message 4 of 8
(3,236 Views)

As not said,...here is the Vi

Principiant

0 Kudos
Message 5 of 8
(3,235 Views)
Hi Principiant,

I think the problem now is related to the fact that the performance limits of your real-time computer has been reached. By setting the sample mode to Hardware Timed Single Point,
hardware timing without a buffer is used, meaning that every sample that is acquired has to be transfered to the PC and also every sample to write has to be individually written to the card. If you would like to achieve higher sample rates, you should use a sample mode that uses a buffer.



I hope this information helps.


Blase
 
0 Kudos
Message 6 of 8
(3,224 Views)

Hi Blase,

 

Thank for your insight. IN fact I have phoned to te NI support to have a confirmation of your idea. They confirmed a rate of 40Ks as I experienced in my application.

Must I say however that also when I try to acquire the data in continuous mode I do not succeed to reach more than 50 Ks.

Strange because I have an USB DAQ able to acquire until 1.3Ms in continuous mode.

I  still not tried to acquire in fixed number of data modality.

Have you got additional insights?

Bye

Principiant

 

0 Kudos
Message 7 of 8
(3,211 Views)
Hi Principiant,

the maximum sample rate you can use in continous mode depends on the parameter "
samples per channel" of your DAQmx task. With this parameter you can set the size of the buffer that is used to store the data acquired from your data acquisition device. However I think it is also important how you read/write the acquired data from/to this buffer with your DAQmx Read/DAQMxWrite.vi. So if you read and write only 1 Sample with each read and write operation in your Timed Loop the buffer won't be  emptied fast enough. I think that you should be able to reach higher sample rates by increasing the number of  samples that you read and write in your Timed Loop.

I hope this information helps you.


Blase
0 Kudos
Message 8 of 8
(3,191 Views)