🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7276

Problem with printing text using RS232

#7276
From: Jan
Date: Fri, 25 Feb 2005 21:12
35 lines
1976 bytes
Can anyone help me with this:

I purchased an order printer (Epson TM200) with the following specifications:
Baud Rate 19200 bps
Data Bits 8 Bits
Handshaking Hardware
Parity Check Disabled,
More specifications can be found on: http://www.star-micronics.co.jp/eng/service/usermanual/tsp600sm.pdf

I downloaded a class that handel the serial communications from:
http://www.ciemmesoft.com/componenti/  and I wrote this code:

       TCommPort *port = new TCommPort();
       AnsiString com = Edit6->Text;
       port->SetCommPort("COM1");
       port->OpenCommPort();
       port->SetBaudRate(19200);
       port->SetParity(2);
       port->SetStopBits(2);
       port->SetByteSize(8);

       String message = "Print this";       
       char *ch = message.c_str();
       port->WriteString(ch);

       port->CloseCommPort();
       delete port;

When I execute the code I don't get anything on paper. But when I change the String message to message = "Print this message \n"; I get some other funny characters printed on the paper (not Print this)

Can anyone see what I am doing wrong?
The paper is almost finished because I am trying from this morning.

Thanks
Technical Details
Message-ID: <421f94b1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,11a480b4e2a1fdaf,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jan" <amstel_25@yahoo.com>
Sender: "Jan" <amstel_25@yahoo.com>
Reply-To: "Jan" <amstel_25@yahoo.com>
Subject: Problem with printing text using RS232
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 62.177.189.75     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <421f94b1$1@newsgroups.borland.com>
Date: 25 Feb 2005 13:12:17 -0800
X-Trace: newsgroups.borland.com 1109365937 207.105.83.66 (25 Feb 2005 13:12:17 -0800)
Lines: 35
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail