---
title: "MotionSensor (_MotionSensorClass)"
canonical: "https://docs.cuesystem.com/space/CVCHELP/512983110/MotionSensor%20(_MotionSensorClass)"
format: markdown
---
> Macro (toc)

---

Commands of the _MotionSensorClass are available only on the standard panels. The variable of the type _MotionSensorClass is built-in and can not be declared in the program. 

# Disable

This function disables the motion sensor. 

#### Syntax 

```visualbasic
Function Disable()
```

# Enable

This function enables the motion sensor. 

#### Syntax 

```visualbasic
Function Enable()
```


# GetSensitivity

This function returns the sensitivity of motion sensor. The return value is in the range 0 - 200. A value of 100 means default sensitivity. A value less than 100 means lower sensitivity . A value greater than 100 means higher sensitivity.

**This function is available since firmware 20.00**

#### Syntax 

```visualbasic
Function GetSensistivity() As Long
```

# IsEnabled

This function returns True if the motion sensor is enabled otherwise returns False. 

#### Syntax 

```visualbasic
Function IsEnabled() As Boolean
```

#### Return value 

True if the motion sensor is enabled otherwise returns False. 

# OnMotion

This event is fired by the system when the motion sensor is activated. The system event handler only switches the display on. If the user OnMotion event handler exists then the system event handler is not called. If you need to switch the display on in the user OnMotion event handler you have to call the command Display.On().   

#### Example 

```visualbasic
// user event handler OnMotion 
Private Process MotionSensor_OnMotion(  ) Link MotionSensor.OnMotion 
  // user event handler part 
  // … 
  
  // Switch display on 
  Display.On()  
End Process
```

#### Syntax 

```visualbasic
Process OnMotion ()
```

# SetSensitivity

This function allows you to change motion sensor sensitivity.

**This function is available since firmware 20.00**

#### Syntax 

```visualbasic
Function SetSensitivity(newsensitivity As Long) As Boolean
```

#### Parameters 

newsensitivity 

[<u>Long</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) It is a new motion sensor sensitivity. The allowed value is in the range 0 - 200. A value of 100 means default sensitivity. A value less than 100 means lower sensitivity . A value greater than 100 means higher sensitivity.

#### Return value 

Returns True if the setting was successful, otherwise returns False.