![Cyndar Electronic Technology XD-TOF-25 Operating Instructions Manual Download Page 20](http://html1.mh-extra.com/html/cyndar-electronic-technology/xd-tof-25/xd-tof-25_operating-instructions-manual_2704637020.webp)
Sensing the world
·
Leading the change
19
}
while (clientStream.Data
Av
ailable); //
If the data does not arrive, the loop is received
string result = myCompleteMessage.ToString();
string[] split = result.Split(new char[] { ' ' });//
loginresult.Text = split[3];//
STEP6
:Read device name (can be omitted)
The application can ask for the radar device name:
:
<STX>sRN{SPC}LocationName<ETX>
02
73 52 4E
20
4C 6F 63 61 74 69 6F 6E 4E 61 6D 65
03
<STX>
02
sRN
73 52 4E
20
LocationName
4C 6F 63 61 74 69 6F 6E 4E 61 6D 65
<ETX>
03
<STX>sRA{SPC}LocationName{SPC}D{SPC}FocusRayLidar<ETX>
02 73 52 41 20 4C 6F 63 61 74 69 6F 6E 4E 61 6D 65 20 31 33 20 46 6F 63
75 73 72 61 79 4C 69 64 61 72 03
byte[] de
v
icename = { 0x02, 0x73, 0x52, 0x4E, 0x20, 0x4C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F,
0x6E, 0x4E, 0x61, 0x6D, 0x65, 0x03 }; //Radar interrogation equipment name
clientStream.Write(de
v
icename, 0, de
v
icename.Length)
;
//Send login instruction to radar
if (clientStream.CanRead)
{
byte[] nameanswer = new byte[1024]; //Open up cache
StringBuilder myCompleteMessage = new StringBuilder(); //
Receive result variable
int numberOfBytesRead = 0;
do
{
numberofBytesRead = clientStream.Read(nameanswer, 0, nameanswer.Length);
//
Read TCPIP communication receive buffer
You can continue to operate the acceptance information in myCompleteMessage to determine further operations. The
following continues to extract key instruction information, which may contain ETX, STX, you need to further elaborate
processing
Divide the received character string into N character string arrays with spaces.
The third part is the device login result inforETX, the first byte is the login result information
:
:
:
Instruction
Header
Actual sending
instruction (Hex)
Data content
Footer
Space
(
SPC
)
If the command is successfully sent, you will receive the following feedback
from the radar (the initial name of the radar is named FocusRayLidar):
(Routine 3) Read the device name