USB Controlled Relay library

Post your working scripts, libraries and tools
Posts: 40
Joined: 25 Nov 2016, 16:44

USB Controlled Relay library

13 Mar 2018, 07:53

A function library for USB Relay boards. See this post for capturing USB input.

It only has one function, turn the relays on or off. There must be a second function, for finding the board serial number, but there are no instructions for it. A test app in the file downloads can be used to find it.

Requires the following files in the script directory.
1. CommandApp_USBRelay.exe
2. usb_relay_device.dll
3. GuiApp_English.exe ;;;;;; These last two are only for
4. XCGUI.dll ;;;;;; finding the device serial number.

File download links.
Original file,

Backup on my website,
This one includes copies of the library and a test script.

"serial" is your device's serial number.
"oc" is open or close. This is opposite of what would be expected, "open" activates the relay and "close" disconnects it.
"chan" is the relay chan, 1, 2, 3, ect. 255 controls all relays on the board.
Example - USBRelay(tk421,open,1)

I've only tested with a two channel board but I imagine it would work with any number of channels.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Return to “Scripts and Functions”

Who is online

Users browsing this forum: brodoplovac and 22 guests