LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error on line 1 is marked by a '#' character at Formula node

Hi can I ask how can I debug this VI? i want to have a function of get char or gets but i dont know how to implement it in labview using formula node or any other methods. Below is is the sample VI of my program..having problem on the formula node.

 

And btw, how can you turn this into labview program?

 

 do
{
x = getchar()
}
while (x!=k);

 

Thanks and God Bless!

 

 

0 Kudos
Message 1 of 3
(6,679 Views)
All that you would have to do is use the Equal or Not Equal function on the string you get but what would be the point? If it fails, you don't exit the while loop and since you don't read a new character, it never would.
0 Kudos
Message 2 of 3
(6,676 Views)

Multiple problems.

 

  1. In your formula node, you never define K.  That is why you get the undefined variable error.
  2. What is the gets() function?  I really doubt that is a valid function the formula node will recognize.
  3. You have no delay between your serial writes and reads to give the device you are talking to any time to turn around a message.  You write a string.  It will immediately check bytes at port which will probably be zero because you didn't give any time for the message to go out, be processed, and a response returned.  If you do get a byte or two back, it almost certainly won't be the complete return message.
  4. The while loop in the 2nd frame of the sequence structure is unneeded.  With the True constant to the stop terminal, it will only run once.
  5. I have no idea why you have a feedback node at the 2nd bytes at port check.  I'm thinking you had a wiring error and LabVIEW inserted the feedback node by default to correct it.  I really don't think you want to read the number of bytes based on the number read during the previous iteration of your overall while loop.  (Go to Tools, Options, Block Diagram, the General section, and uncheck Auto-insert Feedback node in cycles to prevent an error like this from happening in the future.)
  6. You have multiple cases in your case structure that all contain commone code (a VISA write).  You can edit your case selector dropdown so that multiple matches can be used for a single case.  "1", "2", "3" and so on.
  7. You potentially lose your VISA resource name for the second case structure because you don't have the purple wire wired through all cases in your first case structure.
0 Kudos
Message 3 of 3
(6,664 Views)