LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting GENERAL IO FAILURE on closing LPT1?

I am opening LPT1 as a file, (no printer assigned - I am in workstation mode). I write to the port, it succeeds, but when I close it, if fails with GENERAL IO FAILURE. Have tried using fopen, fprintf, & fclose, also opened it with OpenFile, WriteFile, and CloseFile. All give the same results. The close fails and the handle is not released, the next attempt to open it results in failure.
0 Kudos
Message 1 of 2
(3,059 Views)
Hi,

I'm not sure how a moder OS would behave whe using fopen to address the parallel port; memory and port protection may not allow an ANSI C compiler to send characters to the parallel port that easily. I'm using Windows XP and gave it a try in Visual C++ and I was not able to get it to work there either.


There are some CVI specific functions that can allow you to open the parallel port: inp() and outp(. The CVI run-time engine installs a driver that allows you to access the port in any version of Windows; I suggest you move to those function the will give you better portability and your code will last longer.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 2
(3,059 Views)