07-13-2015 09:01 AM
@fendy90 wrote:
What do you mean by changing the data to "codes"? I try to format as "%f %f %f %f %f" and it seems not working out.
No. It is "\ Codes". It is a display style for the string controls and indicators. If you right-click on the string indicator you will see it. It also helps if you show the display style as well (right-click on the string indicator then Visible Items->Dispaly Style).
If the spaces are not working, then the seperator is not a space. It is something else. So you really need to show the \ Codes in order to figure this out.
07-13-2015 10:07 AM - edited 07-13-2015 10:09 AM
I still beleive that the Error 1 occurred at Scan From String (arg 1) is caused by an empty input string.
Or you have a NULL (\00) character as your first byte in your format string. Before your first '%f"
That is the only two way I have been able to reproduce your Error 1
Error 85 is what you get if the input string does not match the format string.
This works with no errors even without the space between the %f
If there is not a one to one match of number in the input string to %f in the format string you get an Error 85.
The only way that I have been able to reproduce the Error 1 is by passing in an empty string.
This throws an Error 1
So I am sticking with the empty string causing the Error 1 or the NULL character in the format string
07-13-2015 10:46 AM
I Opened your Encoder VI.
How do you know the VISA Read did not throw an error? You are not checking the error out.
If after the error popup you select STOP, you would never see the error from the VISA Read that is the cause of your Error 1
At lest add an indicator or put a probe on the Error out wire right after the VISA Read inside the True case.
You don't have NULL char in your format string so it must be an empty input string.
What is the point of passing in the Baud Rate into the byte count of the VISA read.
No need to use dynamic data types
07-14-2015 07:25 AM
Thank you crossrulz, the codes really help me a lot.
07-14-2015 07:26 AM
I finally got it, yes the error pop-out as the initial reading (the data) does not follow the format i initilaze in "Scan from String" .
Thank you Omar II.