Command: Engine Control
The Engine Control command provides access to commands that control the operation of the engine, or report current status of the engine. Each Engine Control command will use the command byte value of '1'. The following table lists each sub-command:
| Name | Data Length | Sub.Com (DB1) | DB2 | DB3 | DB4 | DB5 | Info | |
|---|---|---|---|---|---|---|---|---|
| noop | 1 | 0 | n/a | Non-operative, always returns true. Used for checking to see if the engine is awake and ready for a command. | ||||
| start | 1 | 1 | n/a | Start the current program,or resume from pause. | ||||
| pause | 1 | 2 | n/a | Pause program execution. | ||||
| stop | 1 | 3 | n/a | Stop the current program, moved steps, time spent, shots fired and other statistics are reset. | ||||
| camera enable | 1 | 4 | n/a | Enable the camera for use | ||||
| camera disable | 1 | 5 | n/a | Disable the camera for use | ||||
| move motor now | 5 | 6 | motor # | direction | steps (unsigned int) | Move the given motor the specified number of steps. (Blocking) | ||
| send motor home | 2 | 7 | motor # | Send the given motor to its home position. (Blocking) | ||||
| fire camera now | 5 | 8 | exposure time - ms (unsigned long) | Expose the camera immediately. (Non-Blocking) | ||||
| motor sleep line | 2 | 9 | on/off | Enable or disable the motor sleep line. This causes the motor sleep pin to be brought low between movements to reduce power consumption. | ||||
| min step delay | 3 | 10 | microseconds (unsigned int) | Set minimum delay between motor steps. | ||||
| max step delay | 3 | 11 | microseconds (unsigned int) | Set maximum delay between motor steps. | ||||
| down ramp now | 12 | motor # | Execute a down ramp on the given motor now (used outside of actions/keyframes) | |||||
| exposure action mod | 3 | 13 | divisor (unsigned int) | Divide the value specified in any exposure multiplication action by this value. This is how you would decrease or increase exposure time in fractions of a whole. | ||||
| current status | varies | 100 | status value | Get value of different operating parameters. See documentation on status values below. | ||||
Examples
Send a start command to the engine:
| Command Byte | Data Length Byte | Sub-Com (DB1) |
| 1 | 1 | 1 |
Send motor #2 home:
| Command Byte | Data Length Byte | Sub-Com (DB1) | Data Byte 2 |
| 1 | 2 | 7 | 2 |
Sub-command: Current Status
The Current Status sub-command allows one to retrieve a number of details about the current state of the engine. Each request must include a parameter which one is requesting the value of. The parameter is a single-byte integer which is sent as the second data byte in the command. All current status requests will respond with at least one byte of data when the request is successful.
The following table lists all parameter values:
| Name | Parameter Value (DB2) | DB3 | Returns | Info |
|---|---|---|---|---|
| api version | 0 | n/a | byte | Returns current API version # |
| running status | 1 | n/a | byte | Returns 0 if engine stopped/paused, or 1 if engine currently running |
| run time | 2 | n/a | unsigned long | Returns current program run time, in ms |
| camera status | 3 | n/a | byte | Returns 0 if camera disabled, 1 if camera enabled |
| shot count | 4 | n/a | unsigned long | Returns count of shots fired in currently running program |
| interval time | 5 | n/a | unsigned int | Returns currently set interval time |
| exposure time | 6 | n/a | unsigned long | Returns currently set exposure time, in ms |
| post time | 7 | n/a | unsigned int | Returns currently set post-exposure delay time, in ms |
| currently exposing | 8 | n/a | byte | Returns 1 if camera is currently exposing, 0 if not |
| motor enabled | 9 | motor # | byte | Returns 1 if given motor is enabled, 0 if not |
| motor dir | 10 | motor # | byte | Returns direction set for given motor |
| motor steps moved | 11 | motor # | unsigned long | Returns # of steps moved by motor in current program |
| motor dist from home | 12 | motor # | signed long | Returns distance from home (negative if in 0 direction, positive if in 1 direction) |
| reserved | 13 | |||
| motor max step | 14 | motor # | unsigned long | Returns max steps setting for the given motor |
| motor ramp | 15 | motor # | byte | Returns motor ramp value for the given motor |
| motor backlash | 16 | motor # | byte | Returns motor backlash comp. amount for given motor |
| motor steps | 17 | motor # | unsigned int | Returns # of steps between shots for the given motor |
| camera keyframe | 18 | keyframe index | unsigned long | Returns keyframe value at given index |
| time keyframe | 19 | keyframe index | unsigned long | Returns keyframe value at given index |
| motor keyframe | 20 | keyframe index | unsigned long | Returns keyframe value at given index |
| action | 21 | action index | unsigned long | Returns action value at given index |
Some status requests are only meaningful if the program is started or paused, such as shots fired and run time.
Ensure that you pay close attention to the response type, and its sign!
Examples
Request the current exposure time setting:
| Command Byte | Data Length Byte | Sub-Com (DB1) | Parameter (DB2) |
|---|---|---|---|
| 1 | 2 | 100 | 6 |
Response from Engine:
| Response Value Byte | Data Length Byte | DB1 | DB2 | DB3 | DB4 |
|---|---|---|---|---|---|
| 1 | 4 | exposure time (unsigned long) | |||
- Printer-friendly version
- Login or register to post comments
