LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring times of digital events on a NI PCIe 6259

I am trying to figure out how to acquire time stamps every time a digital input (Boolean) changes values relative to the beginning of a AO output. Ideally, I would like to reset the time stamp to 0 each time the AO output occurs (different trials). Both counters on the 6259 are free, however I am already using the ao/SampleClock in my VI. Thank you for any help.
0 Kudos
Message 1 of 12
(3,009 Views)
FYI - I am using DAQ!
0 Kudos
Message 2 of 12
(2,987 Views)

Hello,

 

The application that you are working on is a bit unclear. The solution to your problem may be implemented in hardware or software depending on the requirements of your application and how you have setup you analog outputs and digital inputs. Can you specify how you setup your analog output and your digital input? (on demand, finite, continuous)

 

Eric

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 3 of 12
(2,984 Views)

I imagine attaching the vi might be easier.  This vi is called as part of another vi for every trial.

 

I would prefer having a solution utilized hardware if it is possible.

 

Thanks for your help.

0 Kudos
Message 4 of 12
(2,976 Views)

Hello Joes,

 

I looked over the VI you posted and did not find any digital input task within the VI. Do you have another VI that contains a digital input task?

 

Eric

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 5 of 12
(2,970 Views)
Yes, I haven't programmed it in yet. There will be dev2/port0/line19 that is a digital analog input. It reads high most of the time, but when the photo beam is broken, it will read low. That is what I would like to time stamp in relation to the ao output. The photobeam may be broken up to 30 times in the 10 sec trial.
0 Kudos
Message 6 of 12
(2,967 Views)
Not analog, I meant to say boolean. My bad, haven't had coffee yet.
0 Kudos
Message 7 of 12
(2,966 Views)

Hello Joes,

 

I want to confirm your application functionality. You want to measure the time between the start of your 10s trial (analog output) and each of the 30 digital lows. Is this a correct interpretation of your application?

 

Eric

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 8 of 12
(2,951 Views)
Yes, this is mostly correct. The only part I want to be clear on is that there may as few as 0 digital lows and as many as 30 digital lows. But yes, I want to measure and (output) the times between the analog output (start of the 10s trial) and each of how ever many digital lows there may be, from port0/line19 (not yet in the vi). Thanks for your patience, I really appreciate it.
0 Kudos
Message 9 of 12
(2,949 Views)

Hello Joes,

 

Since you have 0-30 events which you want to measure the time of, it would be easiest to calculate the time in post processing. You can use a start trigger to trigger both the analog output and the digital input.  Using the start trigger will synchronize the start time. The high to low transitions can be found in the recorded data and the time can be calculated using the position in the data array and the delta time between samples.

 

Eric

 

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 10 of 12
(2,937 Views)