LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass the value if it is not zero

Dear Friends,

 

I have a small Issue, I have a program, which will generate some floating values Dynamically. Some values will be zero and some other values will not be equal to zero have to filter the values which are non Zero and I have to write those in to a file.

Is there any control in the labview to filter out the values which are not equal to zero. Could you please help me on this?

 

 

 

Thank you,

 

 

Best Regards,

Rathan

 

 

 

0 Kudos
Message 1 of 15
(4,629 Views)
There is the function Equal to 0? on the comparison palette.   However, with floating point values zero may not exactly equal zero.  So you can use in range and coerce comparison to compare your value with + a very small number and - a very small number, such as plus or minus machine epsilon.  Feed the In Range? boolean output to a case structure with the file writing code placed in the False case.
Message Edited by Ravens Fan on 07-30-2009 12:37 AM
Message 2 of 15
(4,626 Views)

 


I have a program, which will generate some floating values Dynamically.

 

 

Can you post a screen shot till the generating part. We can suggest how to  eliminate the zeros? r u getting it in a array?

Message 3 of 15
(4,611 Views)

i read your post,it was good and i tried an example. But what happens if the value zero is in the range between 10^12and 10^ -12. I have to eliminate the value (zero) in my written file with specified range. Any help?

 

 

0 Kudos
Message 4 of 15
(4,339 Views)

 


@2249kumar wrote:

i read your post,it was good and i tried an example. But what happens if the value zero is in the range between 10^12and 10^ -12. I have to eliminate the value (zero) in my written file with specified range. Any help?


 

Do you know how big 10^12 is? Zero will never be in the range 10^12 and 10^-12, by definition and the current state of the known universe (as well as simple mathematics).

 

You said you tried an example. Did it work? If not, why not? What exactly did you try? Are you doing the same thing the original poster of this thread did, or are you trying to remove "zeros" from a file and then write the file back. Details, please.

0 Kudos
Message 5 of 15
(4,331 Views)

@2249kumar wrote:

i read your post,it was good and i tried an example. But what happens if the value zero is in the range between 10^12and 10^ -12. I have to eliminate the value (zero) in my written file with specified range. Any help?

 

 


0 is not in the range 10^12 to 10^-12. 10^-200 is still not 0, although it's getting very close. 🙂

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 15
(4,327 Views)

In "Range and coerce" block i set to 10^12 as upper limit and 10^-12 as lower limit... when the input value 'X' is zero??

 

 

0 Kudos
Message 7 of 15
(4,317 Views)

hum... ,try the log base ten of the number first then use machine epsilon....

0 Kudos
Message 8 of 15
(4,316 Views)

 


@2249kumar wrote:

In "Range and coerce" block i set to 10^12 as upper limit and 10^-12 as lower limit... when the input value 'X' is zero??


 

I don't understand what this means. All you did was upload one of the examples. 10^12 = 1 followed by 12 zeros. That's 1,000,000,000,000. Do you know math? Smiley Surprised

 

As explained, use the Machine Epsilon constant.

 

To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

0 Kudos
Message 9 of 15
(4,300 Views)

 


@2249kumar wrote:

i read your post,it was good and i tried an example. But what happens if the value zero is in the range between 10^12and 10^ -12. I have to eliminate the value (zero) in my written file with specified range. Any help?

 

 


 

10^12 = 1 000 000 000 000

10^ -12 = 0.00 000 000 000 1

Smiley Wink

0 Kudos
Message 10 of 15
(4,290 Views)