Technical Information Interfacing With VE Bus Products MK2 Protocol 3 14
Technical Information Interfacing With VE Bus Products MK2 Protocol 3 14
For communicating with older (VE 9-bit RS485) products, refer to “VE - Interfacing
with the Phoenix Product Range”.
2 Supported devices
The following Victron Energy products are equipped with VE.Bus connections:
VE.Bus product version numbers are of the format AA BB CCC, where AA is the
product type, BB is the model, and CCC is the version. The information in this
document is intended for use with devices with software version xxyy111 or higher.
(xx= 19,20 26 or 27)
Please make sure that your MK2 contains the latest firmware. This is automatically
checked when connecting to a Multi/Quattro with latest version of VEConfigure3.
(See also Software compatibility)
<Length> is the number of bytes in the frame, excluding the length and checksum bytes.
If the MSB of <Length> is a 1, then this frame has LED status appended (see chapter
3.6 for more information). <Command> indicates the purpose of the frame. The number
and content of the <Data> bytes depends on the value of <Command>. <Checksum> is
computed such that the sum of all bytes in the frame (including the length and
checksum) equals 0.
Please ignore the paragraph below. Update your Mk2 to the latest firmware version (see
Software compatibility).
Zero padding:
If the last byte before <Checksum> is 0xFF, the frame will be interpreted differently by the MK2. To
prevent this, if the last data byte of the frame is 0xFF, the frame must be padded with 0x00 (and <Length>
incremented).
IMPORTANT: Do NOT add a 0x00 when the last byte <>0xFF
Notes:
• Please ignore this note, use latest MK2 firmware version
(see Software compatibility).
If the version of the MK2 is 1130128 or later then zero padding is not required.
Because of backwards compatibility reasons, an MK2 with version 1130128 or later, will allow zero
padding to be used on commands which are supported by previous versions (all commands
described in this document).
New commands, to be added to later versions in future, might not accept the zero padding!
Depending on the firmware version of the MK2, the response can also be padded with 0x00. Even if
the last byte <> 0xFF.
(MK2 versions 1130128 and up do not use zero padding on their respones.)
• The MK2 protocol is little endian. All values that are larger than one byte are sent
LSB first.
We advise to use a timeout value of 500ms. (Note that response times will be much
lower for the majority of the commands.)
commands.
This value is suitable for all commands with one exception: The response for ‘F’5 (see
paragraph 6) can take up to 750ms. So one should increase the timeout
eout to a value greater
than 750ms when waiting for that response.
response
Command: ‘V’
Reply: ‘V’ <Version number0> … <Version number3> <Mode>
Mode>
It is important
mportant to always use the latest MK2/MK3
MK2 firmware !!
a
To make use of the low power mode with a Multi Compact one must set dipswitch 2 to off.
In case the MK2 is powered before the VE.Bus device, make sure to do one of the
following:
A) Power cycle the MK2 after the VE.Bus device is powered.
B) Send the MK2 a reset command (0x02 0xFF ‘R’ <checksum>).
Note that this is only important in a non-standard system, where the MK2 is not
powered from the VE.Bus device. When the MK2 is connected on to a Multi with a
UTP cable, everything will be automatically, and this powerup sequence will not require
extra attention or consideration.
4 LED status
The operating state of a VE.Bus system can be determined by requesting the LED
status.
Command: ‘L’
Reply: ‘L’ <LED on> <LED blink> 0x00b
Each bit in <LED on> represents the on/off status of an LED. Each bit in <LED blink>
represents the blinking status of an LED; if the corresponding bit in <LED on> is 0 then
the LED is blinking in anti phase with the others.
If the MK2 is unable to determine the LED status, <LED on> and <LED blink> will be
reported as 0x1F.
b
MK2 versions 1130128 and up do not send this 0x00
Variant 1: <Flags[7]>=0
Command: ‘S’ <Switch state> <Pot value> <Panel scale> 0x01 <Flags>
Reply: ‘S’
The <Panel scale> parameter is used to specify the maximum current the system
should draw (in amps). The <Pot value> parameter can be any value between 0 and
255, and is used to allow the set point to be varied between 0 and <Panel scale> amps.
The input current set point used by the system is determined by the following formula:
Variant 2: <Flags[7]>=1
<Flags[n]> Meaning
0 Automatically send panel state to VE.Bus every ½ second.
1 Automatically append the LED status to all frames sent from the
MK2 to the PC. If this flag is set, then all frames sent on the PC will
have a LED status frame appended (see LED status above for
details). When a frame has the LED status appended, bit 7 in the
<Length> byte will be set.
2 Reserved (keep 0).
3 Reserved (keep 0).
4 Do not send panel state.
5 Reserved (keep 0).
6 Automatically forward received panel frames (see below).
7 0 = input current limit is send as potvalue and scale
1 = input current limit is send as Amps * 10
Optional:
<Reserved> (Keep 0)
<FlagsExt0[n]> Meaning
0 0 = Winmon mode 2, long Winmon frames
1 = Winmon mode 1, short Winmon frames (convert long Winmon
frames to old short type. (Default on)
1 Reserved (Keep 0).
2 1 = forward config responses from all devices
3 Ignore block mode requests
<EEPROMFlags[n]> Meaning
0 Force VE.Bus mode (MK2 only). Skips autodetect
VE.Bus/VE9bit mode
1 Block XMT. Listen only
Note: These frames are VE.Bus frames, not MK2 frames. The general format is the
same, except that VE.Bus frames do not begin with 0xFF.
There are two types of panel frame, standard and extended. The type of frame sent
depends on the panel model, and is indicated by bit 3 of <Panel and switch
information>.
If <Frame format> is set, then the frame uses the extended format.
For standard format frames, <Switch position>, <Pot value> and <Panel scale>
are interpreted as described above.
For extended format frames, add 1 to <Switch position> to get the standard format
equivalent. <Absolute current limit> is the input current set point, specified in deci-
amps.
Note: The responses to the ‘F’ command are VE.Bus frames, not MK2 frames. The
general format is the same, except that VE.Bus frames do not begin with 0xFF.
The voltage, current and period fields use the same offsets and scales as the equivalent
values requested with ‘W’ commands (see chapter 7.3 for more information).
Additionally, <Mains current> must be multiplied by <BF factor> to get the total
mains current for that phase, and <Inverter current> must be multiplied by
<Inverter factor>c to get the total inverter current for that phase.
<Phase info> indicates which phase the received frame describes, and in the case of
L1, how many phases are present in the system.
<state> indicates the Multi main state. This is the same state as returned by the
separate Winmon command CommandGetSetDeviceState 7.3.2 .The <state> field is
available in Multi firmware versions >= 207
<State> Meaning
0x0 Down
0x1 Startup
0x2 Off
0x3 Slave
0x4 InvertFull
0x5 InvertHalf
0x6 InvertAES
0x7 PowerAssist
0x8 Bypass
0x9 StateCharge
c
Inverters (not Multis) with software versions xxyy120 up to and including xxyy125, (xx being 19,20,26
or 27) will incorrectly report <Inverter factor> as 0. Updating the device to revision 126 or higher will
fix this.
<Last active input> indicates which of the AC inputs was the last to be used. Note
that this does not necessarily mean that there is currently anything connected to this
input. The first input is input 0.
If <Input current limit overridden by panel> is set, then a remote panel can
override the internal input current limit for this input. If this bit is not set, then the
internal setting will be used even if a remote panel is connected.
<ID> contains the long address of the VE.Bus device. If 0, all devices will be reset.
Battery Operational Limits (BOL) should only be used to implement BMS functionality.
The following applies:
Command: ‘F’ 9
<Flags>
<UBatCharge0> <UBatCharge1>
<IBatCharge0> <IBatCharge1> <IBatCharge2>
<UBatDischarge0> <UBatDischarge1>
<IBatDischarge0> <IBatDischarge1> <IBatDischarge2>
Response: 0x3C
<Flags>
<UBatCharge0> <UBatCharge1>
<IBatCharge0> <IBatCharge1> <IBatCharge2>
<UBatDischarge0> <UBatDischarge1>
<IBatDischarge0> <IBatDischarge1> <IBatDischarge2>
The <Flags> bits define the contents and thereby the length of the frame and are
specified as follows:
<Flags[n]> Meaning
0 UBat charge present
1 IBat charge present
2 UBat discharge present
Bit 0 of the <Action> parameter determines whether the <Address> parameter should
be read or written. If this bit is a 1 then the address used by the MK2 will be set to the
value of the <Address> field, otherwise the <Address> field is ignored. The reply will
return the address currently in use. The <Action> parameter in the reply will be the
same value specified in the command frame.
When the MK2 starts up, the address will be set to the default value of 0xFF. This is not
a valid address, so must be set before it is possible to send ‘W’ commands (see chapter
7.3), a valid address must be set. Valid address values are between 0x00 and 0x1F.
Attempting to set any other value will cause the MK2 to revert to the default value of
0xFF.
When sending ‘W’ commands that should generate a response, you must wait for the
response before sending another ‘W’ or ‘A’ command, otherwise the response will not
be received.
Modes:
d
MK2 versions 1130128 and up do not send this 0x00
Winmon Commands:
<WXYZ>
‘W’ Original Winmon command with 2 bytes payload.
‘x|y|z’ In addition to above this includes the destination address at the end of
the frame. Winmon replies are always uppercase.
When sending ‘W’ commands, the response from the target device may consist of
multiple <W frame>s. In this case, up to 3 <W frame>s will be packed into one MK2
frame.
Each <W frame> will always be 3 bytes, so the number of frames included in a single
response to a ‘W’ command can be determined from the value of <Length>.
Response (mode 1): ‘X|Y|Z’ <W frame0> [<W frame1> [<W frame2>]]
From this point forward, only the contents of the <W frame> part of the command will
be discussed.
W Name Note
command
0x05 CommandSendSoftwareVersionPart0
0x06 CommandSendSoftwareVersionPart1
0x0E CommandGetSetDeviceState
0x30 CommandReadRAMVar
0x31 CommandReadSetting
0x32 CommandWriteRAMVar
0x33 CommandWriteSetting
0x34 CommandWriteData
0x35 CommandGetSettingInfo
0x36 CommandGetRAMVarInfo
0x37 CommandWriteViaID Winmon mode 2 only
0x38 CommandReadSnapShot
If an unsupported command is sent, the device will reply with an “Unknown command”
response:
<Reason> indicates why the command was unrecognised. If bit 0 is set, <Info0> was not
recognised. If bit 1 is set, <Info1> was not recognised. If both bits are clear, <W
command> was not recognised.
Command(s): 0x05/0x06 XX XX
Response : 0x82 <LoPart0> <HiPart0>
0x83 <LoPart1> <HiPart1>
Command: 0x05
Response : 0x82 <LoPart0> <HiPart0> <LoPart1> <HiPart1> XX XX
7.3.2 CommandGetSetDeviceState
This command is used to read the state of the device or to force the unit to go into a
specific state.
Command
<State> Action
0 No state change, just inquire.
1 Force to Equalise. 1 hour 1, 2 or 4 V above absorption (12/24/48V). Charge
current is limited to ¼ of normal value. Will be followed by a normal 24-hour
float state.
2 Force to Absorption, for maximum absorption time. Will be followed by a
normal 24-hour float state.
3 Force to Float, for 24 hours.
Response
<State> State description Sub-state Sub-state description
0 Down 0
1 Startup 0
2 Off 0
3 Device in slave mode 0
4 Invert Full 0
5 Invert Half 0
6 Invert AES 0
7 Power Assist 0
8 Bypass 0
9 Charge 0 Charge Initializing
1 Charge Bulk
2 Charge Absorption
Note: Switching the state might take some time so it is possible that the returned state
does not correspond directly with the requested state. However if state change is
possible it will take place within 1 second. So depending on the application a verify
might be needed.
If the requested state is not supported then an “Unknown command” response is sent.
Note: This command was introduced with firmware versions xxyy122 (xx= 19,20,26 or
27)
Setting ”force equalize”, “force absorption and “force float” works form xxyy400
7.3.3 CommandReadRAMVar
This command can be used to read RAM variables. A list of RAM IDs can be found in
chapter 7.3.11. Not all devices support all variables, refer to CommandGetRAMVarInfo
for information on how to determine which variables are supported, and how to interpret
them.
0x85 = RamReadOK.
0x90 = Variable not supported (in which case <Value> is not valid).
By adding more IDs to the command, up to six RAM variables can be requested in a
single command.
7.3.4 CommandReadSetting
This command can be used to read device settings. A list of setting IDs can be found in
chapter 7.3.11. Not all devices support all settings, refer to CommandGetSettingInfo for
information on how to determine which settings are supported, and how to interpret
them.
0x86 = SettingReadOK.
0x91 = Setting not supported (in which case <Value> is not valid).
7.3.6 CommandWriteSetting
This command can be used to write settings. A list of setting IDs can be found in
chapter 7.3.11. Not all devices support all settings, refer to CommandGetSettingInfo for
information on how to determine which settings are supported, and how to represent
them.
7.3.7 CommandWriteData
This command must be used in conjunction with either CommandWriteRAMVar or
CommandWriteSetting. This command sends the data to be written. The destination of
the data depends on the previous frame.
7.3.8 CommandGetSettingInfo
This command can be used to get information about which settings are supported, and
how to interpret them. A list of setting IDs can be found in chapter 7.3.11.
If Sc = 0, this setting is not supported, and the remaining responses are not
transmitted.
The scale and offset are used to format the setting value. Assume x is the (16-bit) value
of a setting (requested with CommandReadSetting). The following formula is used to
determine the display value:
<Default>, <Minimum>, <Maximum> are unsigned 16-bit values, represented in the same
format as the values returned by CommandReadSetting. To be meaningful for the end-
user these values must be formatted with Scale and Offset as above.
7.3.9 CommandGetRAMVarInfo
This command can be used to get information about which RAM variables are
supported, and how to interpret them. A list of RAM IDs can be found in chapter 7.3.11.
If Sc = 0, this RAM variable is not supported, and the remaining response is not
transmitted.
The scale and offset are used to format the RAM variable. Assume x is the (16-bit)
value of a RAM variable (requested with CommandReadRAMVar). The following
formula is used to determine the display value:
Special case:
When <Offset> is 0x8000, the RAM variable is a bit. <Sc> is then set to the bit number
+ 1 in that case.
7.3.10 Units
Unless otherwise noted, values use the following units:
Type Unit
Voltage Volt
Current Ampere
Time Minute
7.3.11 CommandWriteViaID
This command can be used to write RAM variables or settings.
<flags>
Bit 7 6 5 4 3 2 1 0
Meaning (0)update ram and (0)RAMvar
EEPROM (1)setting
(1)ram value only
Remark Firmware versions
>= 412
Command: 0x38
Response: 0x99, [ <Lo(V0)> <Hi(V0)> [<Lo(V1)> <Hi(V1)> [Lo(V2)>
<Hi(V2)> [Lo(V3)> <Hi(V3)> [Lo(V4)> <Hi(V4)> [Lo(V5)> <Hi(V5)>]]]]]]
The device will respond with the values of the last snapshot (if any).
A snapshot should be requested using the ‘F’ command and can only be read once.
Notes:
1) Taking a snapshot is especially useful when you would like to have for instance
the power of a system as accurate as possible. You should take a snapshot of the non-
filtered values and calculate the total sum of all devices. It might be useful to apply
some filtering on this summed value.
2) The Multis/Quattros have only 1 snapshot memory.
When a new snapshot is requested before the old has been read the old will be lost!
Please note that the CCGX might send snapshot commands so you cannot safely use this
mechanism in a system with a CCGX!!
7.3.13.3 Flags
To determine which flags are supported by the device, the <Maximum> value returned by
CommandGetSettingInfo is used. In the case of the flag settings, <Maximum> is a bit
mask, where a bit will be set for each supported setting.
e
The setting will become active after a reset of the Multi (off/on with the front switch or with a remote
panel which releases the Stand By signal).
Flags[n] Function
0 MultiPhaseSystem
1 MultiPhaseLeader
2 60Hz
3 Disable Wave Check (fast input voltage detection).
IMPORTANT: Keep flags[7] consistent.
4 DoNotStopAfter10HrBulk
5 AssistEnabled
6 DisableCharge
7 IMPORTANT: Must have inverted value of flags[3].
8 DisableAES
9 Not promoted option
10 Not promoted option
11 EnableReducedFloat
12 Not promoted option
13 Disable ground relay
14 Weak AC input
15 Remote overrules AC2
16-26 Virtual switch flags (see below)
27 Accept wide input frequency
28 Dynamic current limiter
29 Use tubular plate traction battery curve
30 Remote overrules AC1
31 Use Low Power Shutdown in AES instead of modified sinewave.
32-34 Virtual switch flags (see below)
35-63 Unused
Warning: do not change ‘Not promoted options’. Changing these can damage the
device.
Warning: When changing flags, do not set bits for unsupported settings, as this can
cause the values of other flags to be changed.
The names are closely related to the function. For example, vstonUBatHigh means the
time UBat must be above vsonUBatHigh before VS is considered on.
Instruct the MK2 to act as a remote panel - switch on, input current limit 12A (of 16A
max.) using variant 1 (sending potvalue and scale)
07 FF ‘S’ 03 C0 10 01 01 D2
02 FF ‘S’ AC
Send single remote panel command - switch on, input current limit 31.5A using variant
2 (sending absolute current limit)
07 FF ‘S’ 03 3B 01 01 80 E7
02 FF ‘S’ AC
f
MK2 versions 1130128 and up do not send this 0x00
g
Newer VE.Bus products add the [DD DD] this can be ignored see also note in §3.2
In order to obtain the scaling a valid device must be selected, in a properly configured
system, address 0 will always be used, set that:
00.401 INF.mk2: setting address: 00
00.448 INF.: > 04 FF A 01 00
00.510 INF.: < 04 FF A 01 00
Get the ram scaling needed to intepreted the values from the device.
00.557 INF.: > 05 FF W 36 00 00
00.650 INF.: < 08 FF W 8E 9C 7F 8F 00 00
00.650 INF.winmon: ram info scale=32668 offset=0
00.650 INF.init: scale for 0 = 0.010000
00.697 INF.: > 05 FF W 36 01 00
00.806 INF.: < 08 FF W 8E 9C 7F 8F 00 00
00.806 INF.winmon: ram info scale=32668 offset=0
00.806 INF.init: scale for 1 = 0.010000
00.884 INF.: > 05 FF W 36 02 00
00.978 INF.: < 08 FF W 8E 9C 7F 8F 00 00
00.978 INF.winmon: ram info scale=32668 offset=0
00.978 INF.init: scale for 2 = 0.010000
01.056 INF.: > 05 FF W 36 03 00
01.165 INF.: < 08 FF W 8E 9C 7F 8F 00 00
01.165 INF.winmon: ram info scale=32668 offset=0
01.165 INF.init: scale for 3 = 0.010000
01.212 INF.: > 05 FF W 36 04 00
01.306 INF.: < 08 FF W 8E 9C 7F 8F 00 00
01.306 INF.winmon: ram info scale=32668 offset=0
01.306 INF.init: scale for 4 = 0.010000
01.352 INF.: > 05 FF W 36 05 00
01.446 INF.: < 08 FF W 8E 64 80 8F 00 00
01.446 INF.winmon: ram info scale=-32668 offset=0
01.446 INF.init: scale for 5 = 0.010000
01.508 INF.: > 05 FF W 36 06 00
01.602 INF.: < 08 FF W 8E 9C 7F 8F 00 00
01.602 INF.winmon: ram info scale=32668 offset=0
01.602 INF.init: scale for 6 = 0.010000
01.664 INF.: > 05 FF W 36 07 00
01.758 INF.: < 08 FF W 8E 57 78 8F 00 01
01.758 INF.winmon: ram info scale=30807 offset=256
01.758 INF.init: scale for 7 = 0.000510