---
title: "Programming OLD"
canonical: "https://docs.cuesystem.com/space/RUM/488276022/Programming%20OLD"
format: markdown
---
When programming, you can proceed as in any other serial controller including drag and drop operations.

The available command are:

![image](media://4db18785-1186-46cb-a21c-76976a64453d)

#### Sub RelayOutputClose (Channel as Byte)

This command closes the relay. The parameter  Channel – in range 1..8 means relay number.

#### Sub RelayOutputOpen (Channel as Byte)

This command opens the relay. The parameter  Channel – in range 1..8 means relay number.

#### Sub RelayOutputToggle (Channel as Byte)

This command toggles the relay. The parameter  Channel – in range 1..8 means relay number.

#### Sub RelayOutputPulse(Channel as Byte , Optional PulseTime As Time=:.4)

This command closes the relay for time PulseTime then the relay is opened.  
The parameter  Channel – in range 1..8 means relay number.  
Pulse Time 0.1 – 999.9 sec.

#### Function RelayState (Channel as Byte) As Boolean

This function reads the actual state of relay. The state TRUE means relay is closed.  
The parameter  Channel – in range 1..8 means relay number.

#### Function InputState (Channel as Byte) As Boolean

This function reads the actual state of input. The state TRUE means input contacts closed.  
The parameter  Channel – in range 1..8 means input number.

#### Sub IOState (ByRef InputStatus as String, ByRef RelayStatus as String)

Reads all relay and inputs states “in one shot”and returns the values in Status strings.  
Status strings (InputStatus and OutputStatus, 8bytes):   N1  N2  N3  N4  N5  N6  N7  N8

The Nx means the status of channel x and the values are:

- FF (hexadecimal) - when channel (input or relay) is closed

- 00 (hexadecimal) - when channel (input or relay) is opened

#### Sub UnitByUnitIDIdentify (ByRef Status as String)

This command serves mostly for testing and it is mainly to be used in debugging programs in large  installations where many relayCUE-8 units have been used. It helps to identify the particular unit in installation and allows to read all its parameters.

Whenever this command is executed, and the unit with UnitID is set according to the equipment properties, the LINK LED on the front panel will flash and so it can be easily identified in the rack. It also sends back the "Unit State String" which is written into Status string. For the "Unit State String" details see [https://cue.atlassian.net/wiki/spaces/RUM/pages/488996919](https://cue.atlassian.net/wiki/spaces/RUM/pages/488996919). The length of Status string is 90 bytes.