LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove zeroes

Hei, I tried to understand how the remove zeros posts work but it just isn't working for me so i cleaned up the vi.

Can someone show me how to remove them from the arrays in my vi?

Thanks alot!

Download All
0 Kudos
Message 1 of 12
(3,042 Views)

OhCRAP!.png

That might make you look at the help file again


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 12
(3,026 Views)

Hi Nunu,

 

good advice:

- go through LabVIEW basics as offered by NI on their website!

- learn to THINK DATAFLOW!

 

This is your VI after removing the most RubeGoldberg and using the AutoCleanup tool:

check.png

 

And this is how it should look like:

check.png

After learning to use shift registers you may simplify this snippet to use only one case structure…

 

@Jeff:

The OP apparently uses an older LabVIEW version without those fancy output tunnel options…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 12
(3,018 Views)

This snippet will remove 0's from an array.  You must have Labview 2012 or higher to use conditional tunnels.

 

Example_VI_BD.png

Edit: remove the unnecessary NOT.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 12
(3,014 Views)

Hi nunu.

 

 

In your case structures, you are using the "Use default if unwired" in the False case. So, that means that when your number is not greater than zero, you are outputting the default value for the data types, which is zero. Hence, you are getting a lot of zeroes in your result.

 

Try to use the build in conditional terminal and wire in you boolean value from your "Greater than" function.

 

Note: You should always try to keep your dataflow from left to right. In your example VI, the dataflow is in every direction....

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 5 of 12
(3,002 Views)

Hehe, 4 answers in short time Smiley Happy

 

This proves how helpfull this community really is!

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 6 of 12
(2,996 Views)

@GerdW wrote:

 

 

@Jeff:

The OP apparently uses an older LabVIEW version without those fancy output tunnel options…


Missed the vi.property source version again!  (Of course the FP.Colors<> should have reminded me to check)  The back save + Ctrl+U looks like this:

!1.png

and fully de-rubed to a LabVIEW 2010 style:

!1-1.png

(Got to watch out for those boolen case structures)


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 12
(2,990 Views)

Hi Jeff,

 


Of course the FP.Colors<> should have reminded me to check


For me it was the missing connector pane in the FP window…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(2,981 Views)

@GerdW wrote:

Hi Jeff,

 


Of course the FP.Colors<> should have reminded me to check


For me it was the missing connector pane in the FP window…


Honestly, I never even looked at the FP 

I usually drop uploaded vis on a blank vi BD (in case they run when opened) and Ctrl+double-click.  You miss those little clues that way.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 12
(2,972 Views)

Thank you very much guys, one of the given solutions did suit my case and everything works smoothly atm. Smiley Happy sadly,some of the given solution didn't work for me,coz the version of my program is outdated,but thanks anyway.

0 Kudos
Message 10 of 12
(2,918 Views)