[Lazarus] Strange behaviour sending data to a serial port.

Horacio Jamilis hjamilis at pymesoft.com.ar
Thu Jul 31 14:41:02 CEST 2008


You probably need a "ser.flush" after the ser.SendString, and before 
destroying the object...

or, if this don´t work, try with a sleep.

Horacio

Dave Coventry escribió:
> Hi,
>
> I have approached the Synapse mailing list with this problem, but have
> had no response, so it may be a Lazarus issue.
>
> In any case, maybe someone can suggest a work-around....
>
> I have used the following code to send data to a serial printer using
> the TBlockSerial synapse variable.
>
> var ser:TBlockSerial;
>
>   ser:=TBlockserial.Create;
>   try
>     ser.RaiseExcept:=True;
>     ser.Connect('COM1');
>     ser.Config(9600,8,'N',0,false,false);
>     ser.SendString('Invoice: The Galley Restaurant'+#13+#10);
>   finally
>     ser.Free;
>   end;
>
> If I run the above code, there is no response from the printer.
>
> However, if I put a breakpoint into the code and step through it, the
> printer prints as expected.
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
> __________ Información de NOD32, revisión 3302 (20080728) __________
>
> Este mensaje ha sido analizado con NOD32 antivirus system
> http://www.nod32.com
>
>
>
>   




More information about the Lazarus mailing list