Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

comparing two dynamic signals to generate an output/ trigger

Hello,

I am not very familiar with LabView so I am having trouble trying to create a trigger using two dynamic input signals.  I used DAQ assistants to acquire the two sensor signals and I would like to create the trigger using digital logic, which compares the two signals, but unfortunately it seems like you cannot compare two dynamic signals.  Is there anyway to get around this problem?

Thanks!Smiley Happy
0 Kudos
Message 1 of 9
(4,034 Views)
What type of comparison are you trying to do and what is the DAQ Assistant set up to do? You can convert the dynamic data out of the DAQ Assistant to something else with the Convert From Dynamic Data function but you have to know the type of dynamic data. For example, if your DAQ Assistant is set for the two channels and a single sample each, you can convert to a 1D array of scalars, index the elements, and then do a comparison of the elements. If the assistant is set for multiple scans for each channel, then you can convert to an array of waveforms or a 2D array of scalars. Attaching the VI you've written will help to see what you've done and how to solve your problem.
0 Kudos
Message 2 of 9
(4,031 Views)
The DAQ assistant is set up to acquire the voltage signal from a sensor.  Since I have two sensors, I am using two DAQ assistants.  It's seems like you're saying that the solution is to convert the data into an array so that I can compare the two...I searched for dynamic to array conversion help, but I only found array to dynamic conversion.  What function do you use to make the conversion?

0 Kudos
Message 3 of 9
(4,027 Views)

Why are you using 2 DAQ Assistants? That would only generate an error. A single DAQ Assistant can have multiple channels.

You really didn't answer my question either about how you are acquiring the data. N Samples, On demand, etc.

The From DDT (convert From Dynamic Data) is on the Express>Signal Manipulation palette.

0 Kudos
Message 4 of 9
(4,023 Views)
I set the voltage input to a max of 10 V and a min of -10 V.  The time setting is set to acquire N samples at 100 samples to read and a rate of 1 kHz.  For now I'm using the default time settings.  I hope this answers your question.  Thanks a lot for your help.
0 Kudos
Message 5 of 9
(4,018 Views)

Here's one of many ways to get the individual channel data. The Convert from Dynamic Data converts to an array of waveforms. The Index Array gets each channel. The Get Waveform Components gets the Y array from each waveform. You haven't said what type of comparison you want to do so I left it that.



Message Edited by Dennis Knutson on 11-05-2007 02:49 PM
0 Kudos
Message 6 of 9
(4,011 Views)

I'm tryin to use the DAQmx Trigger funciton (start analog window) to use the acquired signals to trigger an output signal  However, I have no idea how to use the function.  the signals were coverted from dynamic data to array as explained by Dennis.  When source 2 (Ch 1) is at a given threshold, the output signal should be triggered, until source 1 (Ch 0) reaches that same threshold value. the trigger function indicates that I need a source but it cannot use the array because function requires a string.  Do I need to convert the data or is the function asking for something else?  I would really appreciate your help.

0 Kudos
Message 7 of 9
(3,967 Views)
I'm not all that familiar with the trigger functions but I'm not convinced that you need to use it. If you do a comparison of a signal, you could put a DAQmx Write inside of a case statement, for example. Or, use the Select function to change the output voltage of an existing DAQmx Write task.
0 Kudos
Message 8 of 9
(3,952 Views)

Hi,

Dennis’s methods will complete the task that you described and if you would like more information on analog triggers please look at the following document. It will be fairly simple to accomplish this task using software but it will be more difficult to accomplish this using hardware triggers. If you do not require deterministic timing then software will be the best route.

Tips and Techniques in Data Acquisition Triggering - NI-DAQmx

A screen shot of your code would be very helpful in determining the best way to accomplish this task.  With regard to the source input on the trigger function that is referring to the analog channel that the trigger should be watching. Please post back if you have more questions.

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 9 of 9
(3,933 Views)