ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger counter manually

Solved!
Go to solution

Dear community,

I'm struggling a problem with starting a triggered counter task.

environment:
- card: USB-6218 using latest NI-DAQmx driver 9.7
- OS: Windows 7 x64
- dev plattform: MS Visual Studio 2010 (C/C++ language) ... but do not mind if anyone comes up with a Labview solution

card setup:
- retriggerable Counter 0, which starts generating a finite amount of clocks (100 up to 1000) at pre-defined, high frequency (200 ... 250 kHz) when it receives a rising edge on PFI0
- Counter 0 generates sampling clock for two analog output channels (AO0 and AO1, amount of samples is finite due to finity of clocks generated)
- Counter 0 is also output to standard digital pin (PFI 4 / P1.0) and then smoothened (creates constant high on "clock" orr constant low on "no clock")

process:
- NI DAQ card starts outputting on AO 0 and 1 for a pre-defined time
- while clocks are generated, my smoother keeps PFI 4 high
- when generation is over, the smoothed counter 0 output generates a falling edge (from "last clock impulse" to "no more clocks"), which triggers a device X
- after device X is done with its work, it generates a rising edge on counter 0 input, which starts clock and therefore starts output on A0 0 and 1 again
- and on and on and on ...

problem:
- can't find a way to start the whole loop between NI DAQ card and device X, because I cannot activate the Counter 0 trigger manually
- I cannot order device X to send me a trigger, because it's technically black box ... or call it "dumb piece of electronics" 😉

what I tried:
- creating a digital output task, which output pin reconnects on Counter 0 source pin; doesn't work, because digital ports cannot be shared above task borders on M-series devices; also I cannot attach a single pin to a task (software exception)

Any ideas?

 

Thank you for reading,

M. Paul

0 Kudos
Message 1 of 3
(3,254 Views)

Hi Paul!

 

Could you please post some screenshots wih markers of your VI?

The VI itself would also be very helpful.

 

Best regards,

Adilo

0 Kudos
Message 2 of 3
(3,206 Views)
Solution
Accepted by topic author FocusPaul

Hello Adilo,

 

unfortunately I have no VI screenshot, because it is coded in C.

 

 

But I solved the problem:

It is possible to have an external digital output task, which is started while the retrigger task and the analog output task is already running. This task is set programmatically to create a short pulse. The digital output re-connects to the digital input used for triggering.

 

My mistake was, that my card only has one port of digital outputs, but another task claimed all 8 pins of this port. Now the other task only claims a single pin of the port, so other pins are free for use for additional tasks.

 

Thank you for reading,

Paul

0 Kudos
Message 3 of 3
(3,201 Views)