Repetition time programming.
There are two different modes of reptime programming: hardware and software. First one is based on the setting of a relevant parameter of some device that can trigger the pulse experiment. Software repetition time can be controlled by creation of the dummy device and assigning rep time value to a Delay parameter in the 'eachpoint' section located on the Setup tab. Software repetition time is very rough and mainly serves for the testing purposes.

Note 2


Terms.
Term 'parameter' stands for output and 'data' for input operations.
Terms 'synchronous/asynchronous' applies to the relation between some process and pulse experiment flow. Example: echo signal detection - synchronous data acquisition; temperature reading - asynchronous data acquisition; per point setting of the magnetic field - synchronous parameter's setting; sweeping magnetic field using start/stop operations - asynchronous parameter's setting.

Note 3


Device driver: parallel executing.
To achieve the parallel executing of different device drivers each driver can have a separate thread. The only function of device driver executed in the thread is DoCommand().
If driver does not need a separate thread it is calling SetMainThread() in constructor. To create independent thread CreateDeviceThread() and DeleteDeviceThread() can be called.
To interact between thread and other functions of driver (which will be executed in the thread of Kernel) the command queue is used. Posting of some command to queue using AddCommand() call will finally result in executing of the command. Queue preserves order of commands (FIFO).

Note 4


Device driver: DoCommand().
Device driver can keep some command in the queue as much as needed by setting isProcessed field of the command to false.

Note 5


Device driver: Synchronous/Asynchronous input operations.
If data are synchronous the SyncRead(SProperty *prop, ...) command is sending first. Program expect amount of prop->SetValue() calls equal to hardware repetitions per one SyncRead command. Common practice to have AddCommand() inside SyncRead().
Asynchronous data continuously calling prop->SetValue() at the moment when driver decide. To avoid problem of wrong first points the first time reading is always made synchronously.
To make a synchronous acquisition of asynchronous data program calls GetProperty(). IsDataReady function have to return command is waiting for the execution of all commands made previously.

Limitations.
Sync aquisition assumed to be only on transient axis.

Note 6


Device driver: Synchronous/Asynchronous output operations.
Synchronous parameters set one point at a time using SetProperty().
Asynchronous parameter send all points to device at a time using SetAsyncProperty and then calling SetProperty() in the same way like for synchronous parameters. Is used for: magnetic field sweep - one need to know the sweep direction before the second point appear; or any device with internal memory

Note 7


Variables and namespaces.

  • Variables of outer loops and inner program exist in different namespaces. This means that one can have two independent variables with the same name.

  • External variables of inner program are treated as parameters of calling the inner program. Before the call outer loops set them. Consequence: the change of external variables inside inner loops will not affect setting of this variable during next call.

  • Variable list (that presented to user) consists of external variables of inner program and variables assigned to devices (slow variables).