Jump to content

Send ASCII String to IP Address


Recommended Posts

I am working on an card encoder which only requires a string of ascii to be sent to it's IP address in order to print.

Example

<

Name

#10000

"%10000?

>

So far I've been doing this be writing it to a text file, notepad.exe /p text.txt, then delete text.txt

This prints to the default printer which is a generic/text printer with the IP address of the encoder.

Is there a way to send this string directly to the IP Address, or at least a cleaner way to send it to the generic/text printer?

Resolved: Used TCPConnect and TCPSend to send the print command string to a DataCard printer. Printer is in OpenCard format.

Edited by edthedestroyer
Link to comment
Share on other sites

How can you access your card encoder? Only as a printer, or is there a way to simply use TCPOpen & TCPSend?

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

I am using a genertic/text printer driver that sends the print job as text because that's the only way I know how to send acsii messages to an IP Address. The manual says it simply needs to IP stream with the acsii enclosed. Can you elaborate on TCPOpen & TCPSend?

Edit: Didn't know that was a built-in function. I will research these functions and see if they suit. I don't believe the encoder documentation specified a port, should I just pick a random port over 20000?

Edited by edthedestroyer
Link to comment
Share on other sites

The default port for printing is 9100.

You can find the actual port in the control panel ==> printers ==> (file ==> )Server Properties ==> Ports

And TCPSend is the right way to go. ;)

Edited by hannes08
Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
Share on other sites

Edit: Didn't know that was a built-in function. I will research these functions and see if they suit. I don't believe the encoder documentation specified a port, should I just pick a random port over 20000?

If there is no port specified, try a random port. If you want to associate some meaning, what about Port 9100 or 35 (Any private printer server protocol) Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...