LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel Port Input, is it possibel?

Hi!

I want to output and input data by the parallel port. At this moment I can send the data by the 8pins (from pin 2 to pin 9), without any problem. But now I woul like to read data. I first tried with the "in port.vi" function but then I realize that it just read the buffer of the port. I would like to know if anyone could help me by explaining how can I input data from the parallel port.

I discovered that there are 8 pin for output and 5 for input. Imagine that I connect one of the output pins to one of the input pins, how can I access the input pin data?

I searched here on the forum, but the answers did not took me no any place. If anyone could put a simple example of how it is possible to do read the data as I wrote before (connecting a output put to a input pin (from pin 2 to 9), and read the input data (from pin 10, 11, 12, 13 or 15) would be great to understand.

With my best reagards,
Alexandre Ferreira da Silva
0 Kudos
Message 1 of 7
(8,091 Views)
Hai,
 
Yes its possible. Have a look at the attachment that does the task of reading the input pins.
 
Its also possible to use the pins 2-9 as input pins by configuring the parallel port in bidirectional mode.  This can be acheived by making bit5(C5) of the control port (Address : 37FH if its LPT1) high. When the C5 is high then the parallel port is in input mode ie you can read the values connected to the port when C5 disabled it is in output mode.
 
 
with regards,
JK
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 2 of 7
(8,082 Views)
Thank you for the reply,

I tried your solution but it seems that it is not working...

Let me explain what I have done and see the picture in the attachment...

First I output the value 1 by the parallel port (adress 378 hex)
This output, puts the pin 2 at high value...
I start to read a value of 10000000 without having nothing connect to the input pins...I think it is reading the output pins...
I connect the pin 2 to pin 10, 11, 12, 13 or 15, one of each time, and the input value does not change...

What am I doing wrong?

I also put the VI file in the attachment..

I hope you can tell me what I am doing wrong...

With my best regards,
Alexandre Ferreira da Silva

Download All
0 Kudos
Message 3 of 7
(8,076 Views)

Hai,

From the vi i infer that you read from the address 378H rather than from 379H.  the status port is at the address 379H from which the read must happen.  If you read 378H it returns the last value that you wrote to that port.

After connecting the the signal to 10..15 read from the 379H. That should solve your problem

With regards

JK

 

 

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 4 of 7
(8,056 Views)
Hi!

So i tried what you said, as you can see on the figure and on the VI, and it still do not work...

I do not know what I am doing wrong...what do you think?

With my best regards,
Alexandre Ferreira da Silva
Download All
0 Kudos
Message 5 of 7
(8,052 Views)

Hai,

The printer port works in three different modes like simple, ecp and epp.  when parallel port is configured as simple port then the operations like read write and other you are trying to do will work.  check out the bios settings of your system to find of which of the above mode the parallel port is configured for. Try changing that to simple and run the vi.

With best regards,

JK

 

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 6 of 7
(7,886 Views)

thanks for reply i understand

 

0 Kudos
Message 7 of 7
(4,163 Views)