04-08-2006 02:49 PM
04-09-2006 11:27 AM
I'm not familiar with interrupt programming on x86 machines, but I looked at the code you attached and I seemed to catch a sort of polling mechanism between the tracker and the computer: the computer sends a command to the tracker ('Y' ??) and waits for the instrument to respond. This mechanism is then encapsulate in a interrupt-driven method.
If this is true, you surely can initially use serial.prj to test if the communication can be established and flows regularly between the PC and the instrument. After this has been done, you could see if some of the native CVI instructions in RS232 library can help you to optimize the protocol. In case the answer from the instrument have some regular element (something like a message terminator or a fixed lenght) you could try exploring the possibility of integrating a ComCallback into your code.
Have you searched Ascension Technologies site for an example on integrating their instrumentation into Win32 environments?
04-10-2006 08:14 AM
Roberto is correct, you might want to look for something a little more windows oriented. The code you have is for DOS system which allows direct access to the low level hardware I/O. On windows systems, a serial port driver already exists, you access the serail port through that driver. You do not install interrupt handlers directly from the software. That said, the CVI RS232 library and windows serial driver has already done all the ISR hooking for you so you dont need to deal with that from your program.
You could probably port this code into CVI without too much trouble. You don't need any of the install/deinstall interrupt handler stuff. You would simple open and close the serial port using the CVI OpenCom() and CloseCom() routines in the RS232 library. Elsewhere in the code you would replace the read and write sections with the equivalent CVI routines. The code to access the device will be significantly smaller under CVI than in the file you posted.
If mS timing is not an issue the port should be relatively trouble free, if you have any specific questions, post them here.
Good Luck!