02-17-2014 09:56 AM
Hello,
I am running a VI and intermittenly the execution of the VI is being suspended. I cant even stop the application using the abort button. I operated the NI I/O trace program and setup the scan options to provide a dialog box when there was an error with the VISA API functions. When a VISA error occurred, the program VI execution suspended and the program "froze" up. I have attached a copy of the NI I/O Trace when the program freeze occurred. The error that occurred was the following:
> 1000. viWaitOnEvent (COM27 (0x0D7FCDD8), IO_COMPLETION, 0, 0, 0x00000000)
> Process ID: 0x000001F8 Thread ID: 0x0000166C
> Start Time: 09:34:08.690 Call Duration 00:00:00.000
> Status: 0xBFFF0015 (VI_ERROR_TMO)
I have a VISA device connected to this COM port. Seems like the Visa VI is timing out. Is there a way i can circumvent the application freezup if an error occurs.
Can i please have some advice on how to fix this error with the timeout?
thanks in advance.
02-17-2014 10:27 AM
Can you post your code or at least a screenshot of how you're doing your VISA calls?
I think that would help more than the IO Trace report.
02-17-2014 10:36 AM
Hello, thanks for your prompt feedback. i appreciate it. the screen shot where i do the VISA call is attached.
02-17-2014 10:59 AM
Your setup looks ok. What about your VISA Read and VISA Write Calls?
02-17-2014 11:49 AM
Thanks so much for your prompt feedback. attafhed is the visa read and write calls that i am using.
02-17-2014 01:12 PM
OK. So it looks like there could be a failure on your VISA Write.
How are you doing your error handling? Right now you're packing it into a shift register. It's not clear where this error is getting handled. If it is not handled properly, it may lead to unresponsive behavior.
Are you running in the development environment? Have you been able to trace back into the block diagram to see where you are getting stuck?
Also, it's not clear from the IO trace but it looks like you're swapping COM ports. Are you doing this in your program?
02-17-2014 01:52 PM
hello, thanks again for your prompt feedback. We are not swapping com ports in the application. As for error handling and updating the write function what would you suggest i do to modify the software code ?
02-17-2014 01:53 PM
in addition, we are using the labview debug environment.
02-17-2014 02:08 PM
OK. If you're running in the development environment, you should be able to switch to the block diagram when the program hangs and do a highlight execution to see where the program is going.
I expect that the error is causing it to bounce between states and create the appearance of a hang.
You may also want to put in a specific error handler for the case when the VISA Write times out. I have no idea why the VISA Write would be failing. The failure should be handled more gracefully by your error handler though.
Did you write this code? The string-based state machine looks fairly sophisticated so I would be surprised if it didn't already have a built-in error handler.
02-17-2014 02:46 PM
@MaizeBlue wrote:
hello, thanks again for your prompt feedback. We are not swapping com ports in the application. As for error handling and updating the write function what would you suggest i do to modify the software code ?
If you're not, then why does your NI trace show come 11, 27 and 29 all being used?