Jump to content
Nima

continuous triggering

Recommended Posts

Hi guys,

I have a Ni USB - 6229 multifunction DAQ card and I want the analog output channel to generate exactly one cycle of the 1 Hz Sin wave whenever the card reads an external digital trigger at PFI 1. For example, if the card receives two TTL pulses at PFI 1 with a delay of 2 second in between them the analog output should generate one cycle of the 1Hz sin wave wait for 1 second and then generate another 1Hz cycle.

I have been struggling with this issue for quite a while. I am using the DAQmx write VI in the "Analog 1D DBL 1Chan NSamp" mode to generate the one cycle waveform and start digital edge VI but it only generates the signal at the first trigger!

Is there anyone out there to help me solve this problem?

Thanks

P.S. I have attached a sample VI

continuous triggering.vi

Share this post


Link to post
Share on other sites

Hi Nima

What you have is pretty close. Analog input and output operations are not hardware retriggerable but counters are. What you can do is use a counter to create a retriggerable finite pulse train and use this as the sample clock for the output task. This means the output task will run while the pulse train is going.

Here is an example adapted from the example "Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock.vi" in the LabVIEW NI example finder but I changed it for an output task instead. It might need some work to get it going, I haven't got a DAQ device to try it out on but it should give you the idea.

Multi-Function-Ctr Retrigg Pulse Train Generation for AO Sample Clock.vi

Share this post


Link to post
Share on other sites

Thanks a lot Karissap,

I modified your code (see the attachment) and it is know working. The only issue is that I should have an external trigger source at PFI 0 to run this program! Now my next question is:

Is it possible to add an independent digital output line (TTL pulse train at a certain frequency at PFI 1) in this program? I need the TTL output to connect to PFI 0 to initiate my Labview program and also connect it to an external camera to send me its frames at each trigger.

Thanks,

Multi-Function-Ctr Retrigg Pulse Train Generation for AO Sample Clock_modified.vi

Share this post


Link to post
Share on other sites

Thanks a lot Karissap,

I modified your code (see the attachment) and it is know working. The only issue is that I should have an external trigger source at PFI 0 to run this program! Now my next question is:

Is it possible to add an independent digital output line (TTL pulse train at a certain frequency at PFI 1) in this program? I need the TTL output to connect to PFI 0 to initiate my Labview program and also connect it to an external camera to send me its frames at each trigger.

Thanks,

The counter outputs are the only outputs that can generate a TTL pulse train at specified frequencies. The problem with my method is you are using the first counter (ctr0) with finite samples, this uses the second counter on board (ctr1) to provide the gating to turn the output on and off, this means the second counter is no longer available to output a TTL signal. If you need exact timing you'll need an external source or second device. Otherwise if the timing isn't that strict you can use software timing and use a Digital output port.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.