LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure passing time between 2 signal with DAQmx

Hello guys!

 

My problem is that I want to measure passing time between two analog signal on the same input. I use for this NI myDAQ and the device's Digital Multimeter input because I have industrial signal level. I start to do my task and it is starting to measure time but it is not stop it is run continuously and I need some help how can I do measure if I want to work.

I send what I did yet.

Thanks!

0 Kudos
Message 1 of 11
(2,020 Views)

It is not (yet) clear what you want to do.  I often make a distinction between "What" you want to do (e.g. "Continuously sample data at 1KHz, push a Start Button when I want to start Logging the Data, push a Stop Button to stop logging the data, record the total time I was taking the data, and then ...") and "How" you want to do it ("Use DAQ Assistant to ...").

 

The "What" is much more important (especially for a Beginner, who may not know well the "How").  You do have the glimmer of the "right idea" in acquiring a TimeStamp at "Start" and an updatable TimeStamp that can be used at "Stop", but the "What" is still unclear, and confused by the incomplete "How".  Forget "How" for now, and try to say as clearly as possible What you want to do.

 

Bob Schor

0 Kudos
Message 2 of 11
(1,003 Views)

As I said I use NImyDAQ and its Digital Multimeter input. In this input I want to use two capacitive sensors. I put a little ball on a line and when the ball rolls in front of the capacitive sensor it gives a sign. The first sign is the start point and after 1 meter is the stop sign/point  I want to measure the passing time between these two points. First of all I should use the DAQmx to create the signal and I want to visaulize it on a diagramme when  the signs are high and when low.

0 Kudos
Message 3 of 11
(991 Views)

Your timing feature has nothing to do with the signal you captured, but when you press the start or stop buttons in your VI.  You actually never do anything with the waveform you capture except send it into a Trigger function (same array subset twice!) that you never use the outputs of.

 

How is your DAQ Assistant setup?  We can't get that info from a picture of a block diagram.  An actual VI would help.

 

Are you in the same class as Aero?  https://forums.ni.com/t5/LabVIEW/LV-Won-t-Consistently-Record-Time/m-p/3833428#M1084469

Your problem relating to timing of features sounds very similar to his.

0 Kudos
Message 4 of 11
(983 Views)

I upload how i setup my DAQ Assistant. Yes, i have a similar problem but I can not solve my task yet. I have some question about it. First of all, I don't know how can I give to the " Basic Level Trigger " to give the time after the signal reach the second threshold and after I can do it successfully. Am I get the time from " Basic Level Trigger " with a to Time stamp function or Am I need a plus Tick Count? After I solved these problemes Am I just need to subtract the 2 time and add a numeric indicator? 

Download All
0 Kudos
Message 5 of 11
(967 Views)

Attach your actual VI instead of just pictures of block diagrams.

 

Your code shows a DAQ Assistant that is executed only one time.  And since it reads just 1 sample, you'll only get one sample.  Also, it is only set up for 1 signal, but your subject title says you want 2 signals.

 

Don't worry about trigger levels yet.  Just work on the code to get it to properly read your 2 signals.  Look in the Example Finder for DAQmx examples.  You'll want code that will continuously read analog inputs.

0 Kudos
Message 6 of 11
(960 Views)

Im sorry i was wrong previously. I have 1 signal because I use only one input. I have two rising edge and i would like to measure the passing time between them. The first rising edge is my first sensor and on the same input it get the another sensor as well and it is the second rising edge. 

0 Kudos
Message 7 of 11
(947 Views)

There may be other ways to do this.  Here is one.

 

It looks for the first trigger, takes the waveform data after that.  Looks for the next trigger.

 

I disabled your DAQ Assistant because I don't have a device or signal to test against, so I created a waveform.  I did fix your DAQ Assistant so it is no longer 1 sample on demand, but will grab 5 seconds worth of data.  I set it up as a run once VI, so that if your two triggers occur within 5 seconds after you start the VI, you'll get results.

0 Kudos
Message 8 of 11
(933 Views)

Thank you very much for your help! But I have a little problem anyway. I can not pick just the to pick the Timing setting-->Acquisition Mode--> 1 Sample (On Demand) inside the DaQ assistent and in case it is chang only one value permanently. Unfornately in this way i can not trigger the signal. I try to put it inside a For Loop and i give a Loop Count but i can not wire it to fill an array to make it work. I would like to do that I fill the measured values into an array to can measure the triggered signals but can i do it outside of the DaQ Assistent or how can I do it? Is it because I use the Digital Multimeter input of the device?

0 Kudos
Message 9 of 11
(912 Views)

I got this message:
Error -200077 occurred at DAQ Assistant


"
Possible Reason(s):

Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.

Property: SampTimingType
Requested Value: Sample Clock
Possible Values: On Demand

"

0 Kudos
Message 10 of 11
(909 Views)