---
title: "tapCUE-4"
canonical: "https://docs.cuesystem.com/space/CVCHELP/524353698/tapCUE-4"
format: markdown
---
> Macro (toc)

<details>
<summary>Detail contents</summary>

> Macro (toc)
</details>

# Driver and firmware version

Device driver is launched with every CVC launch. The version of the driver can be read in the General tab of the driver.

**Note**: The version of the tapCUE-4 firmware is not the same as the version of the driver. The driver updates the tapCUE-4 firmware automatically if necessary. The automatic update for both versions from driver version 14.19.

Actual driver version is 14.19, actual tapCUE-4 - hardware revision R01 firmware is 14.19, actual tapCUE-4 - hardware revision R02 firmware is 14.19.  These versions comes with the Cue Visual Composer version 21.20.1316 or higher.

# Communication ports

The tapCUE-4 communicates via LAN using the following ports:

- UDP/1900, UDP/33333, UDP/53129
- TCP/80, TCP/53128.

All TCP and UDP ports must be enabled in router/firewall settings.

# Sample project

# Configuration

There are two drivers, **tapCUE-4** and **IPToCUElink**. They are located in the Cue Visual Composer  **CUEdevice/CUElink** folder. 

Insert drivers to *MyProject Resouces/CUEunits and devices* and then drag and drop this driver to project configuration. The **IPToCUElink** must be inserted between the controller and the tapCUE-4 device in Composer's Configuration window. Connect all interface connectors to appropriate channels on CUEunit. See the example below, where the name of IPToCUElink is IPToCUElink1, and the tapCUE-4 unit is TouchscreenKeypad1.

Example of a connection in a Composer's Configuration window:

![image](media://29f9f61c-74b0-459c-aa32-12a2f54087aa)

Suppose you want to control more tapCUE-4 instances by one controller and then connect both to the same splitter. See the example below.

![image](media://92bcb87a-f6a8-484b-b79b-58bd4059329e)

# Layout description

The tapCUE-4 can be easily configured for up to **32 buttons** divided into up to **4 pages**. Each button can contain an **icon**, a **caption**, and an **indicator**. There are several types of buttons available - pushbutton, repeat, and toggle. Page backgrounds, buttons, icons, captions, and labels can be color-coded.

The tapCUE-4 allows the use of icons that can be inserted in the buttons. The icons are represented by the font described in the section [https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/547684390](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/547684390).

![image](media://554bcf34-c3d4-4a9c-9e14-9fadfb4472fa)

# Properties

### General properties

- **IP address** - IP address of tapCUE-4.
- **Magic name** - Magic name of tapCUE-4.
  - If the property Magic name is not set, the property IP address must match the IP address of the tapCUE-4.
  - If the property Magic name is set, the driver’s IP address **is not being used **and must match the value specified in Admin Web of the tapCUE-4.
- **MountOrientation** – property specifies how tapCUE-4 is mounted (TableTop or Wall - display orientation).
- **Layout **– specifies the base layout mode.

### Menu properties

- **ButtonFontColor **– menu buttons text color
- **ButtonUpColor **– menu buttons up color
- **Button1Icon **- icon on the menu button
- **Button1Text **– text on the menu button
- **Button1DownColor **– menu button color in down state

Meaning of properties for **Button2 – Button4** is the same as for Button1.

### Pages properties

- **LabelFontColor **– label text color
- **ButtonFontColor **– button text color
- **ButtonUpColor **- buttons color in upstate
- **ButtonDownColor **- buttons color in down state
- **Page count** – number of pages in a layout. There are four options -one, two, three, or four pages.

> 📝 If you choose four pages, there will be no icon on the page button Page1 – Page4.

- **Event type** - the event is generated when a button (push or toggle) is pressed (OnDown) or released (OnUp).

### Page 1 - Page 4 properties

- **Layout **– number of buttons on a page. There are four options - two, four, six, or eight buttons.  
Important note: If you choose eight buttons on the page, there will be no bargraph on the page.

- **BackgroundColor **- page background color
- **LabelText **– label text
- **BargraphVisible **- if True bargraph is visible on a page.
- **BargraphBackgroundColor **– bargraph background color
- **BargraphFloodColor **- bargraph flood color
- **Button1Icon **– icon on the button
- **Button1Text **– text on the button
- **Button1Type **- a type of the button
  - PushButton
  - Repeat 0.2 sec
  - Repeat 0.3 sec
  - Repeat 0.4 sec
  - Repeat 0.5 sec
  - Toggle 2 states
  - Toggle 3 states
  - Toggle 4 states

Meaning of properties for **Button2 – Button8** is the same as for Button1.

---

> ℹ️ To use all the commands described below, update the tapCUE-4 firmware to the latest version.

# General functions

## Color

This function **converts **components red, green, and blue to a long value.

#### Syntax

```visualbasic
Function Color(red As Byte, green As Byte, blue As Byte) As Long
```

#### Parameters

red

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u>[ ](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)It is a red component of the color

green

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is a green component of the color

blue

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is a blue component of color

#### Return value

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Color as a Long value.

## InitCommunication

The function sets the communication parameters for tapCUE-4 and waits for the completion of the tapCUE-4 initialization. Timeout is 120 seconds. 

This function should only be used if neither the IP address nor the magic name is set in the tapCUE-4 instance properties. Thus, the function is used if neither the IP address nor the magic name of the tapCUE-4 device is known at the time of source code compilation. This situation typically arises when multi configuration is used.

The function can only be called once for one tapCUE-4 instance, the next call does nothing and the command returns False. 

If the function is called even if the property IP address or Magic name is set , the command does nothing and returns False.

#### Syntax

```visualbasic
Function InitCommunication(magicnameoripaddress As Text) As Boolean
```

#### Parameters

magicnameoripaddress

<u>[Text](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the Magic name or IP address of the tapCUE-4.  

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> The function returns True if initialization has been completed before the timeout expires. Otherwise, it returns 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>[10200](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10200)</u><u>,</u> <u>[10201](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#10201)</u>.

#### Example

```visualbasic
Private Process Autoexec()
  TouchscreenKeypad1.InitCommunication("192.168.1.201")
  TouchscreenKeypad1.Page1.Button1.StartIndicatorBlinking(_COLOR_RED,_COLOR_BLACK)
  TouchscreenKeypad1.Page1.Button2.StartIndicatorBlinking(_COLOR_RED,_COLOR_BLACK)
  //... other initialisation
End Process
```

## IsAlive

This function returns true **if the tapCUE-4 is running and accessible**. 

#### Syntax 

```visualbasic
Function IsAlive()As Boolean
```

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> The function returns true if the CUEunit is running and accessible. 

## SetEnclosureLed

This function **sets the LED indicator**, which is located in the plastic enclosure.

#### Syntax 

```visualbasic
Function SetEnclosureLed( 
  red As Byte, 
  green As Byte, 
  blue As Byte, 
  Optional intensity As Byte := 128) 
As Boolean
```

#### Parameters 

red 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the red component of the color. 

green 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the green component of the color. 

blue 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the blue component of the color. 

intensity 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 128. It is the intensity of the LED light, 0 means light is off, 255 means maximum light. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## WaitForReady

This function waits for tapCUE-4 initialization to complete. If initialization has been completed before the timeout expires, the function exits and returns True. Otherwise, it waits for the timeout to expire and returns False. Timeout is 120 seconds.

> ℹ️ It is recommended to use this function at the beginning of the Autoexec process.  This ensures that subsequent commands in the Autoexec process will be executed after tapCUE-4 has been initialized and will not be lost.

#### Syntax

```visualbasic
Function WaitForReady() As Boolean
```

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> The function returns True if initialization has been completed before the timeout expires. Otherwise, it returns False.

#### Example

```visualbasic
Private Process Autoexec()
  TouchscreenKeypad1.WaitForReady()
  TouchscreenKeypad1.Page1.Button1.StartIndicatorBlinking(_COLOR_RED,_COLOR_BLACK)
  TouchscreenKeypad1.Page1.Button2.StartIndicatorBlinking(_COLOR_RED,_COLOR_BLACK)
      //... other initialisation
End Process
```

---

# Page functions & events

## Show

This function shows the page.

#### Syntax

```visualbasic
Function Show() As Boolean
```

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## OnShow

This event is invoked when a **page is shown**.

#### Syntax

```visualbasic
Process OnShow()
```

---

# Label functions

## SetBackgroundColor

This function sets a new label background color. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command Color to convert components red, green, and blue to a long value.

#### Syntax

```visualbasic
Function SetBackgroundColor(newcolor As Long) As Boolean
```

#### Parameters

color

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color for the label background.

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## SetText

This function sets a **new label text**.

#### Syntax

```visualbasic
Function SetText(newtext As Text) As Boolean
```

#### Parameters

newtext

<u>[Text](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> It is a new text for the label.

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## SetTextColor

This function sets a new label text color. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command Color to convert components red, green, and blue to a long value.

#### Syntax

```visualbasic
Function SetTextColor(color As Long) As Boolean
```

#### Parameters

color

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color for the label background.

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## StartObjectBlinking

This is a **label** function that starts the blinking of the label.

#### Syntax

```visualbasic
Function StartObjectBlinking(
  oncolor As Long,
  offcolor As Long,
  Optional ontime As Time := ONTIMEDEFAULT, 
  Optional offtime As Time := OFFTIMEDEFAULT)
As Boolean
```

#### Parameters

oncolor

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color of the indicator for **on **status. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command **Color **to convert components red, green, and blue to a long value.

offcolor

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color of the indicator for **on **status. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command **Color **to convert components red, green, and blue to a long value.

ontime

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> Optional, default value is 0.5sec. It is a time when the indicator has the oncolor. 

offtime

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> Optional, default value is 1.5sec. It is a time when the indicator has the offcolor.

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## StopObjectBlinking

This is a **label** function that **stops the blinking** of the label.

#### Syntax 

```visualbasic
Function StopObjectBlinking() As Boolean
```

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

---

# Button functions & events

## IsPressed

This function returns true if the input is pressed and false otherwise.

#### Syntax

```visualbasic
Function IsPressed() As Boolean
```

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is true if the input is pressed, false otherwise. 

## OnPush

The system invokes this process. The invocation of the event and the meaning of the state parameter’s value depend on the button type.

#### Syntax

```visualbasic
Process OnPush (state As Long)
```

#### Parameters

Device drivers since version 12.70

| **Button Type** | **When is process invoked** | **Meaning of the state parameter value** |
| --- | --- | --- |
| PushButton | The event is generated according to the property Event type. Button is pressed (OnDown) or released (OnUp). | value is 1 |
| Repeat 0.2 sec | every 0.2 sec until the button is pressed | value is 1 |
| Repeat 0.3 sec | every 0.3 sec until the button is pressed | value is 1 |
| Repeat 0.4 sec | every 0.4 sec until the button is pressed | value is 1 |
| Repeat 0.5 sec | every 0.5 sec until the button is pressed | value is 1 |
| Toggle 2 states | The event is generated according to the property Event type. Button is pressed (OnDown) or released (OnUp). | value is 1 or 2 depending on the toggle state |
| Toggle 3 states | The event is generated according to the property Event type. Button is pressed (OnDown) or released (OnUp). | value is 1, 2 or 3 depending on the toggle state |
| Toggle 4 states | The event is generated according to the property Event type. Button is pressed (OnDown) or released (OnUp). | value is 1, 2, 3 or 4 depending on the toggle state |

#### Device drivers up to version 12.69

|  |  |  |
| --- | --- | --- |
| **Button Type** | **When is process invoked** | **Meaning of the state parameter value** |
| PushButton | the button is released | value is 1 |
| Repeat 0.2 sec | every 0.2 sec until the button is pressed | value is 1 |
| Repeat 0.3 sec | every 0.3 sec until the button is pressed | value is 1 |
| Repeat 0.4 sec | every 0.4 sec until the button is pressed | value is 1 |
| Repeat 0.5 sec | every 0.5 sec until the button is pressed | value is 1 |
| Toggle 2 states | the  button is released | value is 1 or 2 depending on the toggle state |
| Toggle 3 states | the button is released | value is 1, 2 or 3 depending on the toggle state |
| Toggle 4 states | the button is released | value is 1, 2, 3 or 4 depending on the toggle state |

## SetIcon

This function sets a **new icon on the button**. The set of available icons is defined by the [https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/547684390](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/547684390).

#### Syntax

```visualbasic
Function SetIcon (newicon As Text) As Boolean
```

#### Parameters

newicon

<u>[Text](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> It is a new icon for the button. Please select the icon from IconSymbols set in the MyProject Instances window and then drag and drop the icon name chosen to source code.

![image](media://6a365449-61df-428e-80c3-39d972b32227)

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## SetIconColor

This function sets a new button icon color. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command Color to convert components red, green, and blue to a long value.

#### Syntax

```visualbasic
Function SetIconColor(color As Long) As Boolean
```

#### Parameters

color

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color for the button icon.

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## SetIndicator

This function sets a **new color to the indicator** on the button. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command **Color **to convert components red, green, and blue to a long value.

#### Syntax

```visualbasic
Function SetIndicator(newcolor As Long) As Boolean
```

#### Parameters

newcolor

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color of the indicator.

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## SetText

This function sets a **new button text**.

#### Syntax

```visualbasic
Function SetText(newtext As Text) As Boolean
```

#### Parameters

newtext

<u>[Text](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> It is a new button text.

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## SetTextColor

This function sets a new button text color. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command Color to convert components red, green, and blue to a long value.

#### Syntax

```visualbasic
Function SetTextColor(color As Long) As Boolean
```

#### Parameters

color

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color for the button text.

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## StartIndicatorBlinking

This function starts the blinking of the button indicator.

#### Syntax 

```visualbasic
Function StartIndicatorBlinking(
  oncolor As Long, 
  offcolor As Long, 
  Optional ontime As Time := ONTIMEDEFAULT, 
  Optional offtime As Time := OFFTIMEDEFAULT) 
As Boolean
```

#### Parameters

oncolor

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color of the indicator for **on **status. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command **Color **to convert components red, green, and blue to a long value.

offcolor

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is a new color of the indicator for **on **status. You can use named constants (_COLOR_RED, _COLOR_GREEN, etc.), or the tapCUE-4 command **Color **to convert components red, green, and blue to a long value.

ontime

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> Optional, default value is 0.5sec. It is a time when the indicator has the oncolor. 

offtime

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> Optional, default value is 1.5sec. It is a time when the indicator has the offcolor. 

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

#### Example

```visualbasic
TouchscreenKeypad1.Page1.Button1.StartIndicatorBlinking(_COLOR_RED, _COLOR_GREEN,:1, :1)
```

## StopIndicatorBlinking

This function **stops the blinking** of the button indicator.

#### Syntax 

```visualbasic
Function StopIndicatorBlinking() As Boolean
```

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.

## WaitWhilePressed

This function waits while button is pressed and the specified time has not expired. 

#### Syntax 

```
Function WaitWhilePressed(Optional timeout As Time := _TIME_INFINITE) As Boolean
```

#### Parameters 

timeout 

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> Optional, defaults to _TIME_INFINITE. It is time to wait while the input is pressed. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True if the timeout was not expired when the button was released. It is False if the timeout expired and the button was still pressed.

---

# Bargraph functions

## SetValue

This function sets a new **bargraph value**. Value could be in the range of 0.0 – 100.0.

#### Syntax

```visualbasic
Function SetValue(newvalue As Double) As Boolean
```

#### Parameters

newvalue

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is a new value of bargraph. The parameter value must be in the range 0.0 – 100.0

#### Return value

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs.