LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unsure how to pull a continuous scalar value from waveform of signal to compare using Schmitt Trigger

Solved!
Go to solution

Hello! I have attached images of my labview VI as well as the actual program for reference.

 

Preface: I am using the DAQmx software to acquire a voltage, but I only have the software installed on the desktop in my lab, not my laptop which is why you are seeing the ? blocks. Don't worry, I am able to acquire the voltage correctly!

 

The desired result: I am wanting to acquire the voltage waveform and pull out a value at the current time to be compared to the logic operations shown in the bottom portion of the block diagram (the Schmitt Trigger). When the original waveform passes the upper and lower limits, the schmitt trigger boolean turns on and off respectively. Ultimately, I hope to use the schmitt trigger logic operation to then build a square waveform corresponding to the time when the schmitt trigger boolean turns on and off. 

 

The issue: I originally tried comparing the waveform directly to the logic operations and of course was unsuccessful. I then tried following some forum posts to try to convert the waveform into an array, and then to index the array to a given element so that it would output the value at the current array length. I think my issue is that my sampling rate is so large (100000 samples/sec) that I need to have an array that is constantly increasing in length. Either that, or I need some other way to pull a continuous value from the waveform so that I can then use the schmitt trigger to build a square waveform.

 

Am I going in the right direction with this? Or is there an easier way to compare a waveform to the logic shown in the bottom of the block diagram? I am so thankful for any help you could offer me.

 

Thank you,

 

Cason Smith

0 Kudos
Message 1 of 6
(2,298 Views)

Hi Cason,

 

Am I going in the right direction with this?

No - as you don't obey the THINK DATAFLOW! paradigm of LabVIEW!

 

When you want to process data IN THE upper loop then your code should be placed IN THE upper loop. Right now the lower loop executes AFTER the upper loop has finished…

 

On your code:

Do you know of those InRangeAndCoerce function, found in the comparison functions palette?

Have you heard about the BooleanCrossings function in the PtByPt palette?

And why do you create a large 2D array just to pick a single element from it???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(2,273 Views)

You also don't understand the concept of time, which is a legitimate variable/constant in LabVIEW.  You are sampling 10,000 points at 10 kHz, which means that once a second, you have data to run through your Schmitt Trigger algorithm.  When I use a Schmitt Trigger (circuit), I expect to get a TTL pulse "as soon as" the input voltage exceeds my threshold, not "within one second of the time that one of my 10,000 samples exceeds the threshold".

 

There are some things that a simple analog circuit does more "sensibly" than digital circuits ...

 

Bob Schor

Message 3 of 6
(2,258 Views)
Solution
Accepted by topic author Cason_Smith

There's a built-in function named "Basic Level Trigger Detection" that can help you find trigger locations during post-processing.  It's found down under the Waveform palette or you can use quick-drop.  Keep Bob_Shor's precaution in mind that you won't get real-time information this way.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 4 of 6
(2,256 Views)

@Kevin_Price wrote:

Keep Bob_Shor's precaution in mind that you won't get real-time information this way.

 


The "c" is silent, but not invisible ...

 

Bob Schor (tongue firmly in cheek)

0 Kudos
Message 5 of 6
(2,244 Views)

You all have given me great resources and information. Thankfully I realized that I do not need it to be a real time trigger, I can just write the signal to a .lvm and then count the triggers afterwards. Thank you all so much for your help! 

0 Kudos
Message 6 of 6
(2,232 Views)