---
title: "DigitalIO (_DigitalIO class)"
canonical: "https://docs.cuesystem.com/space/CVCHELP/518914148/DigitalIO%20(_DigitalIO%20class)"
format: markdown
---
> Macro (toc)

---

# Close 

The function closes the output pin to the ground. 

#### Syntax 

```
Function Close( )
```

# Open 

The function opens the output pin. 

#### Syntax 

```
Function Open( )
```

# ClosePulse 

The function closes the output pin for the specified time. 

#### Syntax 

```
Function ClosePulse( 

pulsetime As Time )
```

#### Parameters 

pulsetime 

[<u>Time</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time) The time the output pin has to be closed. 

# IsClosed 

The function True, if the input/output pin is closed to the ground. 

#### Syntax* *

```
Function IsClosed() As Boolean
```

#### Return value 

[<u>Boolean</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is True if the input/output pin is closed. It is False if the input/output pin is open. 

# WaitWhileClosed 

The function waits for the time the input pin is closed. It is possible to specify maximal timeout for the waiting. 

#### Syntax 

```
Function WaitWhileClosed( 

Optional timeout As Time  := 

 _TIME_INFINITE) As Boolean 

As Boolean
```

#### Parameters 

timeout 

[<u>Time</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time) Optional, The timeout is the maximal time to wait. If the time interval exceeds the specified timeout, the function returns even if the input pin is still in the closed state. 

#### Return value 

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

**True** The functions returns normally. The input pin has been opened. 

**False** The timeout has been exceeded. The input pin is still closed. 

# WaitWhileOpened 

The function waits while the input pin is open. The wait timeout can be limited to the timeout time. 

#### Syntax 

```
Function WaitWhileOpened( 

Optional timeout As Time  := 

 _TIME_INFINITE) 

As Boolean
```

#### Parameters* *

timeout 

[<u>Time</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time) Optional, The timeout is the maximal time to wait. If the time interval exceeds the specified timeout, the function returns even if the input pin is still in the open state. 

#### Return value 

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

**True** The functions returns normally. The input pin has been closed. 

**False** The timeout has been exceeded. The input pin is still open. 

# OnClose 

The event OnClose can be used inside the driver for the monitoring of the close state of the input pin. The linked process is called when the input pin switches between the open and the close state. 

#### Syntax 

```
Function As Process( )
```

#### Example 

```
// Device driver 

 

DeviceClass DIOdriver 

 

Connector DIOconnector // can be connected to the DIO channel of the controller 

Channel Channel1 As MyChannelClass 

 

Process OnDioClose Link DIOconnector.OnClose 

// when the channel the DIOconnector is connected to closes, Channel1.Play function is called 

Channel1.Play() 

End Process 

 

End DeviceClass 

 

 

 

Class MyChannelClass 

 

Public Function Play() 

End Function 

 

End Class 

 

// End device driver
```