Modbus confusion

hi,

I am trying to get some modbus data in from a Columbia weather station. I have only delt with modbus for the the briefest of times and usually just button mash until it works, I have been unsuccessful here. I am unsure what setting to use in the modbus device config, I have tried all the various Input Register options with no luck. Any suggestions based on this documentation? It works on Kepware on our of SCADA machine.

This is what the documentation for the weather station says, with the Notes three pages down:
full document here, ModbusPointList.xls (columbiaweather.com)

32-Bit Registers
All data accessed via (read only) Input Registers
Data type Long = Signed 32 bit value
Data type Float = 32 bit floating point value
Byte Order: Little Endian
Node 1

Measurement Description, Starting Modbus, Offset, Columbia data type, Modbus
Address, OPC data type, Dnp3 index

umtLastMeasTime Time of last measurement 1 posix time 30001 Long 1
Last measurement time stamp 3 posix time 30003 Long
umtWindSpeed Wind speed 5 float 30005 Float 2
Wind speed time stamp 7 posix time 30007 Long
umtRawWindDir Wind direction - unadjusted 9 float 30009 Float 3
Wind direction - unadjusted time stamp 11 posix time 30011 Long
umtAdjWindDir Wind direction 13 float 30013 Float 4
Wind direction time stamp 15 posix time 30015 Long
umtRelHumidity Relative humidity 17 float 30017 Float 5

Notes:
For each of the available measurements, the two registers immediately following the value
contain the posix time value of the time that value was last updated. For example:
the wind speed value is stored in registers 5 and 6. The last update timestamp is stored in registers 7 and 8 and is a 32-bit integer value.
The posix time values are 32-bit integers; All the values are Modbus input registers.

What have you tried so far? What does your Kepware configuration look like?

Either of these addresses would be a good starting point:

  • 1.IRI30001
  • 1.IRI1

From there, you may need to toggle the "Swap Words" option in the driver config.

Is it really? Not "Word Order: Little Endian"? Because, while the Modbus spec is very loose in most things, it is really explicit that 16-bit registers are transferred in big endian on the wire.

(You may not be able to use this device if it really is little endian for each register.)

Ooh, yeah, I missed that. It would require bringing the "raw" registers in and making expression tags that rearranged the bytes.

aargh!! Well this weather station has been a PITA since we go it so why not continuing...

I can only go by what Columbia's documentation says, that might explain why I get some really impressive number strings.

they do have a 16 bit register option, it means even less to me although it might sort of be more reasonable...

16-Bit Registers
The 16-bit unsigned scaled integer registers
Data type: Unsigned scaled integers
Parameter value = (unsigned 16-bit integer + Offset)/Factor
Measurement Description Register Factor Offset
umtLastMeasTime 32001
umtWindSpeed Wind speed 32002 368 0
umtAdjWindDir
Adjusted wind
direction 32004 163 0

I'd suggest similar starting points for these:

  • 1.IR32001
  • 1.IR2001

except you'll need an additional expression tag for each to apply the scaling, I'm not sure the regular tag scaling can handle what they're doing.

well those give me numbers but they don't make sense even with the scaling. I created a second tag for the expression.

sorry, I'm being dumb. I was mixing up factor and Offset.

I think I have it now. Looks like I'll need to use the 16 bit registers and create a second tag to do the scaling

I suggest you start with the Air Temperature since you can probably tell if the value you receive is reasonable.

This will be at 1.IRF37

"Zero-based Addressing" will NOT be checked.

Try with and without "Reverse Word Order"

That could be in either deg C or deg F.

thanks all, I got it all working. The key was the bit order Pturmel and Kevin caught. once I abandoned that path the unsigned 16 bit registers worked just fine. I create a raw tag and an expression tag to do the math required. clunky but it work and it's just a handful of values. thanks for the help

1 Like