LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Eval formula VI

I am trying to input a formula from the front panel and have the eval formula node VI evaluate the formula - I keep getting errors from the VI.

I finally duplicated the formula (and variables) from the example in the help for the VI, and created a barebone VI to see if there was any other problem, but I still get the same set of errors - "Wrong variable name" or "Bracket at end" problem.

I have attached the sample VI I made - anyone have any idea as what I'm doing wrong? I'm using LV 6.1, in WIn2K.

Thanks.
0 Kudos
Message 1 of 5
(3,478 Views)
There's something wierd about the - in the second formula. If you right-click on the formula and select '\' Codes Display, the - shows up as \96. If it were the normal printable character - it would still be displayed as -, not as a \ code. And the ASCII code for the minus sign is decimal 64, not 96.
Anyway, I just deleted the wierd - and entered a new dash and you program ran with no problems.
0 Kudos
Message 2 of 5
(3,478 Views)
I had the same result - however, since I was still having problems with my actual VI, I went ahead and fiddled some more - it looks like labview has a problem with the input variable names being too long or too complex or something.

I get the 'bracket' or 'wrong variable name' error when I have my input variables named "xx1" or "ch1", but no errors when I name then "x1" or "c1".

I've attached the modified sample VI again for anyone to see if I'm doing something wrong...
0 Kudos
Message 3 of 5
(3,478 Views)
If you drill down through the on-line help for the eval formula node you can find a page on the formual parser that states for variable names "Only a, a0, ..., a9, ... z, z0, ..., z9, are valid".
The quick way to this page is to search for parser in the LabView help and select Differences Between the Parser...
The Eval Formula Node.vi uses the parser VIs so it can only use the short variable names. The standard Formula Node (from the structures function palette) doesn't use the parser and can have long variable names.
0 Kudos
Message 4 of 5
(3,478 Views)
Got it, thanks!
0 Kudos
Message 5 of 5
(3,478 Views)