measure Command

FlexOTO Instance:
Hardware Diagram

This command passes to the driver the names of instrument input connectors on which to perform measurements. The driver performs all measurement on each input and returns a JSON results string for all inputs listed.

The list of measurements to be performed is specified within your driver. The driver should translate from the input connector name to the instrument's SCPI commands that are required to select the instrument's input connector and perform the measurements.

Interaction when the measure command is sent to the Instrument Driver

Command Sent from FlexOTO

measure "input connector" "input connector" ...

This is an example of a typical argument string:

'measure "IN A" "IN B"'

Your driver will need to strip "measure " from the string, and create list of connectors without the double quote characters ("). For example:

['IN A','IN B']

Response Returned from Driver

Returns a JSON string with a list of measurement results. The JSON string is followed by "DONE", on separate lines.

Copy

Example JSON Measure String in Python

measurements = """
[
    {
        "Name": "User Meas1",
        "Input": "IN A",
        "Result": 0.000001234,
        "FormattedResult": "1.23 uW"
    },
    {
        "Name": "User Meas2",
        "Input": "IN B",
        "Result": 0.000001526,
        "FormattedResult": "1.53 uW"
    }
] """

print(error_messages)  # if any
print(measurements)
print("DONE")
            

JSON Name Element

The value of the Name element is a string that names the measurement. The name will be displayed on FlexOTO's Job Results panel.

"Name": "User Meas1",

JSON Input Element

The value of the Input element is a string that names the instrument's measurement input connector.

"Input": "IN A",

JSON Result Element

The Result element returns the measurement result (floating-point number). The measurement will be displayed on FlexOTO's Job Results panel.

"Result": 0.000001234,

JSON FormattedResult Element

The FormattedResult element returns the measurement result with the value formatted to include units of measure. The measurement (formatted) will be displayed on FlexOTO's Job Results panel. The formatting should be performed by the driver.

"FormattedResult": '{0:.2f} uW'.format(0.000001234)