LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Parallel Port with Outport.vi Problem

Hello,

I am trying to use my parallel port to control a relay network and have run into a problem. I am using the outport instead of visa because for some reason I get an error with visa and outport seems more simple. The problem I am having is that my program doesn't seem to be able to initially take control of the port. What I mean by this is that if I restart the computer and open/run my program, I get an incorrect output on the parallel port. However, if I run one of the example programs for controlling the paralle port using outport (attached) (I believe the one I use is called Reading and writing to parallel port using loops) I am able to control the output to the parallel port. Also, after the example has run, my program works correctly. However, if I restart my computer again and run my program first it can no longer control the port correctly. So the problem seems to be that my program isn't initializing the port correctly or assessing it right at the beginning of the program. However, looking at the example program I don't really see what they are doing that I am not. I have the correct port address. 

 

My program takes values from a text file and displays them on the port and that works correctly. 

Download All
0 Kudos
Message 1 of 5
(3,289 Views)

Well the xampe specificaly states "NOTE:  In Port.vi and Out Port.vi, which this example uses, are not supported on Windows Vista and later."  What OS are you on?


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(3,279 Views)

Im on XP 32 bit

0 Kudos
Message 3 of 5
(3,265 Views)

Hi Jag213, I'm glad you were able to resolve the issues you discussed on the other forum related to this issue.

 

Now that you have it working, I would recommend a few things:

1. Just try modifying one of the existing examples and see what you can get away with removing in order to keep it working the first time.

2. Try modifying the timing on your example - 10 seconds is a long time to wait between each week, I wonder if you are getting a time out? Do the examples work when you insert that kind of timing delay?

3. Add the In Port.vi into your code - this may be related to getting your Out Port.vi to work correctly.

4. Your code controls 8-bits on the parallel port, while the examples control 32-bits. Do all 32 bits need to be initalized? Looking at the Parellel Port Read and Write Loop.vi Example, in the IO Connector Status, the 31st bit controls whether the target is initialized.

 

Play with these settings and see if you can get yours to work the first. If all else fails, build your program to run off of one of the examples. For example, have the while loop run once, and then call yours as a SubVI.

 

Good luck!

Joey S.
Senior Product Manager, Software
National Instruments
Message 4 of 5
(3,216 Views)

Hello Joey,

I was just about to post my solution and saw your reply. It seems like part of the problem was the 8 bits instead of 32 bits for the initial calling of the port. This explains why running the example program once (which used a 32 bit outport.vi) made my program (8 bit outport) work until the computer was restarted. Also I nested a while loop in my for to loop continually poll the outport as was done in the example. I don't know if this does anything different than having the outport just in the for loop since the port is supposed to retain whatever value assigned to until it gets a new value. Whatever the case, the program appears to be working and passed the dreaded restart computer test. Thanks, for all your help.

0 Kudos
Message 5 of 5
(3,210 Views)