03-17-2009 02:53 PM
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
03-17-2009 06:45 PM
03-18-2009 01:57 PM
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?
03-18-2009 02:48 PM
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.
03-19-2009 04:01 AM
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
03-20-2009 06:59 AM
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
03-20-2009 07:58 AM
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