send command to printer port 
Author Message
 send command to printer port

Hello,

At home I have a self-made relais-card (switches controlled (on or off) by
the computer).
In qbasic you can set a switch (1 of the 8 switches that are available) by
making a program that looks like this:

LPRINT CHR$(1);          (turn switch 1 in the other position)
LPRINT CHR$(2);          (turn switch 2 in the other position)
LPRINT CHR$(4);          (turn switch 3 in the other position)
LPRINT CHR$(8);          (turn switch 4 in the other position)
LPRINT CHR$(16);        (turn switch 5 in the other position)
LPRINT CHR$(32);        (turn switch 6 in the other position)
LPRINT CHR$(64);        (turn switch 7 in the other position)
LPRINT CHR$(128);      (turn switch 8 in the other position)

How can I do this in Visual Basic 5.0???

Help realy needed!!!!!

Eric



Wed, 18 Jun 1902 08:00:00 GMT  
 send command to printer port
Try if Open "LPT1" for output as #1 works for you. Or search for the WIN95IO
program to control the hardware directly (try www.softcircuits.com or
www.planetsourcecode.com/vb)

John


Quote:
>Hello,

>At home I have a self-made relais-card (switches controlled (on or off) by
>the computer).
>In qbasic you can set a switch (1 of the 8 switches that are available) by
>making a program that looks like this:
>LPRINT CHR$(1);          (turn switch 1 in the other position)
>LPRINT CHR$(2);          (turn switch 2 in the other position)
<SNIP>
>How can I do this in Visual Basic 5.0???
>Help realy needed!!!!!
>Eric



Wed, 18 Jun 1902 08:00:00 GMT  
 send command to printer port

Quote:

>At home I have a self-made relais-card (switches controlled (on or off) by
>the computer).
>In qbasic you can set a switch (1 of the 8 switches that are available) by
>making a program that looks like this:

>LPRINT CHR$(1);          (turn switch 1 in the other position)
>LPRINT CHR$(2);          (turn switch 2 in the other position)
>LPRINT CHR$(4);          (turn switch 3 in the other position)
[snip]
>How can I do this in Visual Basic 5.0???

Open "lpt1" For Output As #1
Print #1, Chr$(1)
Print #1, Chr$(2)
Print #1, Chr$(4)
'etc
Close #1

Pete



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB4.0 sending commands to rs232 (com port) and printer port

2. Help, How to send printer command to printer bypassing printer driver in vb

3. how to send printer commands to a printer

4. Sending Printer Commands to Printer using QBASIC

5. Need to send a command directly to printer (Eltron Card Printer)

6. Send text directly to printer port?

7. Command to Open a Printer Port

8. Send HEX commands to com port

9. Send a byte to printer port?

10. How to send byte to printer port? HELP

11. How to send data to printer port

12. Please Help sending binary info to printer port

 

 
Powered by phpBB® Forum Software