LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I write to the parallel port using LabVIEW 6.0.2

I have tried updating the labview.ini file and also using the parallel.llb available on the site. When I execute the program it gives me error 37 saying,"device not found". I am running this code on windows 98. I tried to use VISA write,serial port write (using port 10) but nothing seems to work. I also tried to develop a sample code using inPort and outPort, but no success, it is not able to read the data back from the parallel port, even if it seems (????i don't know any way to cross-check it though????) to write.
Does anybody know the problem here?
THanks.
Pari.
0 Kudos
Message 1 of 12
(4,361 Views)
It's been a while since I've played with them, but I remember the parallel port (reading from it in particular) to be somewhat tricky. I think that some of my problems were which type of parallel port it was setup for. There are a few web sites out there with alot more info and examples than I care to remember.

Try:
http://www.advmeas.com/goodies/parallelport.html
and
http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/0989d3d9dafae64e8625680400679736?OpenDocument
for starters

I hope this helps you out, if you need more specific info let us know and I will try and rack my brain to remember.

Brian
Message 2 of 12
(4,361 Views)
Thanks Brian,
I had gone thru the documents that you have suggested and did implement what they suggest. But no success! AS I have mentioned in the reply to Dan, I am trying to talk to a power supply (SORENSEN DCS 40 25), and any of the ways (Serial Write/VISA write) does not seem to affect the output at the parallel port. The parallel port is set up at LPT1 and as I observed, it does not respond to any changes in the input. Please see if this information helps you in suggesting me something else.
Thanks again.
Pari.
0 Kudos
Message 5 of 12
(4,361 Views)
The power supply has a parallel port interface? Is it supposed to be bi-directional? If its supposed to be bi-directional then the only way that you are going to read back from it is to use the in/out port vis. I think I had the best luck setting the port to ECP mode. I also seem to remember the port was reconfigured if VISA tried to access it. If you are just trying to write out of the port then I don't see why Dan's method wouldn't work. You should be able to see that parallel port pins changing state with a volt meter. Also make sure that there is nothing else that is trying to use the parallel port, like a printer driver.

I hope this helps, keep us updated on your progress.

Brian
0 Kudos
Message 7 of 12
(4,361 Views)
Thanks Brian.
Well here is the next problem. I got a VI (attatched) off ni.com and it works fine on a windows98 platform. But quits working on NT.
I can write perfectly (which i checked by hooking an LED display unit at the other end of the parallel port cable). I observed that the LEDs respond to the toggling of individual bits (data bits). But the error occures at the "out port.vi", when I try to run it on a NT machine (where I actually wanna use it). Are you aware of any changes to be made in order to run a VI on NT that works on 98?
Thanks again.
Pari.
0 Kudos
Message 9 of 12
(4,361 Views)
The in/out port vis that ship with LabVIEW are incompatable with NT. The is a fix that you have to download from NI's site. I'm not sure on the details because I use 98. Do a search on NI's site and you should be able to find something.

Brian
0 Kudos
Message 10 of 12
(4,361 Views)
Brian,
Fianally I got it done, thought this information might be interesting to you. I got a VI off ni.com (Parallel_NT.llb, attatched is the zip file for that), which does talk to the parallel port on NT. The only requirement being that you have to install accessHW.exe on the NT machine and it takes care of it. I am now able to talk to the power supply by setting individual bits at the parallel port.
Thanks for your concern and help.
-Pari.
0 Kudos
Message 11 of 12
(4,024 Views)
Good, I'm glad you got it to work...

Brian
0 Kudos
Message 12 of 12
(4,024 Views)
Pari:

With NI-VISA you can open ASRL10::INSTR to communicate with LPT1. The only functionality I can truly say we verify is writing data. We test it with a printer.

You do not say what kind of device you are writing to. If it is not a printer, you need to make sure certain pins are wired a certain way. Specifically, assuming you are using a standard DB25 connector, you need to make sure pins 11, 12, 13, and 15 are not left unconnected. Pins 11 and 12 should be held low (wired to GND). Pins 13 and 15 should be held high (asserted). If you are using a Centronix 36-pin connector, pins 11 and 12 should be low and pins 13 and 32 should be high.

Good luck.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 3 of 12
(4,361 Views)
Dan,
I tried making the connections that you suggested, but it did not help. I have tried building my own VIs using, 1. Serial Write 2. VISA Write. I have also tried using the parallel.llb VI that writes to the parallel port. Nothing seems to work. I am just wondering if I need to make some more hardware changed to the PC or the interface connector (DB-25). Actually I am trying to talk to a power supply (SORENSEN DCS 40 25) thru the parallel port of the PC. When I use any of the VIs mentioned above, and check the parallel port connector response, I observed that It does not at all respond to the changes in the input (data to be written). Please see if this information helps you to suggest me something else.
Thanks.
Pari.
0 Kudos
Message 4 of 12
(4,361 Views)