06-04-2006 12:24 AM
06-04-2006 02:01 AM
06-04-2006 04:16 AM
06-04-2006 03:39 PM
Oh, I see! So you want to read the com buffer without freeing it. I am afraid you cannot fulfil such a specification with CVI native RS232 library. You should go to low-level function or windows API to see if it is possible. I have read for example in the SDK that the serial port can be read in overlapped mode, which sounds as if it can meet your needs; however, I am not familiar with it and I may be in error...
Let's see if somebody else can help you.
06-05-2006 11:16 AM
06-05-2006 11:43 AM
Hi Jacky,
Actually, if you describe why you need to do this, we may be able to suggest another method.
For instance we "tap" into the serial lines going from the UUT to the Test PC, which allows us to look at the communication transactions between the two using a third PC. I guess you could call it non-invasive monitoring or "sniffing"...
The above is just an example of doing something non-conventionally to work around a limitation...
Let us know what you are trying to achieve and why... Maybe there's another solution..
Ray
06-05-2006 01:30 PM
My two cents
You could use an eavesdrop cable to allow a PC / monitor to watch the serial traffic.
But Mert's got it - build yourself a second queue external to the driver/library that immediately reads any incoming byte from the driver, looks at it to do whatever you need, then enqueues it for the application. You can easily do this using the rs-232 library. Just schedule a com callback on receipt of any incoming byte. If you've got multiple threads reading the queue, just implement a lock (critical section, mutex, signal, semaphore, etc).
You can find c code to implement a queue without much trouble I would think rather than write it yourself.
We've used this approach with good results to catch an "abort" character off of a serial terminal so we could react to it quickly without waiting for it to eventually get dequeued by the app.
BTW as I understand it the newer NI serial cards (843x) don't use the native win32 driver, they come with their own kernel mode serial driver.
Menchar
06-05-2006 05:19 PM
06-05-2006 06:03 PM