GetRelayCount(string)
- Updated2026-01-20
- 1 minute(s) read
Returns the number of times the relay has changed from closed to open.
Syntax
Namespace: NationalInstruments.ModularInstruments.NISwitch
public int GetRelayCount(string relayName)
Remarks
Relay count is useful for tracking relay lifetime and usage. Call WaitForDebounce before GetRelayCount to ensure an accurate count.
Parameters
| Name | Type | Description |
|---|---|---|
| relayName | string | The name of the relay. |
Returns
Returns a Int32 that indicates the number of times the relay has changed from closed to open.
Exceptions
| Type | Description |
|---|---|
| System.ObjectDisposedException | The GetRelayCount method was accessed after the associated NISwitch object was disposed. |