10-20-2015 11:57 AM
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:
When I look at the calling VI I don't directly see what the issue might be:
Please let me know if you have any insight.
10-20-2015 12:02 PM
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> ---'
10-20-2015 12:50 PM
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.
10-20-2015 12:55 PM - edited 10-20-2015 12:59 PM
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.
You'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> ---'