![Asentria Teleboss 850 Скачать руководство пользователя страница 186](http://html.mh-extra.com/html/asentria/teleboss-850/teleboss-850_user-manual_2981745186.webp)
TeleBoss 850 2.06.280_STD User Manual
Page 180
a_lib.ReadDIPs
Description
Read the state of a bank of DIP switches.
Syntax
a_lib.ReadDIPs(bank)
bank: Which DIP switch bank to read (1-based);
number of DIPs varies by platform, most have
one bank or none
Returns
Returns string representing DIP switch state, from left-to-right, where '1' represents UP and '0' represents DOWN.
Returns nil and error message if argument invalid or DIPs not present on platform.
Example
print(a_lib.ReadDIPs(1))
01001111
print(a_lib.ReadDIPs(2))
nil Invalid DIP switch number.
a_lib.Relay
Description
Sets a relay output to a given state.
Syntax
a_lib.Relay(slot, relay, state)
a_lib.Relay(slot, relay, state, duration)
slot: Eventsensor slot (0-16; 0 for internal)
relay: Relay number on eventsensor (1-10)
state: State to set relay to: "Closed", "Open", "Active", "Inactive"
duration: Number of seconds to hold active state (optional, only
applies to active state)
Returns
Returns 1 if the command is successful, or 'nil' if not.
Example
-- set internal relay 3 to 'closed' state for 5 seconds
print(a_lib.Relay(0, 3, "closed", 5)
Содержание Teleboss 850
Страница 6: ......