Request result()

From SweepMe! Wiki
Jump to navigation Jump to search

After the measure() function has triggered the data acquisition process, request_result() is called to query the results, which are retrieved by read_result() in the next step.

Functionality

Within the concept of unblocking parallelization, the methods request_result() and read_result() are designed to improve measurement efficiency by allowing instruments to operate concurrently.

  • request_result(): This function sends a command to the instrument to initiate data acquisition or buffer filling. It is typically non-blocking, meaning it does not wait for the operation to complete. This allows multiple instruments to start their operations in parallel.
  • read_result(): This function retrieves the result from the instrument. It includes any necessary waiting time until the buffer is ready to be read. It is usually called after all instruments have been triggered with request_result().

By separating the triggering (request_result()) and reading (read_result()) phases, SweepMe! enables instruments to fill their buffers in parallel. This parallelization significantly reduces total measurement time.

If blocking (e.g., waiting for the buffer to be ready) occurs within request_result(), other instruments might not yet have started their acquisition processes. As a result, measurements would proceed sequentially rather than in parallel, which increases total execution time.

Therefore, in general, a command is sent in request_result() to instruct the instrument to start filling the buffer, and the result is read later in read_result(), once it's ready.


Driver Development

  • Measurement Modules:

The `request_result()` function is typically used after the measure() function has been called for measurement modules that expect longer measurement times, such as Temperature modules. It enables parallel measurements between instruments in the sequencer.

  • Not for Switch Drivers:
 The `request_result()` function is not necessary for drivers like Switch, which are used to set values rather than acquire data. These drivers do not require data readiness checks.