LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manually change trigger threshold

Solved!
Go to solution
Sorry for the extreme delay in response. I've been very busy and am finally getting some more time to devote to this project. The Threshold.vi attached is very close to what I need for a current project. Is there a way to alter that setup so that it takes in data from a DAQ Assistant instead of the Sine Waveform VI like it is currently doing? I tried simply changing it, but the "Get Waveform Components (Analog Waveform) Function" didn't like that too much.
0 Kudos
Message 11 of 15
(2,052 Views)
Solution
Accepted by rmhughes
All you need between the DAQ Assistant and the Get Wavefrom Components is a Convert from Dynamic Data VI and select waveform.
Message 12 of 15
(2,037 Views)
Thank you, that helped greatly! I have this portion of the project working on its own, but have yet to incorporate it into the final product. I may be back with questions about that.
0 Kudos
Message 13 of 15
(2,000 Views)

I'm back sooner than I had anticipated.:smileysad:  I've attached the VI (Threshold.VI) with the minimal changes that I have made. Right now I have a slider dictating what the amplitude should be (just for testing purposes). I need to be able to trigger off of the amplitude being read in through the DAQ Assistant. Any ideas?

 

I've been looking at a file attached earlier in the thread (AI Threshold lv86.VI, also attached for easy searching) but I'm not understanding a whole lot of what is going on. I think I understand what is happening in the Threshold.VI, so if there is a fairly straight forward modification that would allow reading the amplitude in from an input, that would really be great.

Message Edited by rmhughes on 11-16-2009 02:01 PM
Download All
0 Kudos
Message 14 of 15
(1,994 Views)

Hi rmhughes,

 

Although the DAQ Assistant is great for people just starting to learn DAQ, in the long run you'll be able to do more if you use the DAQmx VI's. If you are having trouble following the AI threshold lv86 example, I would suggest that you take some time to examine the examples included in LabVIEW for data acquisition or maybe take the DAQ Acquisition Training class.

 

In AI threshold lv 86, the VI's in the bottom half of the program is responsible of gathering data from the analog input channel. The VI's in the upper half are responsible for outputting a signal to a digital output depending on whether the analog input surpasses the threshold. The VI's outside the loop configures the analog acquisition and the digital output. The DAQmx Read VI is what reads the analog input value (which includes information about the amplitude and timing) from the buffer.The amplitude value is extracted and compared to the threshold. THe result of which is went to the digital output.

 

If you want to use threshold.vi you need to make few changes to be able to read the amplitude from the output o fthe DAQ Assistant. First of all, you need to configure your DAQ Assistant to read only one sample.

DAQ Assistant.jpg

Right now you have it configured to read 2000 samples from the buffer each time the VI is called.

 

Second of all, the you need to compare the Y value with the threshold. Since you have converted the dynamic data from the DAQ Assistant to a waveform, the Y value is an array. To pull out the element use Index Array and then compare that element to the threshold value. 

Threshold.jpg

Message Edited by O54E on 11-20-2009 12:17 PM
Message 15 of 15
(1,964 Views)