06-09-2010 01:54 PM
Hi! I am trying to write a basic if statement at the very end of my VI (the far right side, outside the while loop).
I would like any numbers greater than 2.59 X10^6 to be written to the spreadsheet as zero. Any numbers less than that threshold, should be written as they are computed.
It seems like a very basic concept but I am running into problems with having the wrong form of data...? As well as getting the output of zero to write to the spreadsheet if it is, in fact greater than 2.59X10^6.
Thanks for your help!
Solved! Go to Solution.
06-09-2010 02:03 PM
Hi,
You mixed up the data types. Boolean and double.. I attached a simple VI that seems to solve your problem.
/ Patrik
06-09-2010 02:17 PM
Not too bad, You laked a bit of data-dependance for initialization see the structure on the left.
A case statement wasn't needed as you had an array of booleans I simply autoindexed with a for loop and added the select primitive.
Enjoy
06-09-2010 02:17 PM
thanks so much!
I'm still struggling with how to hook it up to my current arrangement....???
How do I hook this up to still write to the spread sheet?
06-09-2010 02:21 PM
Thanks everyone for your help! I actually just figured out how to correct the wiring correctly!
I really appreciate it!
06-09-2010 02:22 PM
06-09-2010 02:58 PM
You have a control, X, wired to the Greater Than input. You cannot wire the output of the loop to the same wire. Can't have two inputs on the same wire. Delete the wire from X to Greater Than. Then wire the loop output array to the Greater Than. Now that will make the output of Greater Than a boolean array. You can't wire that to the T/F Select function. So you have to either use And Array Elements or Or Array Elements (found in boolean palette) depending on what you are trying to do. The output of And/Or Array Elements will be a boolean that you can wire to the Select function.