LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does the default in scan from string work?

If the input to a scan from string is an empty string, and I have the default wired, shouldn't I get the default as an output (without an error)? see attached
0 Kudos
Message 1 of 8
(2,790 Views)
Sorry, I enclosed the wrong vi.
0 Kudos
Message 2 of 8
(2,780 Views)
I ran your VI and the output of the Scan From String is your default value when the input string is empty. What do you see when you probe the output? If you get an erro, what is the error number?
0 Kudos
Message 3 of 8
(2,763 Views)
As shown by your vi, you effectivelly get the default value. However, an error is generated at the same times so you can decide about what to de next. You could wire an error indicator to the error output of the Scan from String terminal.

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 4 of 8
(2,758 Views)


@Dennis Knutson wrote:
I ran your VI and the output of the Scan From String is your default value when the input string is empty. What do you see when you probe the output? If you get an erro, what is the error number?




It's "Error 85 occured at Scan From String (arg1) in trial%20stat[3].vi" "Possible Reason(s): LabVIEW: Scan failed." If I hit Continue on the error dialog, it then gives me the proper default, but why should there be an error in the first place?

Doug
0 Kudos
Message 5 of 8
(2,750 Views)


@chilly charly wrote:
As shown by your vi, you effectivelly get the default value. However, an error is generated at the same times so you can decide about what to de next. You could wire an error indicator to the error output of the Scan from String terminal.

CC




But why is there an error in the first place? What's the default for?

Doug
0 Kudos
Message 6 of 8
(2,750 Views)
It's a legitimate error because the scan did fail. The fact that you have a default value doesn't change that. The reason you get the error message is because you have the automatic error dialog turned on. If you were to rewrite your program to connect error in/error out connections, then the proper way to handle the error would be to set a trap for that specific error code and reset the error if found. To turn off the automatic error dialogs, Go to Tools>Options>Block Diagram and uncheck Enable automatic error handling dialogs.
0 Kudos
Message 7 of 8
(2,745 Views)


@Dennis Knutson wrote:
It's a legitimate error because the scan did fail. The fact that you have a default value doesn't change that. The reason you get the error message is because you have the automatic error dialog turned on. If you were to rewrite your program to connect error in/error out connections, then the proper way to handle the error would be to set a trap for that specific error code and reset the error if found. To turn off the automatic error dialogs, Go to Tools>Options>Block Diagram and uncheck Enable automatic error handling dialogs.




Cool, thanks! I guess there are cases where you would want to trap that situation.

Doug
0 Kudos
Message 8 of 8
(2,741 Views)