LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two edge separation timeout with NI cDAQ 9174 and NI9401

Solved!
Go to solution

Dear

 

I know this has been discussed before but in another way.

I can set the maximum time in the selected unit.

Thats OK.

The question is is this equivalent to the timeout?

It doesn't seam to be.

How can I limit the time of measurement?

 

Regards

Martin

0 Kudos
Message 1 of 6
(1,057 Views)

The min and max inputs at DAQmx Create Virtual Channel are not, strictly speaking, bounding values for the measurement.  They're basically clues for DAQmx to select an internal timebase intelligently.   It will generally choose the fastest one that wouldn't lead to counter rollover if the separation time was at max.

   You've probably got either an 80 or 100 MHz timebase on your chassis, so a 32 bit counter could rollover in (2^32) / (100e6) ~= 43 seconds.

 

All that said, I think you're looking for the 'timeout' input at DAQmx Read.  This should be set at *least* as large as the largest actual measurement time you anticipate, but might sometimes be set very much larger.  For example, you may need to start your program, then walk across the room to fire up the equipment that will generate the pulses whose time separation you want to measure.  Maybe the max separation time is in the millisec realm, but you may still need a 30 second timeout to give you time to go through your launch sequence on the equipment.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 6
(1,045 Views)

Hi Kevin,

 

thank you for your answer.

Indeed I'm looking for a timeout procedure.

Can I terminate the running task anyway if the timout occours?

 

Since the daqmx tast seams not to have a timeout the logical exception is to measure the time and kill the nidaqmx taks anyway.

 

Is it possible to do so?

 

Regards

 

Martin

0 Kudos
Message 3 of 6
(984 Views)

Dear Kevin

 

The solution is simple.

I use the maximum time a a timeout time and wait until the timout time is reached.

Than I execute the DAQmx Control Task.vi and abort the task.

That works perfectly.

 

Regards

 

Martin

0 Kudos
Message 4 of 6
(974 Views)
Solution
Accepted by topic author Martin_Kunze

[Sorry for long delay, just getting back from out of town...]

 

The DAQmx Read function *DOES* have a timeout input.  That's what you should use.  Then if the read function call returns a timeout-related error code, you'd be better off calling DAQmx Stop to stop the task.  Abort is not recommended for normal usage, it's more of a last resort.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 5 of 6
(957 Views)

Hi Kevin,

 

I have overseen this.

Thank you for your reply.

 

Regards

 

Martin

0 Kudos
Message 6 of 6
(950 Views)