10-29-2007 12:43 PM
10-30-2007 01:03 PM
10-30-2007 01:42 PM
Ted,
Thank you for your suggestion about NI-Spy. I will definitely try that. I am only opening one VISA session for each port. The session identifiers are globals to the entire program. In addition, they are not protected by mutexes as one thread initialize them and no other threads modify them. I only have one time critical thread.
The task of most of the serial IO threads is to simply wait for data to come in on their respective port, parse the data and puts the result into a thread safe variable. These thread safe variables are essentially the states of the system. The time critical thread reads and operates on these states, and then sends commands to some of the ports.
What I'm seeing is, randomly (usually within an hour or so), the time critical thread would stop on a viWrite(). All other threads continue running.
--NDo
10-31-2007 10:24 AM
Hi NDo,
What devices are you communicating with over RS-422, specifically what is the thread in question communicating with? It does sound like it may be a device issue. The device you are communicating with probably isn't responding to the command, and is causing the thread to stop. Do you have timeouts declared in your code? Timeouts would allow the thread to continue after the device becomes non-responsive and would also return a timeout error to notify you that the device did not respond.
Ted
11-06-2007 08:20 PM
Hi NDo,
What devices are you communicating with over RS-422, specifically what is the thread in question communicating with? It does sound like it may be a device issue. The device you are communicating with probably isn't responding to the command, and is causing the thread to stop. Do you have timeouts declared in your code? Timeouts would allow the thread to continue after the device becomes non-responsive and would also return a timeout error to notify you that the device did not respond.
================================
Hi Ted,
The thread is communicating with custom hardware via the RS-422 port. I initialized the port using VISA drivers and set the timeout to 1 second, however, viWrite does not return. No hardware/software flow control and no handshaking are used. The RS-422 card we are using is from NI so I'm sure it's compatible with the VISA drivers. The computer that we're communicating with is unaffected when this error occurs. Any insight is appreciated.
Regards,
NDo
11-06-2007 08:22 PM
11-12-2007 11:40 AM