PT Filterwheel Controller Commands

Introduction

The PT Filterwheel Controller controls the shutter, filter wheel and flat field lamp. It runs on a ZWorld JackRabbit BL1810 single board computer, and the code is written in Dynamic C.

Command Interface

Commands

Basic Commands
rebootAckAcknowledge controller reboot. Until this command is sent, all other commands are rejected (following a reboot). This is a no-op once reboot has been acknowledged.
resetResets the controller to a known state, including closing the shutter (aborting a timed exposure, if any), moving the filter wheel to the next known position if the position is unknown (i.e. if there is was an error last time the filter wheel was moved), and turning off the flat field lamp.
Shutter Commands
startExposure timeTenthSecStarts an exposure, where exposuretime is in integer tenth seconds. The allowed range is [1, 20,000]. Prohibited while the shutter is open, the filter wheel is moving or the filter wheel position is unknown. As a deprecated feature, if you omit timeTenthSec then the default exposure time is used (see setExposureTime).
remainingTimeReturns the remaining exposure time for the current exposure in integer tenth seconds. Returns 0 if no exposure. Returns -1 if the shutter is open for an untimed exposure.
closeShutterCloses the shutter, aborting a timed exposure, if any. Returns the exposure time (in tenths of a second) if a timed exposure was occurring. Returns 0 if the shutter was already closed. Returns -1 if an untimed exposure was in progress.
interruptExposureIdentical to closeShutter.
openShutterKills the current timed exposure, if any, then opens the shutter for an untimed exposure.
queryShutterReturns the state of the shutter: "open" or "closed".
The following shutter commands are deprecated:
setExposureTime timeTenthSecSets the default exposure time in integer tenth seconds. Returns the actual time that has been set. The use of default exposure time is deprecated.
getExposureTimeReturns the default exposure time in integer tenth seconds. The use of default exposure time is deprecated.
Filter Wheel Commands
setFilter desPosMoves the filter wheel to the desired position 1-6. Returns the same information as getFilter. Prohibited during a timed exposure. Note: most of the motion happens in the background. However, if the current position is unknown (i.e. if the last move failed) then the filter wheel is first moved to the next known position in the foreground (which can take several seconds) before the command returns.
getFilterReturns currPos desPos status:
  • currPos is the current filterwheel position: 1-6, or NaN if unknown.
  • desPos is the desired filterhweel position: 1-6 if specified, 0 if "go to next known position", or NaN if some internal error has occurred.
  • state is one of:
    • OK if the last move finished successfully.
    • remTime the estimated remaining time to move as an decimal number of seconds. This number is only valid to within a few seconds; the decimal point is included solely to make it obvious it is not a filter position.
    • error: error message if the previous move failed.
Miscellaneous Commands
setFFLamp desStateControls the flat field lamp; desState is one of on or off. Returns the state. Prohibited during a timed exposure.
getFFLampReturns the state of the flat field lamp; one of on or off.
getDigIOReturns the value of digital I/O and other boolean info in hex with a leading 0x; for example: 0x13e. The bits are as follows (where 0 is the low order bit):
  • 0-2: filter wheel switch input; valid filter positions are 1-6; warning: incorrect positions are possible for brief periods during transitions between filters (due to not using a gray code)
  • 3-5: not used, always 1
  • 6: flat field lamp output; 1=on
  • 7: shutter output; 1=open
  • 8: shutter wheel motor output; 1=on; warning: this is maintained by software; ill-behaved code can toggle the filter wheel motor and not toggle this bit
  • 9: filter wheel background task; 1=running

Changes

On 2003-03-28 the PT filterwheel controller underwent a major overhaul. The changes are as follows:

Overall Changes:

Changed Commands:

New Commands:

Deleted Commands:

History