19.2 Modbus communications 110
19.2.1 About Modbus 111
19.2.2 Modbus protocols 112
19.2.3 Understanding Modbus Terminology 113
19.2.4 Connecting Modbus devices 113
19.2.5 Modbus client-server protocol 113
19.2.6 About Modbus programming 114
19.2.6.1 Endianness 114
19.2.6.2 Function codes 115
19.2.7 Modbus information storage 116
19.2.7.1 Registers 116
19.2.7.2 Coils 117
19.2.7.3 Data Types 117
Unsigned 16-bit integer 117
Signed 16-bit integer 118
Signed 32-bit integer 118
Unsigned 32-bit integer 118
32-Bit floating point 118
19.2.8 Modbus tips and troubleshooting 118
19.2.8.1 Error codes 119
Result code -01: illegal function 119
Result code -02: illegal data address 119
Result code -11: COM port error 119
19.3 Internet communications 120
19.3.1 IPaddress 120
19.3.2 HTTPS server 121
19.3.3 FTP server 121
19.4 MQTT 122
19.4.1 Sending data to an MQTT broker 122
19.4.1.1 Mosquitto 122
Configure the data logger 122
Program the data logger 123
19.4.1.2 AWS 124
Setup AWS IoT 124
Configure the data logger 130
Program the data logger 132
Verify data in AWS IoT 132
Table of Contents - v