Mcgspro Yingzhang CO2 Concentration Sensor Communication

Kunlun Tongtai Touch Screen Business Consultation: 18133839970

The Yingzhang CO2 concentration sensor supports Modbus communication, allowing sensor data to be collected through the Modbus driver provided by the configuration software.

1. Determine Sensor Communication Parameters

By referring to the sensor protocol specification, the default parameters are as follows:

The sensor uses serial communication with a baud rate of 9600,8 data bits, 1 stop bit, no parity bit, and the default device address is 2

2. Determine Sensor Modbus Address

Refer to the manual to find the data address as follows:

Mcgspro Yingzhang CO2 Concentration Sensor CommunicationMcgspro Yingzhang CO2 Concentration Sensor Communication

Example of reading concentration message:

Assuming the device address is 2 Read command: 02 04 05 00 00 01 31 35  Return value: 02 04 02 07 AC FF 7D    In the read command: 02 Sensor address 04 Read data function code 0X0405 00 Register value, i.e., 0X0500 indicates gas concentration 00 01 Read register count, i.e., 0X0001, indicating one. 31 35 Checksum Return value: 02 Return sensor address 04 Return read data function code 0X04   02 Return the number of bytes occupied by the register, which is 2 bytes, one register occupies 2 bytes. 07 AC The gas concentration returned by the register occupies two bytes, which is 0X07AC, decimal 1964. For sensors with units in ppm, the reading is 1964 ppm. For sensors with units in %VOL, it needs to be divided by 100, so the result is 19.64%VOL.

From the above message, it can be seen that the function code for reading concentration is: 04 Address in hexadecimal is 500, converted to decimal is: 1280, but the starting address for Modbus in Kunlun Tongtai software is 1, so the address needs to be incremented by 1, corresponding to the Modbus address for area 3, which is 1281. How to determine it is area 3? It is determined based on the function code 04.

3. Add Modbus Driver

Create a new configuration project, click the device window to add a serial parent device, and add the Modicon ModbusRTU child device driver under the parent device, as shown in the figure below.

Mcgspro Yingzhang CO2 Concentration Sensor Communication

Set the communication parameters for the serial parent device. In this example, serial 485 communication is used, with COM2 port, corresponding to serial pins: 7+, 8-. The parameter settings are shown in the figure below:

Mcgspro Yingzhang CO2 Concentration Sensor Communication

Since the Yingzhang CO2 concentration sensor has a default device address of 2 from the factory, the child device address is set to: 2, as shown in the figure below:

Mcgspro Yingzhang CO2 Concentration Sensor Communication

4. Add channels as shown in the figure below:

Mcgspro Yingzhang CO2 Concentration Sensor Communication5. Channel Processing:After adding the channel, click on channel processing settings to add channel processing as shown below:Mcgspro Yingzhang CO2 Concentration Sensor CommunicationThus, communication with the sensor is completed.

Leave a Comment