Generic Modbus Action Example - Misol Weather Station Configuration
Configure the Misol weather station with the generic modbus action
Table of Contents
The Misol WN90LP Weather station is a low-cost RS485 Modbus Weather Station that can be used with the Hawk and its RS-1 card.
It's important to define what values we want to extract from this sensor.
This sensor measures:
- UV Index
- Temperature
- Humidity
- Wind Speed
- Gust speed
- Wind Direction
- Rainfall
- ABS pressure
However, we only have 6 registers we can query.
For our example use case, we want to measure all of the above except for Gust speed and Wind Direction.
Sensor Modbus Protocol Document
Wiring
Wires |
Hawk I/O |
Description |
Green |
I/O 2 |
VCC |
Black |
GND |
GND |
Red |
I/O 4 |
485_A |
Yellow |
I/O 3 |
485_B |
Device Manager Configuration
“Task 1” Tab
Ensure the Task 1 tab has an action set to “Modbus Action 1”
RS1 Card
Ensure that Vboost output is set to 12V.
Ensure that Modbus reading sets Vboost.
Set Modbus baud rate to 9600. From the attached sensor Modbus documentation.
Set Modbus parity to “none”. From the attached Modbus documentation.
Modbus Action 1
Sensor Address:
In the Modbus Protocol, it is specified as 0x90 (hex) which is automatically converted to decimal by Device Manager (0x90 in hex is 144 in decimal).
Power On Delay:
Set to 10s. The weather station needs to warm up before measurements are taken.
Analog Offset:
Set this Analog offset to a number less than Analog 14, because we are saving 6 values to these analogs. The Hawk only has 20 analogs in which to save values.
Reading 1 will be saved to Analog 10, and the subsequent ones to 11, 12, 13, 14, and 15.
Reading 1 - UV
Reading 1 Function:
Set R1 Function to “Read Holding Registers” - from the Modbus spec.
Set the address to correspond to the temperature register location (0x166) which will get converted to 358 when saved.
Set the Datatype to UINT16.
Set Byte order to big-endian.
Keep the exponent as 0. For this case, any required scaling can be done on the final platform.
Repeat for other readings
Repeat similar settings configuration for Reading 2 to 6.
In this case, the only change for each reading will be the register address.
For other sensor integrations you may need to change the datatype (if its a float, double or Int)