delphi-keyes-relay
Delphi interface to Keyes usb relay
- Quiet · last change 11-23-2014
- ★ 3 on GitHub
README
delphi-keyes-relay
Delphi interface to Keyes usb relay
Devices
http://www.dx.com/p/keyes-1-channel-usb-control-switch-relay-module-for-pc-red-5v-308292 http://www.dx.com/p/keyes-2-way-5v-free-drive-usb-control-switch-relay-module-red-307714
Description
Translated the file usb_relay_device.h from the rar file found at https://app.box.com/s/0v2dprnozmry05luxopv
Usage
- Create a new Delphi Project
- Copy the
usb_relay_device.pasandUsbRelay.pasfiles into the source dir of your project or add the directory to your project options. - Copy the
usb_relay_device.dllfile to the output directory of your project. - Put UsbRelay in the
Usessection FindUsbRelaysretrieves a list of relays and stores the in a StringlistUsbRelaysthat has the serials in theStringsandTUsbRelayin the accompanyingObjects.- After setting 'TUsbRelay.open' to
trueindividual relays on the device can be controlled with the propertyTUsbRelay.state[index]. Note thatindexhere is 1-based. - The 'TUsbRelay.devicetype` is actually the number of relays on the device.
- All relays on a device can be set or unset by 'TUsbRelay.openallchannels
andTUsbRelay.closeallchannels`.
See the demo application

