Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using AI Pause trigger signal

Hello,

Who has tried the VI proposed on the NI site for the use of the DAQmx "Pause trigger". I'm trying to get it to work but it's impossible.
I connected on my NI-6351 board, an analog signal [0;5V] of frequency 200Hz on the ai0 channel. I connected the Pause trigger signal, a [0;5V] signal at 100Hz frequency, to the PFI1 port. I configured the Pause trigger so that the final signal has 1 masked period out of 2. I should have half the start signal hidden, but nothing happens?
Have you ever tried the VI proposed by NI?

 

 

Capture.PNG

Capture2.PNG

0 Kudos
Message 1 of 13
(1,618 Views)

I can't open the LV2021 code b/c I'm still at LV2020, but based on the screencap here's what I'd expect:

 

1. You're configured for finite sampling with 100 samples at 1000 Hz.  Without a pause trigger, this would require 0.10 seconds

2.  Assuming a 50% duty cycle 100 Hz square wave acting as the pause trigger, you'll be pausing and un-pausing in 50 msec intervals repeatedly.  That's 50 samples at a time.  Depending on where you are in the pause trigger's cycle, your 100 sample capture should take anywhere from 0.15-0.20 sec.

3. Your 200 Hz signal at ai1 has a 5 msec period.  Each time you capture 50 msec, you'll get exactly 10 full cycles of the signal.  Then you'll miss exactly the next 10.  Then you'll get the 10 after that.  So the data will *look* like nothing was missing, due to coincidences about the timing of the signals you chose.

 

Set your ai1 signal to be something like a 3 Hz sine wave instead so you can more easily spot discontinuities due to the pause triggering.  You might also try capturing 5000 samples instead of 100 to make the timing discrepancy more apparent.  Without a pause trigger the total time should be 5 sec.  With your pause trigger, it should be between 9.95-10.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 13
(1,580 Views)

Thanks pour your help

 

I understand now. I tried to do the VI you suggest. But I think there is a problem with the graph display. I'm not using the right type of graph.

But now I understand the logic of using the "Pause Trigger" function.

The "Pause Trigger" function is used to pause the sampling clock when reading data from an external source. I mean pause. Playback resumes after the requested pause time.

 

In my case, for the project I was working on, this function is not usable. In fact, I wanted to filter every other period of an external signal. In my case, a pulse. This is used as a trigger to generate another signal at the board's output, of the square type. I thought I'd use the pause trigger function to filter this period, then use this new "filtered" signal to trigger the output signal. But this function doesn't allow it. It's not possible to generate an output signal from a filtered signal using the pause trigger function. Too bad, it was an interesting idea....

 

thank you again for your invaluable help

 

Best regards

0 Kudos
Message 3 of 13
(1,512 Views)

I don't entirely understand what you're trying to do.  But the counters on your X-series device are *very* versatile for many ways of manipulating digital (0-5V) timing signals.  There might be a way to get there from here, I'm just not sure I understand where "there" is yet.

 

Can you describe again in more detail the kinds of digital timing signals that come into your X-series device as inputs and the signals you want to produce as outputs?   Include some kind of well-labeled timing diagram to illustrate, even if you just hand-sketch it on paper and send a pic.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 13
(1,504 Views)

Okay,

 

I'm trying to create a device for triggering 2 devices from an input signal.

 

At present, I have a program that makes this possible. It allows 2 output signals to be triggered on each falling edge: a negative pulse and a square wave, with the possibility of a time offset with respect to a trigger signal.
I've attached the image of the signals and the program to the message.

 

On the image, the yellow curve corresponds to the external source that will be used as the trigger source. The other 2 curves are the signals of the 2 output channels generated (red curve and blue curve) to trigger 2 devices.

 

AISourceExt_AO&DO_1to1periode.png

 

 

here's the associated program:

didrider38_0-1694096484897.png

 

Now, I'd like to have a version where, from the external source, the pulses are read every other time. see the image below :

didrider38_1-1694097000316.png

 

 

I was thinking of using the "pause trigger" function, but it doesn't work as a trigger source. However, I managed to obtain the desired result by triggering the signals with a second external source which is synchronized with the first but has a period twice as long, i.e. a frequency twice as low. lt's not visible on picture

 

I therefore succeeded in triggering the signals every other time as I'd wished, but via a second source....

I'd like to find a solution without the second source ...

 

I hope it's clear. Is not, I have other more theorical schematics.

 

 

Program with second source :

 

didrider38_2-1694097605648.png

 

 

0 Kudos
Message 5 of 13
(1,499 Views)

1. Will the incoming (yellow signal) triggering signal's frequency stay constant within a given run?

 

2. Do you have prior knowledge of its frequency, at least within 10-20% or so?  If not (and if it will be constant during a run), could you quickly run a temporary counter task to measure its frequency before getting into your main working code?

 

3. Will each of your output signal's delay from the trigger stay constant for a given run?  (It's fine if they're different from one another.)

 

4. Assuming yes to all of the above, I'd be inclined to approach this with 3 counter tasks and one AI task. 

    A. One counter task will be retriggered by the external (yellow) signal and produce 1 output pulse for every 2 input pulses.  There's more than one way to do this.

    B. The other 2 counter tasks will produce your output (red and blue) signals.  They will be retriggered by the first counter's output rather than directly by the external (yellow) signal.  You'll no longer use AO for one of the outputs.

         (Alternatively, you might be able to use 1 retriggered AO task with 2 output channels instead of the 2 counters.  I like using counters because you can get much finer timing resolution and don't need high sample rates and big buffers like you'd need with AO.)

    C. I'm unsure exactly where and how AI fits in here.  Maybe it uses one your counter outputs as a clock, maybe instead it's retriggered by one of them to do higher-rate sampling?   Whichever you intend, odds are this part will fall into place too.

 

That's the essence of it.  I should have time later tonight to put together a rudimentary example, but you can tinker in the meantime and maybe get there first.

 

 

-Kevin P

 

 

P.S.  It'll help if you can give me a starting point by posting one of the actual vi's in the msg #5 screencaps.  Please back-save to LV2020 if you're working in a more recent LV version.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 13
(1,491 Views)

The incoming triggering signal (yellow) is frequency stay constant with value of 10kHz. Always same form

 

It's interresting to use counter. I never use these

 

I will see examples on the NI website

 

0 Kudos
Message 7 of 13
(1,468 Views)

I wound up with not enough time / motivation to build up an example from scratch last night.  If you post some code with your own config params, etc. in LV 2020 or earlier as a head start, I'll try to get to it over the weekend.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 8 of 13
(1,461 Views)

Ok, found some time over the weekend to put an example together.  You'll need to fill in your own config data (device alias, counter #'s, PFI terminals, pulse timing params, etc.), but I think this will at least get you real close.

 

 

-Kevin P

 

 

delayed pulses every second trigger - modKP LV2016.png.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 9 of 13
(1,437 Views)

Thanks for your help

I'm looking into this issue again, which is still topical.
Can you explain the role of the "DAQmx Control Task"?

 

 

0 Kudos
Message 10 of 13
(1,261 Views)