Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send ASCII commands to barcode printer over network? 1

Status
Not open for further replies.

utc13

Programmer
Oct 25, 2001
43
US
I have a barcode label printer connected locally via a serial port. I have VB code (in an Access database) that sends ASCII commands directly to this printer to print labels. Such as…

OPEN “COM1:9600,n,8,1” FOR OUTPUT AS #1
PRINT #1, CHR$(27); “T”;
PRINT #1, “HELLO WORLD”
CLOSE #1

The printer in also Ethernet capable so the IT guys now want to put it on the network (i.e. assigning it an IP address).

My question is this… how do I now communicate with the printer to send the ASCII commands? Is VB capable of opening a TCP/IP port the same way it opens the COM (serial) port in my above code?

The limitation that I have is that the users of the database only have the standard Office and Access packages (so they would not have the ability to use the Winsock control).

Any help would be appreciated.
 
Hi...

Interesting Problem..

1. Connect to the printer, as a network printer on the machine that you are running your program

2. substitute the com1 connection with printer share name

This is a test that I did between two machines in my office

The W040794 is the machine with the printer attached and the printer is shared as PLLDS, also tried this with

"\\ServerName\PrinterShareName"

OPEN “\\W040794\PLLDS” FOR OUTPUT AS #1
PRINT #1, CHR$(27); “T”;
PRINT #1, “HELLO WORLD”
CLOSE #1

Worked just fine
 
Thanks so much LEWDS. That may just be exactly what I need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top