Re: [fpc-pascal] Reading Serial Hex Data

2020-12-28 Thread José Mejuto via fpc-pascal
El 28/12/2020 a las 2:02, James Richters via fpc-pascal escribió: I think I figured out why my writeln's are causing an issue.. they are introducing a delay between the SerWrite and SerRead... and the device I am reading is timing out and sending it's response a second time. Hello, None of

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-28 Thread Bo Berglund via fpc-pascal
On Mon, 28 Dec 2020 14:12:02 +0100, Jean SUZINEAU via fpc-pascal wrote: >Le 28/12/2020 à 13:16, Bo Berglund via fpc-pascal a écrit : >> Synchronize(CallEvent); //Supply received data in FBuffer to >> caller > >You are using TThread.Synchronize. > >In a console app, it's likely that

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-28 Thread Jean SUZINEAU via fpc-pascal
Le 28/12/2020 à 13:16, Bo Berglund via fpc-pascal a écrit : Synchronize(CallEvent); //Supply received data in FBuffer to caller You are using TThread.Synchronize. In a console app, it's likely that somewhere else in your main thread you'll need to call regularly

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-28 Thread Bo Berglund via fpc-pascal
On Sun, 27 Dec 2020 18:20:32 -0500, James Richters via fpc-pascal wrote: >>On Sun, 27 Dec 2020 10:47:59 -0500, James Richters via fpc-pascal >> wrote: >> >>>I'm trying to figure out how to read a packet of HEX Bytes of an >>>unknown length that have no specific termination character over a

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-28 Thread Marco van de Voort via fpc-pascal
Op 12/27/2020 om 4:47 PM schreef James Richters via fpc-pascal: I'm trying to figure out how to read a packet of HEX Bytes of an unknown length that have no specific termination character over a serial port as efficiently as practical. The packet ends when there is just no more data to read. I

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-27 Thread James Richters via fpc-pascal
discussions' Cc: James Richters Subject: Re: [fpc-pascal] Reading Serial Hex Data What I meant by 'Hex Data' is that I am reading data in the form of bytes but they do not represent ASCII characters. So if I read a $0D, it's just a byte $0D, it doesn't represent a carriage return

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-27 Thread James Richters via fpc-pascal
Bo Berglund Subject: Re: [fpc-pascal] Reading Serial Hex Data On Sun, 27 Dec 2020 10:47:59 -0500, James Richters via fpc-pascal wrote: >I'm trying to figure out how to read a packet of HEX Bytes of an >unknown length that have no specific termination character over a >serial port as

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-27 Thread Bo Berglund via fpc-pascal
On Sun, 27 Dec 2020 10:47:59 -0500, James Richters via fpc-pascal wrote: >I'm trying to figure out how to read a packet of HEX Bytes of an unknown >length that have no specific termination character over a serial port as >efficiently as practical. What exactly do you mean by HEX Bytes? Hex

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-27 Thread Bo Berglund via fpc-pascal
On Sun, 27 Dec 2020 21:15:03 +0100, Jean SUZINEAU via fpc-pascal wrote: >I think TBlockSerial can work in your console program  context. May be >TLazSerial can be more tricky to use in your context, you'll need to use >events/callbacks and FCL. I have struggled with LazSerial in a console

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-27 Thread Jean SUZINEAU via fpc-pascal
May be using TBlockSerial from unit synaser from Ararat Synapse ? ( doc: http://synapse.ararat.cz/doc/help/synaser.TBlockSerial.html , download: http://synapse.ararat.cz/doku.php/download ). Given a variable (SynSer: TBlockSerial;), you can test if data is available with SynSer.CanReadEx(0)

[fpc-pascal] Reading Serial Hex Data

2020-12-27 Thread James Richters via fpc-pascal
I'm trying to figure out how to read a packet of HEX Bytes of an unknown length that have no specific termination character over a serial port as efficiently as practical. The packet ends when there is just no more data to read. I have something that is working that I wrote using SerRead from the