KTA-282 Modbus TCP Weather Station Gateway: Quick View
KTA-282 Modbus TCP Weather Station Gateway: Quick View
Quick View
• Unit Conversions (Page 11) can be done by either writing direct to the registers or using
the KTA-282 Application.
Temperature °C
Pressure mbar
Rain mm
Notes: All temperatures are signed integers, therefore, a reading greater than 32767 represents a
negative temperature.
Overview
The KTA-282 Modbus TCP Weather Station Gateway allows the easy connection of a PLC (Programmable Logic
Controller), RTU (Remote Telemetry Unit) or SCADA System to a Davis Instruments Weather Station. Using the
Modbus RTU (Binary), or Modbus TCP/IP (Ethernet) protocols, it enables a programmable controller to monitor and
carry out actions based on wind speed, wind direction, temperature and many other weather-based variables.
The KTA-282 Modbus TCP Weather Station Gateway is a major upgrade to our popular GWY-141 Modbus-
VantagePro2 Gateway. It provides all the functionality of the GWY-141, with the following improvements:
• Addition of Ethernet:
o Provides a webpage whereby TCP/IP settings can be easily monitored and altered. Also shows
current settings, weather data, and communications statuses.
o Can be interrogated over HTTP to return Modbus register values in XML format
• Supports the new LOOP 2 command in compatible devices 1 (VantagePro 2 firmware V1.90 or later, and
Vantage Vue). This provides an additional 16 packets of previously unavailable weather data.
• Provides a method to setup the weather station for first use, without the need to connect it to your PC.
Notes: 1. The Weatherlink cable can be used to update the firmware of your weather station; allowing it to respond
to the loop 2 command.
Device Compatibility
The KTA-282 is compatible with the following Davis Instruments weather stations (Davis Instruments product
numbers in bold):
Terminology Refers To
“Weather station” • Vantage Pro 2 console
• Vantage Vue console
• Envoy (wired or wireless)
“Sensors” Any weather sensors your weather station communicates with. This is
commonly a bunch of sensors packaged together as an Integrated Sensor
Suite (ISS) but can also include:
• ISS Plus (ISS + UV & solar radiation)
• Wireless Temperature Sensor
• Temp/Humidity Sensor
• Leaf & soil moisture/temp
Or individual sensors (not an exhaustive list):
• Leaf wetness
• Solar radiation
• UV
• Anemometer
• Rain Collector
• Temperature
“Weatherlink” The serial WeatherLink expansion cable. Required for weather station
connection to the KTA-282. Can also be used to update the firmware of your
console.
“Gateway” The KTA-282 Modbus TCP Weather Station Gateway
“Controller” The Modbus device you are using to poll the KTA-282.
“Weather station Persistent memory held inside the weather station used to store factory
EEPROM” calibration values, location specific data, and other configuration values. It is
this memory that is set during the setup of your weather station for first use
(latitude, longitude, elevation, etc).
Table 1: Davis Instruments Jargon
This is now the best time to setup your weather station for first use. Your Davis documentation will detail this
process. If you have a weather station with a screen you can follow the prompts after entering “setup” mode,
otherwise the setup process can be done by connection to a PC. The KTA-282 also offers a method for setting up
your weather station (by directly writing to registers), however it is designed for advanced users to alter calibration
values and is not recommended for first use configuration. The following values are typically set during this
procedure:
Continue the set up process by connecting all necessary cabling. A generic set up is shown in the diagram below
(depending on your particular product, connections may differ slightly).
Connection Description
Vs Power Positive (8 to 28V DC; 100mW)
COM Power Negative (Ground)
D+ RS-485 Data +
D- RS-485 Data -
GND Ground
Male DE-9 Serial communications (RS-232) between KTA-282 and Weather station via
WeatherLink cable
RJ45 Socket Ethernet Port
OC1 Open Collector Output 1
OC2 Open Collector Output 2
Table 2: Connections to the KTA-282
Provide power to the KTA-282 via the V+ and GND screw terminals. Without anything else connected, you should
see the red LED next to the DE-9 connector flash once every 5 seconds. This confirms the card is on and
functional.
Continue by connecting the DE-9 cable from your weather station (via the WeatherLink) to the male D9 port of the
KTA-282. You should now see an accompanying green light every time the red LED flashes. This indicates the card
is successfully receiving data from the weather station.
Configuring Modbus
Modbus RTU
Serial Modbus is provided on RS-485. The communications settings for this port are set using 8 DIP switches next
to the DE-9 Socket. Any changes to the switches won’t take effect until the KTA-282 is power cycled.
Notes:
1. The bootloader is an advanced function that allows firmware updates to be deployed in the field.
To communicate over a TCP/IP network, the KTA-282 needs five pieces of information:
1. The Internet Protocol (IP) address of the KTA-282 within the network. Set by the user
5. The TCP/IP port the request is being sent on. For the KTA-282, Modbus TCP/IP is on port 502, and the
webserver (HTTP) is on port 80.
2. Modbus registers (using either Modbus RTU on RS485 or Modbus TCP/IP on Ethernet)
3. The webpage.
Switch two is the “panic switch”, returning the KTA-282 to default if the user writes incorrect values or doesn’t
otherwise know what settings the card currently possesses. To use, flick the switch on, hold for one second, and
turn back off again. Don’t leave this switch on; the card will be constantly resetting and therefore
unresponsive.
Default Values
IP Address: 192.168.1.100
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
The final four switches determine the last octet of the IP address.
Each register holds one octet of the TCP/IP configuration. These can be read to view the current TCP/IP settings,
or written to set the values. Once all twelve octets are manually set, the settings are committed to the gateway by
writing a one to holding register 92. Make sure all registers are written with correct values before they are
committed to the gateway.
Loop 1 Data
Data returned by the loop 1 command. All supported Davis Instruments hardware will populate these fields.
3. Holding Register 60 contains the communications status, which indicates if the Gateway is receiving data
from the Weather Station.
4. Wet bulb is not NOAA accurated, but rather an estimation based on temperature and dewpoint. Use as an
indication only.
Loop 2 Data
Only recent Davis Instruments hardware (Vantage Pro 2 firmware V1.9 or later, Vantage Vue) will return the loop 2
command with valid data. Older hardware will either not respond or respond with rubbish values. The WeatherLink
cable can be used to update an older weather station with this recent firmware.
7. Holding register 78 contains the status of the loop 2 command. If 1, loop 2 is being successfully received.
To obtain the loop 2 data, the hardware must be either a Vantage Pro2 (Firmware revision 1.90 or later) or
a Vantage Vue.
Functionality
Unit Conversions
NOTE: if your temperature displays incorrectly below 0°C, update to the latest firmware at
oceancontrols.com.au
The units of the readings can be changed by writing to the Modbus holding registers shown in table 16. The
following table shows the multiplier and unit. For example, if a 1 was written to holding register 106 then the
atmospheric pressure readings would be in mmHg and have to be multiplied by 0.1.
Symbol Unit
°F Fahrenheit
°C Centigrade or Celsius
inHg Inches of Mercury
mmHg Millimetres of Mercury
mbar Millibar
atm Atmospheres
mph Miles per Hour
kph Kilometres per Hour
knots Knots (Nautical Miles per Hour)
3. Register 32 is reduced by a factor of 10; the readings returned will be 0.0001 in or 0.1 mm.
Beware that some configuration values are set by Davis in the factory and should not be changed. The KTA-282
does not guard against ill-advised use of the EEPROM write command.
The configuration registers of the weather station can be directly altered by the KTA-282. The EEPROM of the
weather station is written using either the EEWR command or BAR= command depending on which EEPROM
register requires manipulation (see Vantage Serial Protocol Docs on the Ocean Controls website). Each argument
of these commands is coupled to a Modbus register. Any weather station EEPROM can therefore be written using
Modbus communications.
The BAR command is of the following format:
BAR= <barometer calibration (in Hg * 1000)> <weather station elevation (in feet)>
Sending this string to the weather station will write the byte held in data to the EEPROM location specified by
address. For registers of length 2 bytes, two EEWR commands are required.
The EEPROM write function works as follows:
The weather station must be power cycled for the new EEPROM values to take effect. If your console takes
batteries in addition to a plug pack, make sure both the plug pack and the batteries are removed. Wait ten seconds
before reapplying power to ensure the weather station has in fact powered down.
Note: the BAR= command must send both arguments to the weather station. If one of elevation or barometer
calibration does not need to be written, you must manually write that register to zero before sending the BAR=
command.
EEWR 0B 87
EEWR 0C FE
Some users have experienced some problems with their Modbus TCP connection failing after prolonged use
(between days and months). If this is a problem for you, it may help to enable manual socket severing by writing a
one to Modbus Holding Register 125.
Modbus Holding Name Description
Register
125 Modbus Socket 1 = Automatically severs a Modbus TCP connection after
Sever 90 seconds of inactivity.
By writing a one to Holding Register 125, you are enabling manual socket severing. The KTA-282 monitors all open
connections, and if there is no actual traffic on a socket for 90 seconds, that connection is artificially forced to close.
Webpage
In addition to providing an interface to read and write the TCP/IP configuration values, the webpage also provides
the user with a view of the current status of the KTA-282.
Some common current weather values are displayed, along with their corresponding unit and multiplier. The unit
and multiplier are displayed dynamically; that is, they change if conversions change. This is therefore a good way
to view the current conversion settings of the KTA-282.
Below these readings is an indication of the current communication status between the gateway and weather
station, either “GOOD” or “BAD”.
Directly above the horizontal line reads the MAC address for the KTA-282. This identifier is globally unique.
Directly below the horizontal line is the configuration fields for the gateway, and a line of text reading: “After power
cycle, the TCP/IP settings will load from: <dynamic value>”. This text will read either “switches” or “memory” based
on the status of TCP switch 1. It is important to realise that the TCP/IP settings may still be read from the
switches on power up, despite changing them using Modbus or the webpage.
XML Request
In addition to Modbus TCP/IP, the gateway can also return the status of the holding registers via an XML file over
HTTP (port 80). To trigger this request; send a HTTP GET query to the KTA-282’s IP Address with the register
number appended after a forward slash. Alternatively, the entire register listing can be returned by using the same
query with a “registers.xml” termination. The XML file structure is shown in the screenshots. This format is
consistent.
Single Register
All Registers
<IP Address>/registers.xml
Using a web browser – with the gateway at its default address:
192.168.1.100/registers.xml
Error Request
If the GET request is of the wrong format or otherwise unrecognised by the KTA-282, a bad request XML is
returned.
The KTA-282 is equipped with two open collector outputs able to sink up to 300mA. These can be user configured
to switch on/off at a given threshold of any weather data point. They are therefore useful as alarms, or for basic
control operations.
Set up is via six (6) Modbus registers:
Example:
Wind speed is held in register 23. I am on a farm where the roof of my tin shed will blow off above 70 km/h gusts. At
50km/h I want a buzzer to sound as a warning.
I write 23 into register 117, 50 into register 118, and 1 into register 119. The output will turn on the buzzer if the
windspeed goes above 50 km/h.
o Modbus TCP/IP
• Two buttons – named “bind all comms” and “release all comms.” These controls are designed mainly for
internal use; they allow all three communications channels (Modbus RTU, Modbus TCP/IP, and the
weather station simulator) to be batch killed or established. Note that the communications settings must
have been previously established (see configuring communications) to use these controls effectively.
Configuring Communications
Communications can be setup by clicking “Setup comms” on the menu bar. This presents you with a configuration
screen.
Power Connected
Without any connections made except power, the Tx LED next to the DE-9 port should flash red once roughly every
5 seconds. This confirms the gateway is on and operational.
Ethernet
If a valid connection is made on Ethernet cable between another controller, network card, or Ethernet switch, at
least one LED on the Ethernet socket will be illuminated – regardless of TCP/IP settings. If not, there is a problem
with the network equipment.
RS-485
If any type of serial data is sent over RS-485, the Rx LED will flash. If the serial data is a valid Modbus command at
the correct address, baud rate, and parity, the gateway will send a response. This will cause the green Tx LED to
flash.
Troubleshooting Procedure
1. Begin with the Gateway disconnected from all cabling and all DIP switches in the off position.
2. Apply 8 to 28 volts to the power terminals. Check the Tx LED next to the DE-9 port. It should flash red
roughly once every 5 seconds. If so, move to step 3. If not:
1. Check the wires of the power supply are the correct way around.
2. Probe the power terminals with a multimeter to ensure you are receiving the required DC voltage.
3. Plug the weather station into the KTA-282 using the DE-9 connector. Check the Rx LED next to the DE-9
connector. It should now flash green in combination with the red LED. If so, move to step 4. If not:
4. Plug an Ethernet cable from the gateway to a controller (either directly or via an Ethernet switch). After a
moment, the lights on the Ethernet socket should illuminate/flash. If so, go to step 4. If not, there is a
problem with the network hardware. Try:
5. Use the switches to set the TCP/IP settings. Using a machine in the same subnet, browse to the IP
address of the gateway. If you see the KTA-282 webpage, you have successful Ethernet communications.
The gateway can be polled by a Modbus TCP/IP master on this address. If not:
1. Check your network settings to make sure the gateway is in the same subnet as your other
network hardware. On windows:
3. Type ipconfig. This will return the current PC’s network adapter settings.
4. Ensure these settings are in the same subnet as the gateway. In this example, the PC
would be able to contact the PC at default subnet (192.168.1.x), but not on 10.1.1.x.
2. Check your network to ensure the KTA-282 has a unique IP address within the subnet. The best
way to do this is via your router (if applicable). Otherwise you could power off the gateway, and
then send a ping request to that IP address. If that address is already taken, you will get returned
packets.
3. Make a direct connection to your PC using an Ethernet cable, and manually configure the PC to be
on that subnet. On windows:
5.3.5. Click on “use the following IP address” and set the values to:
IP Address: 192.168.1.1
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
5.3.6. Use a ping request to 192.168.1.100. You should get returned packets.
5.3.7. Point your web browser to the IP address. A webpage should be displayed.
Note: These values are the TCP/IP configuration currently loaded into memory. If TCP/IP switch 1 is set to load
from switches, the KTA-282 will be on a different IP address to what is displayed.