Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform computing

Solved!
Go to solution

Hi Michael,

 

If you want to trigger analog input on every falling edge of your trigger pulse, you need to setup a retriggerable task.

Have a look at the following example on how to accomplish that:

 

Help >> Find Examples >> Hardware input and output >> DAQmx -> Analog Measurements -> Voltage -> Acq&Graph Voltage -Int Clk-Retriggerable.vi

 

However, I am afraid that your 9205 might not support support retriggerable input. If that's the case have a look at the following post for a workaround.

Mikhail
RF Toolkits, Product Support Engineer
National Instruments
0 Kudos
Message 11 of 20
(1,665 Views)

Hi, Mikhail

 

Well, 9205 is all that I haveSmiley Frustrated

 

So I cannot do the retrigger thing. and I am wondering if it is possible that I  obtain the data first(the continuous waveform of the voltage for 20s) and then find every falling edge of this waveform and the values around the edge.I am just not sure how to do that..

 

Thanks!

 

Michael

0 Kudos
Message 12 of 20
(1,659 Views)

Hi Michael,

 

To continiously acquire you need to change your sampling to continious and surround your DAQmx Analog Read in a while loop. Refer to the attachment.

If you want to manually find the edges of the waveform and then manually extract the values around those I would recommend that you read two analog channels, one would read your data and another one would read the square wave of the triggering pulse containing falling edges of interest. You can then easily compare the two waveforms side by side and analyze the points around the falling edges.

Mikhail
RF Toolkits, Product Support Engineer
National Instruments
0 Kudos
Message 13 of 20
(1,657 Views)

Hi, Mikhail

 

I read from the mannual of 9205 that it has 4 nomial range +10/-10, +5/-5, +1/-1, +0.2/-0.2. How could I know what range I am operating in and How can I change it?

 

Michael

0 Kudos
Message 14 of 20
(1,650 Views)

Hi Michael,

 

You can adjust the nominal range when you setup your analog input task in LabVIEW. The DAQmx Create Channel: AI Voltage VI has two input: min/max value which you can use to change your nominal range. If you use smaller limits you can improve the precision of your measurement. For more info refer to the following paragraph from NI-DAQmx help:

 

Input Limits (Maximum and Minimum Values)
Input limits are the maximum and minimum values you expect to measure, after any scaling, including custom scaling. Input limits are sometimes confused with device range. Device range refers only to the input range of a particular device. For instance, the device range for a DAQ device might be 0 to 10 V, but that device might be used with a temperature sensor that outputs 100 mV for every 1 °C. The input limits in that case could be 0 to 100, with 10 V corresponding to 100 °C.

Input limits in a smaller range can improve the precision of your measurement. If, in the previous example, you knew that the temperature would never be higher than 50 °C, you could choose a minimum value of 0 and a maximum value of 50. The device can then detect smaller differences in temperature because it is digitizing a voltage between 0 and 5 V, rather than 0 and 10 V.

Parent topic: Sampling Considerations

Mikhail
RF Toolkits, Product Support Engineer
National Instruments
0 Kudos
Message 15 of 20
(1,635 Views)

Hi, Mikhail

 

My vi almost works. Now I tried to obtain two input data at the same time but something is wrong.. I don't know why. Could you please have a look? Seems that I cannot start two tasks at the same time?

 

Thanks!

 

Kangwei

0 Kudos
Message 16 of 20
(1,629 Views)

This is the one that works. But only obtaining one input data(It realize my function.).

0 Kudos
Message 17 of 20
(1,628 Views)

Hi Kangwei,

 

I have looked at your code and it looks like the Formula Node in the second While loop never executes. You need to redesign the condition for the Case structure of your second While loop. Now, you successfully pass the waveform data and its size into the second loop once you hit the stop button on the front panel, however the data doesn't get processed by your formula node. Also, for the future, here is a helpful article on debugging LabVIEW code: Debugging Techniques

 

Mikhail
RF Toolkits, Product Support Engineer
National Instruments
0 Kudos
Message 18 of 20
(1,619 Views)

Hi, Mikhail

 

Thank you! My project is almost done!

 

Now there is this one last question. I am using NI9401 as the digital output as the control signal of the switch. Is it possible to have changable output signal? Say, I want to have 98% of duty ratio in the first second and 99% in the rest time. Or I want to have constant on time but variable frequency. What kind of vi should I look at?

 

Thanks.

 

Michael

0 Kudos
Message 19 of 20
(1,608 Views)

Hi Michael,

 

To update the frequency and duty cycle of your counter output task on the fly, you need to insert a DAQmx Channel Property node within your while loop. Then you will need to use the following properties: CO.Pulse.Freq and CO.Pulse.DutyCyc. Have a look at the following articles and examples on how this is done:

 

Generate a Continuous Digital Pulse Train With On The Fly Frequency Control

 

Generate a Continuous Digital Pulse Train With a Variable Frequency

 

Generate a Continuous Digital Pulse Train With a Variable Frequency Using Event Structure

Mikhail
RF Toolkits, Product Support Engineer
National Instruments
0 Kudos
Message 20 of 20
(1,605 Views)