I've read the answers in this thread, and I don't even think it's that
hard. I've done the same thing using LabVIEW code, and it's very easy.
If you have LV 5.1, look at the Mathematics->Formulas->Eval Formula
Node.VI in the diagram. This is similar to a formula node, except the
formula (as a string) is sent into the VI, parsed, and the answer comes
out. Basic if/then, boolean, logarithmic, and many other functions can
be used in the formula. I'll be more than happy to email you the VI so
you can look at it if you'd like.
Mark
In article <8k7s8f$pu4$1@laurel.tc.umn.edu>,
stei0113@garnet.tc.umn.edu (Andrew J Steinbach) wrote:
> I am writing some control logic code in LabView and have a
> somewhat interesting question. I would like to provide users
with the
> capability of entering a "simple" text expression, and the "evaluator"
> would respond either with a numeric or boolean value. Examples would
be:
>
> a+b
> a*ln(b)
> a+b>c
>
> An even better "evaluator" capability would be to provide a
> BASIC-like block of code:
>
> IF a+b > c
> THEN d=1
> ELSE d=2
> ENDIF
>
> Better still:
>
> IF ((a + b < c) AND (a < 5))
> THEN d=1
> ELSE d=2
> ENDIF
>
> Some of the requirements are:
> 1) Variable number of input and output variables
> 2) Some method of checking for a valid expression
>
> Any help would be appreciated in this manner.
>
> Thanks,
> Andy
>
> --
> Andy Steinbach
> stei0113@tc.umn.edu
>
Sent via Deja.com http://www.deja.com/
Before you buy.