#include <CDriverServotogo.h>
Public Member Functions | |
cDriverServotogo () | |
Constructor of cDriverServotogo. | |
~cDriverServotogo () | |
Destructor of cDriverServotogo. | |
virtual int | open () |
Open connection to Sensoray626 board. | |
virtual int | close () |
Close connection to Sensoray626 board. | |
virtual int | initialize (const bool a_resetEncoders=false) |
Initialize Sensoray626 board. | |
virtual int | command (int a_command, void *a_data) |
int cDriverServotogo::close | ( | ) | [virtual] |
Close connection to Sensoray626 board.
Sets all DACs to zero
Reimplemented from cGenericDevice.
int cDriverServotogo::command | ( | int | a_command, | |
void * | a_data | |||
) | [virtual] |
Send a command to the Servo2Go board. Possible commands are:
CHAI_CMD_GET_DEVICE_STATE: returns an int (1 board is ready, 0 board is NOT ready).
CHAI_CMD_GET_ENCODER_0: reads encoder 0, returns counts value in a long.
CHAI_CMD_GET_ENCODER_1: reads encoder 1, returns counts value in a long.
CHAI_CMD_GET_ENCODER_2: reads encoder 2, returns counts value in a long.
CHAI_CMD_GET_ENCODER_3: reads encoder 3, returns counts value in a long.
CHAI_CMD_GET_ENCODER_4: reads encoder 4, returns counts value in a long, and a value of 0 if the encoder does not exist.
CHAI_CMD_GET_ENCODER_5: reads encoder 5, returns counts value in a long, and a value of 0 if the encoder does not exist.
CHAI_CMD_GET_ENCODER_6: reads encoder 6, returns counts value in a long, and a value of 0 if the encoder does not exist.
CHAI_CMD_GET_ENCODER_7: reads encoder 7, returns counts value in a long, and a value of 0 if the encoder does not exist.
CHAI_CMD_SET_DAC_0: writes a voltage to DAC 0 a value between +10 and -10 volts, which is a double.
CHAI_CMD_SET_DAC_1: writes a voltage to DAC 1 a value between +10 and -10 volts, which is a double.
CHAI_CMD_SET_DAC_2: writes a voltage to DAC 2 a value between +10 and -10 volts, which is a double.
CHAI_CMD_SET_DAC_3: writes a voltage to DAC 3 a value between +10 and -10 volts, which is a double.
CHAI_CMD_SET_DAC_4: writes a voltage to DAC 4 a value between +10 and -10 volts, which is a double. If this axis is not supported no action is taken.
CHAI_CMD_SET_DAC_5: writes a voltage to DAC 5 a value between +10 and -10 volts, which is a double. If this axis is not supported no action is taken.
CHAI_CMD_SET_DAC_6: writes a voltage to DAC 6 a value between +10 and -10 volts, which is a double. If this axis is not supported no action is taken.
CHAI_CMD_SET_DAC_7: writes a voltage to DAC 7 a value between +10 and -10 volts, which is a double. If this axis is not supported no action is taken.
Set command to the Servotogo board.
a_command | Selected command. | |
a_data | Pointer to the corresponding data structure. |
Reimplemented from cGenericDevice.
int cDriverServotogo::initialize | ( | const bool | a_resetEncoders = false |
) | [virtual] |
Initialize Sensoray626 board.
Initializes board. In this implementation there's really nothing to do that hasn't been done in the opening phase.
Reimplemented from cGenericDevice.
int cDriverServotogo::open | ( | ) | [virtual] |
Open connection to Sensoray626 board.
Open board.
Reimplemented from cGenericDevice.