54
10 Programming Guide (C# Code
Examples)
In order to lower the threshold for code access, the device does not use a proprietary
protocol for decoding data transmission, and is familiar with using the serial port/TCP
debugging assistant to control device triggering. After receiving the device decoding data,
the code can be written quickly.
The sample code here is in C# language, other languages can be used after familiarizing
with the device operation. Refer to the relevant data sending and receiving code of the
serial port/TCP debugging assistant to write.
10.1 RS232 Communication
1. Open serial port
For parameters such as port number and baud rate, please refer to the connection
parameters of the host computer or serial debugging assistant.
System.IO.Ports. SerialPort SerialPort1;
serialPort1.PortName = "COM1";
serialPort1.BaudRate = 115200;
serialPort1.DtrEnable = false;
serialPort1.Open();
In actual development, error handling can be added as needed, as shown below