Relay
The relay library provides an interface for controlling relays. This is high level API for controlling digital outputs with human-friendly naming.
The relay library is available for:
- ENP-RL6, using 6 hardware ports,
- ENP-RL6 M2, using 6 hardware ports,
- Virtual UCM on Welotec Arrakis Mk3/Mk4 with DIO module installed, using 4 hardware ports,
- Virtual UCM on any PC using Generic IO interface.
relay.new
-- @param connection_string string Connection URI
-- @return object|nil, string|nil
function relay.new(connection_uri)
end
Returns a new relay client. The connection URI should specify the desired relay (digital output) device.
Use port schema to access hardware ports. On Virtual UCM you may also use gio schema for Generic IO.
On failure, it returns nil and an error message string.
client Object
client:close
-- @return string|nil
function client:close()
end
Closes the relay contact.
On success, the function returns nil. On failure, it returns an error message string.
client:open
-- @return string|nil
function client:open()
end
Opens the relay contact.
On success, the function returns nil. On failure, it returns an error message string.