LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan failed

Dear all,

i am a problem about the function which is "scan from string"
There is a attachment which is a image of my part of program.
The string input is a string of Haxedemical string.
When i used this part of program to convert that into decmical number, there is a scan failed and the error code is 85

Error 85 occurred at an unidentified location
Possible reason(s):
LabVIEW:  Scan failed.
 
It don't understand the reason of this failed and the explain error did not explain detail. Anyone know that? Please help me to solve it.

Thankl you.

KIM
0 Kudos
Message 1 of 8
(3,703 Views)
This, I believe is related to this.

The likely reason is that you're simply going past the end of the string, and there's nothing more to parse. Hence, the Scan From String generates the error. Whether or not it's an error is up to you. A better solution would be to set the number of iterations based on the length of the string divided by the number of characters which make up a number (in this case 4), rounded appropriately to get the right number of iterations.

Tip: If you set the datatype of the constant that you're wiring to the "default value 1" input to I16 then you don't need the convert to I16 function.
0 Kudos
Message 2 of 8
(3,684 Views)
Dear Smercurio_fu,

SO HAPPY to see you again^^!

With your opinion,"set the number of iterations based on the length of the string" which i have thought about this and i have tried.
The attachment just was a example. In my case, the length of string can be multipled by 4 actually and i also have set the string format  be "%4x". With this setting, the string should be multipled by 4 totally and i have checked that. I think the setting is correct but i still don't know the problem where happened. In the error message, there was not too many informatons provided. It is a trouble for me ......

THANK YOU!

KIM
0 Kudos
Message 3 of 8
(3,677 Views)
You don't want to multiply the string length by 4. You want to divide. You didn't provide the string you're actually trying to parse, so let's use your previous example. In that example, the string was "0011000101111111". With each number made up of 4 characters this string contains 4 numbers. The string length is 16. Thus, the number of times the loop should run is 4 (16/4 = string length / number of characters per number), not 16, or 16*4, since you're trying to take 4 characters at a time and convert that into a number.
0 Kudos
Message 4 of 8
(3,670 Views)

Dear Smercurio_fu,

HAHA!Sorry!Yes, my meaning of pervous mesage was "divide", I typed wrong.

I got your meaning and the relationship between string and no. of loop.

Let's use a actual value with this example.

No. of point = 1758
String length of "db point with hexdemical" = 7042 (BOTH Result by measurement)
In the string length, the first 10 characters are not use, therefore, i use
"start measurement point" (0) x 4 +5 = 9 to make a offset to shift.

by Calculation, the reminder length of string is equal to 7042-10 = 7032
7032/4 = 1758 which show that the string can be divided by 4.

Kim

0 Kudos
Message 5 of 8
(3,664 Views)
With the math that I learned in school, 0 x 4 + 5 = 5, not 9. Multiplication happens before addition.

If you know the first 10 characters are of no use, why are you performing any sort of calculation?
0 Kudos
Message 6 of 8
(3,647 Views)
O.. I typed wrong again.
The start measurment point is equal to 1 which i set.

KIM
0 Kudos
Message 7 of 8
(3,623 Views)
OK.

Still, like I said, the most likely reason why you're getting the error is simply because you're reading past the end of the string. As I indicated, you did not post an example with the actual string you're trying to parse, so I cannot confirm this. My suggestion is to run the VI with highlighting turned on, and see for yourself.
0 Kudos
Message 8 of 8
(3,599 Views)