03-30-2007 06:35 PM
04-01-2007 10:22 AM
04-01-2007 12:27 PM - edited 04-01-2007 12:27 PM
Hi Jzee,
(Under LV7.1) To see the C-syntax implemented by the formula-node, Search LabVIEW help on "Formula Node" and take the "syntax" link. There's a syntax summary in "BNF" form. I may be wrong, but it doesn't look like the aggregate-array-constant "expression" is allowed in an "assignment".
BTW, there's also a "Array Manipulation in Formula Nodes" help-page.
Cheers!
Message Edited by tbd on 04-01-2007 12:30 PM
04-01-2007 02:07 PM
04-01-2007 02:55 PM - edited 04-01-2007 02:55 PM
Hi Jzee,
I copied this from the page on syntax:
"expression:
expression binary-operator expression
unary-operator expression
expression unary-operator
expression ? expression : expression
( expression )
identifier
constant
function-name ( argument-list )
"
... the right-side of an "assignment" needs to be an "expression" but there doesn't appear to be any form of "expression" that handles the array-aggregate. If this is in fact the case, then the assignments would need to be done individually:
B[0][0]=2; // note, was "k2", but what does "k2" mean?
B[0][1]=0;
B[1][0]=0;
B[1][1]=0;
B[2][0]=4;
B[2][1]=0; // etc
Would it work for you to pass the 2D array into the Formula Node - already defined?

?
Message Edited by tbd on 04-01-2007 02:56 PM
04-01-2007 03:30 PM
04-01-2007 04:01 PM
> pain in the bum
yes, it's sorta depressing in those (albiet rare) cases when LabVIEW forces us into something so... inelegant. ![]()
... but the work-around that (i think) you suggested doesn't seem too bad. Did you mean to suggest that the (somewhat sparse) 2D arrays could be initialized on the block-diagram, and the 8 "k-values" could be "plugged-into" the pre-existing array? So:
float k1=-m*g*l**2/I_theta;
float k2=xx;
float k3=xx;
float k4=-xx;
float k5=xxi;
float k6=xx;
float k8=xx;
could become:
A[0][1]=-m*g*l**2/I_theta;
B[0][0]= xx; // from k2
A[2][1]= xx; // from k3
B[2][0]=-xx; // from k4
A[4][3]= xx; // from k5
A[4][5]= xx; // from k6
B[5][1]= xx; // from k7
... and the array-assignment dissappears completely! ![]()
?
04-01-2007 04:23 PM
04-01-2007 04:35 PM