---
title: "KNX Group Object DPT2"
canonical: "https://docs.cuesystem.com/space/CVCHELP/525172737/KNX%20Group%20Object%20DPT2"
format: markdown
---
> Macro (toc)

---

# Description

KNX Group Object DPT2 (1 Bit with priority control) is intended for applications offering a priority control that has precedence over the normal (manual) operation. In other words, if an actuator is switched via its priority datapoint, switching via its usual DPT1.xxx group objects is disabled. Switching with priority is ensured via 2-bit datapoint types.

|  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Field |  |  |  |  |  |  | c | b |

# DPT Dimensions

|  |  |  |  |
| --- | --- | --- | --- |
| DPT Dimensions | Name | c | b |
|  |  | 0 = no control | according to DPT1 |
|  |  | 1 = control |  |
| 2.001 | switch control | See table below |
| 2.002 | boolean control |
| 2.003 | enable control |
| 2.004 | ramp control |
| 2.005 | alarm control |
| 2.006 | binary value control |
| 2.007 | step control |
| 2.008 | direction 1 control |
| 2.009 | direction 2 control |
| 2.010 | start control |
| 2.011 | state control |
| 2.012 | invert control |

|  |  |  |
| --- | --- | --- |
| c | b |  |
| 0 | 0 | no control |
| 0 | 1 | no control |
| 1 | 0 | control, function value 0 |
| 1 | 1 | control, function value 1 |

# WriteValue

This function transmits the KNX telegram, including the Boolean newvalue and newcontrol, to the group address defined in the driver property. This function returns True if the function success, else it returns False. A function GetLastError returns the error number that occurred while executing the command. The errors that can happen: <u>[10000](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10000)</u>, <u>[10002](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10002)</u>, <u>[10003](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10003)</u>, <u>[10004](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10004)</u>.

#### Syntax

```visualbasic
Function WriteValue (
  newvalue As Boolean,
  newcontrol As Boolean,
  Optional highpriority As Boolean := False) 
As Boolean
```

#### Parameters

newvalue

Boolean It is the new (function) value sent to the KNX bus.

newcontrol

Boolean It is the new priority control sent to the KNX bus.

highpriority

Boolean Optional, defaults to False. If False, the command is applied with standard priority on the KNX bus. If it is True, the command is applied with a high priority on the KNX bus.

#### Return value

Boolean This function returns True on success or False if an error occurs. A function GetLastError returns the error number.

#### Example

```visualbasic
// Instance of Group object device driver DPT2 is named ObjectDPT2.

ObjectDPT2.WriteValue (True, True)

// Value True (1) with priority control (1) is sent to the given group object on the KNX bus
```

# GetValue

This function returns the last Boolean (function) value of the group object with the given address received from the KNX bus.

#### Syntax

```visualbasic
Function GetValue() As Boolean
```

#### Return value

Boolean It is the last received (function) value of the group object.

# GetControl

This function returns the last Boolean priority control of the group object with the given address received from the KNX bus.

#### Syntax

```visualbasic
Function GetControl() As Boolean
```

#### Return value

Boolean It is the last received priority control of group object.

# OnUpdate

This event is raised when receiving the KNX telegram with the appropriate group address. It returns a Boolean value from the KNX telegram.

#### Syntax

```visualbasic
Event OnUpdate As Process(newvalue As Boolean, newcontrol As Boolean)
```

#### Parameters

newvalue

Boolean It is the new (function) value of a group object.

newcontrol

Boolean It is the new priority control of group object.

#### Example

```visualbasic
// Module DeviceEvents
// Instance of Group object device driver DPT2 is named ObjectDPT2.

Private Process ObjectDPT2_OnUpdate( newvalue As Boolean, newcontrol As Boolean ) Link ObjectDPT2.OnUpdate
  Page1.IndicatorDPT2Value.SetValue(newvalue)
  Page1.IndicatorDPT2Control.SetValue(newcontrol)
End Process

// Graphic object IndicatorDPT2Value displays (function) value of group   // object received from KNX bus
// Graphic object IndicatorDPT2Control displays priority control of group // object received from KNX bus
```