Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Blocking vs nonblocking moves
The LSC interface provides two types of moves: blocking, and nonblocking. When started, a blocking move blocks MATLAB execution until the move is complete. When a nonblocking move is started, control is returned to MATLAB immediately after the move is initiated, so that MATLAB execution can continue. For nonblocking moves, the LSC interface allows a callback to be supplied, which fires when the move is complete.

How LSC works

Roughly speaking, you can think of LSC properties and methods and being split into two groups: those intended for the subclass writer (you), and those intended for the LSC user (whoever interacts with the class, eg the ScanImage application).

The properties you should focus on are the abstract properties, many of which have "Raw" in their names: positionAbsoluteRaw, velocityRaw, etc. You will implement these properties to provide properties of your device, within a coordinate system and unit system of your choosing.

On the other hand, a user of your LSC class will interact with the "non-Raw" properties: postionAbsolute, velocity, and so on. These properties access your properties, with an additional layer of code that performs unit conversion and coordinate transformation. Users of your LSC class in general will not interact with the "Raw" properties.

The situation with methods is the same. You should focus on the abstract methods which have "Hook" in their names, such as moveStartHook. Meanwhile, users of your class will use the corresponding "non-Hook" methods, such as moveStartAbsolute. The code for moveStartAbsolute calls your moveStartHook method, but has an additional layer of code.

Your Device

We will assume you have a particular stage controller device you wish to control from MATLAB. To be controlled by MATLAB, the device must have an interface to your computer, such as a serial port interface. You will need the documentation for this interface (the available commands and their responses, etc). Note that your stage will often have manual input/control in addition to control via its computer interface.

...

Minimal LSC Implementation for ScanImage

At the current time, the abstract properties required for ScanImage operation are:

The LSC interface includes more than is absolutely required by ScanImage, because was designed with the idea that it would provide a stage controller interface that would be generally useful.

That said, you are probably reading this page because you are a ScanImage user with a custom stage. At the moment, ScanImage requires the following properties and methods of LSC to be implemented/functional:

Properties

  1. nonblockingMoveCompletedDetectionStrategy
  2. isMoving
  3. nonblockingMoveCompletedDetectionStrategy
  4. positionAbsoluteRaw (get only)
  5. isMoving positionAbsoluteRaw (get only)
  6. positionDeviceUnits (get only)
  7. resolution (get only)

Methods

  1. moveStartHook

In the case where you want to do the least possible to get ScanImage up and running, the other properties can be "left blank" (eg properties can implemented with empty values).

...