From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan From String, Scan Failed, Parsing Time Value

Hello,

 

I'm using LabVIEW 6.1 to convert the time value as returned from "Seconds To Date/Time" into a string using the Scan From String function. This code has been working without issue for months. Last night, however, the function failed and returned the error below:

 

Error.png

 

When I look at the calling VI I don't directly see what the issue might be:

 

Vi.png

 

Please let me know if you have any insight.

0 Kudos
Message 1 of 4
(2,803 Views)

Do you know what the COM Time String was that made it fail..? That's where your issue originated.

 

On a side note, is this the only way to build a timestamp in LabVIEW 6.1?

Can you scan directly to a timestamp like this? 

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 4
(2,793 Views)

This is code that was generated from a contractor. I'm sure that there are other means of getting a timestamp string... But I haven't explored other methodologies. The COM string, is going to be a COM exposed DateTime value as returned by our C# database library. I can't directly debug the code because it isn't deployed in such a way that would make a unit test trivial to perform. However, from what I can tell, the DateTime value is not defined when entering the aforementioned vi and hence, the default values shall be used. If this is not the case, then the COM string must be the result of getting the "default" value for the record from the MSSQL database for the record (which is linked to the GetDate() function in the MSSQL database).

 

Ultimately, I believe the problem is occurring because of some problem in formatting the default data into a string from the LabVIEW time function. I just don't understand why it would fail all of a sudden.

0 Kudos
Message 3 of 4
(2,777 Views)

Your code will output the default value when the scan fails like above, but it will also throw that error. The code has just never thrown the error before because it's never received an invalid input string.

 

To handle this properly if you don't care about the error, clear the error if it's error 85. This means it will always just use the default value and not tell you when there was a scan failure.

Failed Scan Input.pngYou'll have to create your own error handling Select in LV 6.1.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 4
(2,769 Views)