Error 1 Occured at Scan from String (arg 1) in LabVIEW

Updated Oct 23, 2023

Reported In

Software

  • LabVIEW

Issue Details

I am working with Scan From String and try to read a time stamp but I'm getting the following error: 

Error 1 occurred at Scan From String (arg1)

Possible reason(s):

LabVIEW: An input parameter is invalid.
For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.

This error is shown in the following box.



How can I fix this error?

Solution

Since the input string is coming with a time stamp format is coming as "Year/Month/Day Hour:Minute:Second" the string format should be:

​%<%Y/%m/%d%H:%M:%S>T 

and it cannot have a colon after it because is not an accepted format but if you want to add the number after the time stamp you should include them as:

 %<%Y/%m/%d%H:%M:%S,%3d>T


Additional Information

Scan From String Function:

Scans the input string and converts the string according to format string.

Use this function when you know the exact format of the input. The input can be string, path, enumerated type, time stamp, or numeric data. Alternatively, you can use the Scan From File function to scan text from a file.