waveshare Modbus RTU Analog Input 8CH User Manual
waveshare Modbus RTU Analog Input 8CH

Modbus RTU Analog Input 8CH

ជាងview

ការពិពណ៌នាផ្នែករឹង

  • Each channel can be individually configured for its range, making it more convenient for users.
    “AIN+” is the positive input, and “AIN-” is the negative input. The module supports both differential and single-ended input. When used as a single-ended input, “AIN-” is connected to the ground.
    ការពិពណ៌នាផ្នែករឹង
    គាំទ្រវ៉ុលtage and current simultaneous acquisition
    Note: When inputting the different powers, it is important to connect the ground wire to establish a common ground. Otherwise, the collected data may be inaccurate.
  • Opening the device case, you can see jumpers are near the device terminals, corresponding to the eight channels Al1~Al8. You need to select the jumper mode based on the measurement signal; otherwise, the measurement data will be inaccurate.
    • នៅពេលវាស់វ៉ុលtage signals, the jumper wire for the corresponding channel should be disconnected.
    • When measuring current signals, the jumper wire for the corresponding channel should be connected. ការពិពណ៌នាផ្នែករឹង
  • Modbus RTU Analog Input 8CH defaults to current mode with the jumper wire connected. Modbus RTU Analog Input 8CH (B) defaults to voltage mode with the jumper wire disconnected.

Version Comparision

  • Currently, there are two versions of the analog input series, one defaults to current input, and the other defaults to voltagអ៊ីបញ្ចូល។
  • Modbus RTU Analog Input 8CH
    Supports four ranges (configurable) 0-5V/1-5V 0-20mA (default) /4-20mA
    ការពិពណ៌នាផ្នែករឹង
  • Modbus RTU Analog Input 8CH (B)
    Supports four ranges (configurable): 0-10V (default)/2-10V 0~20mA/4~20mA
    ការពិពណ៌នាផ្នែករឹង
  • Modbus RTU Analog Input 8CH Configurable range
    ការពិពណ៌នាផ្នែករឹង
  • Modbus RTU Analog Input 8CH (B) Configurable rangeការពិពណ៌នាផ្នែករឹង
    កំណែ Modbus RTU Analog Input 8CH Modbus RTU Analog Input 8CH (B)
    របៀបលំនាំដើម 8-ch current mode, 0~20mA 8-ch voltage mode, 0~10V
    ជួររង្វាស់ 0~5V/1~5V0~20mA/4~20mA 0~10V/2~10V0~20mA/4~20mA
    ដំណោះស្រាយ 12 ប៊ីត 12 ប៊ីត
    បច្ចុប្បន្ន សampភាពធន់នឹងលីង 249Ω 499Ω
    ប្រតិបត្តិការ amplifier ratio ៥/៥ ៥/៥
    ឆានែល ៨២៦-អាយ ៨២៦-អាយ

    Each version has five range modes from 0 to 4.

    របៀប Modbus RTU អាណាឡូក បញ្ចូល 8CH Modbus RTU អាណាឡូក បញ្ចូល 8CH (ខ)
    0 0~5V voltagរបៀបអេឡិចត្រូនិច 0~10V voltagរបៀបអេឡិចត្រូនិច
    1 1~5V voltagរបៀបអេឡិចត្រូនិច 2~10V voltagរបៀបអេឡិចត្រូនិច
    2 0~20mA current mode 0~20mA current mode
    3 4~20mA current mode 4~20mA current mode
    4 4096-scale code mode 4096-scale code mode
  • The scale code is the data collected by the AD converter and needs to undergo a linear transformation to obtain voltage or current data. The conversion formula is as follows.
    • វ៉ុលtage = Scale Code 3300/4095/Operational Ampសមាមាត្រ lifier
    • បច្ចុប្បន្ន = វ៉ុលtage/Sampling Resistor

ការតភ្ជាប់ផ្នែករឹង

  • Connect the USB TO 485 to the target boards via cables, A-A and B-B connected as shown below:
    ការតភ្ជាប់ផ្នែករឹង

តេស្តកម្មវិធី

SSCOM Serial Port Debugging Assistant

  • ទាញយក SSCOM serial port debugging assistant and open it on the computer. Open the corresponding port number, set the baud rate as 9600, and select SendHEX and HEXshow.
    Send the following command, and it will return the 8-channel analog input data normally.
    01 04. 00 00 00 08 F1 CC
    តេស្តកម្មវិធី
  • If you need to send other commands, choose SendHEX. For checksum validation, select  ModbusCRC16. After entering the first six bytes of the command, clicking SEND will automatically add the CRC check code. For example, send the following command, you can set channel 1 to 4-20mA current input mode.
    តេស្តកម្មវិធី
  • For more control commands, you can refer to the development protocol.

Modbus Poll Software

  • It is not convenient to use the SSCOM software for observing the data, you can select Modbus Poll software to read the data. Download and install the Modbus Poll software.
  • Open the software, select Setup -> Read/Write Definition. Select the actual device address for Slave ID, 04 Read Input Registers (3x) for Function, and 8 channels for Quantity, and click “OK” to confirm.
    តេស្តកម្មវិធី
  • Select Connection->Connect…, choose the corresponding serial port, set the baud rate to 9600, and select 8 Data bits and None Parity. Click OK to connect.
    តេស្តកម្មវិធី
  • After successful connection, it can display the analog input data for channels 1-8.
    តេស្តកម្មវិធី
  • Modbus RTU Analog Input 8CH (A) displays the current by default, and the unit is uA.
    Modbus RTU Analog Input 8CH (B) displays the voltage by default, and the unit is mV.
  • ជ្រើសរើស File-> New to create a new window, select Setup->Read/Write Definition. Select the actual device address for Slave ID, 16 Write Multiple Registers for Function, Hex for Address Mode, 1000 for Address, and 8 channels for Quantity, and then click “OK” to confirm.
    តេស្តកម្មវិធី
  • The new window 2 can set up the measuring modes for different channels. For example, you can set the channel 1 mode as 2, that is, 0~20mA current mode. And channel 1 of the window 1 will display the current.
    Note: The internal jumper wires should be modified when changing the current and voltage mode, otherwise, the measurement data will not be accurate.
    តេស្តកម្មវិធី

តេស្តសាកល្បង
Note: RS485 can not be directly connected to the serial port of the Raspberry Pi, otherwise it may burn the device, you need to add 485 level conversion. For Raspberry Pi, it is recommended to work with the RS485 CAN HAT module. For NUCLEO-F103RB and Arduino, it is recommended to work with the RS485 CAN Shield module.

Raspberry Pi

Open the Raspberry Pi terminal and enter the following command to enter the configuration interface

sudo raspi-config
Select Interfacing Options -> Serial, disable shell access, and enable the hardware serial port
Raspberry Pi

Then restart Raspberry Pi:

sudo ចាប់ផ្ដើមឡើងវិញ

បើក /boot/config.txt file, find the following configuration statement to enable the serial port, if not, you can add it to the end of the file.
enable_uart-1

For Raspberry Pi 3B users, the serial port is used for Bluetooth and needs to be commented out:
#dtoverlay-pi3-miniuart-bt

Then restart Raspberry Pi:

sudo ចាប់ផ្ដើមឡើងវិញ

Insert the RS485 CAN HAT into the Raspberry Pi, and connect the Modbus RTU Relay module to the RS485 CAN HAT through A and B.
If you are using other 485 devices, make sure to connect A-A, B-B.
Run the following commands to run the demo:

sudo apt-get install unzip.
sudo apt-get ដំឡើង python3-pip
pip install modbus_tk
wget https://files.waveshare.com/wiki/Modbus RTU-Analog-Input-8CH/Modbus RTU Ana log_Input_Code.zip
unzip Modbus_RTU_Analog_Input_Code.zip

cd Modbus_RTU_Analog_Input_Code/Python3
sudo python3 modbus.py

STM32

ចំណាំ៖ The STM32 demo is based on the NUCLEO-F103RB and RS485 CAN Shield module.

  1. ទាញយក Demo, find the STM32 project file Modbus.uvprojx in the path Modbus_RTU_Analog_Input_Code\STM32\MDK-ARM, and double-click to open the STM32 project file. Note that you should ensure Keil5 software is installed on your computer before using it.
    STM32
  2. Connect the STM32 to a computer via the STM32 download and debug probe. Compile and download the program to the development board.
    STM32
  3. Install the RS485 CAN Shield module on the STM32. Connect the RS485_A on the RS485 CAN Shield module to the RS485_A on the Modbus RTU Analog Input 8CH via a wire, and connect the RS485 B on the RS485 CAN Shield module to the RS485 B on the Modbus RTU Analog Input 8CH via a wire. Then power on the Modbus RTU Analog Input 8CH and the STM32 sequentially.
  4. After the program runs normally, you can observe through the serial port assistant that the device prints the collected results
    STM32

អាឌូណូ

ចំណាំ៖ The Arduino demo is based on the UNO PLUS and RS485 CAN Shield module.

  1. Download Demo, find the Arduino project file Modbus_RTU_Analog_Input.ino in the path Modbus_RTU_Analog_Input_Code\Arduino\Modbus_RTU_Analog_Input, and double-click to open the Arduino project file. Note that you should ensure Arduino IDE software is installed on your computer before using it.
    អាឌូណូ
  2. Connect the Arduino to the computer via a USB cable. In the Arduino IDE software, select the Arduino board model under Tools-> Board. Choose the COM port that the Arduino is connected to under Tools->Port.
  3. After seeing the prompt to connect to the computer in the lower right corner, click to compile and flash the program, and wait for the flashing to complete.
    អាឌូណូ
  4. Install the RS485 CAN Shield module on the Arduino. Connect the RS485_A on the RS485 CAN Shield module to the RS485_A on the Modbus RTU Analog Input 8CH via a wire, and connect the RS485_B on the RS485 CAN Shield module to the RS485_B on the Modbus RTU Analog Input 8CH via a wire. Then power on the Modbus RTU Analog Input 8CH and the Arduino sequentially.
  5. After the program runs normally, you can observe through the serial port assistant that the device prints the collected results
    អាឌូណូ

Development Protocol V2

សេចក្តីណែនាំអំពីកូដមុខងារ

មុខងារ កូដ ការពិពណ៌នា
03 អានការចុះឈ្មោះ
04 អានការចុះឈ្មោះបញ្ចូល
06 សរសេរការចុះឈ្មោះតែមួយ
10 Write multiple holding register

Register Address Introduction

Address (HEX) Address storage content ចុះឈ្មោះ តម្លៃ ការអនុញ្ញាត Modbus មុខងារ កូដ
3×0000…… 3×0007 Channels 1~8 input data Read values as unsigned hexadecimal អាន 0x04
4×1000…… 4×1007 Channels 1~8 data types 0x0000~0x0004 five ranges អាន/សរសេរ ០៤៣x០២៧x០៨x៨០
១២៨០ × ១០២៤ UARTParameter The high eight bits indicate the parity mode: 0x00~0x02The low eight bits indicate the baud rate mode: 0x00~0x07 អាន/សរសេរ 0x03, 0x06
១២៨០ × ១០២៤ អាសយដ្ឋានឧបករណ៍ Directly store Modbus address Device address: 0x0001-0x00FF អាន/សរសេរ 0x03, 0x06
១២៨០ × ១០២៤ កំណែសូហ្វវែរ Converting to decimal and then shifting the decimal point two places to the left will represent the software version0x0064 = 100 = V1.00 អាន 0x03

Operation Command Introduction

Read Analog Input Command

ផ្ញើលេខកូដ៖ 01 04 00 00 00 08 F1 CC

វាល ការពិពណ៌នា ចំណាំ
01 អាសយដ្ឋានឧបករណ៍ 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
04 04 command អានការចុះឈ្មោះបញ្ចូល
៦៧ ៨ ចាប់ផ្តើមចុះឈ្មោះ 0x0000 – 0x0007 correspond to 1~8 input channels
អាស័យដ្ឋាន
៦៧ ៨ លេខចុះឈ្មោះ The number of the registers to be read, which must not exceed the maximum number of the channels
F1 CC កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

លេខកូដត្រឡប់៖ 01 04 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 2C

វាល ការពិពណ៌នា ចំណាំ
01 អាសយដ្ឋានឧបករណ៍ 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
04 04 command Read input register
10 Byte Number Data length
00 00…… 00 00 ចុះឈ្មោះទិន្នន័យ Indicates the values of analog inputs from channels 0 – 7An unsigned 16-bit identifier for a channel, with the higher bits first and the lower bits last The data range is determined by the output data type
552C កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

សម្រាប់អតីតampលេ៖ [Address 1 device] Read 1-8 channels 01 04 00 00 00 08 F1 CC
Read 1 channel 01 04 00 00 00 01 31 CA
Read 2 channel 01 04 00 01 00 01 60 DA
Read 3-5 channels 01 04 00 02 00 03 11 св

Read Channel Data Type Command

ផ្ញើលេខកូដ៖ 01 03 10 00 00 08 40 CC

ហ្វីld ការពិពណ៌នា ចំណាំ
01 អាសយដ្ឋានឧបករណ៍ 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
03 03 ពាក្យបញ្ជា អានការចុះឈ្មោះ
៦៧ ៨ ចុះឈ្មោះអាសយដ្ឋានចាប់ផ្តើម 0x1000 – 0x1007 correspond to 1~8 input channels
៦៧ ៨ លេខចុះឈ្មោះ The number of the registers to be read, which must not exceed the maximum number of the channels
40CC កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

លេខកូដត្រឡប់៖ 01 03 10 00 02 00 02 00 02 00 02 00 02 00 02 00 02 00 02 09 C3

វាល ការពិពណ៌នា ចំណាំ
01 អាសយដ្ឋានឧបករណ៍ 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
03 03 ពាក្យបញ្ជា Read holding register
10 Byte Number The number of all bytes of the returned status information
00 02…… 00 02 ប្រភេទទិន្នន័យ Indicates data types of 0-7 channels, 0x0000~0x0004 represents five ranges 0x0000: Range 0~5V, output range 0~5000 or 0~10000, unit mV;0x0001: Range 1~5V, output range 1000~5000 or 2~10V, output range 2000~10000, unit mV;0x0002: Range 0~20mA, output range 0~20000, unit uA; 0x0003: Range 4~20mA, output range 4000~20000, unit uA;0x0004: Direct output of numerical code, output range 0~4096, requires linear conversion to obtain actual measured voltage និងបច្ចុប្បន្ន;
09C3 កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

សម្រាប់អតីតample: [Address 1 device]
Read data types for channels 1-8: 01 03 10 00 00 08 40 CC
Read data type for channel 1: 01 03 10 00 00 01 80 CA
Read data type for channel 2: 01 03 10 01 00 01 DI CA
Read data type for channels 3-5: 01 03 10 02 00 03 АО СВ

Set Single-channel Data Type Command
ផ្ញើលេខកូដ៖ 01 06 10 00 00 03 CD OB

វាល ការពិពណ៌នា ចំណាំ
01 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
06 06 ពាក្យបញ្ជា Write single register
៦៧ ៨ Register Start Address 0x1000 – 0x1007 correspond to data types of 1~8 input channels
0003 Channel Data Type Channel data types, 0x0000~0x0004 represents five ranges 0x0000: Range 0~5V, output range 0~5000 or 0~10000, unit mV;0x0001: Range 1~5V, output range 1000~5000 or 2~10V, output range 2000~10000, unit mV;0x0002: Range 0~20mA, output range 0~20000, unit uA; 0x0003: Range 4~20mA, output range 4000~20000, unit uA;0x0004: Direct output of numerical code, output range 0~4096, requires linear conversion to obtain actual measured voltage និងបច្ចុប្បន្ន;
CD 0B កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

លេខកូដត្រឡប់៖ 01 06 10 00 00 03 CD 0B

វាល ការពិពណ៌នា ចំណាំ
01 អាសយដ្ឋានឧបករណ៍ 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
06 06 ពាក្យបញ្ជា សរសេរការចុះឈ្មោះតែមួយ
៦៧ ៨ Channel Data Type Address 0x1000 – 0x1007 correspond to data types of 1~8 input channels
៦៧ ៨ Channel Data Type Channel data type, 0x0000~0x0004 represents five ranges
CD 0B កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

សម្រាប់អតីតampលេ៖ [Address 1 device]

Set data type to 0-20mA for channel 1: 01 06 10 00 00 02 ОС СВ
Read data type 4-20mA for channel 2: 01 06 10 01 00 03 9C CB

Set Multi-channel Data Type Command

ផ្ញើលេខកូដ៖ 01 10 10 00 00 08 10 00 03 00 03 00 03 00 03 00 03 00 03 00 03 00 03 91 2B

វាល ការពិពណ៌នា ចំណាំ
01 អាសយដ្ឋានឧបករណ៍ 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
10 10 ពាក្យបញ្ជា សរសេរការចុះឈ្មោះច្រើន។
៦៧ ៨ ចុះឈ្មោះអាសយដ្ឋានចាប់ផ្តើម 0x1000 – 0x1007 correspond to data types of 1~8 input channels
៦៧ ៨ លេខចុះឈ្មោះ Set register number, which must not exceed the maximum number of the channels
10 លេខបៃ Set the number of bytes to be output
00 03…… 00 03 បញ្ជា Corresponding to data types of 0-7 channels, 0x0000~0x0004 represents five ranges0x0000: Range 0~5V, output range 0~5000 or 0~10000, unit mV; 0x0001: Range 1~5V, output range 1000~5000 or 2~10V, output range 2000~10000, unit mV;0x0002: Range 0~20mA, output range 0~20000, unit uA; 0x0003: Range 4~20mA, output range 4000~20000, unit uA;0x0004: Direct output of numerical code, output range 0~4096, requires linear conversion to obtain actual measured voltage និងបច្ចុប្បន្ន;
912 ប កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

លេខកូដត្រឡប់៖ 01 10 10 00 00 08 C5 0F

វាល ការពិពណ៌នា ចំណាំ
01 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
10 10 ពាក្យបញ្ជា Write multiple registers
៦៧ ៨ Register Start Address 0x1000 – 0x1007 correspond to data types of 1~8 input channels
៦៧ ៨ Register Number Set register number, which must not exceed the maximum number of the channels
C5 0F កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

សម្រាប់ exampលេ៖ [Address 1 device]

Read data type 4-20mA for channels 1-8: 01 10 10 00 00 08 10 00 03 00 03 00 03 0 0 03 00 03 00 03 00 03 00 03 91 2B
Read data type 1-5V for channels 3-5 01 10 10 02 00 03 06 00 01 00 01 00 01 BE 4A

Set Baudrate Command
ផ្ញើលេខកូដ៖ 00 06 20 00 00 05 43 D8

វាល ការពិពណ៌នា ចំណាំ
00 អាសយដ្ឋានឧបករណ៍ 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
06 06 command Set the baud rate and device address
៦៧ ៨ ចុះឈ្មោះពាក្យបញ្ជា 0x2000: set the baud rate; 0x4000: set the device address
00 Parity Method 0x00: no parity, 0x01: even parity; 0x02: odd parity
05 Baud Rate Value Correspondence of baud rate values 0x00: 48000×01: 96000×02: 192000×03: 384000×04: 576000×05: 1152000×06: 1280000×07: 256000
៣៥ ឃ ៥ កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

លេខកូដត្រឡប់៖ 00 06 20 00 00 05 43 D8

វាល ការពិពណ៌នា ចំណាំ
00 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
06 06 command Set the baud rate and device address
៦៧ ៨ Command Register 0x2000: set the baud rate; 0x4000: set the device address
00 Parity Method 0x00: no parity, 0x01: odd parity; 0x02: even parity
05 អត្រា Baud Correspondence of baud rate values 0x00: 48000×01: 96000×02: 192000×03: 384000×04: 576000×05: 1152000×06: 1280000×07: 256000
៣៥ ឃ ៥ កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

សម្រាប់អតីតampលេ៖ [Address 1 device]

Set the baud rate as 4800: 00 06 20 00 00 00 83 DB
Set the baud rate ав 9600: 00 06 20 00 00 01 42 18
Set the baud rate as 115200: 00 06 20 00 00 05 43 D8

Set Device Address Command

ផ្ញើលេខកូដ៖ 00 06 40 00 00 01 5C 1B

វាល ការពិពណ៌នា ចំណាំ
00 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
06 06 command Set the baud rate and device address
៦៧ ៨ Command Register 0x2000: set the baud rate; 0x4000: set the device address
៦៧ ៨ Device Address Set the device address, 0x0001-0x00FF
5C 1B កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

លេខកូដត្រឡប់៖ 00 06 40 00 00 01 5C 1B

វាល ការពិពណ៌នា ចំណាំ
00 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
06 06 command Set the baud rate and device address
៦៧ ៨ Command Register 0x2000: set the baud rate; 0x4000: set the device address
៦៧ ៨ Device Address Set the device address, 0x0001-0x00FF
5C 1B កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

សម្រាប់អតីតampលេ៖ [Address 1 device] Set the device address as 0x01:00 06 40 00 00 01 5C 1B
Set the device address as 0x02:00 06 40 00 00 02 10 1A
Set the device address as 0x03:00 06 40 00 00 03 DD DA

Read Device Address Command
ផ្ញើលេខកូដ៖ 00 03 40 00 00 01 90 18

វាល ការពិពណ៌នា ចំណាំ
00 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
03 03 ពាក្យបញ្ជា Read the device address
៦៧ ៨ Command register 0x4000: read the device address, 0x8000: read software version
៦៧ ៨ Byte Number Fixed 0x0001
០០ ៦ ប កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

លេខកូដត្រឡប់៖ 01 03 02 00 01 79 84

វាល ការពិពណ៌នា ចំណាំ
01 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
03 03 ពាក្យបញ្ជា Read the software version and device address
02 Byte Number The number of bytes returned
៦៧ ៨ Device Address Set the device address, 0x0001-0x00FF
៦៧ ៨ កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

សម្រាប់អតីតampលេ៖ [Address 2 device] Send: 00 03 40 00 00 01 90 18
Return: 02 03 02 00 02 7D 85
// Address 0x02

Read Software Version Command
ផ្ញើលេខកូដ៖ 00.03 80 00 00 01 AC 18

វាល ការពិពណ៌នា ចំណាំ
00 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
03 03 ពាក្យបញ្ជា Read the software version and device address
៦៧ ៨ Command register 0x4000: read the device address, 0x8000: read software version
៦៧ ៨ Byte Number Fixed 0x0001
AC 1B កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

លេខកូដត្រឡប់៖ 01 03 02 00 64 B9 AF

វាល ការពិពណ៌នា ចំណាំ
01 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
03 03 ពាក្យបញ្ជា Read the software version and device address
02 Byte Number The number of bytes returned
៦៧ ៨ កំណែសូហ្វវែរ Converting to decimal and then shifting the decimal point two places to the left will represent the software version0x0064 = 100 = V1.00
B9 អេហ្វ កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

សម្រាប់អតីតampលេ៖
Send: 00 03 80 00 00 01 AC 18
Return: 01 03 02 00 64 B9 AF
1/0x0064 100 -V1.00

Exception Function Code
When the received command is incorrect or the device is abnormal, an exception response will be returned in the following format:

ត្រឡប់៖ 01 85 03 02 91

វាល ការពិពណ៌នា ចំណាំ
01 Device Address 0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
85 Exception Function Code Exception function code = Request function code + 0x80
03 Byte Number លេខកូដលើកលែង
0291 កាកបាទក្រហមកម្ពុជា ៣២ The CRC16 checksum of the first 6 bytes of data

An exception code is a single-byte value that indicates the type of error. Several commonly used exception codes defined by the Modbus protocol:

ករណីលើកលែង កូដ ឈ្មោះ ការពិពណ៌នា
0x01 មុខងារខុសច្បាប់ The requested function code is not supported
0x02 អាសយដ្ឋានទិន្នន័យខុសច្បាប់ The requested data address is incorrect
0x03 តម្លៃទិន្នន័យខុសច្បាប់ The requested data value or operation cannot be executed
0x04 Server Failure Server equipment failure
0x05 ការឆ្លើយតប The request has been received and is being processed
0x06 Device Busy The device is currently busy and cannot perform the requested operation

ធនធាន

ការបង្ហាញ

  • ការបង្ហាញ

កម្មវិធី

  • Sscom serial port debugging assistant
  • Modbus Poll software
  • SecureCRT software

ធនធានដែលពាក់ព័ន្ធ

  • Modbus Protocol Specification
  • Modbus Series BootLoader Description

ឯកសារ/ធនធាន

waveshare Modbus RTU Analog Input 8CH [pdf] សៀវភៅណែនាំអ្នកប្រើប្រាស់
Modbus RTU Analog Input 8CH, Modbus RTU, Analog Input 8CH, Input 8CH, 8CH

ឯកសារយោង

ទុកមតិយោបល់

អាសយដ្ឋានអ៊ីមែលរបស់អ្នកនឹងមិនត្រូវបានផ្សព្វផ្សាយទេ។ វាលដែលត្រូវការត្រូវបានសម្គាល់ *