Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Making a digital retriggerable gate pulse on demand

Hello,

I am relatively new to using DAQmx, and I was hoping someone here could provide me with a better solution than I have come up with.

The experiment we are running involves a camera, some image processing and then a laser that requires a gate to run. The way our program is currrently setup is that we loop over this process and after each image processing step decide whether or not to gate the laser with a certain number of pulses with a certain frequency and duty cycle. I have attached an example that would functionally do what I am describing. It is worth noting that our laser requires a digital low to gate and not a digital high.

Currently, our camera is triggered using an external trigger, so the while loop hangs on the IMAQ grab until it is triggered. Then we process the image, decide to shoot the laser (running on its 200kHz internal clock). The current example will hang the code until all of the Digital Output is done which may cause us to miss our next camera trigger. It feels like there must be a more intelligent way of doing this. I am even fine routing our own digital output on our DAQ to trigger a pulse train which is also generated by our DAQ, but ideally we would just send our gate pulses as soon as we know whether or not we want to fire our laser.

For extra reference, we are using a PCI2-1433 framegrabber as well as a PCIe-6363 Multifunction DAQ with a BNC 2110 breakout board. Any suggestions would be helpful. I get the feeling that there are a host of different ways that this could be done using this DAQ and the DAQmx software but like I said, I'm really new with these. I'm betting there are things the hardware can do that I have ZERO awareness of.

Thanks for everones time!

Cole

0 Kudos
Message 1 of 2
(4,754 Views)

Hi ColeVV,

 

I've taken a look at your code.  I would recommend using a state machine architecture.  

 

Do you need synchronization among your events?

 

Sincerely,

 

Bogdan Buricea

Applications Engineering

National Instruments

Bogdan Buricea
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(4,725 Views)