From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview DAQmx and NI-6251

Hi Everybody: I am using USB NI-6251 with Labview 7.1. I need to collect clicks, and each time when I collected one click I need to generate a signal out immediately. I am using APFI0 as the AI reference Anolog Edge source, and Start digital edge.vi for AO trigger (/Dev1/ai/StartTrigger as trigger source). I got some problems: every time after my program collect the first click, the system stop working for several seconds, and then keep working normally. I don't know why? However, if I changed the AO trigger to be "Advance digital edge.vi", keep the trigger source as "/Dev1/ai/StartTrigger", the system keep working, but I found there were always some time delay between the collected clicks and the generated signals, not simultaneously. I hope I can get any help and suggestions from you experts to fix this. Thank you.

0 Kudos
Message 1 of 2
(2,215 Views)

You'll probably want to post your code so we can get a better idea of what you're talking about.  I'm assuming a "click" is an analog trigger event.

 

It sounds like when a "click" occurs, you want to acquire both pre- and post- trigger data from an AI line.  Is this the case?  It's fine to do this once, but you will have to restart the task in between acquisitions.  After doing this, the reference trigger will be ignored until the desired amount of pre-trigger samples have been acquired for the next acquisition.

 

If you're triggering the AO off of a "click" which is being used as a reference trigger for AI, you'll want to trigger off of the Analog Comparison Event rather than the AI Start Trigger.  The only subsystem that supports the Retriggerable property on M Series boards is the Counters.  So, you'll either need to also manually restart the AO task after each event, or you'll need to implement a finite retriggerable counter output task to be used for the AO sample clock (like in this example).  Keep in mind that a finite counter output task requires the use of both M Series counters.

 

"Advance digital edge.vi" is not a function from the DAQmx libraries so I'm not sure what to say here.

 

 

Several seconds is an unreasonable amount of time to restart a task in software, it should only take a few ms.  There is probably something unnecessary that you are doing that could save you quite a bit of time--I can't give any more advice without the code.  If you want complete determinism with a rearm time in the order of ns, you'll have to give up the luxury of pre-trigger samples and use a retriggerable counter output as a sample clock for continuous AI and AO tasks.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 2
(2,199 Views)