![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2005
Posts: 7
Rep Power: 0
![]() |
[solved] Controlling the parallel port
is there any way to control the parallel port in VB6. I need to individualy change what each pin does (on, off or earth).
Last edited by bigbondfan; Jun 1st, 2005 at 7:56 AM. Reason: solved |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
http://computer.howstuffworks.com/parallel-port2.htm that will help in figuring out what it does, and i doubt you could have that much control over the port using VB6 you will have to go down to assembly i think.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#3 |
|
Expert Programmer
|
You can communicate with any device as in any other language:
Open "COM1" For Output As #1 Print #1, "AT" 'Sends the Attention directive Close #1 Open "LPT1" For Output As #1 Print #1, Chr(65) 'Sends the letter A Close #1 However, parallel ports only have a shared earth "pin" (the metal cladding): the rest can only be "on" or "off": if you're seeking to connect to an external circuit, you should buy a purpose built device as used in schools: directly connecting the motherboard to a 9v battery would destroy it. If you are using a serial device such as a modem or the serial port, VB wraps this functionality in the MSCOMM object: ' Use COM1 MSComm1.CommPort = 1 ' 2400 baud, no parity, 8 data bits, 1 stop bit MSComm1.Settings = "19200,N,8,1" MSComm1.DTREnable = False MSComm1.PortOpen = True Last edited by Rory; Jun 1st, 2005 at 2:09 AM. |
|
|
|
|
|
#4 |
|
Newbie
Join Date: May 2005
Posts: 7
Rep Power: 0
![]() |
Thanks, I will continue to experiment with VB. I do have the whole of Visual Studio, I've just never programmed in any other language before.
Last edited by bigbondfan; Jun 1st, 2005 at 8:50 AM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|