---
title: "DALI channel"
canonical: "https://docs.cuesystem.com/space/CVCHELP/518914139/DALI%20channel"
format: markdown
---
> Macro (toc)

---

# Introduction

The Digital Addressable Lighting Interface (DALI), international standard IEC-60929, allows to control up to 64 ballasts – sometimes called also DALI gears (with Short Addresses 0-63). The ballasts can be organized in up to 16 Groups (Group addresses 0-15) and in up to 16 scenes (Scene 0-15). Every ballast in the system shall be able to have 1 Short Address, and 16 Group addresses and shall react to broadcast commands. Every ballast shall be able to store levels for 16 scenes, FADE RATE, FADE TIME, MIN LEVEL, MAX LEVEL, POWER-ON, and SYSTEM FAILURE levels. All these parameters are to be set during the DALI configuration and commissioning process. 

The configuration and commissioning of DALI can be accomplished using a wide variety of configuration tools or the plug-in “DALI Config” can be used for this purpose. See section **DALI Config plugin** for further details. 

# Down

This command executes the DALI command "Down" (according to IEC-60929): Dim down for 200ms using the selected FADE RATE. No change if the arc power output is already at the MIN LEVEL. 

#### Syntax 

```visualbasic
Function Down(
  address As Byte, 
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
DALI1.Down(63) // Dim down for 200ms ballast with short address 63
```

# GetDaliPowerState

The function returns info about the DALI bus power state. It returns the following values: 

| Value | Description |
| --- | --- |
| 0 | DALI bus power O.K. |
| 1 | No voltage on DALI bus |
| 2 | Mains voltage on DALI bus |
| 3 | Improper or failed power source supplying DALI bus |

#### Syntax 

```visualbasic
Function GetDaliPowerState () As Byte
```

#### Example 

```visualbasic
If DALI1.GetDaliPowerState () <> 0 Then
  busfail() 
End If 

Function busfail() 
  // service call 
End Function
```

# GetFadeRate

This command returns the value of the FADE RATE parameter. (The FADE RATE parameter is used by Up and Down commands.) 

#### Syntax 

```visualbasic
Function GetFadeRate( 
  address As Byte,  
  Optional isshortaddress As Boolean := True) 
As Double
```

#### Parameter* *

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

#### Return value 

The FADE RATE parameter is set in several steps per second. It can be set to one of 15 possible values. The available values are: 

If the parameter stepspersecond is different than any from the table above, then the nearest one from the table is selected 

#### Example 

```visualbasic
//read FADE RATE value from ballasts with short address 1 
x := DALI1.GetFadeRate(1, True)
```

# GetFadeTime

This command returns the value of the FADE TIME parameter. The FADE TIME parameter is used by SetLevel and SetLevelBin (so called DALI directarc commands).  

#### Syntax 

```visualbasic
Function SetFadeTime(   
  address As Byte,  
  Optional isshortaddress As Boolean := True) 
As Time
```

#### Parameter 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u>  address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>  Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

#### Return value 

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u>  The FADE TIME can be set to one of 16 times. The available times are: 

If the parameter fadetime is set to a different time than any from the table above, then the nearest time from the table is selected 

#### Example 

```visualbasic
//read FADE TIME value from ballasts with short address 5 
t := DALI.GetFadeTime(5)
```

# GoToScene

This command executes the DALI command "GoToScene": it sets the actual arc power level to the level stored for the required scene using the actual predefined FADE TIME. If the ballast does not belong to the required scene, the arc power level remains unchanged. If the lamp is off, it shall be ignited with this command. If the level stored for the required scene is 0 and the lamp is lit on - then the lamp shall be switched off by this command after the predefined FADE TIME. 

#### Syntax 

```visualbasic
Function GoToScene(  
  scene As Byte,  
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

scene 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> scene 0-15  

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10105](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10105)</u>, <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
Const BROADCAST as Byte := 255 

DALI1.GoToScene(6, BROADCAST)   //set scene 6 for all ballast in the system
```

# Off

This command executes the DALI command "Off": extinguish the lamp immediately without fading  

#### Syntax 

```visualbasic
Function Off(
  address As Byte, 
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
DALI1.Off(63) //set ballast with short address 63 to Off state
```

# QueryActualLevel

This command executes the DALI command "QueryActualLevel". It returns the actual level in percent. 

#### Syntax 

```visualbasic
Function QueryActualLevel(
  address As Byte,  
  Optional isshortaddress As Boolean := True) 
As Double
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

#### Return value 

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u>  actual  level in percent 00.0-100.0 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10101](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10101)</u>, <u>[10102](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10102)</u>, <u>[10104](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10104)</u>, <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
//read actual level in percent from ballast with short address 6  
Var myLevel as double  

myLevel := DALI1.QueryActualLevel(6)
```

# QueryActualLevelBin

This command executes the DALI command "QueryActualLevelBin" It returns the actual level in the DALI power arc binary value (in range 0-254). See command SetLevelBin above. 

#### Syntax 

```visualbasic
Function QueryActualLevelBin(  
  address As Byte,  
  Optional isshortaddress As Boolean := True) 
As Byte
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address. 

#### Return value 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> actual  level in DALI power arc binary value ( 0-254) 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10101](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10101)</u>, <u>[10102](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10102)</u>, <u>[10104](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10104)</u>, <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
//read actual level in percent from ballast with short address 6  
Var myBinLevel as Byte  

myBinLevel := DALI1.QueryActualLevelBin(6)
```

# QueryBallast

This command executes the DALI command "QueryBallast": it returns **True** if there is a ballast with the given address that can communicate. The answer shall be** True** or **False.** 

#### Syntax 

```visualbasic
Function QueryBallast(  
  address As Byte,  
  Optional isshortaddress As Boolean := True) 
As Boolean
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10101](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10101)</u>, <u>[10102](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10102)</u>, <u>[10104](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10104)</u>, <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> **True** if there is ballast with the given address that can communicate. Otherwise **False.** 

#### Example 

```visualbasic
//check ballast with short address 63  
If DALI1.QueryBallast(63) Then
  DebugPrint("A63 ready") 
End If
```

# QueryDeviceType

This command executes DALI command "QueryDeviceType": return value shall be an 8 bit number (x = 0 to 255). The basic device types are as follows:

- **0** - for standard/fluorescent lamps
- **1** - for emergency lighting
- **2** - for HID lamps
- **3** - for low-voltage halogen lamps
- **4** - for dimming of incandescent lamps
- **5** - for conversion of digital signals into d.c. signals
- **6** - for light emitting diodes (LED)

#### Syntax 

```visualbasic
Function QueryDeviceType(  
  address As Byte,  
  Optional isshortaddress As Boolean := True) 
As Byte
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

#### Return value 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> device type 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10101](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10101)</u>, <u>[10102](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10102)</u>, <u>[10104](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10104)</u>, <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
//read device type from ballast with short address 6  
Var myDevice as Byte  

myDevice := DALI1.QueryDeviceType(6)
```

# QueryLampFailure

This command executes the DALI command "QueryLampFailure": it returns **True **if there is a Lamp Failure on the addressed ballast. The answer shall be** True** or **False.** 

#### Syntax 

```visualbasic
Function QueryLampFailure(  
  address As Byte,  
  Optional isshortaddress As Boolean := True) 
As Boolean
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

x <u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> **True** if there is a LampFailure. Otherwise **False.** 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10101](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10101)</u>, <u>[10102](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10102)</u>, <u>[10104](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10104)</u>, <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
//check ballast with short address 63 for lamp failure  
If DALI1.QueryLampFailure(63) Then 
  DebugPrint("A63 Lamp Failure!") 
End If
```

# QueryStatus

This command executes the DALI command "QueryStatus": return value shall be an 8-bit number. The meaning is the following bites of the return value: 

| Bit | Description |
| --- | --- |
| 0 | Status of ballast; "0" = OK |
| 1 | Lamp failure; "0" = OK |
| 2 | Lamp arc power on; "0" = OFF |
| 3 | Limit Error; "0" = Last requested level is between Min and Max level Or Off |
| 4 | Fade ready; "0" = fade is ready; "1" = fade is running |
| 5 | Reset state; "0" = "No" |
| 6 | Missing short address? "0" = "No" |
| 7 | Power failure; "0" = "No";"1" =  "RESET" Or an arc power control command has been received after last power-on |

#### Syntax 

```visualbasic
Function QueryStatus(  
  address As Byte,  
  Optional isshortaddress As Boolean := True) 
As Byte
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

#### Return value 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> status 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10101](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10101)</u>, <u>[10102](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10102)</u>, <u>[10104](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10104)</u>, <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
//read status from ballast with short address 6  
Var myDeviceStatus as Byte  

myDeviceStatus := DALI1.QueryStatus(6)
```

# RecallMaxLevel

This command executes the DALI command "RecallMaxLevel": set the actual arc power level to the MAX LEVEL without fading. If the lamp is off it shall be ignited with this command. 

#### Syntax 

```visualbasic
Function RecallMaxLevel(  
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
DALI1. RecallMaxLevel (63)  //set ballast with short address 63 to MaxLevel
```

# RecallMinLevel

This command executes the DALI command "RecallMinLevel": set the actual arc power level to the MIN LEVEL without fading. If the lamp is off it shall be ignited with this command. 

#### Syntax 

```visualbasic
Function RecallMinLevel(  
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example* *

```visualbasic
DALI1. RecallMinLevel (63)  //set ballast with short address 63 to MinLevel
```

# SetFadeRate

This command sets the FADE RATE parameter. The FADE RATE parameter is used by Up and Down commands. FADE RATE is stored in each ballast and it remains valid until it is rewritten by the next SetFadeRate() or is changed by the DALI configuration process or it is changed by another DALI controller. 

#### Syntax 

```visualbasic
Function SetFadeRate(
  stepspersecond As Double, 
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameter 

stepspersecond 

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u>  The FADE RATE parameter is set in a number of steps per second. It can be set to one of 15 possible values. The available values are: 

If the parameter stepspersecond is different than any from the table above, then the nearest one from the table is used. 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

#### Example* *

```visualbasic
//set ballasts with short address 1 to new FADE RATE value 
DALI1.SetFadeRate(15, 1, True)    // the nearest value of 16 steps/sec will be set as nearest to required value
```

# SetFadeTime

This command sets the FADE TIME parameter. The FADE TIME parameter is used by SetLevel and SetLevelBin (so called DALI directarc commands). FADE TIME is stored in each ballast and it remains valid until it is rewritten by the next SetFadeTime() is changed by the DALI configuration process or it is changed by another DALI controller. 

#### Syntax 

```visualbasic
Function SetFadeTime(
  fadetime As Time,  
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameter 

fadetime 

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u>  The FADE TIME can be set to one of 16 time values. The available times are: 

If the parameter fadetime is set to a different time than any from the table above, then the nearest time from the table is used. 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u>  address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>  Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

#### Example 

```visualbasic
//set ballast with short address 5 to new FADE TIME value 
DALI1.SetFadeTime( :1.5, 5 ) // the nearest value of :1.4 will be set as nearest to required value
```

# SetLevel

This command executes the DALI arc power control command. Arc power control commands received during a running fading Process will stop the fading process and shall be executed immediately. Predefined FADE TIME specifies the time for changing the arc power level from the actual level to the requested level. If a burning lamp shall be switched off, the step from MIN LEVEL To "OFF" shall be taken into consideration for the calculation of the FADE TIME. If a lamp shall be ignited and dimmed to a certain value, the step from "OFF" to MIN LEVEL shall not be taken into consideration for the calculation of the FADE TIME. When the target level is below the minimum then it shall be applied as if the target was the minimum level. When the target level is above the maximum then it shall be applied as if the target was the maximum level. 

The parameter *percent* serves to specify the desired target level. Note that not all levels in the range 00.00% to 100.00% can be set by DALI exactly as the actual level is set in 255 levels (0-254) using a logarithmic scale. In such case, the nearest possible DALI arc level is taken as the target level. 

#### Syntax 

```visualbasic
Function SetLevel(  
  percent As Double,  
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

percent 

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u>  target level in percent 00-100 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u>  address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>  Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10104](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10104)</u>, <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
//fade ballast with short address 63 to level 50% using predefined  
//FADE TIME value 
DALI1.SetLevel(50, 63)
```

# SetLevelBin

This command executes the same as the command SetLevel above but the target level in parameter *level* is to be specified as a binary value in the range 0-254 as defined in DALI arc level commands. 

The relation between the level in percent and the bin  is approx:  

bin := 253 * Log((percent*1000)/percentmax) / 3  

#### Syntax 

```visualbasic
Function SetLevel(  
  level As Byte,  
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameters* *

level 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u>  target level in DALI arc level value 0-254 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
//fade ballast with short address 63 to level 228 using predefined  
//FADE TIME value 
DALI1.SetLevelBin(228,63)
```

# StepDown

This command executes the DALI command "StepDown": it sets the actual arc power level one step lower immediately without fading. Lamps shall not be switched off via this command. No change if the arc power output is already at the MIN LEVEL. 

#### Syntax 

```visualbasic
Function StepDown(
  address As Byte, 
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
DALI1.StepDown(63)   //set ballast with short address 63 one arc level down
```

# StepDownAndOff

This command executes the DALI command "StepDownAndOff":  it sets the actual arc power level one step lower immediately without fading. The lamp shall be switched off by this command if the arc power output is already at the MIN LEVEL. 

#### Syntax 

```visualbasic
Function StepDownAndOff(  
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
//set ballast with short address 63 one arc level down  
DALI1.StepDownAndOff(63)
```

# StepUp

This command executes the DALI command "StepUp":  it sets the actual arc power level one step up immediately without fading. No change if the arc power output is already at the MAX LEVEL. This command shall only affect ballasts with burning lamps. No lamp shall be ignited with it. 

#### Syntax 

```visualbasic
Function StepUp(
  address As Byte, 
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
DALI1.StepUp(63) //set ballast with short address 63 one arc level Up
```

# OnAndStepUp

This command executes the DALI command "OnAndStepUp":  it sets the actual arc power level one step up immediately without fading. If the lamp is switched off, the lamp shall be ignited with this command and shall be set to the MIN LEVEL. 

#### Syntax 

```visualbasic
Function OnAndStepUp(  
  address As Byte,  
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
DALI1.OnAndStepUp(63)  //set ballast with short address 63 one arc level Up
```

# Up

This command executes the DALI command "Up": dim up for 200ms using the selected FADE RATE. No change if the arc power output is already at the MAX LEVEL.` ` 

#### Syntax 

```visualbasic
Function Up(
  address As Byte, 
  Optional isshortaddress As Boolean := True)
```

#### Parameters 

address 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> address 0-63 for short address or 0-15 for the group address. Value 255 means the BROADCAST address is valid for all ballasts in the system. 

isshortaddress 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, default **True**. **True** means that the address is a short address. **False** means the address is a group address.  

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[10106](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10106)</u>, <u>[10107](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10107)</u> 

#### Example 

```visualbasic
DALI1.Up(63) // Dim Up for 200ms ballast with short address 63
```