Hello All,

I have been trying to send data to a pole display i.e. DigiPos WD202,

I am trying to use the following code but nothing appears on the display

Procedure CSPortWrite(PortID, PortData : string);
var
f: THandle;
NumberWritten : dword;
begin
NumberWritten := 0;
//assigns the stream to the printer port LPT1
f := CreateFile(PChar(PortID),GENERIC_WRITE,0,nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
//write to printer
{-$1} writefile(f, PChar(PortData)^,Length(PortData),NumberWritten,nil) {+1$};
CloseHandle(f);
End;

and calling then CSPortwWrite()

CSPortWrite(PortID, trim(Frm_FMMain.EdSalesAmount.Text));

Please assist.

Dani AI

Generated

Short summary and practical checklist (follow these in order). The DigiPos WD-202A is an RS‑232 customer display (not a parallel/LPT printer). That explains why the raw LPT CreateFile/WriteFile approach didn’t show anything; a serial/COM method is the right path and, as discovered, a COM/serial component that sends the required control bytes works. See the WD‑202A specs and command list for the exact command sets and DIP‑switch options. (scribd.com)

Key steps to get it working:

  • Confirm the physical interface and cable (DB‑25/DB‑9 RS‑232).
  • Match the display DIP switches to the command set you plan to send (ESC/pos, CD5220, UTC, etc.), and set the baud/parity/data bits accordingly.
  • Use the display’s recommended flow control (DTR/DSR) and the correct voltage/signalling levels.
  • Send raw control bytes (ESC sequences) as documented and terminate string commands with the required CR/LF where noted.
  • If you’re using a USB->Serial adapter, verify the assigned COM number in Device Manager. Test with a terminal program before adding code. (scribd.com)

A minimal Delphi-style approach (pseudo-code; adapt to your serial component):

Com.Open;
Com.WriteStr(Chr(27) + '@' + 'PRICE: $12.34' + Chr(13));  // ESC @ then text, end with CR
Com.Close;

Send an initialization ESC (ESC @) before text when required, and end the command with CR for string modes that expect it. Refer to the manual for the exact hex sequences for the command mode you selected. (scribd.com)

Notes and gotchas: if you open the port with the Win32 API and the COM number is 10 or higher, use the device name form "\\.\COM10" when calling CreateFile (many higher‑level components handle that for you). If the display is installed in passthrough mode with a printer on the same serial line, check the device selection bits or use the display’s command that selects display vs printer. If problems persist, capture the raw bytes you send (hex) and compare to the command examples in the WD‑202A manual. (ftdichip.com)

References:

Got the solution, which is getting a TComm Component which I used to send the control characters together with the text to be displayed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.