Controlling Belimo Valves
Belimo valves are one of the most recognised and widely used makes of valve in the HVAC industry. The libraries on this page provide the tools to control and monitor valves using the MQTT open controls protocol and Node-RED.
Modbus Registers
Note that the register number is one more than address.
Operation Registers
Service Registers
Connecting via FTDI Cable
FTDI -> Actuator
Orange -> Grey
Yellow -> Pink
Black -> Not Connected
Example Commands
Read Modbus Setpoint
As an example, to read the Setpoint requires sending to the device (1 default) a FC3 read command (3) calling for register 1 (0 0), requesting a single value (0 1), ending with the CRC (Cyclic Redundancy Check).
In modbus the following characters would be sent to the valve over RS485 (shown in decimal and hex):
dec: [ 1, 3, 0, 0, 0, 1, 132, 10 ] hex: [0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x84, 0x0a]
Read Analogue Setpoint
The analogue setpoint register (13) is different from the Modbus setpoint (1). Register 119 (Sepoint Selection) choses which is valid.
dec: [ 1, 3, 0, 12, 0, 1, 68, 9 ]
When reading the analogue setpoint, note that analogue values less than 2v will result in unreadable values (65030+). The valve will still be closed.
Open Valve 100%
dec: [ 1, 6, 0, 0, 39, 16, 147, 246 ]
Close Valve
dec: [ 1, 6, 0, 0, 0, 0, 137, 202 ]
CRC Calculation
A Cyclic Redundancy Check is a value at the end of a Modbus message that is calculated from the message and can be used to check that received message is uncorrupted.
The following function takes a buffer as an input. For example, n the Close Valve example above, the input is [ 1, 6, 0, 0, 0, 0 ] and the calculated crc value is [137, 202 ].
function crc16(buffer) { var crc = 0xFFFF; var odd; for (var i = 0; i < buffer.length; i++) { crc = crc ^ buffer[i]; for (var j = 0; j < 8; j++) { odd = crc & 0x0001; crc = crc >> 1; if (odd) { crc = crc ^ 0xA001; } } } crc = "0000" + crc.toString(16); crc = crc.substr(-4); return crc; }
FC3 Read Register Function
The following function can be used to read values using FC3 command.
It takes an input msg as follows:
msg.fc = 6; msg.address = 1; msg.register = 1; msg.rlength = 1; msg.targetv = 5000;
var address = msg.payload.address || msg.address ||8; var fc = msg.payload.fc || msg.fc ; var register = msg.payload.register || msg.register || 1; register = register - 1; var rlength = msg.payload.rlength || msg.rlength || 1;
var r1 = Math.floor(register / 256); var r2 = register % 256; var targetv = msg.targetv; //999; if (fc != 3 && fc != 6) { return null; } if (fc == 3) { var tosend = String.fromCharCode(devAddress) + String.fromCharCode(3); tosend += String.fromCharCode(r1) + String.fromCharCode(r2); tosend += String.fromCharCode(0) + String.fromCharCode(rlength); var crcString = crc16(Buffer.from(tosend, 'ascii')); tosend += String.fromCharCode(parseInt(crcString.substr(2,2),16)) + String.fromCharCode(parseInt(crcString.substr(0,2),16)) ; msg.payload = Buffer.from(tosend, 'ascii'); return msg; }