BenthamHID SDK
Bentham SCPI Terminal
Bentham SCPI terminal is a simple windows terminal for direct communication with Bentham devices. It allows you to try out communication directly prior to and during development of control code using the BenthamHID SDK or bendev.
Introduction to BenthamHID
BenthamHID is a very small library that can easily be integrated into most projects. The rest of this page outlines the availbable functions. The vast majority of time the functions version, write_timeout, and query_timeout to query the BenthamHID version number, write a command to a device, and write-then-read respectively are sufficient to control all devices. For the documentation of other functions, please see the header files shipped with the BenthamHID SDK.
version
Copies the DLL version into the supplied buffer. No USB communication performed.
// @param version_string The data buffer. // @param length 4 byte integer, The length of the data buffer in bytes. void version(unsigned char* version_string, unsigned int length);
query_timeout
Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number. Write the query output report to the HID device. Read the reply input report from the device.
// @param vid 2 byte integer. The Vendor ID(VID) of the device to open. // @param pid 2 byte integer. The Product ID(PID) of the device to open. // @param sn The Serial Number of the device to open // (Optionally NULL). // @param query The query data to send. // @param query_length 4 byte integer. The length in bytes of the query // data to send. // @param reply A buffer to put the read data into. // @param reply_length 4 byte integer. The number of bytes to read. // @param timeout_ms The maximum number of milliseconds // this function will wait to obtain // the thread safe lock before quitting // and returning false without executing // the query (-1 for blocking wait). bool query_timeout( unsigned short vid, unsigned short pid, const char* sn, unsigned char* query, unsigned int query_length, unsigned char* reply, unsigned int reply_length, int timeout_ms);
write_timeout
Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number. Write the output report to the HID device.
// @param vid 2 byte integer. The Vendor ID(VID) of the device to open. // @param pid 2 byte integer. The Product ID(PID) of the device to open. // @param sn The Serial Number of the device to open // (Optionally NULL). // @param data The data to send. // @param length 4 byte integer. The length in bytes of the data to send. // @param timeout_ms The maximum number of milliseconds // this function will wait to obtain // the thread safe lock before quitting // and returning false without executing // the write (-1 for blocking wait). bool write_timeout( unsigned short vid, unsigned short pid, const char* sn, const unsigned char* data, unsigned int length, int timeout_ms);