Endorphin.Instrument.Twickenham.MagnetController


FieldSweep

Namespace: Endorphin.Instrument.Twickenham.MagnetController

Functions related to performing a magnetic field sweep over a specified range with the magnet controller.

Nested types and modules

TypeDescription
FieldSweep

Defines a magnetic field sweep which is associated with a magnet controller. This is created after the connection to the magnet controller has been established.

FieldSweepHandle

Represents a handle to a magnetic field sweep which is currently being performed by a magnet controller. This can be used to wait for the field sweep to complete.

FieldSweepParameters

Defines the parameters for a magnetic field sweep.

FieldSweepResult

Contains the result of a magnetic field sweep, indicating whether the it was completed successfully, failed or cancelled.

FieldSweepStatus

Indicates progress as a magnet controller performs a magnetic field sweep.

ModuleDescription
Parameters

Functions for specifying magnetic field sweep parameters.

Functions and values

Function or valueDescription
create magnetController parameters
Signature: magnetController:MagnetController -> parameters:FieldSweepParameters -> FieldSweep

Creates a magnetic field sweep for the given magnet controller with the specified parameters.

parameters sweep
Signature: sweep:FieldSweep -> FieldSweepParameters

Returns the parameters for a field sweep.

prepare sweep
Signature: sweep:FieldSweep -> FieldSweepHandle

Performs a magnetic field sweep with the default cancellation token. The ready-to-start flag has to be set before the sweep will proceed to the final ramp target once prepared. If the ability to abort the sweep with a cancellation token is required then use prepareWithCancellationToken instead. Returns a handle which can be used to wait for the sweep to be completed asynchronously.

prepareAsChild sweep
Signature: sweep:FieldSweep -> Async<FieldSweepHandle>

Performs a magnetic field sweep as a child (sharing the same cancellation token) to the current asynchronous workflow. The ready-to-start flag has to be set before the sweep will proceed to the final ramp target once prepared. If the token is cancelled, then the sweep will be aborted and the magnet controller will be left in a paused state. To ensure that the sweep is stopped cleanly, no other cancellation compensations should be registered with this cancellation token which will post commands to the magnet controlller. Returns a handle which can be used to wait for the sweep to be completed asynchronously.

prepareWithCancellationToken (...)
Signature: sweep:FieldSweep -> cancellationToken:CancellationToken -> FieldSweepHandle

Prepares a magnetic field sweep with the given cancellation token. The ready-to-start flag has to be set before the sweep will proceed to the final ramp target once prepared. If the token is cancelled, then the sweep will be aborted and the magnet controller will be left in a paused state. To ensure that the sweep is stopped cleanly, no othercancellation compensations should be registered with this cancellation token which will post commands to the magnet controlller. Returns a handle which can be used to wait for the sweep to be completed asynchronously.

setReadyToSweep sweep
Signature: sweep:FieldSweep -> unit

Sets the ready-to-sweep flag on the magnetic field sweep so that it will proceed to the final ramp target once prepared.

status sweep
Signature: sweep:FieldSweep -> IObservable<FieldSweepStatus>

Returns an observable which fires when the magnetic field sweep status changes.

waitToFinish sweepHandle
Signature: sweepHandle:FieldSweepHandle -> Async<FieldSweepResult>

Asynchronously waits for the magnetic field sweep workflow associated with the handle to complete with success, failure or cancellation.

waitToPrepare sweep
Signature: sweep:FieldSweep -> Async<unit>

Asynchronously waits for the magnetic field sweep to be prepared at the initial field.

Fork me on GitHub