Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Direct I/O reads/writes using inp()/outp() in Windows XP with CVI v5.5?

Hello,
 
I have a simple question.
 
Can you do direct I/O address reads and writes using inp() and outp() calls in C
when using CVI v5.5 in Windows XP?
 
We are using an ISA card and it is mapped to a number of I/O addresses.  Currently,
we have no Windows XP driver for the card.  It is a synchro card that utilizes digital I/O
for control and readback.
 
For experimentation I have tried reads/writes on another ISA PIO card we have but have
not been able to get it read switch transitions.  It has a Windows XP driver and I am able
to get switch transitions read when going through its Windows driver but cannot get it to
read directly using inp() and outp().  I was simply trying to prove if inp and outp would work
with it.  It is more of a "known quantity" to prove if direct I/O works or not, but there are
probably unknowns with it, too.
 
Best Regards,
 
Jim Zinn
 
 
 
 
0 Kudos
Message 1 of 5
(6,748 Views)

Hi Jim,

Could you please provide some additional information on the ISA card and drivers that you are currently using? If this is not National Instruments hardware, then I recommend contacting the manufacturer of that board.

Regards,

Hal L.

0 Kudos
Message 2 of 5
(6,738 Views)

Thanks for your reply...

I have a basic ISA I/O card (a 6 channel synchro) with mapped addresses for 8 consecutive

basic I/O addresses (currently 300h - 308h).  The card is unsupported as it is old product but works

fine with  Windows 98 and LabView on another old PC that I took it out of, in which direct I/O reads

and writes work fine.  It has no drivers at all, just simple read/write byte-boundary I/O.

 

So my real question is, should anyone know, can you read and write directly to/from I/O

addresses in Windows XP using CVI/LabWindows v5.5 using inp() and outp() or with the optional

accessHW module (AccessHW.lib, accessHW.h, accessHW.dll) downloaded from the NI site

that provides another linked .lib module with its my_inp() and my_outp() calls in C?

 

0 Kudos
Message 3 of 5
(6,722 Views)

I forgot to mention that I am already using the low-level h/w access driver with CVI/LabWindows v5.5,

as I do make a call (as per manuals/help) to CVILowLevelSupportDriverLoaded() and it returns

TRUE, as would be expected, before attempting calls to inp(), outp(), my_inp() and my_outp()

(from the AccessHW module).

 

0 Kudos
Message 4 of 5
(6,717 Views)

Hello JimmyZ,

You can write to I/O and memory space in CVI.  In particular, to communicate in I/O space, use the inp and outp functions as you are currently doing.  In order to read and write to physical memory, use the ReadFromPhysicalMemory and WhiteToPhysicalMemory functions. Every time you use these functions, you map and unmap physical memory. To reduce this overhead, you can use the Map/UnMapPhysicalMemory functions to obtain pointers to portions of memory. This pointer can be treated like any other C pointer.

The low level driver that is loaded when using the inp/outp functions is a generic driver which works with the operating systems that your version of CVI supports.  So the driver that is installed with CVI 5.5, is only proven to support Windows 9x/ME/NT/2000.  I would recommend upgrading your system to CVI 7.1, which is supported on the WIndows XP operating system.  Also, if you have Visual Studio installed on your Windows XP system, you can try using the inp/outp functions in the Visual C runtime engine.

Thanks.

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 5 of 5
(6,696 Views)