LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What's wrong with this array operation?

Hellow!
Attached is a sample program ,I would like to do a array operation (A**2),but why i can not connet the ouput of the fomular to a array indicator? thanks!
 
0 Kudos
Message 1 of 8
(3,068 Views)
What you do seems overly complicated. Why not do it this way:

0 Kudos
Message 2 of 8
(3,059 Views)

Thanks for your help,but actually,this is just sample program cutted from a bigger program,i have to find the reason why i can not connect the fomular output to a array indicator

 

0 Kudos
Message 3 of 8
(3,057 Views)
Why are you trying to use a formula express vi?  If you want to square all the values of the array just wire it together.  Attached is a modification to your program to square every element in the array (without any loops).  You can do the same thing inside a loop if you want to just square certain parts of the array (like in your example). 
 
Your array does not work because it is not configured to read dynamic data, which is the output of your formula express vi.  You need only the values, not dynamic data which contains additional information (timestamp, t0).  If you really need to use the express vi then you will need to extract the value accordingly.
 
P.S.  It look's like fahler beat me to the punch.

Message Edited by John Rich on 07-29-2005 12:35 PM

0 Kudos
Message 4 of 8
(3,054 Views)
To answer the original question the two are different types which cant be wired together.  If you do wire them together (error wire) and hover over the wire with context help open the mouse it will show the error and what type is coming from the loop and what it needs to be.  From this you can use the variants pallette to solve the problem.
 
 

Message Edited by Chaos on 07-29-2005 12:41 PM

0 Kudos
Message 5 of 8
(3,047 Views)
Thanks for your reply,but my labview is 7.0 version,i can not open the attached program,can you make a lower version one?
0 Kudos
Message 6 of 8
(3,029 Views)
Sure, here it is...
Although I got some errors about saving an instrument to a previous version.  At least you should be able to open it...
 
0 Kudos
Message 7 of 8
(3,023 Views)

OK, your VI does not make much sense. You are not autoindexing on the while loop, thus you will never get a 2D array and all calculations except for the last while iteration will be lost.

Why are you generating 10x10 data if you later only use 3x3?

IF you really want to use the formula node in a loop with a single scalar input, you would simply need to convert the dynamic output back to a single scalar. There are clearly better ways to do this (no loops required), but since I don't know the real code, I left the rest in place. Don't use while loops if there is no variable termination condition and a fixed number of iterations!

0 Kudos
Message 8 of 8
(3,014 Views)