LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I implement the functionality of a Schmitt trigger in LabVIEW?

I am reading in a waveform file using the Read Waveform From File.vi.  I would like some guidance as to how to implement a Schmitt trigger using LabVIEW blocks to massage the incoming waveform into a new waveform that resembles a digital data stream.

For example:
When the amplitude of the incoming waveform goes over 0.7, the output is 1 and is latched until the amplitude falls below -0.7.
Once the amplitude of the incoming waveform falls below -0.7, the output is 0 and is latched until the amplitude exceeds 0.7.
0 Kudos
Message 1 of 6
(3,769 Views)
Use a shift register to manage the threshold. Change the value written to the shift register to the new value whenever the threshold is crossed in the correct direction. That value then becomes the new threshold for the next element. You need to consider the initial condition: What threshold will be used for the first element in the array? What is the output while the elements remain between -0.7 and +0.7 and none has been outside that range?

Lynn
Message 2 of 6
(3,763 Views)
Thank you for your reply. 

I have looked through help files to try and find out how to use the shift registers (I am a beginner in LabVIEW) and I think that I have created something that would work for comparing an incoming value with the threshold, as well as switching the threshold.

However, I am not sure how to sample the waveform to get the Y-values to pass in one by one for the comparison.   How would I do this?


Message Edited by Raine on 01-30-2007 02:23 PM

0 Kudos
Message 3 of 6
(3,735 Views)
You can use the Get Waveform Components function to extract the array of data. Then feed that to an autoindexing terminal on a loop.

Lynn
Message 4 of 6
(3,726 Views)
Thanks again for the quick response.

I am having trouble with the autoindexing: I keep getting data values of 0.
I have attached a VI that I quickly threw together to show what I am doing.
Please tell me if my method/reasoning is incorrect.


0 Kudos
Message 5 of 6
(3,717 Views)

You've autoindexed into a while loop. It runs so fast that you don't see the chart being updated with the array elements. Since the while loop keeps running until you hit the stop button, it is eventually indexing elements that don't exist in the array. The array has 1000 elements and it doesn't take long for the while loop to reach 1000 iterations with no delays. A for loop will iterate to the array size and then stop.

Message 6 of 6
(3,709 Views)