![Cyndar Electronic Technology XD-TOF-25 Operating Instructions Manual Download Page 21](http://html1.mh-extra.com/html/cyndar-electronic-technology/xd-tof-25/xd-tof-25_operating-instructions-manual_2704637021.webp)
Sensing the world
·
Leading the change
20
myCompleteMessage.AppendFormat("{0}",Encoding.ASCII.GetString(nameanswer, 0,
numberOfBytesRead));
//
Write all the information stack read by the network port to the receiving result variable
}
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[] { ' ' });//
lidarname.Text = split[4];//
STEP7
:Read device index, get device type and version (can be omitted)
The application can query the radar device index:
<STX>sRN{SPC}DeviceIdent<ETX>
02
73 52 4E
20
44 65 76 69 63 65 49 64 65 6E 74
03
<STX>
02
sRN
73 52 4E
20
DeviceIdent
44 65 76 69 63 65 49 64 65 6E 74
<ETX>
03
If the command is successfully sent, you will receive the following feedback
from the radar to inform the device index:
<STX>sRA{SPC}DeviceIdent{SPC}8{SPC}
FOSLS121{SPC}4{SPC}V1.0<ETX>
02 73 52 41 20 44 65 76 69 63 65 49 64 65 6E 74 20 38 20 46 4F 53 4C 53
31 32 31 20 34 20 56 31 2E 30 03
byte[]ident = { 0x02, 0x73, 0x52, 0x4E, 0x20, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64,
0x65, 0x6E, 0x74, 0x03 }; //
Ask for device index
clientStream.Write(ident, 0, ident.Length)
;
//Send login instruction to radar
if (clientStream.CanRead)
{
byte[] identanswer = new byte[1024]; //Open up cache
StringBuilder myCompleteMessage = new StringBuilder(); //
Receive result variable
int numberOfBytesRead = 0;
do
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 fourth part is the device name +ETX, you can remove the last byte.
Instruction
Actual sending
instruction (Hex)
Header
Data content
(Routine 4) Read device index
Space
(
SPC
)
Footer