Command: Set Program Information
The Set Program Information command allows you to control the different parameters that are used during the running of a program. This is essentially how a time-lapse or similar program is created. You set the different parameters controlling how your program will operate, and then start the execution of the program. Every value is read immediately before it is used by the engine, so you are able to modify parameters on the fly, and have them take effect the next time that value would be used.
Each Program Information command will use the command byte value of 2.
The set program information provides a number of sub-commands, grouping parameters by type. The following table lists each sub-command:
| Name | Sub-Command (DB1) | Info |
|---|---|---|
| camera | 1 | Set camera parameters |
| motor | 2 | Set motor parameters |
| action | 3 | Add/Remove actions |
| keyframe | 4 | Add/Remove keyframes |
When specifying a sub-command, you must also specify which parameter you want to modify as a next byte, the sections below detail each sub-command, and the available parameters.
No Set Program Information command returns any data, only a positive response with zero data bytes will be returned for any set program info command.
Sub-command: Camera
The Camera sub-command allows you to control all camera parameters. The following parameters are supported:
| Name | Data Length Byte | Sub-Com (DB1) | Param (DB2) | DB3 | DB4 | DB5 | DB6 | Info |
|---|---|---|---|---|---|---|---|---|
| interval | 4 | 1 | 1 | interval (unsigned int) | Sets the interval between camera shots | |||
| exposure time | 6 | 1 | 2 | exposure tm (unsigned long) | Sets exposure time in milliseconds | |||
| pre-focus tap time | 4 | 1 | 3 | tap tm (unsigned int) | Set amount of time to bring focus pin high before firing camera (0 to disable focus tap) | |||
| max shots | 4 | 1 | 4 | shot count (unsigned int) | Set maximum number of exposures to take during program | |||
| post delay time | 4 | 1 | 5 | delay tm (unsigned int) | Set amount of time to delay after completing exposure, and before moving motors | |||
| focus with shutter | 3 | 1 | 6 | on/off (1 or 0) | Set whether to always bring focus pin high with shutter pin -- 0 to disable, 1 to enable. | |||
| camera cycle repeat count | 3 | 1 | 7 | count | Set repeat cycle (see documentation) count | |||
| camera cycle add repeat action | 4 | 1 | 8 | cycle action index (0-3) | action id (0-15) | Add an action to be called between each repeat shot in a repeat cycle | ||
| camera cycle add complete action | 4 | 1 | 9 | complete action index (0-3) | action id (0-15) | Add an action to be called at the completion of a camera repeat cycle | ||
| camera cycle return motors home upon cycle complete | 3 | 1 | 10 | on/off (1 or 0) | Set whether or not to send all motors back to the point where they were at the beginning of a repeat cycle. | |||
For more information on the camera repeat cycle functions, see the Cycle Repeat documentation.
Example:
Set intervalometer:
| Command Byte | Data Length Byte | Sub-Com (DB1) | Parameter (DB2) | DB3 | DB4 |
|---|---|---|---|---|---|
| 2 | 4 | 1 | 1 | interval sec. (unsigned int) | |
Sub-command: Motor
The Motor sub-command allows you to control all motor parameters.
Each parameter requires a motor number to apply the parameter to. Valid motor numbers are 0-3. You may change any parameter while a program is running, e.g. you could set up each axis initially, and only turn them on as needed during the course of executing your program.
The following parameters are supported:
| Name | Data Length Byte | Sub-Com (DB1) | Param (DB2) | DB3 | DB4 | DB5 | DB6 | DB7 | Info |
|---|---|---|---|---|---|---|---|---|---|
| steps | 4 | 2 | 1 | motor # | steps (unsigned int) | Set # of steps between camera shots for the given motor | |||
| ramp rate | 4 | 2 | 2 | motor # | ramp rate | Set # of exposures to ramp up to full speed/down to stop for the given motor | |||
| direction | 4 | 2 | 3 | motor # | dir (0 or 1) | Set the direction of travel for the given motor | |||
| max steps | 7 | 2 | 4 | motor # | steps (unsigned long) | Set the maximum number of steps to travel in the program for the given motor | |||
| enable | 3 | 2 | 5 | motor # | Enable the given motor | ||||
| disable | 3 | 2 | 6 | motor # | Disable the given motor | ||||
| set home | 3 | 2 | 7 | motor # | Set current position as 'home' for the given motor | ||||
| backlash comp | 4 | 2 | 8 | motor # | steps | Set the number of steps of backlash to compensate for, for the given motor | |||
Example:
Set ramp rate for motor #0:
| Command Byte | Data Length Byte | Sub-Com (DB1) | Parameter (DB2) | DB3 |
|---|---|---|---|---|
| 1 | 2 | 100 | 2 | ramp rate (byte) |
Sub-command: Action
The Action sub-command allows you to create and remove actions for use by keyframes or in a repeat shot cycle. Up to sixteen total actions may be stored, each specified by an index value (0-15). You may, at any time, over-write any existing action, or remove it to prevent it from being called again in the future.
Actions can change parameters, or control program execution. There are four basic action controls:
| Name | Control (DB2) | Info |
|---|---|---|
| camera | 1 | Changes parameters related to camera control |
| motor | 2 | Changes parameters related to motor control |
| program | 3 | Changes program execution |
| delete | 4 | Deletes an action from memory |
Each action control will be followed by a single byte, specifying the action index to write to/delete. The legal values for an action index are 0-15.
Each action request should begin with the following 5-byte sequence:
| Command Byte | Data Length Byte | Sub-Com (DB1) | Control (DB2) | Action Index (DB3) |
| 2 | length | 3 | control | index |
length, control, and index will vary with each action command.
Camera Control Action
When creating a camera control action, you can choose which camera setting you want to change. The setting to change is defined by the 'type' parameter, that is specified in the 4th data byte. The following table details which controls are available, and the data to send from the data length byte:
| Name | DLB | Sub-Com (DB1) | Cntrl (DB2) | IDX (DB3) | Type (DB4) | DB5 | DB6 | Info |
|---|---|---|---|---|---|---|---|---|
| enable | 6 | 3 | 1 | index | 1 | interval (unsigned int) | Enables the camera and sets the interval time. (Interval time is optional, if 0 the interval is unchanged) | |
| disable | 4 | 3 | 1 | index | 2 | Disables the camera | ||
| exposure tm | 6 | 3 | 1 | index | 3 | exp tm (unsigned int) | Sets exposure time to given amount of milliseconds | |
| exposure mult. | 6 | 3 | 1 | index | 4 | multiplier (unsigned int) | Multiplies exposure time by multiplier | |
Example:
Set Action Index #0 to set exposure time for camera
| Command Byte | Data Length Byte | Sub-Com (DB1) | Control (DB2) | Action Index (DB3) | Type (DB4) | DB5 | DB6 |
| 2 | 6 | 3 | 1 | 0 | 3 | exposure tm (unsigned int) | |
Motor Control Action
Motor control actions all require a motor number, enable/disable flag, direction, and command. This means that you may, in a single action, enable a motor, set direction, and change an operating parameter for a motor. The following table lists each command and its arguments:
note: DB1-DB3 (sub-com through index) are omitted for brevity
| Name | DLB | Motor (DB4) | Enable (DB5) | Dir (DB6) | Command (DB7) | DB8 | DB9 | Info |
|---|---|---|---|---|---|---|---|---|
| set steps | 9 | motor # | 0-3 | 0-3 | 1 | steps (unsigned int) | Sets steps between shots for the given motor | |
| ramp down | 7 | motor # | 0-3 | 0-3 | 2 | Execute a downramp for given motor, starting with the next movement | ||
| move now | 9 | motor # | 0-3 | 0-3 | 3 | steps (unsigned int) | Execute a move now with given motor | |
| enable/dir change only | 7 | motor # | 0-3 | 0-3 | 4 | Change only direction/enable parameter for motor | ||
The Enable Flag allows you to specify how to modify the Enable parameter for the given motor via this action:
| Enable Value | Info |
|---|---|
| 0 | Set motor enable to 'disabled' |
| 1 | Set motor enable to 'enabled' |
| 2 | Set motor enable to the opposite of its current value (invert) |
| 3 | Leave motor enable unchanged |
The Direction Flag allows you to specify how to modify the Direction of the given motor via this action:
| Direction Value | Info |
|---|---|
| 0 | Set motor direction to '0' |
| 1 | Set motor direction to '1' |
| 2 | Set motor direction to the opposite of its current value (invert) |
| 3 | Leave motor direction unchanged |
Program Control Action
Program control actions control execution of the currently running program. Start is included for completeness, but as keyframes cannot run when the program is not running, it would be difficult to call. The following table lists each available command for this action type, from the Data Length Byte:
| Name | DLB | Sub-Com (DB1) | Cntrl (DB2) | IDX (DB3) | Type (DB4) | Info |
|---|---|---|---|---|---|---|
| stop | 4 | 3 | 3 | index | 1 | stop program execution |
| start | 4 | 3 | 3 | index | 2 | start program execution |
| pause | 4 | 3 | 3 | index | 3 | pause program execution |
Delete Action
The Delete Action control allows you to remove an action that you had previously stored.
| Name | DLB | Sub-Com (DB1) | Cntrl (DB2) | IDX (DB3) | Info |
|---|---|---|---|---|---|
| delete | 3 | 3 | 4 | index | delete action at the given index |
Sub-Command: Keyframe
The Keyframe sub-command allows you to place a keyframe at a specified point in the program. Each keyframe can trigger an action you have defined with the Action sub-command. Keyframes can be set for motor positions, exposures, or points in time. That is, if you created an action that modified the time interval between exposures, you could call it when a motor has moved 10,000 steps, or when you've taken 50 exposures, or even when the program has been running for two hours.
There are three primary types of keyframes: motor, camera, and time. Each type can hold up to sixteen keyframes, and are identified by a keyframe index ranging from 0-15. Once a keyframe has been activated, it is removed from memory so that you may re-use its position if needed, and so that it does not trigger again. All keyframes require an action index for the action to call, and motor keyframes require you to specify the motor # for the distance measurement.
The following table lists each type of keyframe:
| Name | DLB | Sub-Com (DB1) | Type(DB2) | IDX (DB3) | Value (DB4) | Motor (DB5) | Action IDX (DB6) | Info |
|---|---|---|---|---|---|---|---|---|
| camera | 6 | 4 | 1 | index | 1 | 0 | action index | call action at exposure value |
| motor | 6 | 4 | 2 | index | 2 | motor # | action index | call action at motor dist. moved |
| time | 6 | 4 | 3 | index | 3 | 0 | action index | call action at given run length |
- Printer-friendly version
- Login or register to post comments
