LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I reset the Arm Trigger with DAQmx?

I want to generate a pulse that is armed by a low (or asynchronous) frequency trigger and then fired by a higher frequency (10 kHz) trigger. I am using a PXI-6602 in a real time OS. The idea is that the output pulse is synced to the high frequency trigger, but only when the low frequency trigger activates it. Currently I have my output as a CO Pulse Time which is configured with an Arm.Start.DigEdge.Src from the low frequency source and Start.DigEdge.Src from the high frequency source with the Start.Retriggerable set to false. The timing is set to implicit with 1 sample. I have a while loop that runs at 30 kHz and when the task is done it stops and starts the task again to re-arm for the next pulse. It works, but the start and stop action seems to take about 3 ms no matter what I do. The stop and start task vis only take 2 and 13 us to execute. Is it possible to re-arm or restart the task quicker?

 

I am using the “is task done” vi to determine when to restart the task. I was hoping that since the task is officially done that all I would need to do is just run the start task vi, but that returns an error saying that the task is still running. So my second question is why is task that is “done” still considered “running”?

0 Kudos
Message 1 of 12
(3,302 Views)

Hi Nissen,

       You did a great job explaining your code, but it's always a little hard to visualize.  Would you mind either posting your code or posting a screen shot of your block diagram? It sounds to me like you're simply being limited by the speed of the DAQmx driver, however, there may be a better way to set things up.  Regarding your question about when a vi is considered running or not- I believe you could be seeing this because "is task done" will tell you if your aqcuisition is completed, but if the task is not stopped or cleared, then it could still be considered running. Like I said, I'd love to take a peek at how your code is setup.  Thanks!

 

aNItaB
Applications Engineer
National Instruments

Digital Multimeters
0 Kudos
Message 2 of 12
(3,274 Views)
Here is the vi. I am also experimenting with using a digital out line instead of a counter. In that case I have a real-time loop that looks for the 10kHz event and then if the async. trigger is high then sends the pulse using the DAQmx write functions. It worked better than I thought and I may use the output of the vi with an external AND gate to trigger the actual pulse. Of course it uses a lot more CPU and would use up another counter channel.
Download All
0 Kudos
Message 3 of 12
(3,271 Views)

I have made a system that can do what I originally wanted. The low frequency signal triggers a counter to output a 99 us pulse; the 10kHz signal triggers another counter to output a 2 us pulse. Those two output pulses are wired to an external AND gate. The output of that AND gate is what triggers my final output pulse. The only potential problem is when the 2 us pulse occurs within 500 ns of the 99 us pulse edge because that would give me two triggers. For that case I put in a “Start.DigEdge.DigFltr.MinPulseWidth” of 500 ns on my final output trigger properties. So far it seems to work.

0 Kudos
Message 4 of 12
(3,253 Views)
I'm glad to hear that you got things working.  On a side note, if you are acquiring and get another tirgger, that trigger will simply be ignored.  It sounds like you have a good check in there anyway, so it sounds like things should run smoothly.  Take care!
aNItaB
Applications Engineer
National Instruments

Digital Multimeters
0 Kudos
Message 5 of 12
(3,239 Views)

Hi nissen6,

 

In this post (if you can remember what you have done from 2009), did you wire to an actual external FET or is this a gate that you wired to from within labview?

 

I'm doing an experiment which requires almost exactly the same type of setup as what you have so any replies would be very helpful!

 

Thanks!

0 Kudos
Message 6 of 12
(2,681 Views)

It was external FET and gate chip. I think there were still occasional instances of double pulses so we ended up changing the setup so the higher frequency was a integer multiple of the lower one, which solved all the issues.

0 Kudos
Message 7 of 12
(2,676 Views)

Cool.  Thanks for the quick reply.  Yeah you gotta have frequencies multiples of each other...  This is definitely a simpler solution than anything I've been able to come up with using Labview and the DAQ...

0 Kudos
Message 8 of 12
(2,666 Views)

Hi clintons and nissen6,

Sorry for digging up such an old thread... Smiley Embarassed

I'm currently facing the exact same problem, also using the PCI-6602.

I was wondering if either of you eventually found a way to do this with DAQmx in LabVIEW or if the only solution is to use a different hardware...

 

Cheers

Fred

--

0 Kudos
Message 9 of 12
(2,494 Views)

Fred, I would recommend starting a new thread to get more exposure, it's always tough to revive one that's been dead for two years. If no one comes along and answers your question within a couple days, it'll get some attention from another engineer at NI.

 

Rob B
FlexRIO Product Manager
0 Kudos
Message 10 of 12
(2,473 Views)