---
title: "DMX (_DMX class)"
canonical: "https://docs.cuesystem.com/space/CVCHELP/518881439/DMX%20(_DMX%20class)"
format: markdown
---
> Macro (toc)

---

DMX (DMX512 - Digital MultipleX) is a standard for digital communication networks that are commonly used to control stage lighting and effects as well as interior and architectural lighting. DMX channel is dedicated to connect DMX Slave Device drivers. DMX channel is implemented as an internal channel of controller controlCUE-dmx-d. 

![image](media://47b89ff3-2618-4077-bdcf-35ea60ac6fd1)

The use of DMX Slave Device drivers is recommended. These drivers configure addresses used by the DMX channel. 

# FollowInput

This function connects the output slave device with the input slave device. The result is that the percent value of the input slave device is copied to the output slave device.  

Note: Connection is canceled by calling StopAtCurrentLevel, SetLevel, or ChangeLevel. 

#### Syntax 

```visualbasic
Function FollowInput(
  address As Long, 
  inputchannel As AddressOf _DMX, 
  Optional inputaddress As Long := 0) 
As Boolean
```

#### Parameters 

address 

[<u>Long</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) It is the address of the output slave device in the range 1 – 512 

inputchannel 

AddressOf _DMX. It is the address of input DMX channel 

inputaddress 

[<u>Long</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) Optional, it is the address of the input slave device in the range 1 – 512. Defaults (0) means that the input slave address is the same as the (output slave) address.  

#### Return value 

[<u>Boolean</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) This function returns True on success or False if an error occurs. The function [<u>GetLastError</u>](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError) returns the error number that occurred while executing the command. The errors that can happen: [<u>216</u>](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#216). 

#### Example 

```visualbasic
DMX1.SetInputMode () 
DMX2.SetOutputMode () 
DMX2.FollowInput (10, DMX1) 

// Slave device 10 of DMX2 channel will follow slave device 10 of DMX1 
// channel 
DMX2.FollowInput (10, DMX1, 5) 

// Slave device 10 of DMX2 output channel will follow slave device 5 of 
// DMX1 input channel
```

# GetLevel

This function gets the actual slave device percent level in the range of 0.0 - 100.0. It returns 0 if the slave device address is out of range 1 – 512. In input mode, it returns the received percent level. In output mode, it returns the output percent level. 

#### Syntax 

```visualbasic
Function GetLevel (address As Long) As Double
```

#### Parameters 

address 

[<u>Long</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) It is slave device address in range 1 – 512 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is slave device percent level in range 0.0 - 100.0 

# ChangeLevel

This function increases (percentlevelchange is positive) or decreases (percentlevelchange is negative) slave device percent level within ramptime. The new_percentlevel := old_percentlevel + percentlevelchange. 

#### Syntax 

```visualbasic
Function ChangeLevel(
  address As Long, 
  percentlevelchange As Double, 
  Optional ramptime As Time := :0) 
As Boolean
```

#### Parameters 

address 

[<u>Long</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) It is slave device address in range 1 – 512 

percentlevelchange 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is slave device percent level change in range 0.0 - 100.0 

ramptime 

[<u>Time</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time) Optional, defaults to :0. It is the time of the ramp. If it is :0 by default, the level is set immediately. 

#### Return value 

[<u>Boolean</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) This function returns True on success or False if an error occurs. The function [<u>GetLastError</u>](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError) returns the error number that occurred while executing the command. The errors that can happen: [<u>216</u>](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#216). 

# SetInputMode

This function sets the DMX channel to input (slave) mode. 

#### Syntax 

```visualbasic
Function SetInputMode ()
```

# SetLevel

This function sets slave device percent level 0.0 - 100.0 within ramptime. This function works in input mode too - the setting is saved and takes effect after the switch to output mode. 

#### Syntax 

```visualbasic
Function SetLevel(
  address As Long, 
  percentlevel As Double, 
  Optional ramptime As Time := :0) 
As Boolean
```

#### Parameters 

address 

[<u>Long</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) It is slave device address in range 1 – 512 

percentlevel 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is slave device percent level in range 0.0 - 100.0 

ramptime 

[<u>Time</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time) Optional, defaults to :0. It is the time of the ramp. If it is :0 by default, the level is set immediately. 

#### Return value 

[<u>Boolean</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) This function returns True on success or False if an error occurs. The function [<u>GetLastError</u>](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError) returns the error number that occurred while executing the command. The errors that can happen: [<u>216</u>](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#216). 

# SetOutputMode

This function sets the DMX channel to output (master) mode. After the finish of all initializations and finish of this function, the DMX channel starts sending data packets. 

#### Syntax 

```visualbasic
Function SetOutputMode ()
```

# StopAtCurrentLevel

This function stops slave device level change on the current percent level and returns this percent level. 

#### Syntax 

```visualbasic
Function StopAtCurrentLevel (address As Long) As Double
```

#### Parameters 

address 

[<u>Long</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) It is the address of slave device in range 1 – 512 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is slave device percent level in range 0.0 - 100.0