Skip to main content

Controlling Relays and Dry Contacts

The AT1000 provides 8 dry contact relays per device, which can be controlled individually or all at once. Each relay is addressed by its number (0-7).

Closing and Opening Relays​

the code snippets below demonstrate how to control the relays using the AT1000 API. The tester.relay() function is used to select a relay. The close() and open() methods are used to activate and deactivate the relay, respectively.

import at1000 from "at1000";
let tester = at1000.find_device("12345"); // Find the device with serial number 12345
let relay4 = tester.relay(4); // Select relay number 4
relay4.close(); // Close relay 4 (activate)
relay4.open(); // Open relay 4 (deactivate)

// Control all relays at once
tester.relay().close();

Reading Relay Status

To check whether a relay is open or closed, use the read() function in a similar manner. This function returns 1 if the relay is closed and 0 if it is open.

let relay_status = tester.relay(4).read(); // Read the status of relay 4
console.log("Relay 4 status:", relay_status ? "Closed" : "Open");
Relays / Dry contacts are not synchronized

Please note that relays operation are always sequential, and cannot be synchronized using the output_hold and output_sync mechanisms.