Modbus is a serial communication protocol that Modicon published in 1979 for the use of programmable logic controllers (PLCs). In fact, it has become the standard for communication protocols in the industrial sector and is now a fairly common connection between industrial electronic devices.
The Modbus protocol currently has versions for serial, Ethernet, and other networks that support Internet Protocol.
Most Modbus device communication takes place via the serial EIA-485 physical layer. For serial connections, there are two variants that differ slightly in numerical data representation and protocol details. Modbus RTU is a compact, binary representation of data. Modbus ASCII is a human-readable, lengthy representation. Both variants use the serial communication (serial communicaTIon) approach. Subsequent commands/data in the RTU format have a checksum of the cyclic redundancy check, while the ASCII format uses a checksum of the vertical redundancy check. Nodes configured as RTU variants will not communicate with nodes set to ASCII variants, and vice versa.
A message analysis of modbusrtuFirst declare our purpose, we want to communicate with two devices, using the MODBUS protocol. The above briefly introduces: "message" "CRC check" "function number".
Take some memory (RAM) in the MCU for two devices communication, for example:
Comment after the array, description
OX[20] represents the output coil, accessed with function codes 0x01, 0x05, 0x0F, and the starting address is 0 (this follow-up description)
IX[20] represents the input coil, accessed with function code 0x02, and the starting address is 1 (this follow-up description)
The other two are the same.
Note: The so-called "coil" "register" is the "bit variable" "16-bit variable", do not be confused. The reason why it is called "coil" I think should be for the application equipment, MODBUS protocol is specifically developed for 485 bus equipment (such as PLC).
1, the host writes data to the slaveIf the MCU receives a message, it parses the message and performs the corresponding processing, such as the above message:
01 06 00 01 00 17 98 04
Slave address function number data address data CRC check
If the local address is 1, then the MCU receives the data according to the data and calculates whether the CRC check data is correct. If the data is correct, the result is:
HoldDataReg[1] = 0x0017;
The MODBUS master completes a write operation on the slave data and implements communication.
2, the host reads the data from the machineWhen the host reads the HoldDataReg[1] operation, the message is:
01 03 00 01 00 01 D5 CA
Slave address function number data address read data number CRC check
Then, the MCU receives the string of data and calculates whether the CRC check data is correct according to the data. If the data is judged to be correct, the result is: returning the information to the host, and the returned information is also formatted:
Return content:
01 03 02 0017 F8 4A
Slave address function number data byte number two bytes data CRC check
The MODBUS master completes a read operation on the slave data and implements communication.
MODBUS message modelThe above has learned how a frame of MODBUS messages are communicated. In fact, the format of each message is basically the same.
The two abbreviations here are not known before, but now I have to understand what it means, "ADU" "PDU"
ADU: Application Data Unit
PDU: Protocol Data Unit
Modbusrtu message formatAll exchanged RTU type messages (frames) have the same structure regardless of the uplink/downlink:
Each frame of message contains 4 types of information:
Slave numberThe slave station number is 1 byte and the value ranges from 0 to FFH. Exceptionally, if this value is 0, it is the broadcast message identifier of the primary station. Therefore, the physical slave number can only be between 01H and FFH (that is, between 1 and 255).
function codeThe function code is 1 byte. It is used to select a command (read, write or answer check is correct, etc.). The valid function code range is from 1 to 255. The function codes supported in this manual will be in Chapter 2. To be detailed.
Data areaThe data area is n bytes and contains a string of hexadecimal data associated with the function code.
E-cig as a substitute of tobacco mainly reminds people of its potential benefits for health. Four ingredients contain in the e-liquid : propylene glycol, glycerin vegetable, nicotine and food grade essence. Nevertheless, smoke from cigarette contains carbon monoxide, tar, arsenic, ammonia, and many other cyanide and acetone.
Advantage
- New ceramic self heating element, Uniform heating
- High reduction, Temperaturecan be accurately controlled
- Safety and Health, Worth a product,Natural and realistic taste,Factory Direct Sale
- Using proprietary technology,Quality assurance, trustworthy
- Oil leakage free, compact, pocket-sized, portable and easy to transport
-
So that smokers can smoke addiction, refreshing, to meet the psychological and physiological needs of smokers, and in line with the habit of smokers for many years.
-
Compared with rechargeable e-cigarettes and mechanical e-cigarettes, the price of disposable e-cigarettes is much lower, which is applicable to a wider range of customers than the first two. It is also the absolute truth for ordinary consumer groups to be cheap.
Wax Device Oem,Thc Wax Device Oem,Marijuana Wax Device Oem,High Cost Performance Wax Device
Shenzhen MASON VAP Technology Co., Ltd. , https://www.e-cigarettefactory.com