---
title: "Device Type 8 (DT8) ballast"
canonical: "https://docs.cuesystem.com/space/CVCHELP/550502418/Device%20Type%208%20(DT8)%20ballast"
format: markdown
---
> Macro (toc)

---

# Introduction

The Device Type 8 is to operate with lighting control gear (ballast) providing Color control it means the control gear that can change its light color according to IEC-62386.

The DT8 is recognizing four mechanisms how to set appropriate color and these mechanisms are defining four different Color Types:

- **XY-Coordinate**
  - the output color must correspond as closely as possible to the point in color space diagram IEC1931

- **Tc-Color Temperature**
  - temperature of Planckian black body radiator whose perceived color most closely resembles that of given stimulus at the same brightness and under specified viewing conditions
- **PrimaryN**
  - This color type gives direct control of the light intensity of each available primary output channel - each representing single output channel of the light. Up to 6 Primary channels is supported.

- **RGBWAF**
  - Color type, in which the output channels of the control gear can be associated with Red(R), Green(G), Blue(B), White(W), Amber(A) and Freecolor(F)

Each DT8 control gear must support at least one of the color types mentioned above.

All the commands for Device Type 8 are starting with:”DT8_”. These commands do not have any effect if applied on ballasts or control gears of any other Device Type than Device Type 8.

Note that all following DALI Channel commands are automatically sending throgh DALI bus the message to Enable DT8 which must be issued prior any executive command for DT8.

<u>**Querry commands:**</u>

To Query info about just active Color/Brightness the principle of Report Color values is used:

When using command **QuerryActualLevel**()[https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/522387457/DALI+ballast#QueryActualLevel](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/522387457/DALI+ballast#QueryActualLevel)  or command **QuerryActualLevelBin**()[https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/522387457/DALI+ballast#QueryActualLevelBin](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/522387457/DALI+ballast#QueryActualLevelBin)  it causes that all values describing current Color are stored in Report Value registers. The ReportColorType is the essential one to recognize with which set of parameters the Color value is described. These params are then accessible by DT8_QuerryReportXXX() commands.

<u>**Note:**</u>

The DALI communication is rather slow and as most of commands for Device Type 8 needs to send more packets of data then the throughput of  DALI could cause significant delays when executing these commands.  This feature of DALI must be taken in account in the way how to programm requested tasks.  For example when programming R,G,B sliders on touchpannel  to work with SetCollorRGB() commands: You must keep in mind that  each slider can generate many new levels while SetCollorRGB() command is executing just the single value change.  One possible solution how to program similar task with this slow bus can be found in  “DALI_DT8_Example“ template in CVC installation. 


# DT8_Activate

This function provides activation of predefined Color preset by commands SetCollorXXXX with parameter activatenow:=FALSE     

#### Syntax

```visualbasic
Function DT8_Activate()
```

#### Example

```visualbasic
DALI_Ballast_DT8_1.DT8_Activate()     // Activate ballast
```

# DT8_QueryColorStatus

The function returns the 8—bit ‘Color STATUS' information byte:   

|  |  |
| --- | --- |
| Bit | Description |
| bit 0 | XY-Coordinate Color point out of range; '0' = No |
| bit 1 | Color temperature Tc out of range; '0' = No |
| bit 2 | Auto calibration running; '0' = No |
| bit 3 | Auto calibration successful; '0' = No |
| bit 4 | Color type XY-Coordinate active; '0' = No |
| bit 5 | Color type Color Temperature Tc active; '0' = No |
| bit 6 | Color type primary N active; '0' = No |
| bit 7 | Color type RGBWAF active; '0' = No |

           

#### Syntax

```visualbasic
Function DT8_QueryColorStatus() As Byte
```

#### Example

```visualbasic
Var b As Byte

b:= DALI_Ballast_DT8.DT8_QueryColorStatus()     //get ColorStatus
```

# DT8_QueryColorTemperatureTcPhysicalCoolest

The function returns the Color Temperature Physical Coolest which means the Temperature in Kelvin of coolest color physically possible     

#### Syntax

```visualbasic
Function DT8_QueryColorTemperatureTcPhysicalCoolest() As Double
```

#### Example

```visualbasic
Var TcPhCoolest As Double //

TcPhCoolest:= DALI_Ballast_DT8.DT8_QueryColorTemperatureTcPhysicalCoolest()
//get Color Temperature Physical Coolest in Kelvin
```

# DT8_QueryColorTemperatureTcPhysicalWarmest

The function returns the Color Temperature Physical Warmest which means the Temperature in Kelvin of the warmest color physically possible   

#### Syntax

```visualbasic
Function DT8_QueryColorTemperatureTcPhysicalWarmest() As Double
```

#### Example

```visualbasic
Var TcPhWarmest As Double

TcPhWarmest:= DALI_Ballast_DT8.DT8_QueryColorTemperatureTcPhysicalWarmest()
//get Color Temperature Physical Warmest in Kelvin
```

# DT8_QueryColorTemperatureTc

The function returns the current value of Color Temperature Tc in Kelvin

#### Syntax

```visualbasic
Function DT8_QueryColorTemperatureTc() As Double
```

#### Example

```visualbasic
Var Tc As Double

Tc:= DALI_Ballast_DT8.DT8_QueryColorTemperatureTc()
//get ColorTemperatureTc in Kelvin
```

# DT8_QueryColorTemperatureTcCoolest

The function returns the Color Temperature Tc Coolest which means the Temperature Tc in Kelvin of coolest color possible      

#### Syntax

```visualbasic
Function DT8_QueryColorTemperatureTcCoolest() As Double
```

#### Example

```visualbasic
Var TcCoolest As Double //

TcCoolest:= DALI_Ballast_DT8.DT8_QueryColorTemperatureTcCoolest()
//get ColorTemperatureTcCoolest in Kelvin
```

# DT8_QueryColorTemperatureTcWarmest

The function returns the Color Temperature Tc Warmest which means the Temperature Tc in Kelvin of the warmest color possible        

#### Syntax

```visualbasic
Function DT8_QueryColorTemperatureTcWarmest() As Double
```

#### Example

```visualbasic
Var TcWarmest As Double //

TcWarmest:= DALI_Ballast_DT8.DT8_QueryColorTemperatureTcWarmest()
//get ColorTemperatureTcWarmest in Kelvin
```

# DT8_QueryColorTypeFeatures

The function returns the 8—bit ‘Color Type Features' information byte. It holds info about Color type(s) supported by the control gear: 

|  |  |
| --- | --- |
| Bit | Description |
| bit 0 | XY-Coordinate capable; '0' = No |
| bit 1 | Tc-Color Temperature capable; '0' = No |
| bit 2-4 | Number of primaries; '0-6' |
| bit 5-7 | Number of RGBWAF channels; '0-6' |

A Value of ‘0' for number of primaries or number of RGBWAF channels means that these Color types are Not supported.

#### Syntax

```visualbasic
Function DT8_QueryColorTypeFeatures() As Byte
```

#### Example

```visualbasic
Var b As Byte

b:= DALI_Ballast_DT8.DT8_QueryColorTypeFeatures()    
//get ColorTypeFeatures
```

# DT8_QueryGearFeaturesStatus

The function returns the 8—bit GearFeaturesStatus information byte:  

|  |  |
| --- | --- |
| Bit | Description |
| bit 0 | Automatic Activation; '0' = No |
| bit 1-5 | Reserved; '0' = default Value |
| bit 6 | Auto calibration supported; '0' = No |
| bit 7 | Auto calibration recovery supported; '0' = No |

#### Syntax

```visualbasic
Function DT8_QueryGearFeaturesStatus() As Byte
```

#### Example

```visualbasic
Var b As Byte

b:= DALI_Ballast_DT8.DT8_QueryGearFeaturesStatus()    
//get GearFeaturesStatus
```

# DT8_QueryReportColorType

The function returns the 8—bit ReportColorType information byte:

|  |  |
| --- | --- |
| Value | Color Type |
| &H10 | XY-Coordinate |
| &H20 | Tc-Color Temperature |
| &H40 | PrimaryN |
| &H80 | RGBWAF |

#### Syntax

```visualbasic
Function DT8_QueryReportColorType() As Byte
```

#### Example

```visualbasic
Var colorType As Byte

colorType:= DALI_Ballast_DT8.DT8_QueryReportColorType()    
//get ReportColorType
```

# DT8_QueryReportRLevel

# DT8_QueryReportGLevel

# DT8_QueryReportBLevel

# DT8_QueryReportWLevel

# DT8_QueryReportALevel

# DT8_QueryReportFLevel

The function returns the current value Report Color R/G/B/W/A/F . The relevant return values can be expected only if ReportColorType indicates RGBWAF color type. This command returns Level value 0-254.   

#### Syntax

```visualbasic
Function DT8_QueryReportRLevel() As Byte
```

#### Example

```visualbasic
Var level     As Double
Var XCoordinate As Double
Var YCoordinate As Double
Var colorTempTc As Double
Var primN[6]  As Long
Var red       As Byte
Var green     As Byte
Var blue      As Byte
Var colorType As Byte
Var i         As Byte

//…

level := DALI_Ballast_DT8.QueryActualLevel()  //color info stored in Report Value
colorType:= DALI_Ballast_DT8.DT8_QueryReportColorType()    
//get info about color type

Select colorType
  Case &H10 //for XY-Coordinate color type
    XCoordinate:= DALI_Ballast_DT8.DT8_QueryReportXCoordinate()    
    YCoordinate:= DALI_Ballast_DT8.DT8_QueryReportYCoordinate()    
    //get Report X Y Coordinates
  Case &H20 //for Tc-Color Temperature color type
    colorTempTc:= DALI_Ballast_DT8.DT8_QueryReportTemperatureTc()    
    //get ReportTemperatureTc
  Case &H40 //for PrimaryN color type
    For i:=1 to 6
      primN[i] := DALI_Ballast_DT8.DT8_QueryReportPrimaryNBin(i-1)
    End For
  Case &H80 //for RGBWAF color type
    red  := DALI_Ballast_DT8.DT8_QueryReportRLevel()
    green:= DALI_Ballast_DT8.DT8_QueryReportGLevel()
    blue := DALI_Ballast_DT8.DT8_QueryReportBLevel()
    //get Report R,G,B
End Select

//…
```

# DT8_QueryReportPrimaryNBin

The function returns the  Report Level of one PrimaryN channel

Return value is in range 0 - 65534

The relevant return values can be expected only if ReportColorType indicates PrimaryN color type.

#### Syntax

```visualbasic
Function DT8_QueryReportPrimaryNBin(primaryNo /*0-5*/ As Byte) As Long
```

#### Parameters

primaryNo

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> primary channel number 0 – 5 (Max 6 primary channels are supported)

#### Example

```visualbasic
Var primN1 As Long
Var primN2 As Long
Var primN3 As Long
Var primN4 As Long
Var primN5 As Long
Var primN6 As Long

primN1 := DALI_Ballast_DT8.DT8_QueryReportPrimaryNBin(0)     
primN2 := DALI_Ballast_DT8.DT8_QueryReportPrimaryNBin(1)     
primN3 := DALI_Ballast_DT8.DT8_QueryReportPrimaryNBin(2)     
primN4 := DALI_Ballast_DT8.DT8_QueryReportPrimaryNBin(3)     
primN5 := DALI_Ballast_DT8.DT8_QueryReportPrimaryNBin(4)     
primN6 := DALI_Ballast_DT8.DT8_QueryReportPrimaryNBin(5)     
//get ReportPrimaryN levels for channels 1-6
```

# DT8_QueryReportTemperatureTc

The function returns the Report Tc-Color Temperature value in Kelvin.

Return value is in range 15.6 – 1000000 Kelvin.

The relevant return values can be expected only if ReportColorType indicates Tc-Color Temperature color type.

#### Syntax

```visualbasic
Function DT8_QueryReportTemperatureTc() As Double
```

#### Example

```visualbasic
Var colorTempTc As Double

colorTempTc:= DALI_Ballast_DT8.DT8_QueryReportTemperatureTc()    
//get ReportTemperatureTc
```

# DT8_QueryReportTemperatureTcMirek

The function returns the Report Tc-Color Temperature value in Mirek

Mirek = 1000000/Tc  where Tc is temperature in Kelvin

Return value is in range 1 - 65534 Mirek.

The relevant return values can be expected only if ReportColorType indicates Tc-Color Temperature color type.

#### Syntax

```visualbasic
Function DT8_QueryReportTemperatureTcMirek() As Long
```

#### Example

```visualbasic
Var colorTempTcM As Long

colorTempTcM:= DALI_Ballast_DT8.DT8_QueryReportTemperatureTcMirek()    
//get ReportTemperatureTcMirek
```

# DT8_QueryReportXCoordinate

The function returns the Report X coordinate of the point in color space according to CIE1931. Return value is in range: 0 - 0.99997.

The relevant return values can be expected only if ReportColorType indicates XY-Coordinate color type.

#### Syntax

```visualbasic
Function DT8_QueryReportXCoordinate() As Double
```

#### Example

```visualbasic
Var Xcoordinate As Double

Xcoordinate:= DALI_Ballast_DT8.DT8_QueryReportXCoordinate()    
//get ReportXCoordinate
```

# DT8_QueryReportXCoordinateBin

The function returns the Report X coordinate of the point in color space according to CIE1931 recalculated into return value  (X * 65535).

Return value is in range : 0 - 65534.

The relevant return values can be expected only if ReportColorType indicates XY-Coordinate color type.

#### Syntax

```visualbasic
Function DT8_QueryReportXCoordinateBin() As Long
```

#### Example

```visualbasic
Var XcoordinateBin As Long

XcoordinateBin:= DALI_Ballast_DT8.DT8_QueryReportXCoordinateBin()    
//get ReportXCoordinate in binary
```

# DT8_QueryReportYCoordinate

The function returns the Report Y coordinate of the point in color space according to CIE1931. Return value is in range : 0 - 0.99997.

The relevant return values can be expected only if ReportColorType indicates XY-Coordinate color type.

#### Syntax

```visualbasic
Function DT8_QueryReportYCoordinate() As Double
```

#### Example

```visualbasic
Var YCoordinate As Double

YCoordinate:= DALI_Ballast_DT8.DT8_QueryReportYCoordinate()    
//get ReportYCoordinate
```

# DT8_QueryReportYCoordinateBin

The function returns the Report Y coordinate of the point in color space according to CIE1931 recalculated into return value:  (Y * 65535).

Return value is in range : 0 - 65534.

The relevant return values can be expected only if ReportColorType indicates XY-Coordinate color type.

#### Syntax

```visualbasic
Function DT8_QueryReportYCoordinateBin() As Long
```

#### Example

```visualbasic
Var YCoordinateBin As Long

YCoordinateBin:= DALI_Ballast_DT8.DT8_QueryReportYCoordinateBin()    
//get ReportXCoordinate in binary
```

# DT8_SetColorPrimaryNBin

The function sets the dimming level for one PrimaryN channel

This command can have effect only if the control gear on the specified address supports the PrimaryN color type.

Execution time: approx. **360ms**.

#### Syntax

```visualbasic
Function DT8_SetColorPrimaryNBin(
  dimmlevelBin As Long, 
  primaryNo /*0-5*/ As Byte, 
  Optional activatenow As Boolean :=True)
```

#### Parameters

dimmlevelBin

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> dimming level in range 0 – 65534, value 65535 means no change

primaryNo

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> primary channel number 0 – 5 (Max 6 primary channels are supported)

activatenow

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the color change will have immediate effect on output light. **False** means that output light will be changed to new specified color value by nearest activate.

#### Example

```visualbasic
DALI_Ballast_DT8.DT8_SetColorPrimaryNBin(65534, 0)   
DALI_Ballast_DT8.DT8_SetColorPrimaryNBin(65534, 1)   
DALI_Ballast_DT8.DT8_SetColorPrimaryNBin(65534, 2)   
DALI_Ballast_DT8.DT8_SetColorPrimaryNBin(65534, 3)   
DALI_Ballast_DT8.DT8_SetColorPrimaryNBin(65534, 4)   
DALI_Ballast_DT8.DT8_SetColorPrimaryNBin(65534, 5)   
//set PrimaryN max levels for channels 1-6
```

# DT8_SetColorRGB

The function sets the levels for RGB lighting channels

This command can have effect only if the control gear on the specified address supports the RGBWAF color type.

Execution time: approx. **360ms**.

#### Syntax

```visualbasic
Function DT8_SetColorRGB(
  red As Byte, 
  green As Byte, 
  blue As Byte, 
  Optional activatenow As Boolean :=True)
```

#### Parameters

red, green, blue

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> level in range 0 – 254, value 255 means no change

activatenow

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the color change will have immediate effect on output light. **False** means that output light will be changed to new specified color value by nearest activate.

#### Example

```visualbasic
DALI_Ballast_DT8.DT8_SetColorRGB(254,254,254)     
//set R,G,B max levels
```

# DT8_SetColorRGBWAF

The function sets the levels for RGBWAF lighting channels

This command can have effect only if the control gear on the specified address supports the RGBWAF color type.

Execution time: approx. **640ms**.


#### Syntax

```visualbasic
Function DT8_SetColorRGWAFB(
  red As Byte, 
  green As Byte, 
  blue As Byte, 
  white As Byte, 
  amber As Byte, 
  free As Byte, 
  Optional activatenow As Boolean :=True)
```

#### Parameters

red, green, blue, white, amber, free

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> level in range 0 – 254, value 255 means no change

activatenow

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the color change will have immediate effect on output light. **False** means that output light will be changed to new specified color value by nearest activate.

#### Example

```visualbasic
DALI_Ballast_DT8.DT8_SetColorRGBWAF(254,254,254,255,255,255)     
//set R,G,B max levels and W,A,F no change
```

# DT8_SetColorTemperatureTc

The function sets Color Temperature Tc to temperature in Kelvin

This command can have effect only if the control gear on the specified address supports the Tc-Color Temperature color type.

Execution time: approx. **320ms**.


#### Syntax

```visualbasic
Function DT8_SetColorTemperatureTc(
  kelvin As Double, 
  Optional activatenow As Boolean :=True)
```

#### Parameters

kelvin

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> temperature in Kelvin in range 15.4 – 1000000

activatenow

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the color change will have immediate effect on output light. **False** means that output light will be changed to new specified color value by nearest activate.

#### Example

```visualbasic
DALI_Ballast_DT8.DT8_SetColorTemperatureTc(5000)     
// set color temperature Tc to 5000K
```

# DT8_SetColorTemperatureTcMirek

The function sets Color Temperature Tc to temperature specified in Mirek

Mirek = 1000000/Tc  where Tc is temperature in Kelvin

This command can have effect only if the control gear on the specified address supports the Tc-Color Temperature color type.

Execution time: approx. **320ms**.

#### Syntax

```visualbasic
Function DT8_SetColorTemperatureTcMirek(
  mirek As Long, 
  Optional activatenow As Boolean :=True)
```

#### Parameters

mirek

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> temperature in Mirek in range 1 – 1000000

activatenow

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the color change will have immediate effect on output light. **False** means that output light will be changed to new specified color value by nearest activate.

#### Example

```visualbasic
DALI_Ballast_DT8.DT8_SetColorTemperatureTcMirek(200)     
//set color temperature Tc to 5000K = 200Mirek
```

# DT8_SetColorWAF

The function sets the levels for WAF lighting channels

This command can have effect only if the control gear on the specified address supports the RGBWAF color type.

Execution time: approx. **360ms**.

#### Syntax

```visualbasic
Function DT8_SetColorWAF(
  white As Byte, 
  amber As Byte, 
  free As Byte, 
  Optional activatenow As Boolean :=True)
```

#### Parameters

white, amber, free

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> level in range 0 – 254, value 255 means no change

activatenow

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the color change will have immediate effect on output light. **False** means that output light will be changed to new specified color value by nearest activate.

#### Example

```visualbasic
DALI_Ballast_DT8.DT8_SetColorWAF(254,254,254)     
//set W,A,F max levels
```

# DT8_SetColorXY

The function sets Color to color of the point in color space according to CIE1931.

This command can have effect only if the control gear on the specified address supports the XY-Coordinate color type.

Execution time: approx. **540ms**.

#### Syntax

```visualbasic
Function DT8_SetColorXY(
  Xvalue0to1 As Double, 
  Yvalue0to1 As Double, 
  Optional activatenow As Boolean :=True)
```

#### Parameters

Xvalue0to1, Yvalue0to1

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> X,Y coordinates in range : 0 - 0.99997 ,value 1 means no change

activatenow

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the color change will have immediate effect on output light. **False** means that output light will be changed to new specified color value by nearest activate.

#### Example

```visualbasic
DALI_Ballast_DT8.DT8_SetColorXY( 0.6203, 0.270 )  
//set shade of red color
```

# DT8_SetColorXYBin

The function sets light color to color of the point in color space according to CIE1931.

This command can have effect only if the control gear on the specified address supports the XY-Coordinate color type.

Execution time: approx. **540ms**.

#### Syntax

```visualbasic
Function DT8_SetColorXYBin(
  Xbin As Long, 
  Ybin As Long, 
  Optional activatenow As Boolean :=True)
```

#### Parameters

Xbin,Ybin

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Coordinates in range in range 0 – 65534, value 655335 means no change

For point in colorspace with coordinates x,y (both x,y are in range 0-0.99997)

The Xbin value is calculated as 65535*x

The Ybin value is calculated as 65535*y

activatenow

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the color change will have immediate effect on output light. **False** means that output light will be changed to new specified color value by nearest activate.

#### Example

```visualbasic
DALI_Ballast_DT8.DT8_SetColorXYBin(40551,17694 )    
//set shade of red color
```