LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

formula node error: missing left parenthesis

Solved!
Go to solution

Hi guys

 

I am new on labview and i am strugling to right a bit of code.

 

I am using formula node and i keep getting the error as above on the title moreover it displays: Error on line 5 is marked by a '#' character: "     for   {# H = 00.00.00 to  H = 06.00".

 

I am attaching my file so that if you can give me a hand you could have a brief look.

 

Thank you

 

0 Kudos
Message 1 of 8
(5,732 Views)
Solution
Accepted by topic author InasLab

Hi inaslab,

 

what kind of datatype do you expect for your variable H? You input an integer and try to calculate with numbers like "6.00.00" ( a notation I never have seen before)...

 

I think you should also define any variables in the formula node (like T, V, To, U). And I would prefer real LabView code using a case structure...

Message Edited by GerdW on 10-28-2009 03:21 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(5,728 Views)

Allow me to channel my inner-Ben for a moment:  I am reluctant to help somebody in the use of a formula node.  I use them myself for testing purposes only.  My first suggestion is to dump it and go for real LV code.  We will all thank you for it.

 

If you insist on the formula node route, begin by reading the context help, particularly the section on syntax.  Curly braces should be parentheses, and the for-loop construction is different than what you show.  You are passing integers and checking for what appear to be time values.

 

If I fixed the error you are now showing, there are at least two-dozen more that will follow.  We may both be enthusiasts by the time it is all sorted out. 

Message 3 of 8
(5,721 Views)

Thanks guys

 

As a matter of a fact this code is just for testing. Indeed one of the problems was that I stupidily thought H would be in the format HH.MM.SS. In fact it is just a integer numeber.

 

I have also sorted out the dozens of other possible error it was potentially about to show after solving the first issue.

 

For future reference, there is an attached solution for this matter.

 

Thanks

0 Kudos
Message 4 of 8
(5,716 Views)

Hi inaslab,

 

why do you give an input H when the first command is overwriting the input anyway? ("for (H=0;...")

 

Are those "for H+18" (and similar) really wanted or just typos?

Message Edited by GerdW on 10-28-2009 04:08 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(5,709 Views)

Perhaps it would help if you said what you were trying to accomplish.

 

As far as I can see you formula node has a lot of redundancy in it, and to me doesn't really make any sense.

 

You have a number of loops, with the first four all executing. Inside each loop the calculation is loop-invariant, so it will just do the calculation within, and set the loop variable to it's end state. You don't pass the loop variable outside of the node so....

 

   if (T< 23)
     { 
         V=a;
     }
 
      else
      { V=0;
      }

 

would have the same effect as your node.

 

The last loop would not execute as it's termination condition is already met. (After the previous loop, H will be equal to 25) If the last loop's "H+0" were to be changed to "H=0" that loop would then execute and would do the  U=b contained within.

 

 

 

Rod.

 

 

 

0 Kudos
Message 6 of 8
(5,663 Views)

Guys,

 

the previous file attached isn't the right one.

 

See the following attachment.

 

All I wanted is to test a numeber of different conditions... to get use to formula node editing on labview...and the following attached file does help a bit.

 

thanks

0 Kudos
Message 7 of 8
(5,646 Views)

Hi inaslab,

 

still your formula node doesn't make sense: You still overwrite the value for H in the first FOR statement...

 

What you want is either an IF-THEN-ELSE or a SWITCH/CASE construct like "IF (H>=0 AND H<6) THEN...". Right-click the formula node, select help, select formula node syntax !

 

And I'm even more convinced a standard LV case structure will be much more reasonable here: just wire H to the selector input...

Message Edited by GerdW on 10-29-2009 11:29 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(5,644 Views)