11-05-2009 06:07 PM
11-06-2009 06:04 PM
11-16-2009 12:11 PM
11-16-2009 01:00 PM - edited 11-16-2009 01:01 PM
I'm back sooner than I had anticipated.
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.
11-20-2009 12:16 PM - edited 11-20-2009 12:17 PM
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.
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.