Author Topic: START=ANY DATA, STOP=CHR(13)  (Read 1913 times)

MTZOVARAS

  • Newbie
  • *
  • Posts: 5
    • View Profile
START=ANY DATA, STOP=CHR(13)
« on: February 06, 2009, 02:17:19 pm »
Hello,

how can i define a packet that starts with the first character received (any character) and stops with chr(13) ?

Minas Tzovaras

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: START=ANY DATA, STOP=CHR(13)
« Reply #1 on: February 06, 2009, 02:38:14 pm »
Hello

After installation nrComm Lib you can find "{nrComm_Home_Folder}\Demos\SimplePacket\SimplePacket.dpr" project. It shows a simple way how you can detect a data packet by fixed end char sequence.

Another way is using the TnrDataProcessor component.
Unfortunately the Object Inspector does not allow to enter invisible chars (#13, #10) in design mode for string properties of DataPacket.

But you can initialize the needed properties at runtime before open serial port:

nrDataProcessor1.DataPackets[1].PacketEnd := #13;

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.