ni.com checkout is currently experiencing issues.

Support teams are actively working on the resolution.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to signal edge triggered event on Digital Input line of PCI-6025E using DAQmx in VB.Net?

I am using DAQmx in VB.Net with a PCI-6025E.  I would like to use a Digital Input line to generate a trigger event on a falling edge.  This would be used as a camera trigger for a GigE camera.  In the event handler, or callback routine, I would also like to disable any other triggers from occurring until the camera acquisition has completed.

 

Thanks in advance for any suggestions.

 

0 Kudos
Message 1 of 6
(3,692 Views)

Hi mpu,

 

Are you trying to internally generate the trigger or are you monitoring a digital signal and will decide from this when the trigger will occur?  How are you acquiring from the camera?  What driver are you using?  Can you elaborate a little more on your overall application?  This will help get a better understanding of the setup!

Regards,


h_baker
National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(3,643 Views)

I am attempting to monitor a digital signal as my trigger input.  The digital signal will be driven by external hardware where a falling edge signals a trigger request.  The fact that I am trying to use it as a camera trigger is actually irrelevant.  I simply want to have a delegate method called on the falling edge of the digital input.  I will call my camera "Snap" method from inside the delegate method, although getting the delegate method called in the first place is my issue, not what will happen once I am in there.  I am using DAQmx 9.1 as my DAQ driver.

 

 

0 Kudos
Message 3 of 6
(3,639 Views)

Try generating a pulse with a counter, where the high tick is the amount of time you want to acquire from your camera.  The digital signal you are monitoring can be the start trigger, which will begin the counter pulse generation.  Consequently any trigger pulses received during the high tick will be ignored.

 

Use the Generate Digital Pulse Train-Finite-Retriggerable example as a starting point (C:\Documents and Settings\All Users\Shared Documents\National Instruments\NI-DAQ\Examples\ ).  CO Pulse Time will be the channel type, while both the Initial Delay and Low Time will be the minimum values possible.  The formula below shows how to calculate the max/min values for the device.  E series cards use 24 bit counters thus the maximum tick count is 16777215.  I recommend using the 100kHz timebase rather than the 20MHz to increase the high time.  If you have an M or X series card available, then you can take advantage of the 32 bit counters. 

 

2 / Counter Timebase Rate <= X <= Counter Maximum Count/ Counter Timebase Rate

where X = Initial Delay, High Time, and Low Time, and where Counter Timebase Rate

 

Notice the example uses implicit timing to determine how many pulses to output.  You will want to remove this and configure the timing as in the Generate Digital Pulse Train – Continuous example.  You may need to access the counter timebase source via a property. Hopefully this helps!

Regards,


h_baker
National Instruments
Applications Engineer
0 Kudos
Message 4 of 6
(3,605 Views)

Thanks. I am trying to use the counter now.

 

I see the Generate Digital Pulse Train – Continuous example on my system, but not the Generate Digital Pulse Train-Finite-Retriggerable.  Is that available on NI's site?

 

Also, does the example set up an asynchronous callback when the counter has reached it's count after being triggered?  That is really what I am looking to accomplish.

0 Kudos
Message 5 of 6
(3,567 Views)

I was able to find the example you mentioned on-line.  I still need to be able to setup a callback method either for when the counter starts or when a final count has been reached.

 

0 Kudos
Message 6 of 6
(3,564 Views)