LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-VISA 2.6.1f2 won't release parallel port

I'm using NI-VISA 2.6.1f2 in Labwindows/CVI 7.0 to dump data out the parallel port to custom hardware. VISA allows me to dump data FAST, by avoiding the kernel-switching involved when using inp and outp.

The problem is, when I exit my application, nothing else can access the parallel port. The only way to get it back for use by other non-VISA applications is to reboot the computer.

My question is this: How can I release the parallel port (or reconfigure, which is my suspicion) so that other applications can use it after I exit my application?

Here's a code snippet:

status = viOpenDefaultRM(&DRM);
status = viOpen(DRM, "PXI::MEMACC", 0, 0, &InHan);
status = viSetAttribute(InHan,
VI_ATTR_DEST_
INCREMENT, 0);
Port = 0x378; // Parallel port "data" port
NBytes = Many;
viMoveOut8(InHan, 8, Port, NBytes, Data);
viClose(InHan);
viClose(DRM);
exit(0);
0 Kudos
Message 1 of 6
(3,012 Views)
Hi,

I have never seen this issue before when usignt he paralel port, what happens if you run your application again? does the VISA handle changes?

Another option here would be to use a port monitor software to check what changes in the parallel port after running the CVI applications.

I hope this helps, please keep me posted.

Regads,

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

My CVI/VISA application runs over and over with no problems. Run the application, exit, run it again, no problem. Run the "other" application after a reboot, then close it and run my CVI/VISA application, no problem. The application that's having problems is actually an Altera software development tool that looks for a licensing dongel hanging off the parallel port. Altera won't recognize the dongel after my software has run, at least not until the computer is rebooted.

My touchy-feely gut feeling on this is that something I'm doing with VISA is reconfiguring the parallel port, and it stays in that new configuration until a reboot, when it goes back to system default. I may be all wrong, but that's what it seems like.

Excellent idea on the
port monitor. Can you suggest a monitor out there in netland that I can download?

Thanks!
-Michelle
0 Kudos
Message 3 of 6
(3,012 Views)
Michelle,

I think you are right when you say that some configuration is being changed by the VISA application. There are a couple of applications that you can try:

+PortMon (not sure where to download it)
+http://neil.fraser.name/software/lpt/

Please keep me posted on your findings.

Regards,
Juan Carlos
0 Kudos
Message 4 of 6
(3,012 Views)
JuanCarlos schrieb:
> Michelle,
>
> I think you are right when you say that some configuration is being
> changed by the VISA application. There are a couple of applications
> that you can try:
>
> +PortMon (not sure where to download it)
> +http://neil.fraser.name/software/lpt/
>
> Please keep me posted on your findings.
>
> Regards,
> Juan Carlos

For PortMon have a look at http://www.sysinternals.com/

I use it from time to time and it is free+good

Stephan
0 Kudos
Message 5 of 6
(3,012 Views)
Thanks to all for your suggestions. I will give PortMon a try and post the results.

Unfortunately I am in a trainng class, and won't have a chance to try until Thursday.
0 Kudos
Message 6 of 6
(3,012 Views)