LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hot to read number from array

Hi,
i have 9 Numbers from Typ [DBL], and all they are wired with "Build Array".
I only get one nummber at the same moment from all the Numbers. For Example: Number 1 is only active or Number 3.
I don't want to show all the numbers, so i will make a array and then i will only read the number what i active and show the Number again as TYP [DBL].

My Problem is, how can i change the output from the array into a Number?
I try it with Boolean Array to Number but it's wrong! because my Arra yis not boolean!
I attached the File [Labview5.1] maybe it more easy to understand what i will do! 🙂

Please help!
Thanks for your help and answers in advance.

Greetings,
Ender
0 Kudos
Message 1 of 7
(3,069 Views)
hi

you can use the "Wert" as the index of the array output. However, you may have to re-arrange them so that the indexed output is according to your "Wert" input.

Hope I am doing what you were trying to do 🙂

Cheers
ian
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 2 of 7
(3,069 Views)
Hello Ian,
thanks for the programm, but i can't open it, maybe you use LabVIEW 6.1?
I get an Error CODE 8: Could not load VI ressource!
Please save it as LabVIEW 5.1 so i can read it!
Thanks in advance!

Greetings,
Ender
0 Kudos
Message 3 of 7
(3,069 Views)
You program is confusing. All of the formula nodes are the same and if the point of the program is to get a single result from user specified x and y values, the program can be simplified to what I show in the attachment. Your "Wert" control seems to do nothing except select between identical case statements. As it stands right now, it kind of reminds me of the old contest for C programmers to see who can create the most obtuse and complicated program for a simple task.
0 Kudos
Message 4 of 7
(3,069 Views)
Hello Dennis,
this is a part of a programm and is not confusing.
x and y are different strings from Excel File.
This x and y changes the values every second and it's not the same!
I have a result it calls "Wert" but i don't know which of the 9 Numbers are active! But i use the same formula node for every Wert.

My programm here is only to choose the right Wert from the 9Numbers i have.
It's a simple OR Function with a formula node, but will not get an boolean value, i will get the number what is active!.
The cases are 1,3,2,6,4,12,8,24 and 16.
This are the values from the 9 Numbers, but only one can be active, because the "Wert" changes between this cases.
Maybe, now you understand why i use the same formula node 9 times 🙂
Yo
u have a other Idea how can i solve this problem ?
0 Kudos
Message 5 of 7
(3,069 Views)
If you only want to calculate a number if "Wert" is equal to 1,2,3,4,6,8,12,16, or 24, make a case statement and wire "Wert" to the selector. For one case, type 1..4,6,8,12,16,24. Inside this case, place the formula node. The other case should have a value of 0 and should be the default case. Inside this case, just place a zero constant. Doing a 1 x 0 multiplication to have a result of 0 is just a waste. I've attached a new picture that shows what I mean. I converted the "Wert" value to an integer because making equality comparisons with floating point numbers should always be avoided. If you do any kind of calculation of "Wert", because of the inexact conversion of floating point numbers to binary, what you think is
3.0, might actually be 3.000000001.
0 Kudos
Message 6 of 7
(3,069 Views)
hi,

here's your vi.
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 7 of 7
(3,069 Views)