Program Fact 7. To Control a User Instrument

FlexOTO allows you to use a generic instrument to perform a measurement that is not available in FlexOTO. You can write your own instrument driver which will enable FlexOTO to communicate with and make measurements with your instrument. It's really not that difficult and you can easily learn how to write the driver. Here's an example program.

A user-written instrument driver should listen for commands from FlexOTO over stdin, handle them, and respond to them by writing to stdout. There are only three commands that the driver needs to handle:

  • get_description. Sends to FlexOTO a list of the instrument's model number, serial number, and measurement input connectors in the form of a JSON string.
  • measurements. Receives from FlexOTO a list of instrument input connectors on which to perform measurements. Sends to FlexOTO the measurement results in the JSON format.
  • exit. Receives from FlexOTO the requirement to stop the instrument driver.

To Use Your Instrument Driver

Once you have written your driver, you'll use the following four FlexOTO commands install and run the driver: