04-06-2011 03:59 AM - edited 04-06-2011 04:00 AM
Hi Kok,
do you read what I write?
In message #5 I wrote:
"Your error description seems to come from a ScanFromString function. Are you sure it's generated in this very subVI? Are you really sure about this?"
Have you double cross-checked that?
04-06-2011 04:22 AM
Hi,
Actually the indicated problem is the SCANFROMSTRING function, but i dont know what is wrong with my input string that causes it to say it does not contain data in expected format.
Regards,
Kok Wan
04-06-2011 04:27 AM
04-06-2011 04:30 AM
Hi,
I did upload my program in the message. My input string is in (display mas and ana data with auto starting time on the interface.vi).
04-06-2011 04:34 AM
Hi kok,
the format string is "%d:%d:%d". What is the input string when the SFS fails? You didn't save any inputs with your VI...
I suspect you want to scan timestamps like HH:MM:SS. When the scan fails you provide something different from that format...
04-06-2011 04:37 AM
Hi,
What does "%d:%d:%d" stands for? How i go about inputting HH:MM:SS?
Regards,
Kok Wan
04-06-2011 04:40 AM
Hi kok,
"What does "%d:%d:%d" stands for?"
RTFM!
Again I have to suggest to read the context help... (Please follow the link that explains the format codes!)
"How i go about inputting HH:MM:SS?"
This subVI is expecting timestamp data formatted as HH:MM:SS. You have to load the correctly formatted data files...
04-06-2011 04:55 AM
Hi,
Sorry about that! The input string that causes the error is in between 18:30:00-18:45:00. Maybe i can attach one of my data files for you to try computing to see if you encounter the same problem as me?!
Regards, Kok Wan
04-06-2011 11:11 PM
Kok Wan,
You have to find the input that causes the error. Knowing that it is between two values doesn't do much good. There's obviously an input that's causing it to error. You just need to find which one that is. It's hard to tell how often the loop that contains all that code is in is running. There also seem to be some unecessary sequence structures in there, but that's another topic I suppose.
If you have to run your program a long time to find the error and you can't watch every iteration of the code, try logging the input data to a file then go back and look at the file with all the data in it. Or you could use the error output from the Scan From String file to trigger the true case of a case structure so it writes the value that is causing the error to an indicator or to a text file.
These are just some ideas to help debug. Others might have some suggestions that are even easier to implement.
Eric
04-06-2011 11:18 PM
You can also put a probe on an error wire, and set it to pause on error under the conditional tab.