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

---

# IsAlive

This function returns True if the CUEunit is running and accessible. 

#### Syntax 

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

#### Return value 

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

# GetAvailableRAM

This function returns available RAM in kB. The function always returns 20480 kB in simulation in the IDE. 

#### Syntax 

```visualbasic
Function GetAvailableRAM() As Long
```

#### Return value 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u>. It is the available RAM in kB.

# GetFilestorageFreeSpace

This function returns free filestorage space in kB. The function always returns 153600 kB in simulation in the IDE. 

#### Syntax 

```visualbasic
Function GetFilestorageFreeSpace() As Long
```

#### Return value 

<u>[Long.](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is free filestorage space in kB. 

# GetCPUAverageLoad

This function returns the CPU’s average load in percent within the last 10 seconds. The function can return value in the range of 0 to 10000:

- Return value 50 means that CPU utilization is 50%.
- Return value 100 means that CPU utilization is 100%.
- Return value 200 means that the CPU is overloaded by 100%.
- Return value 500 means that the CPU is overloaded by 400%, etc.

The function always returns value 50 in simulation in the IDE.  

#### Syntax 

```visualbasic
Function GetCPUAverageLoad() As Long
```

#### Return value* *

<u>[Long.](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is CPU’s average load. 

# GetCPUTemperature

This function returns CPU temperature in °C. 

#### Syntax 

```visualbasic
Function GetCPUTemperature() As Double
```

#### Return value 

<u>[Double.](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the CPU temperature in °C. 

# GetCurrentIP

This function returns the current IP in the CUEunit.** ** 

#### Syntax 

```visualbasic
Function GetCurrentIP(ByRef ip As _IPSettings) As Boolean
```

#### Parameters 

ip 

<u>[_IpSettings](/wiki/spaces/CVCHELP/pages/512983127/General#Structure-_IPSettings)</u> - the destination structure. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> True if successful, False otherwise.

# Structure _IPSettings

This structure is predefined in the firmware of all units, which supports functions with _IPSettings structure. 

#### Syntax 

```visualbasic
Structure _IPSettings 
  Var IpAddress As Text[15] 
  Var Mask As Text[15] 
  Var Gateway As Text[15] 
  Var DNSServer1 As Text[15] 
  Var DNSServer2 As Text[15] 
  Var IPFromDHCP As Boolean 
  Var DNSFromDHCP As Boolean 
End Structure
```

IpAddress

Current IP address 

Mask

Current Mask address 

Gateway

Current Gateway address 

DNS1

Current DNS server 1 address 

DNS2

Current DNS server 2 address 

IPFromDHCP

If it is true current IPAddress, Mask and Gateway are obtained from a DHCP server. 

DNSFromDHCP

If it is true current DNS1 and DNS2 are obtained from a DHCP server. 

# GetFirmwareVersion

This function returns the current firmware version in text format like on web pages, for example as **5.50a ** 

#### Syntax 

```visualbasic
Function GetFirmwareVersion(ByRef fwversion As Text) As Boolean
```

#### Parameters 

fwversion 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> - the destination of the fwversion text. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u><u> True if successful, False if fwversion is too short.</u>

# GetMACAddress

This function returns the MAC address of the WiFi or Ethernet interface. GetMACAddress always returns **False** on iCUE-standard and iCUE-professional because reading MAC address is not allowed in iOS. The function returns all MAC addresses on pcCUE-standard, pcCUE-professional, and in simulation mode. 

#### Syntax 

```visualbasic
Function GetMACAddress(ByRef macaddress As Text) As Boolean
```

#### Parameters 

macaddress 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> - the destination of the macaddress text. The MAC address is written as a sequence of 12 hexadecimal digits as follows: **1234ABCD56EF** 

The function returns all MAC addresses on pcCUE-standard, pcCUE-professional, and in simulation mode. All MAC addresses are written … 

Two MAC addresses are written as **4AB3C5F7890A65FCDE2F9BE1**. Every MAC address in the macaddress text is 12 hexadecimal digits long. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> True if successful, False if MAC address reading is not allowed (iCUE) or the parameter macaddress is too short.

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

# GetMagicName

This function returns the magic name of the unit.** ** 

#### Syntax 

```visualbasic
Function GetMagicName(ByRef magicname As Text) As Boolean
```

#### Parameters 

magicname 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> - the destination of the magicname text. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> True if all done, False if magicname is too short.

# GetMemorySegment

This function gets a memory segment number where a variable is placed. 

#### Syntax 

```visualbasic
Function GetMemorySegment(ParamArray[1]) As Byte
```

#### Parameters 

ParamArray 

<u>[ParamArray](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/509149361/ParamArray#ParamArray)</u> It is the address of the variable. 

#### Return value 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the number of the memory segment. Predefined result constants are as follows: 

|  |  |  |
| --- | --- | --- |
| Name | Value | Description |
| _MSEG_NONE | 0 | None. |
| _MSEG_DATA | 1 | Data. |
| _MSEG_NONVOLATILEDATA | 2 | Non volatile data. |
| _MSEG_LOCALDATA | 3 | Local data. |
| _MSEG_CONSTDATA | 4 | Constant data. |
| _MSEG_PROGRAMCODE | 5 | Program code. |
| _MSEG_COMMANDAPI | 7 | Command API. |
| _MSEG_CHANNELADDRESS | 8 | Channel address. |
| _MSEG_BUILTINVARIABLE | 9 | Built-in variable. |
| _MSEG_SYSTEMEVENTADDRESS | 14 | System event address. |
| _MSEG_GRAPHICOBJECTS | 16 | Graphics objects. |
| _MSEG_RESOURCEDATA | 17 | Resource data. |
| _MSEG_USEREVENTADDRESS | 20 | User event address. |

#### Example 

```visualbasic
Class MyButton Inherits BaseGraphicClass 
  Protected Property ShownText As AddressOf Text := Nothing WithAttributes 
  { 
    PropertyGroup := "Caption", 
    DisplayName := "ShownText" 
  } 
  Protected Var TextBuffer As Text[150] := "" 

  Public Function SetText(NewText As Text) 
    // if NewText is placed in resources 
    If GetMemorySegment(NewText) = _MSEG_RESOURCEDATA Then 
      ShownText := NewText 
    Else 
      // copy text to variable TextBuffer, 
      // it must not be a local SetText's variable 
      // to remember its value after exiting the function 
      TextBuffer := NewText 
      ShownText := TextBuffer 
    End If 

    Redraw() 
  End Function 

  // other variables, properties, functions ... 
End Class
```

# GetProductName

This function returns the product name of the CUEunit.** ** 

#### Syntax 

```visualbasic
Function GetProductName(ByRef productname As Text) As Boolean
```

#### Parameters 

productname 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> - the destination of the productname text. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> 

***True*** All done. 

***False*** The parameter productname is too short. 

# GetSiteIdentification

This function returns the site identification of the unit.** ** 

#### Syntax 

```visualbasic
Function GetSiteIdentification(ByRef siteidentification As Text) As Boolean
```

#### Parameters 

magicname 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> - the destination of the site identification text. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>

***True*** All done. 

***False*** The declared length of the parameter siteidentication is too short. 

# GetSystemIdentification

This function returns the identification of the machine running the application. The identification is the text like this. 

*“CSxxxx.Ryy.ssssss“* 

|  |  |
| --- | --- |
| *xxxx* | product code of the unit |
| *yy* | hardware revision. |
| *ssssss* | serial number of the unit |

For example: "CS0251.R01.000007" 

If the unit is running in the **simulation mode**, then the identification is like this: "CSxxxx.Simulation". 

For example: "CS0251.Simulation" 

#### Syntax 

```visualbasic
Function GetSystemIdentification(ByRef identification As Text) As Boolean
```

#### Parameters 

identification 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> as the destination of the identification text. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> True if successful, False if the parameter identification is too short.

# IsKeyboardPresent

This function returns true if the hardware keyboard is connected to the ipCUE-omega or pcCUE. 

#### Syntax 

```visualbasic
Function IsKeyboardPresent()As Boolean
```

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>. The function returns true if the hardware keyboard is connected. 

# PowerOff

This function switches the system off. The function exists only on the airCUE-7 panel. 

#### Syntax 

```visualbasic
Function PowerOff()
```

# Reset

This function restarts the CUEunit.  The function is not available in appCUE.

#### Syntax 

```
Function Reset()
```

# OnPower12VOutputOverload

This event process is invoked by the system when the 12V supply is overloaded. The 12V supply is used to power devices connected to Sensor1 and Keypad1 channels. 

#### Syntax 

```visualbasic
Event OnPower12VOutputOverload As Process()
```

# OnIdle

This event function is invoked by the system when the user does not touch the panel or the panel button for a time longer than the idle timeout (see <u>SetIdleTimeout</u>). The function is called only once after the last touch. If the function is called, it is not called until the next touch. The caller timeout is reset by the touch. If you can serve that event, you have to link the function like in the example. You can have only one function linked. 

#### Syntax 

```visualbasic
Event OnIdle As Function()
```

#### Example 

```visualbasic
// Module Main 

Private Function MyIdleServer() Link OnIdle 
  // the body of the function 
  // the body must be short and quick because the function is called in the system context. 
End Function
```

# SetIdleTimeout

This function sets the timeout for the event OnIdle. The timeout is the time between the last touch or button press and the calling of the OnIdle linked function. To disable calling OnIdle set timeout to :0 value. If the function is used and the last touch was before the specified timeout, then the event OnIdle is fired immediately. If the function is used and the last touch was before a shorter time, then the system waits for the rest of the idle time. 

#### Syntax 

```visualbasic
Function  SetIdleTimeout(timeout As Time)
```

#### Parameters 

timeout 

[Time](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)

# SetSideLightBrightness

This function sets the light intensity on the panel sides.  

#### Syntax 

```visualbasic
Function SetSideLightBrightness(
  redbrightness As Double, 
  greenbrightness As Double, 
  bluebrightness As Double
)
```

#### Parameters 

redbrightness 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the intensity of the red light component. The value must be between 0.0 and 100.0 

greenbrightness 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the intensity of the green light component. The value must be between 0.0 and 100.0 

bluebrightness 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the intensity of the blue light component. The value must be between 0.0 and 100.0 

# Standby

This function sets the system in standby mode. The function exists only on the airCUE-7 panel. 

#### Syntax 

```visualbasic
Function Standby()
```