ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can I create array inside formula node

I need to create and use array (multidimensional) inside a formula node. My LabVIEW version is 5.1.The input and output from/to formula node do not necessarily being array. Thank you.
0 Kudos
Message 1 of 5
(5,336 Views)
You need to declare a variable to be an array. To declare a multidimensional array of 32 bit intergers enter this:

int32 VarName[x][y];

Where x=1st dimension size (rows) and y=2nd dimension size (columns). You can then operate on this like you would an array in a text based language. Try the entering the example below in a formula node.

int32 i;
int32 y[5][2];
for (i=0;i<5;i++)
y[i][1] = x[i]+1;

Where y is an output and x is an 1D array input.

Hope this helps...

Brian
Message 2 of 5
(5,336 Views)
Thank you Mr.Brian. I have tried but it does not work. the error I get is
#int32 i; ...
Is it because I am using version 5.1 or there is something that I do not understand using the declared data type. Please if possible provide me with the working vi. Thank you again.
0 Kudos
Message 3 of 5
(5,336 Views)
Not really sure why it isn't working. I think that it should work in 5.1 as well. Try adding an output terminal for i, you don't need to wire it to anything. Let me know if that works.
0 Kudos
Message 4 of 5
(5,336 Views)

thanx it works good.Smiley Happy

0 Kudos
Message 5 of 5
(4,662 Views)