Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sending Byte List
#5
OK, this is great. I've been struggling and had arrive at a similar method to send a byte array... thinking I had failed I vasilate between trying Indy & the old reliable Piette's sockets but I want to use Indy- then suddenly my example streamed a response so there is hope. unfortunately I am a struggling newbie to Indy and an intermediate Delphi guy.

I created a dynamic array;
 TxBuffer : TIdBytes;
Sized it;
    SetLength(TxBuffer,6);

I loaded it with pointers, I see now I didn't have to do that anyway...

I sent the bytes like this but I don't think it's right?:

IdTCPClient.IOHandler.Write(@TxBuffer[0],7);

I need to receive a byte array. The protocol is a lightweight datalink protocol, framed by simple headers (Start of Frame byte, inverted payload length, payload length, (Payload is a packed record structure of bytes and words, then an array of words) followed by two bytes of the 'Modbus' CRC, which I am calculating fine.

Could someone please give me a starting point for the IOHandler to receive a buffer of bytes? It's not big, about 46 bytes right now though it will be bigger. Ultimately it will stream at a fair speed for monitoring the data.
Reply


Messages In This Thread
Sending Byte List - by krshin - 08-22-2018, 07:19 PM
RE: Sending Byte List - by rlebeau - 08-22-2018, 08:27 PM
RE: Sending Byte List - by krshin - 08-23-2018, 05:52 AM
RE: Sending Byte List - by rlebeau - 08-23-2018, 10:32 PM
RE: Sending Byte List - by CaptRick - 08-29-2018, 11:43 AM
RE: Sending Byte List - by rlebeau - 08-29-2018, 06:22 PM
RE: Sending Byte List - by CaptRick - 08-29-2018, 10:50 PM
RE: Sending Byte List - by CaptRick - 08-31-2018, 10:38 AM
RE: Sending Byte List - by rlebeau - 08-31-2018, 05:10 PM
RE: Sending Byte List - by CaptRick - 08-31-2018, 09:02 PM
RE: Sending Byte List - by rlebeau - 08-31-2018, 09:35 PM
RE: Sending Byte List - by CaptRick - 08-31-2018, 09:46 PM
RE: Sending Byte List - by CaptRick - 09-01-2018, 12:46 PM
RE: Sending Byte List - by CaptRick - 09-04-2018, 03:35 PM
RE: Sending Byte List - by rlebeau - 09-04-2018, 06:32 PM
RE: Sending Byte List - by kudzu - 09-05-2018, 02:28 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)