[Lazarus] Help needed: How do I install the attached component?

Peter Williams pewtas at gmail.com
Thu Jul 31 12:11:42 CEST 2008


2008/7/31 Dave Coventry <dgcoventry at gmail.com>:
> 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.

Hi,
this might be irrelevant and I never used the Synapse routines, but I'll try:
are you stepping also into the actual transmitting routine, character
by character ?
I am asking this because it is quite strange to see a device thar
requires _no_ stop bit, like you configured it:

>    ser.Config(9600,8,'N',0,false,false);

and by stepping, you might be stopping after each character, so that
the device state machine can decode the character.
All the devices I have ever seen in the last decade, either PC devices
or not, they _need_ exactly 1 stop bit, so an easy shot could be to
change it to:

>    ser.Config(9600,8,'N',1,false,false);

Let me know if it works!

R#








> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>



More information about the Lazarus mailing list