LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I programatically get the Base I/O address of a PCI-485/2 card?

How do I programatically get the Base I/O address of a PCI-485/2 card? I am programming in C under Windows NT. The program will be ran under 95 and NT. The driver I am using is NI-Serial Version 1.45.
0 Kudos
Message 1 of 4
(3,525 Views)
Hello Matt,
The NI-Serial driver integrates with the built-in Windows serial IO subsystem. This is what allows you to use the ports on your NI serial card with any Windows compliant serial application. It does not provide additional functions for detecting hardware parameters of your board. The next question is why do you need to know the base address? The CVI and Microsoft Platform SDK functions for performing serial IO only require the COM port number. Using the base address would only be necessary for doing direct port IO which is not recommended on Windows NT/2000/XP. If you give us more details on what you are trying to accomplish, we should be able to provide you with better alternatives.

Jeremiah Cox
Applications Engineer
National Instruments
http://
www.ni.com/ask
0 Kudos
Message 2 of 4
(3,525 Views)
Jeremiah,
I am using the base address to change the parity setting of the comport using the "outp" function, which requires the base I/O address. When I send the address byte of the device, it requires the parity bit be set. The other data bytes require that the parity bit not be set. Is there a way to get around having the base I/O address?
0 Kudos
Message 3 of 4
(3,525 Views)
Hello Matt,
I have not encountered a device that required enabling/disabling of the parity bit (reconfiguring the serial chip) on the fly during communications. Using port IO to accomplish this task is simple (if you know the port) and fast, but not recommended on newer OS's. Instead it is preferred to use an OS call to reconfigure the port for you (avoiding blue screens and the like). If you are using CVI, see the example located at \samples\rs232\serial.prj and look at the callback for the Close button on the Configure window. Otherwise, I would recommend looking at MSDN (http://www.msdn.microsoft.com/) for information on the use of Platform SDK functions for controlling the serial port under Windows.

Jeremiah Cox
Application
s Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 4 of 4
(3,525 Views)