10-18-2019 09:09 AM
hello i got an error at scan from string , error 85 ,
this is my program , please give me solution
Solved! Go to Solution.
10-18-2019 09:28 AM - edited 10-18-2019 09:28 AM
First, your subject says error 85, but your picture says error 1.
Please be accurate in describing the problem.
That and we can't provide a solution. You haven't given enough information.
Thank you for providing an actual VI to go along with the picture of your code.
But the problem is in the data you get form the VISA Read and are feeding into the scan from string. That doesn't show in your picture.
If you placed an indicator on that string, and even better, ran your code and saved the data in that indicator as default before saving it and attaching the VI, we could see what is wrong with your data.
Also, your first embedded picture is broken.
10-18-2019 10:12 AM - edited 10-18-2019 10:23 AM
im sorry
10-18-2019 10:20 AM
actually the vi that i attach is part of my program ,
my issue , sometimes the program work properly , and sometimes the program give error 85 ,
before i use scan from string i use match pattern , but match pattarn have an issue , a few data will show Nan and inf , than i try to change to scan from string , thanks for tryng help me , below is my project , this project yet finish
10-18-2019 10:21 AM
If you got Error 1, that means you got an empty string from your VISA Read (ie the read failed either due to an error or timed out).
Error 85 indicates that you got something from the VISA Read, but it does not match the format you state in the Scan From String. So we are back to "What did the VISA Read output"?
10-18-2019 10:50 AM
You didn't save the data in your Read Buffer indicator as default.
Go back to the simpler VI, run it. Right click that indicator. Save as Default. Save VI . Attach.
Please use block diagram cleanup on your big VI. Why have 3 different case structures all controlled by the same boolean button?
10-18-2019 10:59 AM
Now that you added the image from the Arduino terminal, it looks like the data is formatted correctly. How often does the Arduino spit out data? Could you share the Arduino code so we can see if we can find a little "gotcha"?
11-09-2019 05:32 PM
i got the solution , ty , the solution is adding Visa flush I/O buffer
11-09-2019 07:06 PM
VISA Flush is probably not the right answer. What if you flush after a message packet has started but not finished? You'll get an incomplete message.
You should almost never need a VISA Flush. Honestly, I don't think I've ever used it in my programming.
If your Loop runs fast enough to service the VISA buffer it should keep up. But a protocol that has the device sending data continuously is generally a bad design. A protocol where the device waits for you to write it a command, then sends back a response that you read, is better. That way it isn't filling up the VISA buffer if you aren't ready to read it.