I'm writing a program in LabWindows 5.5.1 and I've been having problems with the COM Ports. I have COM Port 1 setup to read data at 1200 baud anytime there is data in the input Q using a callback. At the momement this callback is being run in the same thread as the GUI, I will change it to run in it's own thread very soon. I'm using COM Port 2 to send GPS Data at 38.4 kBaud using an AsyncTimer at a rate of 10Hz. I have the ability to turn ON/OFF the GPS but COM 1 is always waiting for data using the callbacks.
The GPS data is transmitted to a device that reads the GPS data and sends out a status message that I read on COM 1. If the device is receiving GPS data it transmits a status message that's 35 bytes long at the rate the GPS data is received,
10 Hz. This cannot be changed. If the device is NOT receiving a GPS message it sends out a status message that's 232 bytes long at a rate of 2 seconds.
This setup work fine when I'm NOT sending GPS data and the longer status message is being transmitted. Once I turn on the GPS messages, I cannot read anything from COM 1 but COM 2 continutes to transmits. I have confirmed this using debugging statements in the COM 1 Callback when it reads the buffer. InQLen() returns a number > 0 but when I try to read out the data in the buffer using ComRd(1,Buffer,InQLen), I get an empty buffer.
This leads to me to believe that COM 2 is somehow blocking the reading of COM 1 since they are occuring at the same rate. Am I correct? If so how can I resolve this problem? I need to be able to read both COM Ports at the same time in order for my program to work correctly. If you'd like any more details about what I'm doing to help you answer my problem just ask.
Thanks in advance.
Stev
e