LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

USING INTERRRUPTS

Hi,
    I m currently working on a program to acquire data from a headtracker(ascension technologies) via rs-232. However i m having errors in compiling the program on labwindows. I have used the source code provided by ascension technologies in C in the program. This source sode runs well with borland cThe source code has functions like serial isr, read data from the device.
My questions are
- Can i use interrupts(IRQ4,IRQ3)that we use in c in labwindows? Do they need to be modified in labwindows?
- Some of the interrupt structure in the C code provided by ascension technologies is linked to file dos.h which i think is not recognised by win 2K
-I m having errors in compiling on statements like
 
 setvect(COM1INTERRUPT-comport,serialisr);    Error :missing prototype
void interrupt far serialisr(void);                             Error: missing prototype
void interrupt far (*oldserialintvect)(void); /* old serial interrupt vector */ 
0 Kudos
Message 1 of 2
(2,912 Views)

Your legacy code has its own interrupt service routine and interacts with the com port at a very low level.

WIn2K, NT, and XP all use a "Hardware Abstraction Layer" that purposely prevents interacting with the hardware at that level.

There are third party products that attempt to emulate the DOS / Win9X environment for interrupt driven legacy code, but we've had bad luck with them.  They seem to have a hard time emulating the IRQ functionality.  They kindof work, but interrupt response is very slow.

You could re-write to use the native Win32 serial drivers (and use the CVI serial library which runs on top of the native serial driver).  The equivalent of interrupt response to a serial port using the NI rs-232 library is to install a com port callback, which will "interrupt" with a callback on specified serial port input conditions (e.g. a character in the in queue).  With a modern PC it's likely you can match the interrupt driven performance of your legacy system unless maybe you're using a custom bit rate that's very high.

Some of the NI serial cards (843X) use the new NI serial driver, which I believe is a kernel mode (i.e. low level, below the HAL) driver that supports hyperthreading and multi-processing.  We've had serial ports that simply won't work if hyper-threading or multi-processing is enabled. 

 

Hayes

0 Kudos
Message 2 of 2
(2,893 Views)