Skip to content

air-conditioner

Description

The air-conditioner block is used to integrate an air conditioner controlled over Modbus RTU via RS485. The block periodically reads the device state and allows it to be controlled from the logic project and through the associated vlogic virtual device.

The block supports five independent functional areas:

  • reference temperature
  • work mode
  • blowing force
  • current temperature
  • device on/off state

Each of these areas can be enabled or disabled independently in the configuration. If a given area is disabled, the block does not read it from Modbus and does not react to commands related to it.

The block has one main input and three inputs labeled with the tag block, used to force the device off, force heating, or force cooling. It does not expose standard logic outputs. Its state is visible mainly through the virtual device associated with the block.

The first read from the device takes place about 2 seconds after project initialization is finished. Subsequent reads are performed cyclically every refreshInterval milliseconds.

Configuration parameters

Parameter name Value
Name (name) Optional block name.
Device model (deviceModel) Optional text passed to the virtual device as the air conditioner model. The value Mitsubishi BMS i-MXW selects the built-in register map for this model.
Device address (deviceAddress) Required Modbus slave address in the range 1 to 255.
Byte order (endianess) Required method of interpreting multi-byte data. Allowed values: LittleEndian, BigEndian, SwapBytes, SwapWords.
Refresh interval (refreshInterval) Required time between consecutive read cycles in milliseconds. Allowed range: 1-3600000 ms.
Response timeout (responseTimeout) Required maximum time to wait for the device response in milliseconds. Allowed range: 10-60000 ms.
RS485 configuration (server) Required identifier of the modbus-client block from which the RS485 port configuration is taken.

For configuration based on the generic register map, the parameters of the individual functional areas described below must also be provided, including endianess and the addresses, function codes, and value types of the corresponding registers.

For the Mitsubishi BMS i-MXW model, the block uses a built-in register map. The built-in handling covers device on/off, work mode, reference temperature, blowing force, and current temperature. In this configuration, endianess and the generic register map for these functions do not need to be provided. The required common parameters are deviceAddress, refreshInterval, responseTimeout, and server. The i-MXW device address must be in the 1-60 range.

For the Mitsubishi BMS i-MXW model, the referenced RS485 configuration must use 9600 8N1, no parity, and 1 stop bit.

Reference temperature

Parameter name Value
Enable reference temperature (enableReferenceTemperature) Enables reading and writing of the reference temperature.
Reference temperature register address (referenceTemperatureRegisterAddress) Register address in the range 0-65535.
Reference temperature function code (referenceTemperatureFunctionCode) Read/write mode. Allowed values: 0x03/0x06 or 0x03/0x10.
Reference temperature value type (referenceTemperatureValueType) Data type stored in the register. For 0x03/0x06, only SIGNED_NUMBER16 and UNSIGNED_NUMBER16 are allowed. For 0x03/0x10, the allowed values are SIGNED_NUMBER16, UNSIGNED_NUMBER16, SIGNED_NUMBER32, UNSIGNED_NUMBER32, and FLOAT.
Reference temperature multiplier/divisor (referenceTemperatureMultiplierDivisor) Value in the range 1-4294967295. When reading, the value from Modbus is divided by this parameter. When writing, the reference temperature is multiplied by it.
Minimum reference temperature (referenceTemperatureMin) Minimum allowed temperature value. It cannot be lower than 0°C.
Maximum reference temperature (referenceTemperatureMax) Maximum allowed temperature value. It cannot be higher than 80°C.

The minimum temperature must be lower than the maximum temperature. If a value outside the configured range is sent to the input, the block does not report a user-visible error. Instead, it clamps the written value to the configured minimum or maximum.

For the Mitsubishi BMS i-MXW model, the reference temperature range depends on the currently read work mode:

  • cooling: 10.0-30.0°C
  • heating: 10.0-30.0°C
  • auto/dead zone: 18.0-30.0°C
  • ventilation only: reference temperature changes are ignored

The range visible in the virtual device is updated only after the real work mode has been read from the device. Internal temperature limits configured in the i-MXW device are not read by the block. If the device's real limits are narrower than the range shown by the block, the device may reject a temperature write.

Work mode

Parameter name Value
Enable work mode (enableWorkMode) Enables reading and writing of the work mode.
Work mode register address (workModeRegisterAddress) Register address in the range 0-65535.
Work mode function code (workModeFunctionCode) Allowed values: 0x03/0x06 or 0x03/0x10.
Work mode value type (workModeValueType) Allowed values: UNSIGNED_NUMBER16 or UNSIGNED_NUMBER32.
Heating mode value (workModeHeatingValue) Number written to the register for heating mode.
Cooling mode value (workModeCoolingValue) Number written to the register for cooling mode.
Auto mode value (workModeAutoValue) Number written to the register for auto mode.

At least 2 out of the 3 values heating, cooling, and auto must be configured. Configured values must be unique.

The virtual device may also expose ventilation-only mode if it is supported by a specific device model. For configuration based on the generic register map, mode availability is determined only by the workModeHeatingValue, workModeCoolingValue, and workModeAutoValue values.

For the Mitsubishi BMS i-MXW model, the supported modes are cooling, heating, auto/dead zone, and ventilation only.

Blowing force

Parameter name Value
Enable blowing force (enableBlowingForce) Enables reading and writing of the blowing force.
Blowing force register address (blowingForceRegisterAddress) Register address in the range 0-65535.
Blowing force function code (blowingForceFunctionCode) Allowed values: 0x03/0x06 or 0x03/0x10.
Blowing force value type (blowingForceValueType) For 0x03/0x06, only UNSIGNED_NUMBER16 is allowed. For 0x03/0x10, the allowed values are UNSIGNED_NUMBER16 and UNSIGNED_NUMBER32.
Minimum blowing intensity (blowingForceMinimumIntensity) Minimum allowed intensity value.
Maximum blowing intensity (blowingForceMaximumIntensity) Maximum allowed intensity value.

The minimum intensity must be lower than the maximum intensity.

For the Mitsubishi BMS i-MXW model, the blowing force range is 0-3, where 0 means automatic fan speed, and 1, 2, and 3 mean minimum, medium, and maximum speed respectively.

Current temperature

Parameter name Value
Enable current temperature (enableCurrentTemperature) Enables reading of the current temperature.
Current temperature register address (currentTemperatureRegisterAddress) Register address in the range 0-65535.
Current temperature read function code (currentTemperatureReadFunctionCode) Allowed values: 0x03 for holding registers or 0x04 for input registers.
Current temperature value type (currentTemperatureValueType) Allowed values: SIGNED_NUMBER16, UNSIGNED_NUMBER16, SIGNED_NUMBER32, UNSIGNED_NUMBER32, FLOAT.
Current temperature divisor (currentTemperatureDivisor) Value in the range 1-4294967295. After reading, the register value is divided by this parameter.

For the Mitsubishi BMS i-MXW model, the current temperature is selected from the sensors in the following order: T1, T2, T3. If a sensor has an active fault alarm, the block skips it and tries to use the next sensor. If no valid temperature can be obtained from any sensor, the current temperature value in the virtual device changes to the unknown state.

Device on/off state

Parameter name Value
Enable device power control (enableOnOffDevice) Enables reading and writing of the device on/off state.
Register or coil address (onOffDeviceRegisterAddress) Address in the range 0-65535.
On/off function code (onOffDeviceFunctionCode) Allowed values: 0x01/0x05, 0x03/0x06, 0x03/0x10.
On/off value type (onOffDeviceValueType) Allowed values: UNSIGNED_NUMBER16 or UNSIGNED_NUMBER32.
Value representing the ON state (onDeviceValue) Value written and recognized as the ON state.
Value representing the OFF state (offDeviceValue) Value written and recognized as the OFF state.

The onDeviceValue and offDeviceValue values must be different. For the 0x01/0x05 mode, only the values 0 and 1 make sense.

Input handling

The block has one main input. The following data types are supported:

  • cooling command from the command block: switches the device to cooling mode
  • heating command from the command block: switches the device to heating mode
  • auto command from the command block: switches the device to auto mode
  • up command from the command block: increases the blowing force by 1
  • down command from the command block: decreases the blowing force by 1
  • logical value true: turns the device on
  • logical value false: turns the device off
  • numeric value: sets the reference temperature

Additional operating rules:

  • The cooling, heating, and auto commands from the command block work only when work mode handling is enabled and the corresponding register value has been configured.
  • The up and down commands from the command block work only when blowing force handling is enabled and the block knows the current value read from the device.
  • up and down never go outside the configured minimum and maximum intensity range.
  • A numeric value received at the input is interpreted as the reference temperature. When writing, the block limits it to the referenceTemperatureMin - referenceTemperatureMax range.
  • Values that do not match any of the rules above are ignored.

Inputs labeled with the tag block

Input line Action
tag1 Forces the air conditioner off.
tag2 Forces heating mode while the air conditioner is operating.
tag3 Forces cooling mode while the air conditioner is operating.

Each of these lines accepts Boolean values only. true enables the corresponding force, while false disables it. null, all other data types, and tags other than tag1-tag3 are ignored.

The forces are independent, and the resulting operating rule uses the following priorities:

  • forced off takes priority over forced heating and forced cooling,
  • forcing heating and cooling at the same time also results in forced off,
  • if only forced heating or only forced cooling is active, the block keeps the device in the selected mode while it is operating.

Disabling a higher-priority force does not clear the remaining forces. The block then reapplies the rule resulting from their current values, but it does not turn the device on or restore its previous mode.

Forced off requires device on/off handling to be enabled. Forced heating or cooling requires device on/off and work mode handling to be enabled, with the corresponding heating or cooling mode configured. An attempt to enable a force that the device does not support is ignored.

An active forcing rule also applies to commands from sources other than the tag inputs, such as the main input or the associated virtual device:

  • forced off blocks commands that turn the device on,
  • with forced heating or cooling, external work mode change commands are ignored,
  • a command that turns the device off is always allowed.

Forced heating or cooling does not turn an inactive device on by itself. After the device is turned on explicitly or externally, the block tries to set the required mode. During these attempts, the air conditioner may briefly operate in its previous mode. If the required mode is still not confirmed after three attempts, the block turns the device off. It remains off until the next explicit or external turn-on; the block does not turn it on again automatically. The active force remains set, so mode control starts again after the next turn-on.

If multiple sources provide a value for the same tag, the last valid value delivered takes precedence. For project readability, however, connecting one source to each tagged input line is recommended.

When the project is started or reloaded, the initial tag values are restored first, and only then is the resulting operating rule applied. This prevents the device from being controlled according to a temporary combination of values during project initialization.

Block outputs

The air-conditioner block does not expose standard logic outputs for further connections in the flow.

The air conditioner state is exposed through the associated virtual device. This device provides:

  • reference temperature
  • allowed reference temperature range
  • work mode and information about which modes are available
  • blowing force together with the range of allowed values
  • current temperature
  • on/off state
  • device model

Each of these values can have one of three states:

  • valid value
  • unknown value, when reading failed or the device returned data outside the expected range
  • disabled value, when the given functional area was not enabled in the configuration

The virtual device also shows the forced off, forced heating, and forced cooling states. These three states are read-only and can only be changed from the logic project through the corresponding tag inputs.

Block status description

During normal operation, the status visible below the block shows the currently available air conditioner data. Configuration error messages and RS485 layer problems take precedence over the device data description.

The description consists of segments separated by |. The segments always appear in the following order:

  1. power state: On, Off, or Power ?
  2. work mode: Heating, Cooling, Auto, Ventilation, or Mode ?
  3. current temperature: Temp <value>°C or Temp ?
  4. reference temperature: Set <value>°C or Set ?
  5. blowing force: Fan <value> or Fan ?

For the Mitsubishi BMS i-MXW model, automatic fan speed is shown as Fan Auto. Functional areas disabled in the configuration are omitted from the description. A ? means that an area is enabled but its value is currently unknown. It is shown in a partial description when at least one other value is available.

Example of a complete description:

On | Cooling | Temp 24.5°C | Set 22°C | Fan 2

Example of a partial description:

On | Mode ? | Temp 24.5°C | Set ? | Fan 2

After the device is confirmed to be off, the work mode, reference temperature, and blowing force are hidden. If current temperature reading is enabled, the description is, for example, Off | Temp 24.5°C or Off | Temp ?. If that reading is disabled, the description is Off.

If at least one reading is enabled but the block has not yet received any valid value, it shows Waiting for device data. When all enabled values are unknown and the built-in limit of consecutive unavailable results is reached for at least one of them, the description changes to Device data unavailable. This applies both to failed reads and to repeated successfully received responses containing unrecognized or disallowed values. If at least one value remains available, the block shows a partial description with ? for the remaining values instead of either of these messages.

If none of the five readings is enabled, the description remains Working.

Errors visible to the user

The block can display the following error messages:

Error code Error description
Invalid name configuration. The name parameter has an invalid format.
Invalid device model configuration. The deviceModel parameter has an invalid format.
Invalid device address configuration. The deviceAddress parameter is invalid or outside the 1-255 range.
Invalid endianess configuration. The endianess parameter has an unsupported value.
Invalid refresh interval configuration. The refreshInterval parameter is invalid or outside the 1-3600000 ms range.
Invalid response timeout configuration. The responseTimeout parameter is invalid or outside the 10-60000 ms range.
Missing RS485 configuration. The server parameter does not point to a valid modbus-client block.
Mitsubishi BMS i-MXW requires RS485 baudrate 9600. The Mitsubishi BMS i-MXW model requires RS485 baudrate 9600.
Mitsubishi BMS i-MXW requires RS485 parity none. The Mitsubishi BMS i-MXW model requires RS485 parity set to none.
Mitsubishi BMS i-MXW requires RS485 stop bits 1. The Mitsubishi BMS i-MXW model requires 1 RS485 stop bit.
Invalid enable reference temperature configuration. The enableReferenceTemperature parameter is not a valid logical value.
Invalid reference temperature register address configuration. The referenceTemperatureRegisterAddress parameter is invalid or outside the 0-65535 range.
Invalid reference temperature function code configuration. The referenceTemperatureFunctionCode parameter has an unsupported value.
Invalid reference temperature value type configuration. The referenceTemperatureValueType parameter is invalid or incompatible with the selected function code.
Invalid multiplier/divisor configuration. The referenceTemperatureMultiplierDivisor parameter is invalid or outside the 1-4294967295 range.
Invalid reference temperature minimum value. The referenceTemperatureMin parameter is invalid or lower than 0°C.
Invalid reference temperature maximum value. The referenceTemperatureMax parameter is invalid or higher than 80°C.
Invalid reference temperature minimum/maximum values. The minimum reference temperature is not lower than the maximum.
Invalid enable work mode configuration. The enableWorkMode parameter is not a valid logical value.
Invalid work mode register address configuration. The workModeRegisterAddress parameter is invalid or outside the 0-65535 range.
Invalid work mode function code configuration. The workModeFunctionCode parameter has an unsupported value.
Invalid work mode value type configuration. The workModeValueType parameter has an unsupported value.
Missing heating/cooling/auto value configuration. Fewer than two modes among heating, cooling, and auto were configured.
Duplicate heating/cooling work mode value configuration. The heating and cooling modes have the same register value.
Duplicate heating/auto work mode value configuration. The heating and auto modes have the same register value.
Duplicate cooling/auto work mode value configuration. The cooling and auto modes have the same register value.
Invalid enable blowing force configuration. The enableBlowingForce parameter is not a valid logical value.
Invalid reference temperature register address configuration. This message can also appear for an invalid blowingForceRegisterAddress parameter. Despite its name, it then refers to the blowing force register address.
Invalid blowing force function code configuration. The blowingForceFunctionCode parameter has an unsupported value.
Invalid blowing force value type configuration. The blowingForceValueType parameter is invalid or incompatible with the selected function code.
Invalid blowing force minimum intensity configuration. The blowingForceMinimumIntensity parameter is invalid.
Invalid blowing force maximum intensity configuration. The blowingForceMaximumIntensity parameter is invalid.
Invalid blowing force minimum/maximum intensity configuration. The minimum blowing force is not lower than the maximum.
Invalid enable current temperature configuration. The enableCurrentTemperature parameter is not a valid logical value.
Invalid current temperature register address configuration. The currentTemperatureRegisterAddress parameter is invalid or outside the 0-65535 range.
Invalid current temperature read function code configuration. The currentTemperatureReadFunctionCode parameter has an unsupported value.
Invalid current temperature value type configuration. The currentTemperatureValueType parameter has an unsupported value.
Invalid current temperature divisor configuration. The currentTemperatureDivisor parameter is invalid or outside the 1-4294967295 range.
Invalid enable on off device configuration. The enableOnOffDevice parameter is not a valid logical value.
Invalid current temperature register address configuration. This message can also appear for an invalid onOffDeviceRegisterAddress parameter. Despite its name, it then refers to the register or coil address responsible for turning the device on and off.
Invalid on off device function code configuration. The onOffDeviceFunctionCode parameter has an unsupported value.
Invalid on off device value type configuration. The onOffDeviceValueType parameter has an unsupported value.
Invalid on device value configuration. The onDeviceValue parameter is invalid or incompatible with the selected write method.
Invalid off device value configuration. The offDeviceValue parameter is invalid or incompatible with the selected write method.
Expected different on/off device value configuration. onDeviceValue and offDeviceValue have the same value.
RS485 setup incomplete. The runtime does not yet have a complete RS485 configuration.
RS485 port missing. No RS485 port is available in the runtime for communication with the device.

Examples

  • If the cooling command from the command block is sent to the main input, the block writes the value configured in workModeCoolingValue to the register.
  • If the value true is sent to the main input, the block writes the ON state defined by onDeviceValue.
  • If the number 31 is sent to the main input and the maximum reference temperature is 28, the block writes the value corresponding to 28 to the device.
  • If the current blowing force is 2 and the up command from the command block is sent to the input, the new value is increased to 3, as long as it still fits within the allowed range.
  • If current temperature reading is enabled but consecutive reads from the device keep failing, the virtual device shows this value as unknown instead of keeping the last failed read as if it were valid.