Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit switch via parallel port

Hi Guys,

I'm trying to control 2 limit switches  via parallel port. I dont have any experience before to configure the parallel port. Can anyone help me with this please?

I'm sending 5V signal through pin 14 to the both limit switches, use pin 25 as ground pin and using pin 12, 13(status pin) to receive signal from the limit switches.

I just want design a small VI which can able to check that limited switches are on/off. I could send or receive the boolean value through the parralel port.

I attached the VI that I have designed. Could anyone can correct this please?

 

Mayuren

0 Kudos
Message 1 of 7
(4,392 Views)
I don't know about 8.0, but in current versions, there are two parallel port examples. Look for Parallel Port Read and Write Loop.
0 Kudos
Message 2 of 7
(4,380 Views)

Thanks for your reply.

I have had a look at the examples in labview which is really helpful.

How can I choose a pin  separately in parallel port to send/receive signal? what does it mean by changing the address? Can I choose the pin through changing the address of the parallel port? 

0 Kudos
Message 3 of 7
(4,361 Views)

I don't believe it's possible to select an individual pin. Does it matter? You are only sending to bit 1 of the control register and you can mask the results for the Inport function to ignore everything except the two bits of the status register.

 

The address refers to the base address of the entire port. If you had a second parallel port, you would have a different base address for that.

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

Hi

 

Wht i understood is you want to  change one bit in the data register of parallel port without effecting the other bits of data register

 

Ex: Data register has "h50"

now you want to make it "h51" ie change of D0 bit with out effecting the other bits

 

am i correct?

 

if this is your requirement 

you can do it 

use some variable to store data in data register, use bit operations to change the data register and send new value again to parallel port

 

Regards

Pradeep 

0 Kudos
Message 5 of 7
(4,342 Views)

yes, you are correct. thanks for the reply.

Can anyone tell me, how can I send 5V through pin 14(control pin)? I mean, just want to send maxmium voltage from the PC to the 4 limited switches on the scanner and receive back the read signal through the pin 2,3,4,5. I use pin 25 as the ground.

How I can design the VI to send the 5V?

 

Regards

Mayuren

0 Kudos
Message 6 of 7
(4,321 Views)

Hi Mayuren,

 

What i understood is you wanted to send logic "1" on D1 bit of parallel port's control register

 

address of data register in parallel port will be either "0x378" or  "0x278"

 

similarly address of satus register is either "0x379" or "0x279" (ie address of data register +1)

and address of control register is either "0x37a" or "0x27a" (ie address of data register +2)

 

so if you want to set D1 of control register write "0x02" into "0x37a" address 

 

you can refer to http://logix4u.net/Legacy_Ports/Parallel_Port/A_tutorial_on_Parallel_port_Interfacing.html

 

Regards

Pradeep

 

I think it helps

 

 

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