LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I open Lpt1 in XP using LabWindows CVI? It will function using Windows 95.

We are just trying to open the port with the following code fopen ("lpt1","w") This worked under 95 and LabWindows/CVI 5 but when the new machine running XP was introduced, we can get the port to open. It returns an a Null.
0 Kudos
Message 1 of 3
(3,276 Views)
Juan Carlos of NI recommends using inp() and outp() rather than fopen() to access the parallel port. See his comments here.
0 Kudos
Message 2 of 3
(3,276 Views)
Ports in NT/2000/XP have to be opened using a 'proper' device name e.g.

\\.\LPT1 or \\.\COM1

(these work in 95/98/Me also)

Of course, as a C string you have to double the backslashes, so you get source code like

"\\\\.\\LPT1"

--
Martin.
--
Martin
Certified CVI Developer
0 Kudos
Message 3 of 3
(3,276 Views)