LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help on Software Triggered Analog Output...

Solved!
Go to solution
Hi, everyone:
 
There is a very nice shipping example from LV for software triggered analog input task. But I couldn't find any discussions or resources about how to implement the software triggered analog output (finit samples). Although I am using PCI-6251 card that supports analog/digital trigger for AO, my applications always require me to do complex run-time data analysis on input signals and thus make AO generation according to my analysis result. The problem I met is that although I can finish the data analysis within a very small amount of time, for example, 1 ms, I still have very big and variable jitter on the latency of my output signal. (For ideal case, the latency should be only my data analyzing time, say 1 ms, plus the overhead of DAQmx Write.) However for me case, the VI running on LabVIEW 8.0 on INTEL Celeron 2.0 GHz PC-Win-XP, the latency of my analog output waveform could be as big as 5~20 ms. Could anyone do me a favor? I pretty appreciate your comments and helps. Thanks.
 
-Claude.

Message Edited by ClaudeWang on 07-09-2007 08:39 PM

0 Kudos
Message 1 of 9
(4,535 Views)

Hi Claudewang,

The datas for analog output have to be transferred from lv's ram to the board itself, through several "layers" and this will take some time and this time depends on the system you're using. You're running the application on windows and general purpose os's aren't deterministic, so you can't guarantee the times involved in your applications too.

You can try to optimize your code in lv to have the shortest delay for ao updates. Especially if you're using Express VI's there could be some potential to speed up your appl.

Other ways to get a better performance would be a faster machine, or changing to real time os or implementing the code in FPGA....

Please let us know, how you've created your application perhaps there are ways in the sw to get the desired behaviour.

With Best Regards,

Evrem

 

0 Kudos
Message 2 of 9
(4,495 Views)
Hi, Evrem:
 
Thanks for your reply. Please find my VI as the attachment and a wave file to act as the analog input signal for my VI.
The task of my VI is to continuously measure the inter-pulse intervals of a pulse train. Whenever there is an interval less than 0.01 seconds detected, it will immediately generate a single digital pulse. Although I think my VI has been designed in an optimal way, I still got the generated pulse with big latency jittering (from 1 ms  to 15 ms). In the attached VI, you will see annotation for the block diagram. Very easy to undersatnd. And the zipped wave file is an examplary analog signal containing two pulses seperated by 4.2 ms. The default analog triggering level is set as 0.15 volt for my wave file. Please take a look at my VI and comment if the problem really due to the "OS-Latency". Welcome to modify my VI anyway if you got good solutions. Thanks.
 
PS: My soft/hard-ware are PCI-6251 M-Series card, INTEL Celeron-2 GHz PC, 1GB RAM, WIN-XP, LabVIEW 8.0.
 
Best,
Claude.

Message Edited by ClaudeWang on 07-12-2007 07:19 PM

Download All
0 Kudos
Message 3 of 9
(4,479 Views)
Solution
Accepted by topic author ClaudeWang

Hi ClaudeWang,

It looks like you are familiar with the DAQmx driver :-).

The only suggestion I have for your app is to use the DAQmx Control task.vi for the pulse generation task.

The task should be in the committed state, before you start the task, so the start task.vi can just change from the commited state to the running state in the loop. Place a DAQmx Control Task.vi with the "commit"-action before the loop.

I hope this will decrease significantly the delay in generating a pulse. If not, then you may think about using hw, which I have mentioned in my first post.

With Best Regards,

Evrem

 

 

   

0 Kudos
Message 4 of 9
(4,468 Views)
Dear Evrem:
 
Thanks for your quick reply. Your suggestion did really help but still can not totally remove the occasional big latency (~10 ms). However, I replace the INTEL Celeron-2.0 GHz PC with the the INTEL-P4-3.0GHz PC and run my VI again. I found the latency is just reduced to 1 ms and the jitter of also 1 ms, which is acceptable for my application. Now my problem has been 95% solved. Could you please help me for the last "5%"? The problem goes to:
In my VI, you could see that I used the AI task to get the Analog Comparison Event signal for Counter Period measurement. However, actually in my experiment, I have to preserve the AI and AO tasks for another VI running in parallel. So could it be possible to get the Analog Comparison Event from other task such as the Counter input task? Actually yesterday I have post this problem on "Multifunction DAQ" board, but nobody reply to me so far. You can go to check it out:
Thank you very much for the last help!
 
Best,
 
Claude.
 
0 Kudos
Message 5 of 9
(4,455 Views)

Hi Claude,

Wow, 1ms is really a significant reduction!

Anyway, your "5%" will be harder to solve, because the boards are limited to one Task for each subsystem.

That means the analog trigger circuitry can only be used once (for one task) and only one task per subsystem can be used per board.

If you have already reserved the ai subsystem with a task, you cannot run another ai task on the same board.

But you can on another board, that means if you have a second board you can run two ai tasks in parallel in the same application...

Thats the only way I see.

I hope it helps.

With Best Regards,

Evrem

 

 

0 Kudos
Message 6 of 9
(4,421 Views)

Dear Evrem,

Yes, I know I can only use one AI task on the same board. That's why I ask whether it's possible not to use AI or AO task to have the Analog Comparison Event signal. For example, is it possible to use a "Counter" task and wire it with a Start Trigger (Analog Trigger type, source APFI0)? I tried it, but it doesn't work. It only works for setting the Start Trigger as Digital Trigger mode in a Counter task. Is it true? or did I miss something important? Thanks.

Claude.

0 Kudos
Message 7 of 9
(4,419 Views)

Hi Claude,

Yes, it's true , you can only use digital triggering for counter tasks. The only way, to get an analog trigger involved in a counter task, is to use the anlog trigger circuitry of the ai subsystem and route the analog comparison event signal to the counter task. It's not possible to seperate an ai task from the analog trigger circuitry and run both in parallel.

With Best Regards,

Evrem

0 Kudos
Message 8 of 9
(4,377 Views)

Dear Evrem:

OK! Thanks for your help. Now I can sleep well. This case can be closed. 🙂

Best,

Claude.

0 Kudos
Message 9 of 9
(4,368 Views)