LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Electronic comparator

the same thing, no difference between my sine wave and yours!

0 Kudos
Message 41 of 45
(647 Views)

I'd guess either the oscillations are too fast, and therefore width is too high, or the thresholds are not correctly set.

 

Attached is the following code (2017), which uses an XY Graph to plot the points at which threshold crossings are detected.

In addition to showing how to get the time values, it highlights that I really don't know why you're dividing by 2...

highlightThresholds.pngThreshold = 0.2Threshold = 0.2


GCentral
0 Kudos
Message 42 of 45
(638 Views)

Also a modified version here that handles negative thresholds:

Add "Sign" and "Absolute Value" nodes. Multiply the input to the threshold VI by the sign (but leave the actual values plotted as the original sign)Add "Sign" and "Absolute Value" nodes. Multiply the input to the threshold VI by the sign (but leave the actual values plotted as the original sign)


GCentral
0 Kudos
Message 43 of 45
(636 Views)

Here's an example in response to a private message regarding the file creation.

 

The example here uses a simple text file, so I used the Close File to close the reference and then the Open/Create/Replace File to reopen the same file. For TDMS, you might prefer to copy some of the contents of the "Create File with Incrementing Suffix" (everything before the Create File) into a different subVI so that you don't create a text file with the wrong formatting (I haven't tested to know what the effect would be for that - I don't know the internal behaviour of the Open TDMS File function).

 

fileIncrementing.png

With this example, the numbers 0-99 are written to a text file and then the next file is created (every 5 seconds).

For the Get File Size function you pointed out that by default it wants a Path input (the slightly wiggly green line) but actually you can also wire a reference to it (the thin, straight green line).

fileSize.png


GCentral
0 Kudos
Message 44 of 45
(615 Views)

This command "Create File with Incrementing Suffix" doesn't work with TDMS file

0 Kudos
Message 45 of 45
(610 Views)