FieldSoftware
Home

PrinterCE SDK
   General Info
   Download
   Purchase & Pricing

Developer Info
   eVC MFC
   eVC C/C++
   eVB

Special Features
   AsciiCE
   PrintDC
   BarcodeCE

Documentation
   PrinterCE SDK
   AsciiCE
   PrintDC
   BarcodeCE

Special Topics
  Supported Printers
  Bluetooth Printing
  Network Printing

.Net CF C# or VB.Net:
  PrinterCE.NetCF SDK

-----------------------------

Software Developers
  PrinterCE SDK
 
PrinterCE.NetCF SDK
  PocketHTMLprint SDK

Printing Utilities
  PrintPocketCE
  PIEprint
  PocketPixPrint
  PocketShot
 
PocketClipPrint

 Arcade Games
  SockOut
  MazeCraze

Contact Info

Special AsciiCE2 Topic: 
Reading Data from Special-Purpose Printers

[AsciiCE2 Documentation]    [AsciiCE2 Developer Info]

in addition to the standard writing (printing) of data to printers, AsciiCE2 supports reading data from specialized printers, . This gives developers opportunities to support special-purpose printers which might include data readers such as magnetic-card and smart card readers. AsciiCE2's data reading capabilities are generic in nature, so it is the responsibility of the application to use AsciiCE2's write functions to send appropriate commands to the printer that will trigger the printer to send data back. Note: AsciiCE and PrinterCE use an infrared protocol called IRLPT to communicate with IR printers, so AsciiCE can only read data from devices that can send using the IRLPT protocol.

The following provides a brief outline of the steps involved in using AsciiCE2 to read data from a printer. Refer to AsciiCE2 documentation here for full details on the commands.

  1. Use SelectPortEx to enable data reading from the printer. SelectPortEx (an extension to SelectPort) establishes a communication link to the printer (IR or Serial). If the ReadBufferSize parameter is non-zero, it causes AsciiCE2 to create a read-thread with a read-buffer that is "ReadBufferSize" bytes long. The read-thread will watch for any data received from the printer and save it in the ReadBuffer until your application is ready to use it.

  2. Use any of AsciiCE2's "write" methods ("Write", "WriteVar" or "Text") to instruct the printer to perform whatever tasks (such as read a magnetic card swipe) are necessary to gather data and begin sending via the established IR or serial port.

  3. Use any of AsciiCE2's "read" methods ("Read", "ReadChar", "ReadString", "ReadVar", or "ReadStringVar") to read data sent from the printer. "Read" (for C++ or MFC) and "ReadVar" (for eVB) provide special functionality to support timeouts (in case data isn't received in some specified amount of time) and several simple data handling operations.

  4. Process the data (or handle timeout or other errors) then close the AsciiCE2 connection