LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to take only the positive section of a waveform using Labview 2009

I was going to add a suggestion about the in-range operator until I saw that Bill posted that so now let me argue against me own idea infavor of your version Tbob.

 

Replace the "0" with "NaN" and then the chart will not be "lying" to us (the values really aren't zero so don't display anything).

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 11 of 16
(647 Views)

@Ben wrote:

 

Replace the "0" with "NaN" and then the chart will not be "lying" to us (the values really aren't zero so don't display anything).

 

Ben


Point well taken.  It depends upon what the OP wants to see.  In reality, if one would apply a diode in series with an AC signal to capture the positive section, an oscilloscope would show the zeros.  It would look similar to my VI's graph.  So it depends upon what the user really wants and how it is to be processed.

- tbob

Inventor of the WORM Global
0 Kudos
Message 12 of 16
(635 Views)

However, you cannot use the NaN as the input to the In Range and Coerce.  The result is all NaN.  So a second step is required to replace the zeros with NaN.

 

Lynn

0 Kudos
Message 13 of 16
(628 Views)

@johnsold wrote:

However, you cannot use the NaN as the input to the In Range and Coerce.  The result is all NaN.  So a second step is required to replace the zeros with NaN.

 

Lynn


I agree.

 

That is why I "argued against myself" regarding using the in-range function and started build a case for Tbob's approach.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 14 of 16
(623 Views)

The OP needs to speak up.  I think Ravens Fan's approach is best.  When viewing a graph, I would want to see a continuous line (with 0's).  But if processing only positive values, then maybe the graph doesn't matter and spaces between sections is OK.

 

Actually, I think the OP has a solution he is satisfied with and will never return.  So we are arguing amongst ourselves never to know what the original intent really was.

- tbob

Inventor of the WORM Global
0 Kudos
Message 15 of 16
(613 Views)

@tbob wrote:

The OP needs to speak up.  I think Ravens Fan's approach is best.  When viewing a graph, I would want to see a continuous line (with 0's).  But if processing only positive values, then maybe the graph doesn't matter and spaces between sections is OK.

 

Actually, I think the OP has a solution he is satisfied with and will never return.  So we are arguing amongst ourselves never to know what the original intent really was.


There is no harm in padding out a thread with other suggestions. The OP may not care but somebody in the future may need the alternative.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 16 of 16
(604 Views)