---
title: "GeneralIO (_GeneralIO class)"
canonical: "https://docs.cuesystem.com/space/CVCHELP/518881466/GeneralIO%20(_GeneralIO%20class)"
format: markdown
---
> Macro (toc)

---

# Close

This function switches output ON. 

#### Syntax 

```visualbasic
Function Close()
```

#### Example 

```visualbasic
GIO2.Close()
```

This command switches the GIO2 output ON. 

# ClosePulse

This function switches output ON and after **pulsetime** switches it OFF. 

#### Syntax 

```visualbasic
Function ClosePulse(pulsetime As Time)
```

#### Parameters* *

pulsetime 

[<u>Time</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time) It is a time of the pulse. 

#### Example 

```visualbasic
GIO1.ClosePulse(:1.0)
```

This command switches the GIO1 output ON and after one second switches it OFF. 

# GetVoltage

The function returns a voltage on a channel. 

#### Syntax 

```visualbasic
Function GetVoltage() As Double
```

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the voltage on the channel. 

#### Example 

```visualbasic
Var Voltage1 As Double  

Voltage1 := GIO1.GetVoltage()
```

In the variable Voltage1 is a current voltage on a GIO1 channel. 

# IsClosed

The function returns if a channel is closed or opened. 

#### Syntax 

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

#### Return value 

[<u>Boolean</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is True if the channel is closed, False otherwise. 

#### Example 

```visualbasic
If GIO1.IsClosed() Then  
  DebugPrint("GIO1 is closed now") 
Else 
  DebugPrint("GIO1 is open now") 
End If
```

# IsPullupOn

The function returns if a pullup is ON or OFF. 

#### Syntax 

```visualbasic
Function IsPullupOn() As Boolean
```

#### Return value 

[<u>Boolean</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is True if the pullup is ON, False otherwise. 

#### Example 

```visualbasic
If GIO1.IsPullupOn() Then  
  DebugPrint("GIO1 Pullup is ON") 
Else 
  DebugPrint("GIO1 Pullup is OFF") 
End If
```

# Open

This function switches output OFF. 

#### Syntax 

```visualbasic
Function Open()
```

#### Example 

```visualbasic
GIO4.Open()
```

This command switches the GIO4 output OFF. 

# PullupOff

This function switches a pullup OFF. 

#### Syntax 

```visualbasic
Function PullupOff()
```

#### Example 

```visualbasic
GIO4.PullupOff()
```

This command switches GIO4 pullup OFF. 

# PullupOn

This function switches a pullup ON. 

#### Syntax 

```visualbasic
Function PullupOn()
```

#### Example 

```visualbasic
GIO2.PullupOn()
```

This command switches GIO2 pullup ON. 

# WaitWhileVoltageInRange

The function waits while a value on the channel lies within **volts1** and **volts2** levels and until the **waittime** elapsed. 

#### Syntax 

```visualbasic
Function WaitWhileVoltageInRange( 
  volts1 As Double, 
  volts2 As Double, 
  Optional waittime As Time := _TIME_INFINITE) 
As Boolean
```

#### Parameters 

volts1 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the first volts value. 

volts2 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the second volts value. 

waittime 

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

#### Return value 

[<u>Boolean</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is True if the channel value lies out of volts1 and volts2. It is False when the time elapsed if an error occurs. A function GetLastError returns the error number. 

#### Example 

A button with potential free contacts is connected to GIO8. The pullup is ON. If the button is pressed, on GIO is 0 volts. If the button is released, on GIO is approximately 4.4 V. 

```visualbasic
GIO8.PullupOn() 

// wait while the button is released 
GIO8.WaitWhileVoltageInRange(2, 5)
```

The command waits while the voltage level 4.4 V lies within 2 V and 5 V. 

#### Example 

A button with potential free contacts is connected to GIO8. The pullup is ON. If the button is pressed, on GIO is 0 volts. If the button is released, on GIO is approximately 4.4 V. 

```
GIO8.PullupOn() 

// wait while the button is released 
GIO8.WaitWhileVoltageInRange(2, 5) 
DebugPrint("Button is pressed now") 

// wait while the button is pressed until 10 seconds elapsed 
If GIO8.WaitWhileVoltageInRange(0, 2, :10.0) Then 
  DebugPrint("Button was released") 
Else 
  DebugPrint("Button was not released within 10 seconds") 
End If
```

It prints to the debug window when the button is pressed "*Button is pressed now*". If the button is released within 10 seconds, it prints to the debug window "*Button was released*". If the button is not released within 10 seconds, it prints to the debug window 10 sec after pressing "*Button was not released within 10 seconds*".