libximc
2.13.6
|
Header file for libximc library. More...
Go to the source code of this file.
Data Structures | |
struct | calibration_t |
Calibration companion structure. More... | |
struct | device_network_information_t |
Device network information structure. More... | |
struct | feedback_settings_t |
Feedback settings. More... | |
struct | home_settings_t |
Position calibration settings. More... | |
struct | home_settings_calb_t |
Position calibration settings which use user units. More... | |
struct | move_settings_t |
Move settings. More... | |
struct | move_settings_calb_t |
Move settings which use user units. More... | |
struct | engine_settings_t |
Movement limitations and settings, related to the motor. More... | |
struct | engine_settings_calb_t |
Movement limitations and settings, related to the motor, which use user units. More... | |
struct | entype_settings_t |
Engine type and driver type settings. More... | |
struct | power_settings_t |
Step motor power settings. More... | |
struct | secure_settings_t |
This structure contains raw analog data from ADC embedded on board. More... | |
struct | edges_settings_t |
Edges settings. More... | |
struct | edges_settings_calb_t |
Edges settings which use user units. More... | |
struct | pid_settings_t |
PID settings. More... | |
struct | sync_in_settings_t |
Synchronization settings. More... | |
struct | sync_in_settings_calb_t |
Synchronization settings which use user units. More... | |
struct | sync_out_settings_t |
Synchronization settings. More... | |
struct | sync_out_settings_calb_t |
Synchronization settings which use user units. More... | |
struct | extio_settings_t |
EXTIO settings. More... | |
struct | brake_settings_t |
Brake settings. More... | |
struct | control_settings_t |
Control settings. More... | |
struct | control_settings_calb_t |
Control settings which use user units. More... | |
struct | joystick_settings_t |
Joystick settings. More... | |
struct | ctp_settings_t |
Control position settings(is only used with stepper motor). More... | |
struct | uart_settings_t |
UART settings. More... | |
struct | calibration_settings_t |
Calibration settings. More... | |
struct | controller_name_t |
Controller user name and flags of setting. More... | |
struct | nonvolatile_memory_t |
Userdata for save into FRAM. More... | |
struct | emf_settings_t |
EMF settings. More... | |
struct | engine_advansed_setup_t |
EAS settings. More... | |
struct | extended_settings_t |
EST settings. More... | |
struct | get_position_t |
Position information. More... | |
struct | get_position_calb_t |
Position information. More... | |
struct | set_position_t |
Position information. More... | |
struct | set_position_calb_t |
Position information which use user units. More... | |
struct | status_t |
Device state. More... | |
struct | status_calb_t |
Device state which use user units. More... | |
struct | measurements_t |
The buffer holds no more than 25 points. More... | |
struct | chart_data_t |
Additional device state. More... | |
struct | device_information_t |
Read command controller information. More... | |
struct | serial_number_t |
Serial number structure and hardware version. More... | |
struct | analog_data_t |
Analog data. More... | |
struct | debug_read_t |
Debug data. More... | |
struct | debug_write_t |
Debug data. More... | |
struct | stage_name_t |
Stage user name. More... | |
struct | stage_information_t |
Stage information. More... | |
struct | stage_settings_t |
Stage settings. More... | |
struct | motor_information_t |
motor information. More... | |
struct | motor_settings_t |
Physical characteristics and limitations of the motor. More... | |
struct | encoder_information_t |
Encoder information. More... | |
struct | encoder_settings_t |
Encoder settings. More... | |
struct | hallsensor_information_t |
Hall sensor information. More... | |
struct | hallsensor_settings_t |
Hall sensor settings. More... | |
struct | gear_information_t |
Gear information. More... | |
struct | gear_settings_t |
Gear setings. More... | |
struct | accessories_settings_t |
Additional accessories information. More... | |
struct | init_random_t |
Random key. More... | |
struct | globally_unique_identifier_t |
Globally unique identifier. More... |
Macros | |
#define | XIMC_API |
Library import macro. | |
#define | XIMC_CALLCONV |
Library calling convention macros. | |
#define | XIMC_RETTYPE void* |
Thread return type. | |
#define | device_undefined -1 |
Handle specified undefined device. | |
Result statuses | |
#define | result_ok 0 |
success | |
#define | result_error -1 |
generic error | |
#define | result_not_implemented -2 |
function is not implemented | |
#define | result_value_error -3 |
value error | |
#define | result_nodevice -4 |
device is lost | |
Logging level | |
#define | LOGLEVEL_ERROR 0x01 |
Logging level - error. | |
#define | LOGLEVEL_WARNING 0x02 |
Logging level - warning. | |
#define | LOGLEVEL_INFO 0x03 |
Logging level - info. | |
#define | LOGLEVEL_DEBUG 0x04 |
Logging level - debug. | |
Enumerate devices flags | |
#define | ENUMERATE_PROBE 0x01 |
Check if a device with OS name name is XIMC device. | |
#define | ENUMERATE_ALL_COM 0x02 |
Check all COM devices. | |
#define | ENUMERATE_NETWORK 0x04 |
Check network devices. | |
Flags of move state | |
This is a bit mask for bitwise operations. Specify move states.
| |
#define | MOVE_STATE_MOVING 0x01 |
This flag indicates that controller is trying to move the motor. | |
#define | MOVE_STATE_TARGET_SPEED 0x02 |
Target speed is reached, if flag set. | |
#define | MOVE_STATE_ANTIPLAY 0x04 |
Motor is playing compensation, if flag set. | |
Flags of internal controller settings | |
#define | EEPROM_PRECEDENCE 0x01 |
If the flag is set settings from external EEPROM override controller settings. | |
Flags of power state of stepper motor | |
This is a bit mask for bitwise operations. Specify power states.
| |
#define | PWR_STATE_UNKNOWN 0x00 |
Unknown state, should never happen. | |
#define | PWR_STATE_OFF 0x01 |
Motor windings are disconnected from the driver. | |
#define | PWR_STATE_NORM 0x03 |
Motor windings are powered by nominal current. | |
#define | PWR_STATE_REDUCT 0x04 |
Motor windings are powered by reduced current to lower power consumption. | |
#define | PWR_STATE_MAX 0x05 |
Motor windings are powered by maximum current driver can provide at this voltage. | |
Status flags | |
This is a bit mask for bitwise operations. Controller flags returned by device query. Contains boolean part of controller state. May be combined with bitwise OR.
| |
#define | STATE_CONTR 0x000003F |
Flags of controller states. | |
#define | STATE_ERRC 0x0000001 |
Command error encountered. | |
#define | STATE_ERRD 0x0000002 |
Data integrity error encountered. | |
#define | STATE_ERRV 0x0000004 |
Value error encountered. | |
#define | STATE_EEPROM_CONNECTED 0x0000010 |
EEPROM with settings is connected. | |
#define | STATE_IS_HOMED 0x0000020 |
Calibration performed. | |
#define | STATE_SECUR 0x1B3FFC0 |
Flags of security. | |
#define | STATE_ALARM 0x0000040 |
Controller is in alarm state indicating that something dangerous had happened. | |
#define | STATE_CTP_ERROR 0x0000080 |
Control position error(is only used with stepper motor). | |
#define | STATE_POWER_OVERHEAT 0x0000100 |
Power driver overheat. | |
#define | STATE_CONTROLLER_OVERHEAT 0x0000200 |
Controller overheat. | |
#define | STATE_OVERLOAD_POWER_VOLTAGE 0x0000400 |
Power voltage exceeds safe limit. | |
#define | STATE_OVERLOAD_POWER_CURRENT 0x0000800 |
Power current exceeds safe limit. | |
#define | STATE_OVERLOAD_USB_VOLTAGE 0x0001000 |
USB voltage exceeds safe limit. | |
#define | STATE_LOW_USB_VOLTAGE 0x0002000 |
USB voltage is insufficient for normal operation. | |
#define | STATE_OVERLOAD_USB_CURRENT 0x0004000 |
USB current exceeds safe limit. | |
#define | STATE_BORDERS_SWAP_MISSET 0x0008000 |
Engine stuck at the wrong edge. | |
#define | STATE_LOW_POWER_VOLTAGE 0x0010000 |
Power voltage is lower than Low Voltage Protection limit. | |
#define | STATE_H_BRIDGE_FAULT 0x0020000 |
Signal from the driver that fault happened. | |
#define | STATE_WINDING_RES_MISMATCH 0x0100000 |
The difference between winding resistances is too large. | |
#define | STATE_ENCODER_FAULT 0x0200000 |
Signal from the encoder that fault happened. | |
#define | STATE_ENGINE_RESPONSE_ERROR 0x0800000 |
Error response of the engine control action. | |
#define | STATE_EXTIO_ALARM 0x1000000 |
The error is caused by the input signal. | |
Status flags of the GPIO outputs | |
This is a bit mask for bitwise operations. GPIO state flags returned by device query. Contains boolean part of controller state. May be combined with bitwise OR.
| |
#define | STATE_DIG_SIGNAL 0xFFFF |
Flags of digital signals. | |
#define | STATE_RIGHT_EDGE 0x0001 |
Engine stuck at the right edge. | |
#define | STATE_LEFT_EDGE 0x0002 |
Engine stuck at the left edge. | |
#define | STATE_BUTTON_RIGHT 0x0004 |
Button "right" state (1 if pressed). | |
#define | STATE_BUTTON_LEFT 0x0008 |
Button "left" state (1 if pressed). | |
#define | STATE_GPIO_PINOUT 0x0010 |
External GPIO works as Out, if flag set; otherwise works as In. | |
#define | STATE_GPIO_LEVEL 0x0020 |
State of external GPIO pin. | |
#define | STATE_BRAKE 0x0200 |
State of Brake pin. | |
#define | STATE_REV_SENSOR 0x0400 |
State of Revolution sensor pin. | |
#define | STATE_SYNC_INPUT 0x0800 |
State of Sync input pin. | |
#define | STATE_SYNC_OUTPUT 0x1000 |
State of Sync output pin. | |
#define | STATE_ENC_A 0x2000 |
State of encoder A pin. | |
#define | STATE_ENC_B 0x4000 |
State of encoder B pin. | |
Encoder state | |
This is a bit mask for bitwise operations. Encoder state returned by device query.
| |
#define | ENC_STATE_ABSENT 0x00 |
Encoder is absent. | |
#define | ENC_STATE_UNKNOWN 0x01 |
Encoder state is unknown. | |
#define | ENC_STATE_MALFUNC 0x02 |
Encoder is connected and malfunctioning. | |
#define | ENC_STATE_REVERS 0x03 |
Encoder is connected and operational but counts in other direction. | |
#define | ENC_STATE_OK 0x04 |
Encoder is connected and working properly. | |
Winding state | |
This is a bit mask for bitwise operations. Motor winding state returned by device query.
| |
#define | WIND_A_STATE_ABSENT 0x00 |
Winding A is disconnected. | |
#define | WIND_A_STATE_UNKNOWN 0x01 |
Winding A state is unknown. | |
#define | WIND_A_STATE_MALFUNC 0x02 |
Winding A is short-circuited. | |
#define | WIND_A_STATE_OK 0x03 |
Winding A is connected and working properly. | |
#define | WIND_B_STATE_ABSENT 0x00 |
Winding B is disconnected. | |
#define | WIND_B_STATE_UNKNOWN 0x10 |
Winding B state is unknown. | |
#define | WIND_B_STATE_MALFUNC 0x20 |
Winding B is short-circuited. | |
#define | WIND_B_STATE_OK 0x30 |
Winding B is connected and working properly. | |
Move command state | |
This is a bit mask for bitwise operations. Move command (command_move, command_movr, command_left, command_right, command_stop, command_home, command_loft, command_sstp) and its state (run, finished, error).
| |
#define | MVCMD_NAME_BITS 0x3F |
Move command bit mask. | |
#define | MVCMD_UKNWN 0x00 |
Unknown command. | |
#define | MVCMD_MOVE 0x01 |
Command move. | |
#define | MVCMD_MOVR 0x02 |
Command movr. | |
#define | MVCMD_LEFT 0x03 |
Command left. | |
#define | MVCMD_RIGHT 0x04 |
Command rigt. | |
#define | MVCMD_STOP 0x05 |
Command stop. | |
#define | MVCMD_HOME 0x06 |
Command home. | |
#define | MVCMD_LOFT 0x07 |
Command loft. | |
#define | MVCMD_SSTP 0x08 |
Command soft stop. | |
#define | MVCMD_ERROR 0x40 |
Finish state (1 - move command have finished with an error, 0 - move command have finished correctly). | |
#define | MVCMD_RUNNING 0x80 |
Move command state (0 - move command have finished, 1 - move command is being executed). | |
Flags of the motion parameters | |
#define | RPM_DIV_1000 0x01 |
This flag indicates that the operating speed specified in the command is set in milli rpm. | |
Flags of engine settings | |
#define | ENGINE_REVERSE 0x01 |
Reverse flag. | |
#define | ENGINE_CURRENT_AS_RMS 0x02 |
Engine current meaning flag. | |
#define | ENGINE_MAX_SPEED 0x04 |
Max speed flag. | |
#define | ENGINE_ANTIPLAY 0x08 |
Play compensation flag. | |
#define | ENGINE_ACCEL_ON 0x10 |
Acceleration enable flag. | |
#define | ENGINE_LIMIT_VOLT 0x20 |
Maximum motor voltage limit enable flag(is only used with DC motor). | |
#define | ENGINE_LIMIT_CURR 0x40 |
Maximum motor current limit enable flag(is only used with DC motor). | |
#define | ENGINE_LIMIT_RPM 0x80 |
Maximum motor speed limit enable flag. | |
Flags of microstep mode | |
This is a bit mask for bitwise operations. Specify settings of microstep mode. Using with step motors. Flags returned by query of engine settings. May be combined with bitwise OR
| |
#define | MICROSTEP_MODE_FULL 0x01 |
Full step mode. | |
#define | MICROSTEP_MODE_FRAC_2 0x02 |
1/2 step mode. | |
#define | MICROSTEP_MODE_FRAC_4 0x03 |
1/4 step mode. | |
#define | MICROSTEP_MODE_FRAC_8 0x04 |
1/8 step mode. | |
#define | MICROSTEP_MODE_FRAC_16 0x05 |
1/16 step mode. | |
#define | MICROSTEP_MODE_FRAC_32 0x06 |
1/32 step mode. | |
#define | MICROSTEP_MODE_FRAC_64 0x07 |
1/64 step mode. | |
#define | MICROSTEP_MODE_FRAC_128 0x08 |
1/128 step mode. | |
#define | MICROSTEP_MODE_FRAC_256 0x09 |
1/256 step mode. | |
Flags of engine type | |
This is a bit mask for bitwise operations. Specify motor type. Flags returned by query of engine settings.
| |
#define | ENGINE_TYPE_NONE 0x00 |
A value that shouldn't be used. | |
#define | ENGINE_TYPE_DC 0x01 |
DC motor. | |
#define | ENGINE_TYPE_2DC 0x02 |
2 DC motors. | |
#define | ENGINE_TYPE_STEP 0x03 |
Step motor. | |
#define | ENGINE_TYPE_TEST 0x04 |
Duty cycle are fixed. | |
#define | ENGINE_TYPE_BRUSHLESS 0x05 |
Brushless motor. | |
Flags of driver type | |
This is a bit mask for bitwise operations. Specify driver type. Flags returned by query of engine settings.
| |
#define | DRIVER_TYPE_DISCRETE_FET 0x01 |
Driver with discrete FET keys. | |
#define | DRIVER_TYPE_INTEGRATE 0x02 |
Driver with integrated IC. | |
#define | DRIVER_TYPE_EXTERNAL 0x03 |
External driver. | |
Flags of power settings of stepper motor | |
#define | POWER_REDUCT_ENABLED 0x01 |
Current reduction enabled after CurrReductDelay, if this flag is set. | |
#define | POWER_OFF_ENABLED 0x02 |
Power off enabled after PowerOffDelay, if this flag is set. | |
#define | POWER_SMOOTH_CURRENT 0x04 |
Current ramp-up/down is performed smoothly during current_set_time, if this flag is set. | |
Flags of secure settings | |
#define | ALARM_ON_DRIVER_OVERHEATING 0x01 |
If this flag is set enter Alarm state on driver overheat signal. | |
#define | LOW_UPWR_PROTECTION 0x02 |
If this flag is set turn off motor when voltage is lower than LowUpwrOff. | |
#define | H_BRIDGE_ALERT 0x04 |
If this flag is set then turn off the power unit with a signal problem in one of the transistor bridge. | |
#define | ALARM_ON_BORDERS_SWAP_MISSET 0x08 |
If this flag is set enter Alarm state on borders swap misset. | |
#define | ALARM_FLAGS_STICKING 0x10 |
If this flag is set only a STOP command can turn all alarms to 0. | |
#define | USB_BREAK_RECONNECT 0x20 |
If this flag is set USB brake reconnect module will be enable. | |
#define | ALARM_WINDING_MISMATCH 0x40 |
If this flag is set enter Alarm state when windings mismatch. | |
#define | ALARM_ENGINE_RESPONSE 0x80 |
If this flag is set enter Alarm state on response of the engine control action. | |
Position setting flags | |
#define | SETPOS_IGNORE_POSITION 0x01 |
Will not reload position in steps/microsteps if this flag is set. | |
#define | SETPOS_IGNORE_ENCODER 0x02 |
Will not reload encoder state if this flag is set. | |
Feedback type. | |
#define | FEEDBACK_ENCODER 0x01 |
Feedback by encoder. | |
#define | FEEDBACK_EMF 0x04 |
Feedback by EMF. | |
#define | FEEDBACK_NONE 0x05 |
Feedback is absent. | |
#define | FEEDBACK_ENCODER_MEDIATED 0x06 |
Feedback by encoder mediated by mechanical transmission (for example leadscrew). | |
Describes feedback flags. | |
#define | FEEDBACK_ENC_REVERSE 0x01 |
Reverse count of encoder. | |
#define | FEEDBACK_ENC_TYPE_BITS 0xC0 |
Bits of the encoder type. | |
#define | FEEDBACK_ENC_TYPE_AUTO 0x00 |
Auto detect encoder type. | |
#define | FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40 |
Single ended encoder. | |
#define | FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80 |
Differential encoder. | |
Flags for synchronization input setup | |
#define | SYNCIN_ENABLED 0x01 |
Synchronization in mode is enabled, if this flag is set. | |
#define | SYNCIN_INVERT 0x02 |
Trigger on falling edge if flag is set, on rising edge otherwise. | |
#define | SYNCIN_GOTOPOSITION 0x04 |
The engine is go to position specified in Position and uPosition, if this flag is set. | |
Flags of synchronization output | |
#define | SYNCOUT_ENABLED 0x01 |
Synchronization out pin follows the synchronization logic, if set. | |
#define | SYNCOUT_STATE 0x02 |
When output state is fixed by negative SYNCOUT_ENABLED flag, the pin state is in accordance with this flag state. | |
#define | SYNCOUT_INVERT 0x04 |
Low level is active, if set, and high level is active otherwise. | |
#define | SYNCOUT_IN_STEPS 0x08 |
Use motor steps/encoder pulses instead of milliseconds for output pulse generation if the flag is set. | |
#define | SYNCOUT_ONSTART 0x10 |
Generate synchronization pulse when movement starts. | |
#define | SYNCOUT_ONSTOP 0x20 |
Generate synchronization pulse when movement stops. | |
#define | SYNCOUT_ONPERIOD 0x40 |
Generate synchronization pulse every SyncOutPeriod encoder pulses. | |
External IO setup flags | |
#define | EXTIO_SETUP_OUTPUT 0x01 |
EXTIO works as output if flag is set, works as input otherwise. | |
#define | EXTIO_SETUP_INVERT 0x02 |
Interpret EXTIO states and fronts inverted if flag is set. | |
External IO mode flags | |
This is a bit mask for bitwise operations.
| |
#define | EXTIO_SETUP_MODE_IN_BITS 0x0F |
Bits of the behaviour selector when the signal on input goes to the active state. | |
#define | EXTIO_SETUP_MODE_IN_NOP 0x00 |
Do nothing. | |
#define | EXTIO_SETUP_MODE_IN_STOP 0x01 |
Issue STOP command, ceasing the engine movement. | |
#define | EXTIO_SETUP_MODE_IN_PWOF 0x02 |
Issue PWOF command, powering off all engine windings. | |
#define | EXTIO_SETUP_MODE_IN_MOVR 0x03 |
Issue MOVR command with last used settings. | |
#define | EXTIO_SETUP_MODE_IN_HOME 0x04 |
Issue HOME command. | |
#define | EXTIO_SETUP_MODE_IN_ALARM 0x05 |
Set Alarm when the signal goes to the active state. | |
#define | EXTIO_SETUP_MODE_OUT_BITS 0xF0 |
Bits of the output behaviour selection. | |
#define | EXTIO_SETUP_MODE_OUT_OFF 0x00 |
EXTIO pin always set in inactive state. | |
#define | EXTIO_SETUP_MODE_OUT_ON 0x10 |
EXTIO pin always set in active state. | |
#define | EXTIO_SETUP_MODE_OUT_MOVING 0x20 |
EXTIO pin stays active during moving state. | |
#define | EXTIO_SETUP_MODE_OUT_ALARM 0x30 |
EXTIO pin stays active during Alarm state. | |
#define | EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40 |
EXTIO pin stays active when windings are powered. | |
Border flags | |
#define | BORDER_IS_ENCODER 0x01 |
Borders are fixed by predetermined encoder values, if set; borders position on limit switches, if not set. | |
#define | BORDER_STOP_LEFT 0x02 |
Motor should stop on left border. | |
#define | BORDER_STOP_RIGHT 0x04 |
Motor should stop on right border. | |
#define | BORDERS_SWAP_MISSET_DETECTION 0x08 |
Motor should stop on both borders. | |
Limit switches flags | |
#define | ENDER_SWAP 0x01 |
First limit switch on the right side, if set; otherwise on the left side. | |
#define | ENDER_SW1_ACTIVE_LOW 0x02 |
1 - Limit switch connnected to pin SW1 is triggered by a low level on pin. | |
#define | ENDER_SW2_ACTIVE_LOW 0x04 |
1 - Limit switch connnected to pin SW2 is triggered by a low level on pin. | |
Brake settings flags | |
#define | BRAKE_ENABLED 0x01 |
Brake control is enabled, if this flag is set. | |
#define | BRAKE_ENG_PWROFF 0x02 |
Brake turns off power of step motor, if this flag is set. | |
Control flags | |
#define | CONTROL_MODE_BITS 0x03 |
Bits to control engine by joystick or buttons. | |
#define | CONTROL_MODE_OFF 0x00 |
Control is disabled. | |
#define | CONTROL_MODE_JOY 0x01 |
Control by joystick. | |
#define | CONTROL_MODE_LR 0x02 |
Control by left/right buttons. | |
#define | CONTROL_BTN_LEFT_PUSHED_OPEN 0x04 |
Pushed left button corresponds to open contact, if this flag is set. | |
#define | CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08 |
Pushed right button corresponds to open contact, if this flag is set. | |
Joystick flags | |
#define | JOY_REVERSE 0x01 |
Joystick action is reversed. | |
Position control flags | |
#define | CTP_ENABLED 0x01 |
Position control is enabled, if flag set. | |
#define | CTP_BASE 0x02 |
Position control is based on revolution sensor, if this flag is set; otherwise it is based on encoder. | |
#define | CTP_ALARM_ON_ERROR 0x04 |
Set ALARM on mismatch, if flag set. | |
#define | REV_SENS_INV 0x08 |
Sensor is active when it 0 and invert makes active level 1. | |
#define | CTP_ERROR_CORRECTION 0x10 |
Correct errors which appear when slippage if the flag is set. | |
Home settings flags | |
#define | HOME_DIR_FIRST 0x001 |
Flag defines direction of 1st motion after execution of home command. | |
#define | HOME_DIR_SECOND 0x002 |
Flag defines direction of 2nd motion. | |
#define | HOME_MV_SEC_EN 0x004 |
Use the second phase of calibration to the home position, if set; otherwise the second phase is skipped. | |
#define | HOME_HALF_MV 0x008 |
If the flag is set, the stop signals are ignored in start of second movement the first half-turn. | |
#define | HOME_STOP_FIRST_BITS 0x030 |
Bits of the first stop selector. | |
#define | HOME_STOP_FIRST_REV 0x010 |
First motion stops by revolution sensor. | |
#define | HOME_STOP_FIRST_SYN 0x020 |
First motion stops by synchronization input. | |
#define | HOME_STOP_FIRST_LIM 0x030 |
First motion stops by limit switch. | |
#define | HOME_STOP_SECOND_BITS 0x0C0 |
Bits of the second stop selector. | |
#define | HOME_STOP_SECOND_REV 0x040 |
Second motion stops by revolution sensor. | |
#define | HOME_STOP_SECOND_SYN 0x080 |
Second motion stops by synchronization input. | |
#define | HOME_STOP_SECOND_LIM 0x0C0 |
Second motion stops by limit switch. | |
#define | HOME_USE_FAST 0x100 |
Use the fast algorithm of calibration to the home position, if set; otherwise the traditional algorithm. | |
UART parity flags | |
#define | UART_PARITY_BITS 0x03 |
Bits of the parity. | |
#define | UART_PARITY_BIT_EVEN 0x00 |
Parity bit 1, if even. | |
#define | UART_PARITY_BIT_ODD 0x01 |
Parity bit 1, if odd. | |
#define | UART_PARITY_BIT_SPACE 0x02 |
Parity bit always 0. | |
#define | UART_PARITY_BIT_MARK 0x03 |
Parity bit always 1. | |
#define | UART_PARITY_BIT_USE 0x04 |
None parity. | |
#define | UART_STOP_BIT 0x08 |
If set - one stop bit, else two stop bit. | |
Motor Type flags | |
#define | MOTOR_TYPE_UNKNOWN 0x00 |
Unknown type of engine. | |
#define | MOTOR_TYPE_STEP 0x01 |
Step engine. | |
#define | MOTOR_TYPE_DC 0x02 |
DC engine. | |
#define | MOTOR_TYPE_BLDC 0x03 |
BLDC engine. | |
Encoder settings flags | |
#define | ENCSET_DIFFERENTIAL_OUTPUT 0x001 |
If flag is set the encoder has differential output, else single ended output. | |
#define | ENCSET_PUSHPULL_OUTPUT 0x004 |
If flag is set the encoder has push-pull output, else open drain output. | |
#define | ENCSET_INDEXCHANNEL_PRESENT 0x010 |
If flag is set the encoder has index channel, else encoder hasn`t it. | |
#define | ENCSET_REVOLUTIONSENSOR_PRESENT 0x040 |
If flag is set the encoder has revolution sensor, else encoder hasn`t it. | |
#define | ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100 |
If flag is set the revolution sensor active state is high logic state, else active state is low logic state. | |
Magnetic brake settings flags | |
#define | MB_AVAILABLE 0x01 |
If flag is set the magnetic brake is available. | |
#define | MB_POWERED_HOLD 0x02 |
If this flag is set the magnetic brake is on when powered. | |
Temperature sensor settings flags | |
#define | TS_TYPE_BITS 0x07 |
Bits of the temperature sensor type. | |
#define | TS_TYPE_UNKNOWN 0x00 |
Unknow type of sensor. | |
#define | TS_TYPE_THERMOCOUPLE 0x01 |
Thermocouple. | |
#define | TS_TYPE_SEMICONDUCTOR 0x02 |
The semiconductor temperature sensor. | |
#define | TS_AVAILABLE 0x08 |
If flag is set the temperature sensor is available. | |
#define | LS_ON_SW1_AVAILABLE 0x01 |
If flag is set the limit switch connnected to pin SW1 is available. | |
#define | LS_ON_SW2_AVAILABLE 0x02 |
If flag is set the limit switch connnected to pin SW2 is available. | |
#define | LS_SW1_ACTIVE_LOW 0x04 |
If flag is set the limit switch connnected to pin SW1 is triggered by a low level on pin. | |
#define | LS_SW2_ACTIVE_LOW 0x08 |
If flag is set the limit switch connnected to pin SW2 is triggered by a low level on pin. | |
#define | LS_SHORTED 0x10 |
If flag is set the Limit switches is shorted. | |
Flags of auto-detection of characteristics of windings of the engine. | |
#define | BACK_EMF_INDUCTANCE_AUTO 0x01 |
Flag of auto-detection of inductance of windings of the engine. | |
#define | BACK_EMF_RESISTANCE_AUTO 0x02 |
Flag of auto-detection of resistance of windings of the engine. | |
#define | BACK_EMF_KM_AUTO 0x04 |
Flag of auto-detection of electromechanical coefficient of the engine. |
Typedefs | |
typedef unsigned long long | ulong_t |
typedef long long | long_t |
typedef int | device_t |
Type describes device identifier. | |
typedef int | result_t |
Type specifies result of any operation. | |
typedef uint32_t | device_enumeration_t |
Type describes device enumeration structure. | |
typedef struct calibration_t | calibration_t |
Calibration companion structure. | |
typedef struct device_network_information_t | device_network_information_t |
Device network information structure. |
Functions | |
Controller settings setup | |
Functions for adjusting engine read/write almost all controller settings. | |
result_t XIMC_API | set_feedback_settings (device_t id, const feedback_settings_t *feedback_settings) |
Feedback settings. | |
result_t XIMC_API | get_feedback_settings (device_t id, feedback_settings_t *feedback_settings) |
Feedback settings. | |
result_t XIMC_API | set_home_settings (device_t id, const home_settings_t *home_settings) |
Set home settings. | |
result_t XIMC_API | set_home_settings_calb (device_t id, const home_settings_calb_t *home_settings_calb, const calibration_t *calibration) |
Set home settings which use user units. | |
result_t XIMC_API | get_home_settings (device_t id, home_settings_t *home_settings) |
Read home settings. | |
result_t XIMC_API | get_home_settings_calb (device_t id, home_settings_calb_t *home_settings_calb, const calibration_t *calibration) |
Read home settings which use user units. | |
result_t XIMC_API | set_move_settings (device_t id, const move_settings_t *move_settings) |
Set command setup movement (speed, acceleration, threshold and etc). | |
result_t XIMC_API | set_move_settings_calb (device_t id, const move_settings_calb_t *move_settings_calb, const calibration_t *calibration) |
Set command setup movement which use user units (speed, acceleration, threshold and etc). | |
result_t XIMC_API | get_move_settings (device_t id, move_settings_t *move_settings) |
Read command setup movement (speed, acceleration, threshold and etc). | |
result_t XIMC_API | get_move_settings_calb (device_t id, move_settings_calb_t *move_settings_calb, const calibration_t *calibration) |
Read command setup movement which use user units (speed, acceleration, threshold and etc). | |
result_t XIMC_API | set_engine_settings (device_t id, const engine_settings_t *engine_settings) |
Set engine settings. | |
result_t XIMC_API | set_engine_settings_calb (device_t id, const engine_settings_calb_t *engine_settings_calb, const calibration_t *calibration) |
Set engine settings which use user units. | |
result_t XIMC_API | get_engine_settings (device_t id, engine_settings_t *engine_settings) |
Read engine settings. | |
result_t XIMC_API | get_engine_settings_calb (device_t id, engine_settings_calb_t *engine_settings_calb, const calibration_t *calibration) |
Read engine settings which use user units. | |
result_t XIMC_API | set_entype_settings (device_t id, const entype_settings_t *entype_settings) |
Set engine type and driver type. | |
result_t XIMC_API | get_entype_settings (device_t id, entype_settings_t *entype_settings) |
Return engine type and driver type. | |
result_t XIMC_API | set_power_settings (device_t id, const power_settings_t *power_settings) |
Set settings of step motor power control. | |
result_t XIMC_API | get_power_settings (device_t id, power_settings_t *power_settings) |
Read settings of step motor power control. | |
result_t XIMC_API | set_secure_settings (device_t id, const secure_settings_t *secure_settings) |
Set protection settings. | |
result_t XIMC_API | get_secure_settings (device_t id, secure_settings_t *secure_settings) |
Read protection settings. | |
result_t XIMC_API | set_edges_settings (device_t id, const edges_settings_t *edges_settings) |
Set border and limit switches settings. | |
result_t XIMC_API | set_edges_settings_calb (device_t id, const edges_settings_calb_t *edges_settings_calb, const calibration_t *calibration) |
Set border and limit switches settings which use user units. | |
result_t XIMC_API | get_edges_settings (device_t id, edges_settings_t *edges_settings) |
Read border and limit switches settings. | |
result_t XIMC_API | get_edges_settings_calb (device_t id, edges_settings_calb_t *edges_settings_calb, const calibration_t *calibration) |
Read border and limit switches settings which use user units. | |
result_t XIMC_API | set_pid_settings (device_t id, const pid_settings_t *pid_settings) |
Set PID settings. | |
result_t XIMC_API | get_pid_settings (device_t id, pid_settings_t *pid_settings) |
Read PID settings. | |
result_t XIMC_API | set_sync_in_settings (device_t id, const sync_in_settings_t *sync_in_settings) |
Set input synchronization settings. | |
result_t XIMC_API | set_sync_in_settings_calb (device_t id, const sync_in_settings_calb_t *sync_in_settings_calb, const calibration_t *calibration) |
Set input synchronization settings which use user units. | |
result_t XIMC_API | get_sync_in_settings (device_t id, sync_in_settings_t *sync_in_settings) |
Read input synchronization settings. | |
result_t XIMC_API | get_sync_in_settings_calb (device_t id, sync_in_settings_calb_t *sync_in_settings_calb, const calibration_t *calibration) |
Read input synchronization settings which use user units. | |
result_t XIMC_API | set_sync_out_settings (device_t id, const sync_out_settings_t *sync_out_settings) |
Set output synchronization settings. | |
result_t XIMC_API | set_sync_out_settings_calb (device_t id, const sync_out_settings_calb_t *sync_out_settings_calb, const calibration_t *calibration) |
Set output synchronization settings which use user units. | |
result_t XIMC_API | get_sync_out_settings (device_t id, sync_out_settings_t *sync_out_settings) |
Read output synchronization settings. | |
result_t XIMC_API | get_sync_out_settings_calb (device_t id, sync_out_settings_calb_t *sync_out_settings_calb, const calibration_t *calibration) |
Read output synchronization settings which use user units. | |
result_t XIMC_API | set_extio_settings (device_t id, const extio_settings_t *extio_settings) |
Set EXTIO settings. | |
result_t XIMC_API | get_extio_settings (device_t id, extio_settings_t *extio_settings) |
Read EXTIO settings. | |
result_t XIMC_API | set_brake_settings (device_t id, const brake_settings_t *brake_settings) |
Set settings of brake control. | |
result_t XIMC_API | get_brake_settings (device_t id, brake_settings_t *brake_settings) |
Read settings of brake control. | |
result_t XIMC_API | set_control_settings (device_t id, const control_settings_t *control_settings) |
Set settings of motor control. | |
result_t XIMC_API | set_control_settings_calb (device_t id, const control_settings_calb_t *control_settings_calb, const calibration_t *calibration) |
Set settings of motor control which use user units. | |
result_t XIMC_API | get_control_settings (device_t id, control_settings_t *control_settings) |
Read settings of motor control. | |
result_t XIMC_API | get_control_settings_calb (device_t id, control_settings_calb_t *control_settings_calb, const calibration_t *calibration) |
Read settings of motor control which use user units. | |
result_t XIMC_API | set_joystick_settings (device_t id, const joystick_settings_t *joystick_settings) |
Set settings of joystick. | |
result_t XIMC_API | get_joystick_settings (device_t id, joystick_settings_t *joystick_settings) |
Read settings of joystick. | |
result_t XIMC_API | set_ctp_settings (device_t id, const ctp_settings_t *ctp_settings) |
Set settings of control position(is only used with stepper motor). | |
result_t XIMC_API | get_ctp_settings (device_t id, ctp_settings_t *ctp_settings) |
Read settings of control position(is only used with stepper motor). | |
result_t XIMC_API | set_uart_settings (device_t id, const uart_settings_t *uart_settings) |
Set UART settings. | |
result_t XIMC_API | get_uart_settings (device_t id, uart_settings_t *uart_settings) |
Read UART settings. | |
result_t XIMC_API | set_calibration_settings (device_t id, const calibration_settings_t *calibration_settings) |
Set calibration settings. | |
result_t XIMC_API | get_calibration_settings (device_t id, calibration_settings_t *calibration_settings) |
Read calibration settings. | |
result_t XIMC_API | set_controller_name (device_t id, const controller_name_t *controller_name) |
Write user controller name and flags of setting from FRAM. | |
result_t XIMC_API | get_controller_name (device_t id, controller_name_t *controller_name) |
Read user controller name and flags of setting from FRAM. | |
result_t XIMC_API | set_nonvolatile_memory (device_t id, const nonvolatile_memory_t *nonvolatile_memory) |
Write userdata into FRAM. | |
result_t XIMC_API | get_nonvolatile_memory (device_t id, nonvolatile_memory_t *nonvolatile_memory) |
Read userdata from FRAM. | |
result_t XIMC_API | set_emf_settings (device_t id, const emf_settings_t *emf_settings) |
Set electromechanical coefficients. | |
result_t XIMC_API | get_emf_settings (device_t id, emf_settings_t *emf_settings) |
Read electromechanical settings. | |
result_t XIMC_API | set_engine_advansed_setup (device_t id, const engine_advansed_setup_t *engine_advansed_setup) |
Set engine advansed settings. | |
result_t XIMC_API | get_engine_advansed_setup (device_t id, engine_advansed_setup_t *engine_advansed_setup) |
Read engine advansed settings. | |
result_t XIMC_API | set_extended_settings (device_t id, const extended_settings_t *extended_settings) |
Set extended settings. | |
result_t XIMC_API | get_extended_settings (device_t id, extended_settings_t *extended_settings) |
Read extended settings. | |
Group of commands movement control | |
result_t XIMC_API | command_stop (device_t id) |
Immediately stop the engine, the transition to the STOP, mode key BREAK (winding short-circuited), the regime "retention" is deactivated for DC motors, keeping current in the windings for stepper motors (with Power management settings). | |
result_t XIMC_API | command_power_off (device_t id) |
Immediately power off motor regardless its state. | |
result_t XIMC_API | command_move (device_t id, int Position, int uPosition) |
Upon receiving the command "move" the engine starts to move with pre-set parameters (speed, acceleration, retention), to the point specified to the Position, uPosition. | |
result_t XIMC_API | command_move_calb (device_t id, float Position, const calibration_t *calibration) |
Move to position which use user units. | |
result_t XIMC_API | command_movr (device_t id, int DeltaPosition, int uDeltaPosition) |
Move to offset. | |
result_t XIMC_API | command_movr_calb (device_t id, float DeltaPosition, const calibration_t *calibration) |
Move to offset using user units. | |
result_t XIMC_API | command_home (device_t id) |
The positive direction is to the right. | |
result_t XIMC_API | command_left (device_t id) |
Start continous moving to the left. | |
result_t XIMC_API | command_right (device_t id) |
Start continous moving to the right. | |
result_t XIMC_API | command_loft (device_t id) |
Upon receiving the command "loft" the engine is shifted from the current point to a distance GENG :: Antiplay, then move to the same point. | |
result_t XIMC_API | command_sstp (device_t id) |
Soft stop engine. | |
result_t XIMC_API | get_position (device_t id, get_position_t *the_get_position) |
Reads the value position in steps and micro for stepper motor and encoder steps all engines. | |
result_t XIMC_API | get_position_calb (device_t id, get_position_calb_t *the_get_position_calb, const calibration_t *calibration) |
Reads position value in user units for stepper motor and encoder steps all engines. | |
result_t XIMC_API | set_position (device_t id, const set_position_t *the_set_position) |
Sets any position value in steps and micro for stepper motor and encoder steps of all engines. | |
result_t XIMC_API | set_position_calb (device_t id, const set_position_calb_t *the_set_position_calb, const calibration_t *calibration) |
Sets any position value and encoder value of all engines which use user units. | |
result_t XIMC_API | command_zero (device_t id) |
Sets the current position and the position in which the traffic moves by the move command and movr zero for all cases, except for movement to the target position. | |
Group of commands to save and load settings | |
result_t XIMC_API | command_save_settings (device_t id) |
Save all settings from controller's RAM to controller's flash memory, replacing previous data in controller's flash memory. | |
result_t XIMC_API | command_read_settings (device_t id) |
Read all settings from controller's flash memory to controller's RAM, replacing previous data in controller's RAM. | |
result_t XIMC_API | command_save_robust_settings (device_t id) |
Save important settings (calibration coefficients and etc.) from controller's RAM to controller's flash memory, replacing previous data in controller's flash memory. | |
result_t XIMC_API | command_read_robust_settings (device_t id) |
Read important settings (calibration coefficients and etc.) from controller's flash memory to controller's RAM, replacing previous data in controller's RAM. | |
result_t XIMC_API | command_eesave_settings (device_t id) |
Save settings from controller's RAM to stage's EEPROM memory, which spontaneity connected to stage and it isn`t change without it mechanical reconstruction. | |
result_t XIMC_API | command_eeread_settings (device_t id) |
Read settings from controller's RAM to stage's EEPROM memory, which spontaneity connected to stage and it isn`t change without it mechanical reconstruction. | |
result_t XIMC_API | command_start_measurements (device_t id) |
Start measurements and buffering of speed, following error. | |
result_t XIMC_API | get_measurements (device_t id, measurements_t *measurements) |
A command to read the data buffer to build a speed graph and a sequence error. | |
result_t XIMC_API | get_chart_data (device_t id, chart_data_t *chart_data) |
Return device electrical parameters, useful for charts. | |
result_t XIMC_API | get_serial_number (device_t id, unsigned int *SerialNumber) |
Read device serial number. | |
result_t XIMC_API | get_firmware_version (device_t id, unsigned int *Major, unsigned int *Minor, unsigned int *Release) |
Read controller's firmware version. | |
result_t XIMC_API | service_command_updf (device_t id) |
Command puts the controller to update the firmware. | |
Service commands | |
result_t XIMC_API | set_serial_number (device_t id, const serial_number_t *serial_number) |
Write device serial number and hardware version to controller's flash memory. | |
result_t XIMC_API | get_analog_data (device_t id, analog_data_t *analog_data) |
Read analog data structure that contains raw analog data from ADC embedded on board. | |
result_t XIMC_API | get_debug_read (device_t id, debug_read_t *debug_read) |
Read data from firmware for debug purpose. | |
result_t XIMC_API | set_debug_write (device_t id, const debug_write_t *debug_write) |
Write data to firmware for debug purpose. | |
Group of commands to work with EEPROM | |
result_t XIMC_API | set_stage_name (device_t id, const stage_name_t *stage_name) |
Write user stage name from EEPROM. | |
result_t XIMC_API | get_stage_name (device_t id, stage_name_t *stage_name) |
Read user stage name from EEPROM. | |
result_t XIMC_API | set_stage_information (device_t id, const stage_information_t *stage_information) |
Set stage information to EEPROM. | |
result_t XIMC_API | get_stage_information (device_t id, stage_information_t *stage_information) |
Read stage information from EEPROM. | |
result_t XIMC_API | set_stage_settings (device_t id, const stage_settings_t *stage_settings) |
Set stage settings to EEPROM. | |
result_t XIMC_API | get_stage_settings (device_t id, stage_settings_t *stage_settings) |
Read stage settings from EEPROM. | |
result_t XIMC_API | set_motor_information (device_t id, const motor_information_t *motor_information) |
Set motor information to EEPROM. | |
result_t XIMC_API | get_motor_information (device_t id, motor_information_t *motor_information) |
Read motor information from EEPROM. | |
result_t XIMC_API | set_motor_settings (device_t id, const motor_settings_t *motor_settings) |
Set motor settings to EEPROM. | |
result_t XIMC_API | get_motor_settings (device_t id, motor_settings_t *motor_settings) |
Read motor settings from EEPROM. | |
result_t XIMC_API | set_encoder_information (device_t id, const encoder_information_t *encoder_information) |
Set encoder information to EEPROM. | |
result_t XIMC_API | get_encoder_information (device_t id, encoder_information_t *encoder_information) |
Read encoder information from EEPROM. | |
result_t XIMC_API | set_encoder_settings (device_t id, const encoder_settings_t *encoder_settings) |
Set encoder settings to EEPROM. | |
result_t XIMC_API | get_encoder_settings (device_t id, encoder_settings_t *encoder_settings) |
Read encoder settings from EEPROM. | |
result_t XIMC_API | set_hallsensor_information (device_t id, const hallsensor_information_t *hallsensor_information) |
Set hall sensor information to EEPROM. | |
result_t XIMC_API | get_hallsensor_information (device_t id, hallsensor_information_t *hallsensor_information) |
Read hall sensor information from EEPROM. | |
result_t XIMC_API | set_hallsensor_settings (device_t id, const hallsensor_settings_t *hallsensor_settings) |
Set hall sensor settings to EEPROM. | |
result_t XIMC_API | get_hallsensor_settings (device_t id, hallsensor_settings_t *hallsensor_settings) |
Read hall sensor settings from EEPROM. | |
result_t XIMC_API | set_gear_information (device_t id, const gear_information_t *gear_information) |
Set gear information to EEPROM. | |
result_t XIMC_API | get_gear_information (device_t id, gear_information_t *gear_information) |
Read gear information from EEPROM. | |
result_t XIMC_API | set_gear_settings (device_t id, const gear_settings_t *gear_settings) |
Set gear settings to EEPROM. | |
result_t XIMC_API | get_gear_settings (device_t id, gear_settings_t *gear_settings) |
Read gear settings from EEPROM. | |
result_t XIMC_API | set_accessories_settings (device_t id, const accessories_settings_t *accessories_settings) |
Set additional accessories information to EEPROM. | |
result_t XIMC_API | get_accessories_settings (device_t id, accessories_settings_t *accessories_settings) |
Read additional accessories information from EEPROM. | |
result_t XIMC_API | get_bootloader_version (device_t id, unsigned int *Major, unsigned int *Minor, unsigned int *Release) |
Read controller's firmware version. | |
result_t XIMC_API | get_init_random (device_t id, init_random_t *init_random) |
Read random number from controller. | |
result_t XIMC_API | get_globally_unique_identifier (device_t id, globally_unique_identifier_t *globally_unique_identifier) |
This value is unique to each individual die but is not a random value. | |
result_t XIMC_API | goto_firmware (device_t id, uint8_t *ret) |
Reboot to firmware. | |
result_t XIMC_API | has_firmware (const char *uri, uint8_t *ret) |
Check for firmware on device. | |
result_t XIMC_API | command_update_firmware (const char *uri, const uint8_t *data, uint32_t data_size) |
Update firmware. | |
result_t XIMC_API | write_key (const char *uri, uint8_t *key) |
Write controller key. | |
result_t XIMC_API | command_reset (device_t id) |
Reset controller. | |
result_t XIMC_API | command_clear_fram (device_t id) |
Clear controller FRAM. |
Boards and drivers control | |
typedef char * | pchar |
Nevermind. | |
typedef void(XIMC_CALLCONV * | logging_callback_t )(int loglevel, const wchar_t *message, void *user_data) |
Logging callback prototype. | |
device_t XIMC_API | open_device (const char *uri) |
Open a device with OS uri uri and return identifier of the device which can be used in calls. | |
result_t XIMC_API | close_device (device_t *id) |
Close specified device. | |
result_t XIMC_API | load_correction_table (device_t *id, const char *namefile) |
Command of loading a correction table from a text file (this function is deprecated). | |
result_t XIMC_API | set_correction_table (device_t id, const char *namefile) |
Command of loading a correction table from a text file. | |
result_t XIMC_API | probe_device (const char *uri) |
Check if a device with OS uri uri is XIMC device. | |
result_t XIMC_API | set_bindy_key (const char *keyfilepath) |
Set network encryption layer (bindy) key. | |
device_enumeration_t XIMC_API | enumerate_devices (int enumerate_flags, const char *hints) |
Enumerate all devices that looks like valid. | |
result_t XIMC_API | free_enumerate_devices (device_enumeration_t device_enumeration) |
Free memory returned by enumerate_devices. | |
int XIMC_API | get_device_count (device_enumeration_t device_enumeration) |
Get device count. | |
pchar XIMC_API | get_device_name (device_enumeration_t device_enumeration, int device_index) |
Get device name from the device enumeration. | |
result_t XIMC_API | get_enumerate_device_serial (device_enumeration_t device_enumeration, int device_index, uint32_t *serial) |
Get device serial number from the device enumeration. | |
result_t XIMC_API | get_enumerate_device_information (device_enumeration_t device_enumeration, int device_index, device_information_t *device_information) |
Get device information from the device enumeration. | |
result_t XIMC_API | get_enumerate_device_controller_name (device_enumeration_t device_enumeration, int device_index, controller_name_t *controller_name) |
Get controller name from the device enumeration. | |
result_t XIMC_API | get_enumerate_device_stage_name (device_enumeration_t device_enumeration, int device_index, stage_name_t *stage_name) |
Get stage name from the device enumeration. | |
result_t XIMC_API | get_enumerate_device_network_information (device_enumeration_t device_enumeration, int device_index, device_network_information_t *device_network_information) |
Get device network information from the device enumeration. | |
result_t XIMC_API | reset_locks () |
Resets the error of incorrect data transmission. | |
result_t XIMC_API | ximc_fix_usbser_sys (const char *device_uri) |
Fixing a USB driver error in Windows. | |
void XIMC_API | msec_sleep (unsigned int msec) |
Sleeps for a specified amount of time. | |
void XIMC_API | ximc_version (char *version) |
Returns a library version. | |
void XIMC_API | logging_callback_stderr_wide (int loglevel, const wchar_t *message, void *user_data) |
Simple callback for logging to stderr in wide chars. | |
void XIMC_API | logging_callback_stderr_narrow (int loglevel, const wchar_t *message, void *user_data) |
Simple callback for logging to stderr in narrow (single byte) chars. | |
void XIMC_API | set_logging_callback (logging_callback_t logging_callback, void *user_data) |
Sets a logging callback. | |
result_t XIMC_API | get_status (device_t id, status_t *status) |
Return device state. | |
result_t XIMC_API | get_status_calb (device_t id, status_calb_t *status, const calibration_t *calibration) |
Return device state. | |
result_t XIMC_API | get_device_information (device_t id, device_information_t *device_information) |
Return device information. | |
result_t XIMC_API | command_wait_for_stop (device_t id, uint32_t refresh_interval_ms) |
Wait for stop. | |
result_t XIMC_API | command_homezero (device_t id) |
Make home command, wait until it is finished and make zero command. |
Header file for libximc library.
#define ALARM_ON_DRIVER_OVERHEATING 0x01 |
If this flag is set enter Alarm state on driver overheat signal.
#define BACK_EMF_INDUCTANCE_AUTO 0x01 |
Flag of auto-detection of inductance of windings of the engine.
#define BACK_EMF_KM_AUTO 0x04 |
Flag of auto-detection of electromechanical coefficient of the engine.
#define BACK_EMF_RESISTANCE_AUTO 0x02 |
Flag of auto-detection of resistance of windings of the engine.
#define BORDER_IS_ENCODER 0x01 |
Borders are fixed by predetermined encoder values, if set; borders position on limit switches, if not set.
#define BORDER_STOP_LEFT 0x02 |
Motor should stop on left border.
#define BORDER_STOP_RIGHT 0x04 |
Motor should stop on right border.
#define BORDERS_SWAP_MISSET_DETECTION 0x08 |
Motor should stop on both borders.
Need to save motor then wrong border settings is set
#define BRAKE_ENABLED 0x01 |
Brake control is enabled, if this flag is set.
#define BRAKE_ENG_PWROFF 0x02 |
Brake turns off power of step motor, if this flag is set.
#define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04 |
Pushed left button corresponds to open contact, if this flag is set.
#define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08 |
Pushed right button corresponds to open contact, if this flag is set.
#define CONTROL_MODE_BITS 0x03 |
Bits to control engine by joystick or buttons.
#define CONTROL_MODE_JOY 0x01 |
Control by joystick.
#define CONTROL_MODE_LR 0x02 |
Control by left/right buttons.
#define CONTROL_MODE_OFF 0x00 |
Control is disabled.
#define CTP_ALARM_ON_ERROR 0x04 |
Set ALARM on mismatch, if flag set.
#define CTP_BASE 0x02 |
Position control is based on revolution sensor, if this flag is set; otherwise it is based on encoder.
#define CTP_ENABLED 0x01 |
Position control is enabled, if flag set.
#define CTP_ERROR_CORRECTION 0x10 |
Correct errors which appear when slippage if the flag is set.
It works only with the encoder. Incompatible with flag CTP_ALARM_ON_ERROR.
#define DRIVER_TYPE_DISCRETE_FET 0x01 |
Driver with discrete FET keys.
Default option.
#define DRIVER_TYPE_EXTERNAL 0x03 |
External driver.
#define DRIVER_TYPE_INTEGRATE 0x02 |
Driver with integrated IC.
#define EEPROM_PRECEDENCE 0x01 |
If the flag is set settings from external EEPROM override controller settings.
#define ENC_STATE_ABSENT 0x00 |
Encoder is absent.
#define ENC_STATE_MALFUNC 0x02 |
Encoder is connected and malfunctioning.
#define ENC_STATE_OK 0x04 |
Encoder is connected and working properly.
#define ENC_STATE_REVERS 0x03 |
Encoder is connected and operational but counts in other direction.
#define ENC_STATE_UNKNOWN 0x01 |
Encoder state is unknown.
#define ENDER_SW1_ACTIVE_LOW 0x02 |
1 - Limit switch connnected to pin SW1 is triggered by a low level on pin.
#define ENDER_SW2_ACTIVE_LOW 0x04 |
1 - Limit switch connnected to pin SW2 is triggered by a low level on pin.
#define ENDER_SWAP 0x01 |
First limit switch on the right side, if set; otherwise on the left side.
#define ENGINE_ACCEL_ON 0x10 |
Acceleration enable flag.
If it set, motion begins with acceleration and ends with deceleration.
#define ENGINE_ANTIPLAY 0x08 |
Play compensation flag.
If it set, engine makes backlash (play) compensation procedure and reach the predetermined position accurately on low speed.
#define ENGINE_CURRENT_AS_RMS 0x02 |
Engine current meaning flag.
If the flag is unset, then engine current value is interpreted as maximum amplitude value. If the flag is set, then engine current value is interpreted as root mean square current value (for stepper) or as the current value calculated from the maximum heat dissipation (bldc).
#define ENGINE_LIMIT_CURR 0x40 |
Maximum motor current limit enable flag(is only used with DC motor).
#define ENGINE_LIMIT_RPM 0x80 |
Maximum motor speed limit enable flag.
#define ENGINE_LIMIT_VOLT 0x20 |
Maximum motor voltage limit enable flag(is only used with DC motor).
#define ENGINE_MAX_SPEED 0x04 |
Max speed flag.
If it is set, engine uses maximum speed achievable with the present engine settings as nominal speed.
#define ENGINE_REVERSE 0x01 |
Reverse flag.
It determines motor shaft rotation direction that corresponds to feedback counts increasing. If not set (default), motor shaft rotation direction under positive voltage corresponds to feedback counts increasing and vice versa. Change it if you see that positive directions on motor and feedback are opposite.
#define ENGINE_TYPE_2DC 0x02 |
2 DC motors.
#define ENGINE_TYPE_BRUSHLESS 0x05 |
Brushless motor.
#define ENGINE_TYPE_DC 0x01 |
DC motor.
#define ENGINE_TYPE_NONE 0x00 |
A value that shouldn't be used.
#define ENGINE_TYPE_STEP 0x03 |
Step motor.
#define ENGINE_TYPE_TEST 0x04 |
Duty cycle are fixed.
Used only manufacturer.
#define ENUMERATE_PROBE 0x01 |
Check if a device with OS name name is XIMC device.
Be carefuly with this flag because it sends some data to the device.
#define EXTIO_SETUP_INVERT 0x02 |
Interpret EXTIO states and fronts inverted if flag is set.
Falling front as input event and low logic level as active state.
#define EXTIO_SETUP_MODE_IN_ALARM 0x05 |
Set Alarm when the signal goes to the active state.
#define EXTIO_SETUP_MODE_IN_BITS 0x0F |
Bits of the behaviour selector when the signal on input goes to the active state.
#define EXTIO_SETUP_MODE_IN_HOME 0x04 |
Issue HOME command.
#define EXTIO_SETUP_MODE_IN_MOVR 0x03 |
Issue MOVR command with last used settings.
#define EXTIO_SETUP_MODE_IN_NOP 0x00 |
Do nothing.
#define EXTIO_SETUP_MODE_IN_PWOF 0x02 |
Issue PWOF command, powering off all engine windings.
#define EXTIO_SETUP_MODE_IN_STOP 0x01 |
Issue STOP command, ceasing the engine movement.
#define EXTIO_SETUP_MODE_OUT_ALARM 0x30 |
EXTIO pin stays active during Alarm state.
#define EXTIO_SETUP_MODE_OUT_BITS 0xF0 |
Bits of the output behaviour selection.
#define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40 |
EXTIO pin stays active when windings are powered.
#define EXTIO_SETUP_MODE_OUT_MOVING 0x20 |
EXTIO pin stays active during moving state.
#define EXTIO_SETUP_MODE_OUT_OFF 0x00 |
EXTIO pin always set in inactive state.
#define EXTIO_SETUP_MODE_OUT_ON 0x10 |
EXTIO pin always set in active state.
#define EXTIO_SETUP_OUTPUT 0x01 |
EXTIO works as output if flag is set, works as input otherwise.
#define FEEDBACK_EMF 0x04 |
Feedback by EMF.
#define FEEDBACK_ENC_REVERSE 0x01 |
Reverse count of encoder.
#define FEEDBACK_ENC_TYPE_AUTO 0x00 |
Auto detect encoder type.
#define FEEDBACK_ENC_TYPE_BITS 0xC0 |
Bits of the encoder type.
#define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80 |
Differential encoder.
#define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40 |
Single ended encoder.
#define FEEDBACK_ENCODER 0x01 |
Feedback by encoder.
#define FEEDBACK_ENCODER_MEDIATED 0x06 |
Feedback by encoder mediated by mechanical transmission (for example leadscrew).
#define FEEDBACK_NONE 0x05 |
Feedback is absent.
#define H_BRIDGE_ALERT 0x04 |
If this flag is set then turn off the power unit with a signal problem in one of the transistor bridge.
#define HOME_DIR_FIRST 0x001 |
Flag defines direction of 1st motion after execution of home command.
Direction is right, if set; otherwise left.
#define HOME_DIR_SECOND 0x002 |
Flag defines direction of 2nd motion.
Direction is right, if set; otherwise left.
#define HOME_HALF_MV 0x008 |
If the flag is set, the stop signals are ignored in start of second movement the first half-turn.
#define HOME_MV_SEC_EN 0x004 |
Use the second phase of calibration to the home position, if set; otherwise the second phase is skipped.
#define HOME_STOP_FIRST_BITS 0x030 |
Bits of the first stop selector.
#define HOME_STOP_FIRST_LIM 0x030 |
First motion stops by limit switch.
#define HOME_STOP_FIRST_REV 0x010 |
First motion stops by revolution sensor.
#define HOME_STOP_FIRST_SYN 0x020 |
First motion stops by synchronization input.
#define HOME_STOP_SECOND_BITS 0x0C0 |
Bits of the second stop selector.
#define HOME_STOP_SECOND_LIM 0x0C0 |
Second motion stops by limit switch.
#define HOME_STOP_SECOND_REV 0x040 |
Second motion stops by revolution sensor.
#define HOME_STOP_SECOND_SYN 0x080 |
Second motion stops by synchronization input.
#define HOME_USE_FAST 0x100 |
Use the fast algorithm of calibration to the home position, if set; otherwise the traditional algorithm.
#define JOY_REVERSE 0x01 |
Joystick action is reversed.
Joystick deviation to the upper values correspond to negative speeds and vice versa.
#define LOW_UPWR_PROTECTION 0x02 |
If this flag is set turn off motor when voltage is lower than LowUpwrOff.
#define MICROSTEP_MODE_FRAC_128 0x08 |
1/128 step mode.
#define MICROSTEP_MODE_FRAC_16 0x05 |
1/16 step mode.
#define MICROSTEP_MODE_FRAC_2 0x02 |
1/2 step mode.
#define MICROSTEP_MODE_FRAC_256 0x09 |
1/256 step mode.
#define MICROSTEP_MODE_FRAC_32 0x06 |
1/32 step mode.
#define MICROSTEP_MODE_FRAC_4 0x03 |
1/4 step mode.
#define MICROSTEP_MODE_FRAC_64 0x07 |
1/64 step mode.
#define MICROSTEP_MODE_FRAC_8 0x04 |
1/8 step mode.
#define MICROSTEP_MODE_FULL 0x01 |
Full step mode.
#define MOVE_STATE_ANTIPLAY 0x04 |
Motor is playing compensation, if flag set.
#define MOVE_STATE_MOVING 0x01 |
This flag indicates that controller is trying to move the motor.
Don't use this flag for waiting of completion of the movement command. Use MVCMD_RUNNING flag from the MvCmdSts field instead.
#define MOVE_STATE_TARGET_SPEED 0x02 |
Target speed is reached, if flag set.
#define MVCMD_ERROR 0x40 |
Finish state (1 - move command have finished with an error, 0 - move command have finished correctly).
This flags is actual when MVCMD_RUNNING signals movement finish.
#define MVCMD_HOME 0x06 |
Command home.
#define MVCMD_LEFT 0x03 |
Command left.
#define MVCMD_LOFT 0x07 |
Command loft.
#define MVCMD_MOVE 0x01 |
Command move.
#define MVCMD_MOVR 0x02 |
Command movr.
#define MVCMD_NAME_BITS 0x3F |
Move command bit mask.
#define MVCMD_RIGHT 0x04 |
Command rigt.
#define MVCMD_RUNNING 0x80 |
Move command state (0 - move command have finished, 1 - move command is being executed).
#define MVCMD_SSTP 0x08 |
Command soft stop.
#define MVCMD_STOP 0x05 |
Command stop.
#define MVCMD_UKNWN 0x00 |
Unknown command.
#define POWER_OFF_ENABLED 0x02 |
Power off enabled after PowerOffDelay, if this flag is set.
#define POWER_REDUCT_ENABLED 0x01 |
Current reduction enabled after CurrReductDelay, if this flag is set.
#define POWER_SMOOTH_CURRENT 0x04 |
Current ramp-up/down is performed smoothly during current_set_time, if this flag is set.
#define PWR_STATE_MAX 0x05 |
Motor windings are powered by maximum current driver can provide at this voltage.
#define PWR_STATE_NORM 0x03 |
Motor windings are powered by nominal current.
#define PWR_STATE_OFF 0x01 |
Motor windings are disconnected from the driver.
#define PWR_STATE_REDUCT 0x04 |
Motor windings are powered by reduced current to lower power consumption.
#define PWR_STATE_UNKNOWN 0x00 |
Unknown state, should never happen.
#define REV_SENS_INV 0x08 |
Sensor is active when it 0 and invert makes active level 1.
That is, if you do not invert, it is normal logic - 0 is the activation.
#define RPM_DIV_1000 0x01 |
This flag indicates that the operating speed specified in the command is set in milli rpm.
Applicable only for ENCODER feedback mode and only for BLDC motors.
#define SETPOS_IGNORE_ENCODER 0x02 |
Will not reload encoder state if this flag is set.
#define SETPOS_IGNORE_POSITION 0x01 |
Will not reload position in steps/microsteps if this flag is set.
#define STATE_ALARM 0x0000040 |
Controller is in alarm state indicating that something dangerous had happened.
Most commands are ignored in this state. To reset the flag a STOP command must be issued.
#define STATE_BORDERS_SWAP_MISSET 0x0008000 |
Engine stuck at the wrong edge.
#define STATE_BRAKE 0x0200 |
State of Brake pin.
Flag "1" - if the pin state brake is not powered(brake is clamped), "0" - if the pin state brake is powered(brake is unclamped).
#define STATE_BUTTON_LEFT 0x0008 |
Button "left" state (1 if pressed).
#define STATE_BUTTON_RIGHT 0x0004 |
Button "right" state (1 if pressed).
#define STATE_CONTR 0x000003F |
Flags of controller states.
#define STATE_CONTROLLER_OVERHEAT 0x0000200 |
Controller overheat.
#define STATE_CTP_ERROR 0x0000080 |
Control position error(is only used with stepper motor).
#define STATE_DIG_SIGNAL 0xFFFF |
Flags of digital signals.
#define STATE_EEPROM_CONNECTED 0x0000010 |
EEPROM with settings is connected.
#define STATE_ENC_A 0x2000 |
State of encoder A pin.
#define STATE_ENC_B 0x4000 |
State of encoder B pin.
#define STATE_ENGINE_RESPONSE_ERROR 0x0800000 |
Error response of the engine control action.
#define STATE_ERRC 0x0000001 |
Command error encountered.
#define STATE_ERRD 0x0000002 |
Data integrity error encountered.
#define STATE_ERRV 0x0000004 |
Value error encountered.
#define STATE_EXTIO_ALARM 0x1000000 |
The error is caused by the input signal.
#define STATE_GPIO_LEVEL 0x0020 |
State of external GPIO pin.
#define STATE_GPIO_PINOUT 0x0010 |
External GPIO works as Out, if flag set; otherwise works as In.
#define STATE_LEFT_EDGE 0x0002 |
Engine stuck at the left edge.
#define STATE_LOW_USB_VOLTAGE 0x0002000 |
USB voltage is insufficient for normal operation.
#define STATE_OVERLOAD_POWER_CURRENT 0x0000800 |
Power current exceeds safe limit.
#define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400 |
Power voltage exceeds safe limit.
#define STATE_OVERLOAD_USB_CURRENT 0x0004000 |
USB current exceeds safe limit.
#define STATE_OVERLOAD_USB_VOLTAGE 0x0001000 |
USB voltage exceeds safe limit.
#define STATE_POWER_OVERHEAT 0x0000100 |
Power driver overheat.
#define STATE_REV_SENSOR 0x0400 |
State of Revolution sensor pin.
#define STATE_RIGHT_EDGE 0x0001 |
Engine stuck at the right edge.
#define STATE_SECUR 0x1B3FFC0 |
Flags of security.
#define STATE_SYNC_INPUT 0x0800 |
State of Sync input pin.
#define STATE_SYNC_OUTPUT 0x1000 |
State of Sync output pin.
#define SYNCIN_ENABLED 0x01 |
Synchronization in mode is enabled, if this flag is set.
#define SYNCIN_GOTOPOSITION 0x04 |
The engine is go to position specified in Position and uPosition, if this flag is set.
And it is shift on the Position and uPosition, if this flag is unset
#define SYNCIN_INVERT 0x02 |
Trigger on falling edge if flag is set, on rising edge otherwise.
#define SYNCOUT_ENABLED 0x01 |
Synchronization out pin follows the synchronization logic, if set.
It governed by SYNCOUT_STATE flag otherwise.
#define SYNCOUT_IN_STEPS 0x08 |
Use motor steps/encoder pulses instead of milliseconds for output pulse generation if the flag is set.
#define SYNCOUT_INVERT 0x04 |
Low level is active, if set, and high level is active otherwise.
#define SYNCOUT_ONPERIOD 0x40 |
Generate synchronization pulse every SyncOutPeriod encoder pulses.
#define SYNCOUT_ONSTART 0x10 |
Generate synchronization pulse when movement starts.
#define SYNCOUT_ONSTOP 0x20 |
Generate synchronization pulse when movement stops.
#define SYNCOUT_STATE 0x02 |
When output state is fixed by negative SYNCOUT_ENABLED flag, the pin state is in accordance with this flag state.
#define UART_PARITY_BITS 0x03 |
Bits of the parity.
#define WIND_A_STATE_ABSENT 0x00 |
Winding A is disconnected.
#define WIND_A_STATE_MALFUNC 0x02 |
Winding A is short-circuited.
#define WIND_A_STATE_OK 0x03 |
Winding A is connected and working properly.
#define WIND_A_STATE_UNKNOWN 0x01 |
Winding A state is unknown.
#define WIND_B_STATE_ABSENT 0x00 |
Winding B is disconnected.
#define WIND_B_STATE_MALFUNC 0x20 |
Winding B is short-circuited.
#define WIND_B_STATE_OK 0x30 |
Winding B is connected and working properly.
#define WIND_B_STATE_UNKNOWN 0x10 |
Winding B state is unknown.
#define XIMC_API |
Library import macro.
Macros allows to automatically import function from shared library. It automatically expands to dllimport on msvc when including header file.
typedef void(XIMC_CALLCONV * logging_callback_t)(int loglevel, const wchar_t *message, void *user_data) |
Logging callback prototype.
loglevel | a loglevel |
message | a message |
Close specified device.
id | an identifier of device |
Clear controller FRAM.
Can be used by manufacturer only
id | an identifier of device |
Read settings from controller's RAM to stage's EEPROM memory, which spontaneity connected to stage and it isn`t change without it mechanical reconstruction.
id | an identifier of device |
Save settings from controller's RAM to stage's EEPROM memory, which spontaneity connected to stage and it isn`t change without it mechanical reconstruction.
Can be used by manufacturer only.
id | an identifier of device |
The positive direction is to the right.
A value of zero reverses the direction of the direction of the flag, the set speed. Restriction imposed by the trailer, act the same, except that the limit switch contact does not stop. Limit the maximum speed, acceleration and deceleration function. 1) moves the motor according to the speed FastHome, uFastHome and flag HOME_DIR_FAST until limit switch, if the flag is set HOME_STOP_ENDS, until the signal from the input synchronization if the flag HOME_STOP_SYNC (as accurately as possible is important to catch the moment of operation limit switch) or until the signal is received from the speed sensor, if the flag HOME_STOP_REV_SN 2) then moves according to the speed SlowHome, uSlowHome and flag HOME_DIR_SLOW until signal from the clock input, if the flag HOME_MV_SEC. If the flag HOME_MV_SEC reset skip this paragraph. 3) then move the motor according to the speed FastHome, uFastHome and flag HOME_DIR_SLOW a distance HomeDelta, uHomeDelta. description of flags and variable see in description for commands GHOM/SHOM
id | an identifier of device |
Make home command, wait until it is finished and make zero command.
This is a convinient way to calibrate zero position.
id | an identifier of device | |
[out] | ret | RESULT_OK if controller has finished home & zero correctly or result of first controller query that returned anything other than RESULT_OK. |
Start continous moving to the left.
id | an identifier of device |
Upon receiving the command "loft" the engine is shifted from the current point to a distance GENG :: Antiplay, then move to the same point.
id | an identifier of device |
Upon receiving the command "move" the engine starts to move with pre-set parameters (speed, acceleration, retention), to the point specified to the Position, uPosition.
For stepper motor uPosition sets the microstep, for DC motor this field is not used.
id | an identifier of device |
Position | position to move. |
uPosition | part of the position to move, microsteps. Microstep size and the range of valid values for this field depend on selected step division mode (see MicrostepMode field in engine_settings). |
result_t XIMC_API command_move_calb | ( | device_t | id, |
float | Position, | ||
const calibration_t * | calibration | ||
) |
Move to position which use user units.
Upon receiving the command "move" the engine starts to move with pre-set parameters (speed, acceleration, retention), to the point specified to the Position.
id | an identifier of device |
Position | position to move. |
calibration | user unit settings |
Move to offset.
Upon receiving the command "movr" engine starts to move with pre-set parameters (speed, acceleration, hold), left or right (depending on the sign of DeltaPosition) by the number of pulses specified in the fields DeltaPosition, uDeltaPosition. For stepper motor uDeltaPosition sets the microstep, for DC motor this field is not used.
DeltaPosition | shift from initial position. |
uDeltaPosition | part of the offset shift, microsteps. Microstep size and the range of valid values for this field depend on selected step division mode (see MicrostepMode field in engine_settings). |
id | an identifier of device |
result_t XIMC_API command_movr_calb | ( | device_t | id, |
float | DeltaPosition, | ||
const calibration_t * | calibration | ||
) |
Move to offset using user units.
Upon receiving the command "movr" engine starts to move with pre-set parameters (speed, acceleration, hold), left or right (depending on the sign of DeltaPosition) the distance specified in the field DeltaPosition.
DeltaPosition | shift from initial position. |
id | an identifier of device |
calibration | user unit settings |
Immediately power off motor regardless its state.
Shouldn't be used during motion as the motor could be power on again automatically to continue movement. The command is designed for manual motor power off. When automatic power off after stop is required, use power management system.
id | an identifier of device |
Read important settings (calibration coefficients and etc.) from controller's flash memory to controller's RAM, replacing previous data in controller's RAM.
id | an identifier of device |
Read all settings from controller's flash memory to controller's RAM, replacing previous data in controller's RAM.
id | an identifier of device |
Reset controller.
Can be used by manufacturer only
id | an identifier of device |
Start continous moving to the right.
id | an identifier of device |
Save important settings (calibration coefficients and etc.) from controller's RAM to controller's flash memory, replacing previous data in controller's flash memory.
id | an identifier of device |
Save all settings from controller's RAM to controller's flash memory, replacing previous data in controller's flash memory.
id | an identifier of device |
Soft stop engine.
The motor stops with deceleration speed.
id | an identifier of device |
Start measurements and buffering of speed, following error.
id | an identifier of device |
Immediately stop the engine, the transition to the STOP, mode key BREAK (winding short-circuited), the regime "retention" is deactivated for DC motors, keeping current in the windings for stepper motors (with Power management settings).
When this command is called, the ALARM flag is reset.
id | an identifier of device |
result_t XIMC_API command_update_firmware | ( | const char * | uri, |
const uint8_t * | data, | ||
uint32_t | data_size | ||
) |
Update firmware.
Service command
uri | a uri of device |
data | firmware byte stream |
data_size | size of byte stream |
Wait for stop.
id | an identifier of device | |
refresh_interval_ms | Status refresh interval. The function waits this number of milliseconds between get_status requests to the controller. Recommended value of this parameter is 10 ms. Use values of less than 3 ms only when necessary - small refresh interval values do not significantly increase response time of the function, but they create substantially more traffic in controller-computer data channel. | |
[out] | ret | RESULT_OK if controller has stopped and result of the first get_status command which returned anything other than RESULT_OK otherwise. |
Sets the current position and the position in which the traffic moves by the move command and movr zero for all cases, except for movement to the target position.
In the latter case, set the zero current position and the target position counted so that the absolute position of the destination is the same. That is, if we were at 400 and moved to 500, then the command Zero makes the current position of 0, and the position of the destination - 100. Does not change the mode of movement that is if the motion is carried, it continues, and if the engine is in the "hold", the type of retention remains.
id | an identifier of device |
device_enumeration_t XIMC_API enumerate_devices | ( | int | enumerate_flags, |
const char * | hints | ||
) |
Enumerate all devices that looks like valid.
[in] | enumerate_flags | enumerate devices flags |
[in] | hints | extended information hints is a string of form "key=value \n key2=value2". Unrecognized key-value pairs are ignored. Key list: addr - used together with ENUMERATE_NETWORK flag. Non-null value is a remote host name or a comma-separated list of host names which contain the devices to be found, absent value means broadcast discovery. adapter_addr - used together with ENUMERATE_NETWORK flag. Non-null value is a IP address of network adapter. Remote ximc device must be on the same local network as the adapter. When using the adapter_addr key, you must install the addr key. Example: "addr= \n adapter_addr=192.168.0.100". To enumerate network devices you must call set_bindy_key first. |
result_t XIMC_API free_enumerate_devices | ( | device_enumeration_t | device_enumeration | ) |
Free memory returned by enumerate_devices.
[in] | device_enumeration | opaque pointer to an enumeration device data |
result_t XIMC_API get_accessories_settings | ( | device_t | id, |
accessories_settings_t * | accessories_settings | ||
) |
Read additional accessories information from EEPROM.
id | an identifier of device | |
[out] | accessories_settings | structure contains information about additional accessories |
result_t XIMC_API get_analog_data | ( | device_t | id, |
analog_data_t * | analog_data | ||
) |
Read analog data structure that contains raw analog data from ADC embedded on board.
This function used for device testing and deep recalibraton by manufacturer only.
id | an identifier of device | |
[out] | analog_data | analog data coefficients |
result_t XIMC_API get_bootloader_version | ( | device_t | id, |
unsigned int * | Major, | ||
unsigned int * | Minor, | ||
unsigned int * | Release | ||
) |
Read controller's firmware version.
id | an identifier of device | |
[out] | Major | major version |
[out] | Minor | minor version |
[out] | Release | release version |
result_t XIMC_API get_brake_settings | ( | device_t | id, |
brake_settings_t * | brake_settings | ||
) |
Read settings of brake control.
id | an identifier of device | |
[out] | brake_settings | structure contains settings of brake control |
result_t XIMC_API get_calibration_settings | ( | device_t | id, |
calibration_settings_t * | calibration_settings | ||
) |
Read calibration settings.
This function fill structure with calibration settings.
id | an identifier of device | |
[out] | calibration_settings | calibration settings |
result_t XIMC_API get_chart_data | ( | device_t | id, |
chart_data_t * | chart_data | ||
) |
Return device electrical parameters, useful for charts.
Useful function that fill structure with snapshot of controller voltages and currents.
id | an identifier of device | |
[out] | chart_data | structure with snapshot of controller parameters. |
result_t XIMC_API get_control_settings | ( | device_t | id, |
control_settings_t * | control_settings | ||
) |
Read settings of motor control.
When choosing CTL_MODE = 1 switches motor control with the joystick. In this mode, the joystick to the maximum engine tends Move at MaxSpeed [i], where i = 0 if the previous use This mode is not selected another i. Buttons switch the room rate i. When CTL_MODE = 2 is switched on motor control using the Left / right. When you click on the button motor starts to move in the appropriate direction at a speed MaxSpeed [0], at the end of time Timeout [i] motor move at a speed MaxSpeed [i+1]. at Transition from MaxSpeed [i] on MaxSpeed [i +1] to acceleration, as usual.
id | an identifier of device | |
[out] | control_settings | structure contains settings motor control by joystick or buttons left/right. |
result_t XIMC_API get_control_settings_calb | ( | device_t | id, |
control_settings_calb_t * | control_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Read settings of motor control which use user units.
When choosing CTL_MODE = 1 switches motor control with the joystick. In this mode, the joystick to the maximum engine tends Move at MaxSpeed [i], where i = 0 if the previous use This mode is not selected another i. Buttons switch the room rate i. When CTL_MODE = 2 is switched on motor control using the Left / right. When you click on the button motor starts to move in the appropriate direction at a speed MaxSpeed [0], at the end of time Timeout [i] motor move at a speed MaxSpeed [i+1]. at Transition from MaxSpeed [i] on MaxSpeed [i +1] to acceleration, as usual.
id | an identifier of device | |
[out] | control_settings_calb | structure contains settings motor control by joystick or buttons left/right. |
calibration | user unit settings |
result_t XIMC_API get_controller_name | ( | device_t | id, |
controller_name_t * | controller_name | ||
) |
Read user controller name and flags of setting from FRAM.
id | an identifier of device | |
[out] | controller_name | structure contains previously set user controller name |
result_t XIMC_API get_ctp_settings | ( | device_t | id, |
ctp_settings_t * | ctp_settings | ||
) |
Read settings of control position(is only used with stepper motor).
When controlling the step motor with encoder (CTP_BASE 0) it is possible to detect the loss of steps. The controller knows the number of steps per revolution (GENG :: StepsPerRev) and the encoder resolution (GFBS :: IPT). When the control (flag CTP_ENABLED), the controller stores the current position in the footsteps of SM and the current position of the encoder. Further, at each step of the position encoder is converted into steps and if the difference is greater CTPMinError, a flag STATE_CTP_ERROR. When controlling the step motor with speed sensor (CTP_BASE 1), the position is controlled by him. The active edge of input clock controller stores the current value of steps. Further, at each turn checks how many steps shifted. When a mismatch CTPMinError a flag STATE_CTP_ERROR.
id | an identifier of device | |
[out] | ctp_settings | structure contains settings of control position |
result_t XIMC_API get_debug_read | ( | device_t | id, |
debug_read_t * | debug_read | ||
) |
Read data from firmware for debug purpose.
Its use depends on context, firmware version and previous history.
id | an identifier of device | |
[out] | debug_read | Debug data. |
int XIMC_API get_device_count | ( | device_enumeration_t | device_enumeration | ) |
Get device count.
[in] | device_enumeration | opaque pointer to an enumeration device data |
result_t XIMC_API get_device_information | ( | device_t | id, |
device_information_t * | device_information | ||
) |
Return device information.
All fields must point to allocated string buffers with at least 10 bytes. Works with both raw or initialized device.
id | an identifier of device | |
[out] | device_information | device information Device information. |
pchar XIMC_API get_device_name | ( | device_enumeration_t | device_enumeration, |
int | device_index | ||
) |
Get device name from the device enumeration.
Returns device_index device name.
[in] | device_enumeration | opaque pointer to an enumeration device data |
[in] | device_index | device index |
result_t XIMC_API get_edges_settings | ( | device_t | id, |
edges_settings_t * | edges_settings | ||
) |
Read border and limit switches settings.
id | an identifier of device | |
[out] | edges_settings | edges settings, specify types of borders, motor behaviour and electrical behaviour of limit switches |
result_t XIMC_API get_edges_settings_calb | ( | device_t | id, |
edges_settings_calb_t * | edges_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Read border and limit switches settings which use user units.
id | an identifier of device | |
[out] | edges_settings_calb | edges settings, specify types of borders, motor behaviour and electrical behaviour of limit switches |
calibration | user unit settings |
result_t XIMC_API get_emf_settings | ( | device_t | id, |
emf_settings_t * | emf_settings | ||
) |
Read electromechanical settings.
The settings are different for different stepper motors.
id | an identifier of device | |
[out] | emf_settings | EMF settings |
result_t XIMC_API get_encoder_information | ( | device_t | id, |
encoder_information_t * | encoder_information | ||
) |
Read encoder information from EEPROM.
id | an identifier of device | |
[out] | encoder_information | structure contains information about encoder |
result_t XIMC_API get_encoder_settings | ( | device_t | id, |
encoder_settings_t * | encoder_settings | ||
) |
Read encoder settings from EEPROM.
id | an identifier of device | |
[out] | encoder_settings | structure contains encoder settings |
result_t XIMC_API get_engine_advansed_setup | ( | device_t | id, |
engine_advansed_setup_t * | engine_advansed_setup | ||
) |
Read engine advansed settings.
id | an identifier of device | |
[out] | engine_advansed_setup | EAS settings |
result_t XIMC_API get_engine_settings | ( | device_t | id, |
engine_settings_t * | engine_settings | ||
) |
Read engine settings.
This function fill structure with set of useful motor settings stored in controller's memory. These settings specify motor shaft movement algorithm, list of limitations and rated characteristics.
id | an identifier of device | |
[out] | engine_settings | engine settings |
result_t XIMC_API get_engine_settings_calb | ( | device_t | id, |
engine_settings_calb_t * | engine_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Read engine settings which use user units.
This function fill structure with set of useful motor settings stored in controller's memory. These settings specify motor shaft movement algorithm, list of limitations and rated characteristics.
id | an identifier of device | |
[out] | engine_settings_calb | engine settings |
calibration | user unit settings |
result_t XIMC_API get_entype_settings | ( | device_t | id, |
entype_settings_t * | entype_settings | ||
) |
Return engine type and driver type.
id | an identifier of device | |
[out] | entype_settings | structure contains settings motor type and power driver type |
result_t XIMC_API get_enumerate_device_controller_name | ( | device_enumeration_t | device_enumeration, |
int | device_index, | ||
controller_name_t * | controller_name | ||
) |
Get controller name from the device enumeration.
Returns device_index device controller name.
[in] | device_enumeration | opaque pointer to an enumeration device data |
[in] | device_index | device index |
[out] | controller_name | controller name |
result_t XIMC_API get_enumerate_device_information | ( | device_enumeration_t | device_enumeration, |
int | device_index, | ||
device_information_t * | device_information | ||
) |
Get device information from the device enumeration.
Returns device_index device information.
[in] | device_enumeration | opaque pointer to an enumeration device data |
[in] | device_index | device index |
[out] | device_information | device information data |
result_t XIMC_API get_enumerate_device_network_information | ( | device_enumeration_t | device_enumeration, |
int | device_index, | ||
device_network_information_t * | device_network_information | ||
) |
Get device network information from the device enumeration.
Returns device_index device network information.
[in] | device_enumeration | opaque pointer to an enumeration device data |
[in] | device_index | device index |
[out] | device_network_information | device network information data |
result_t XIMC_API get_enumerate_device_serial | ( | device_enumeration_t | device_enumeration, |
int | device_index, | ||
uint32_t * | serial | ||
) |
Get device serial number from the device enumeration.
Returns device_index device serial number.
[in] | device_enumeration | opaque pointer to an enumeration device data |
[in] | device_index | device index |
[out] | serial | device serial number |
result_t XIMC_API get_enumerate_device_stage_name | ( | device_enumeration_t | device_enumeration, |
int | device_index, | ||
stage_name_t * | stage_name | ||
) |
Get stage name from the device enumeration.
Returns device_index device stage name.
[in] | device_enumeration | opaque pointer to an enumeration device data |
[in] | device_index | device index |
[out] | stage_name | stage name |
result_t XIMC_API get_extended_settings | ( | device_t | id, |
extended_settings_t * | extended_settings | ||
) |
Read extended settings.
id | an identifier of device | |
[out] | extended_settings | EST settings |
result_t XIMC_API get_extio_settings | ( | device_t | id, |
extio_settings_t * | extio_settings | ||
) |
Read EXTIO settings.
This function reads a structure with a set of EXTIO settings from controller's memory.
id | an identifier of device | |
[out] | extio_settings | EXTIO settings |
result_t XIMC_API get_feedback_settings | ( | device_t | id, |
feedback_settings_t * | feedback_settings | ||
) |
Feedback settings.
id | an identifier of device | |
[out] | IPS | number of encoder counts per shaft revolution. Range: 1..65535. The field is obsolete, it is recommended to write 0 to IPS and use the extended CountsPerTurn field. You may need to update the controller firmware to the latest version. |
[out] | FeedbackType | type of feedback |
[out] | FeedbackFlags | flags of feedback |
[out] | CountsPerTurn | number of encoder counts per shaft revolution. Range: 1..4294967295. To use the CountsPerTurn field, write 0 in the IPS field, otherwise the value from the IPS field will be used. |
result_t XIMC_API get_firmware_version | ( | device_t | id, |
unsigned int * | Major, | ||
unsigned int * | Minor, | ||
unsigned int * | Release | ||
) |
Read controller's firmware version.
id | an identifier of device | |
[out] | Major | major version |
[out] | Minor | minor version |
[out] | Release | release version |
result_t XIMC_API get_gear_information | ( | device_t | id, |
gear_information_t * | gear_information | ||
) |
Read gear information from EEPROM.
id | an identifier of device | |
[out] | gear_information | structure contains information about step gearhead |
result_t XIMC_API get_gear_settings | ( | device_t | id, |
gear_settings_t * | gear_settings | ||
) |
Read gear settings from EEPROM.
id | an identifier of device | |
[out] | gear_settings | structure contains step gearhead settings |
result_t XIMC_API get_globally_unique_identifier | ( | device_t | id, |
globally_unique_identifier_t * | globally_unique_identifier | ||
) |
This value is unique to each individual die but is not a random value.
This unique device identifier can be used to initiate secure boot processes or as a serial number for USB or other end applications.
id | an identifier of device | |
[out] | globally_unique_identifier | the result of fields 0-3 concatenated defines the unique 128-bit device identifier. |
result_t XIMC_API get_hallsensor_information | ( | device_t | id, |
hallsensor_information_t * | hallsensor_information | ||
) |
Read hall sensor information from EEPROM.
id | an identifier of device | |
[out] | hallsensor_information | structure contains information about hall sensor |
result_t XIMC_API get_hallsensor_settings | ( | device_t | id, |
hallsensor_settings_t * | hallsensor_settings | ||
) |
Read hall sensor settings from EEPROM.
id | an identifier of device | |
[out] | hallsensor_settings | structure contains hall sensor settings |
result_t XIMC_API get_home_settings | ( | device_t | id, |
home_settings_t * | home_settings | ||
) |
Read home settings.
This function fill structure with settings of calibrating position.
id | an identifier of device | |
[out] | home_settings | calibrating position settings |
result_t XIMC_API get_home_settings_calb | ( | device_t | id, |
home_settings_calb_t * | home_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Read home settings which use user units.
This function fill structure with settings of calibrating position.
id | an identifier of device | |
[out] | home_settings_calb | calibrating position settings |
calibration | user unit settings |
result_t XIMC_API get_init_random | ( | device_t | id, |
init_random_t * | init_random | ||
) |
Read random number from controller.
id | an identifier of device | |
[out] | init_random | random sequence generated by the controller |
result_t XIMC_API get_joystick_settings | ( | device_t | id, |
joystick_settings_t * | joystick_settings | ||
) |
Read settings of joystick.
If joystick position is outside DeadZone limits from the central position a movement with speed, defined by the joystick DeadZone edge to 100% deviation, begins. Joystick positions inside DeadZone limits correspond to zero speed (soft stop of motion) and positions beyond Low and High limits correspond MaxSpeed [i] or -MaxSpeed [i] (see command SCTL), where i = 0 by default and can be changed with left/right buttons (see command SCTL). If next speed in list is zero (both integer and microstep parts), the button press is ignored. First speed in list shouldn't be zero. The DeadZone ranges are illustrated on the following picture. !/attachments/download/5563/range25p.png! The relationship between the deviation and the rate is exponential, allowing no switching speed combine high mobility and accuracy. The following picture illustrates this: !/attachments/download/3092/ExpJoystick.png! The nonlinearity parameter is adjustable. Setting it to zero makes deviation/speed relation linear.
id | an identifier of device | |
[out] | joystick_settings | structure contains joystick settings |
result_t XIMC_API get_measurements | ( | device_t | id, |
measurements_t * | measurements | ||
) |
A command to read the data buffer to build a speed graph and a sequence error.
Filling the buffer starts with the command "start_measurements". The buffer holds 25 points, the points are taken with a period of 1 ms. To create a robust system, read data every 20 ms, if the buffer is completely full, then it is recommended to repeat the readings every 5 ms until the buffer again becomes filled with 20 points.
id | an identifier of device | |
[out] | measurements | structure with buffer and its length. |
result_t XIMC_API get_motor_information | ( | device_t | id, |
motor_information_t * | motor_information | ||
) |
Read motor information from EEPROM.
id | an identifier of device | |
[out] | motor_information | structure contains motor information |
result_t XIMC_API get_motor_settings | ( | device_t | id, |
motor_settings_t * | motor_settings | ||
) |
Read motor settings from EEPROM.
id | an identifier of device | |
[out] | motor_settings | structure contains motor settings |
result_t XIMC_API get_move_settings | ( | device_t | id, |
move_settings_t * | move_settings | ||
) |
Read command setup movement (speed, acceleration, threshold and etc).
id | an identifier of device | |
[out] | move_settings | structure contains move settings: speed, acceleration, deceleration etc. |
result_t XIMC_API get_move_settings_calb | ( | device_t | id, |
move_settings_calb_t * | move_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Read command setup movement which use user units (speed, acceleration, threshold and etc).
id | an identifier of device | |
[out] | move_settings_calb | structure contains move settings: speed, acceleration, deceleration etc. |
calibration | user unit settings |
result_t XIMC_API get_nonvolatile_memory | ( | device_t | id, |
nonvolatile_memory_t * | nonvolatile_memory | ||
) |
Read userdata from FRAM.
id | an identifier of device | |
[out] | nonvolatile_memory | structure contains previously set userdata |
result_t XIMC_API get_pid_settings | ( | device_t | id, |
pid_settings_t * | pid_settings | ||
) |
Read PID settings.
This function fill structure with set of motor PID settings stored in controller's memory. These settings specify behaviour of PID routine for positioner. These factors are slightly different for different positioners. All boards are supplied with standard set of PID setting on controller's flash memory.
id | an identifier of device | |
[out] | pid_settings | pid settings |
result_t XIMC_API get_position | ( | device_t | id, |
get_position_t * | the_get_position | ||
) |
Reads the value position in steps and micro for stepper motor and encoder steps all engines.
id | an identifier of device | |
[out] | the_get_position | structure contains move settings: speed, acceleration, deceleration etc. |
result_t XIMC_API get_position_calb | ( | device_t | id, |
get_position_calb_t * | the_get_position_calb, | ||
const calibration_t * | calibration | ||
) |
Reads position value in user units for stepper motor and encoder steps all engines.
id | an identifier of device | |
[out] | the_get_position_calb | structure contains move settings: speed, acceleration, deceleration etc. |
calibration | user unit settings |
result_t XIMC_API get_power_settings | ( | device_t | id, |
power_settings_t * | power_settings | ||
) |
Read settings of step motor power control.
Used with stepper motor only.
id | an identifier of device | |
[out] | power_settings | structure contains settings of step motor power control |
result_t XIMC_API get_secure_settings | ( | device_t | id, |
secure_settings_t * | secure_settings | ||
) |
Read protection settings.
id | an identifier of device | |
[out] | secure_settings | critical parameter settings to protect the hardware |
Read device serial number.
id | an identifier of device | |
[out] | SerialNumber | serial number |
result_t XIMC_API get_stage_information | ( | device_t | id, |
stage_information_t * | stage_information | ||
) |
Read stage information from EEPROM.
id | an identifier of device | |
[out] | stage_information | structure contains stage information |
result_t XIMC_API get_stage_name | ( | device_t | id, |
stage_name_t * | stage_name | ||
) |
Read user stage name from EEPROM.
id | an identifier of device | |
[out] | stage_name | structure contains previously set user stage name |
result_t XIMC_API get_stage_settings | ( | device_t | id, |
stage_settings_t * | stage_settings | ||
) |
Read stage settings from EEPROM.
id | an identifier of device | |
[out] | stage_settings | structure contains stage settings |
Return device state.
id | an identifier of device | |
[out] | status | structure with snapshot of controller status Device state. Useful structure that contains current controller status, including speed, position and boolean flags. |
result_t XIMC_API get_status_calb | ( | device_t | id, |
status_calb_t * | status, | ||
const calibration_t * | calibration | ||
) |
Return device state.
id | an identifier of device | |
[out] | status | structure with snapshot of controller status |
calibration | user unit settings Calibrated device state. Useful structure that contains current controller status, including speed, position and boolean flags. |
result_t XIMC_API get_sync_in_settings | ( | device_t | id, |
sync_in_settings_t * | sync_in_settings | ||
) |
Read input synchronization settings.
This function fill structure with set of input synchronization settings, modes, periods and flags, that specify behaviour of input synchronization. All boards are supplied with standard set of these settings.
id | an identifier of device | |
[out] | sync_in_settings | synchronization settings |
result_t XIMC_API get_sync_in_settings_calb | ( | device_t | id, |
sync_in_settings_calb_t * | sync_in_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Read input synchronization settings which use user units.
This function fill structure with set of input synchronization settings, modes, periods and flags, that specify behaviour of input synchronization. All boards are supplied with standard set of these settings.
id | an identifier of device | |
[out] | sync_in_settings_calb | synchronization settings |
calibration | user unit settings |
result_t XIMC_API get_sync_out_settings | ( | device_t | id, |
sync_out_settings_t * | sync_out_settings | ||
) |
Read output synchronization settings.
This function fill structure with set of output synchronization settings, modes, periods and flags, that specify behaviour of output synchronization. All boards are supplied with standard set of these settings.
id | an identifier of device | |
[out] | sync_out_settings | synchronization settings |
result_t XIMC_API get_sync_out_settings_calb | ( | device_t | id, |
sync_out_settings_calb_t * | sync_out_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Read output synchronization settings which use user units.
This function fill structure with set of output synchronization settings, modes, periods and flags, that specify behaviour of output synchronization. All boards are supplied with standard set of these settings.
id | an identifier of device | |
[out] | sync_out_settings_calb | synchronization settings |
calibration | user unit settings |
result_t XIMC_API get_uart_settings | ( | device_t | id, |
uart_settings_t * | uart_settings | ||
) |
Read UART settings.
This function fill structure with UART settings.
Speed | UART speed | |
[out] | uart_settings | UART settings |
Reboot to firmware.
id | an identifier of device | |
[out] | ret | RESULT_OK, if reboot to firmware is possible. Reboot is done after reply to this command. RESULT_NO_FIRMWARE, if firmware is not found. RESULT_ALREADY_IN_FIRMWARE, if this command was sent when controller is already in firmware. |
Check for firmware on device.
uri | a uri of device | |
[out] | ret | non-zero if firmware existed |
Command of loading a correction table from a text file (this function is deprecated).
Use the function set_correction_table(device_t id, const char* namefile). The correction table is used for position correction in case of mechanical inaccuracies. It works for some parameters in _calb commands.
id | an identifier the device | |
[in] | namefile | - the file name must be fully qualified. If the short name is used, the file must be located in the application directory. If the file name is set to NULL, the correction table will be cleared. File format: two tab-separated columns. Column headers are string. Data is real, the point is a determiter. The first column is a coordinate. The second one is the deviation caused by a mechanical error. The maximum length of a table is 100 rows. |
void XIMC_API logging_callback_stderr_narrow | ( | int | loglevel, |
const wchar_t * | message, | ||
void * | user_data | ||
) |
Simple callback for logging to stderr in narrow (single byte) chars.
loglevel | a loglevel |
message | a message |
void XIMC_API logging_callback_stderr_wide | ( | int | loglevel, |
const wchar_t * | message, | ||
void * | user_data | ||
) |
Simple callback for logging to stderr in wide chars.
loglevel | a loglevel |
message | a message |
void XIMC_API msec_sleep | ( | unsigned int | msec | ) |
Sleeps for a specified amount of time.
msec | time in milliseconds |
Open a device with OS uri uri and return identifier of the device which can be used in calls.
[in] | uri | - a device uri. Device uri has form "xi-com:port" or "xi-net://host/serial" or "xi-emu:///file". In case of USB-COM port the "port" is the OS device uri. For example "xi-com:\\.\COM3" in Windows or "xi-com:/dev/tty.s123" in Linux/Mac. In case of network device the "host" is an IPv4 address or fully qualified domain uri (FQDN), "serial" is the device serial number in hexadecimal system. For example "xi-net://192.168.0.1/00001234" or "xi-net://hostname.com/89ABCDEF". Note: to open network device you must call set_bindy_key first. In case of virtual device the "file" is the full filename with device memory state, if it doesn't exist then it is initialized with default values. For example "xi-emu:///C:/dir/file.bin" in Windows or "xi-emu:///home/user/file.bin" in Linux/Mac. |
Check if a device with OS uri uri is XIMC device.
Be carefuly with this call because it sends some data to the device.
[in] | uri | - a device uri |
Resets the error of incorrect data transmission.
This function returns only 0 (OK). For example, sending the libximc command ends with an incorrect data transfer (error), any subsequent command always returns -1 (relevant for Windows).
Command puts the controller to update the firmware.
After receiving this command, the firmware board sets a flag (for loader), sends echo reply and restarts the controller.
result_t XIMC_API set_accessories_settings | ( | device_t | id, |
const accessories_settings_t * | accessories_settings | ||
) |
Set additional accessories information to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | accessories_settings | structure contains information about additional accessories |
Set network encryption layer (bindy) key.
[in] | keyfilepath | full path to the bindy keyfile When using network-attached devices this function must be called before enumerate_devices and open_device functions. |
result_t XIMC_API set_brake_settings | ( | device_t | id, |
const brake_settings_t * | brake_settings | ||
) |
Set settings of brake control.
id | an identifier of device | |
[in] | brake_settings | structure contains settings of brake control |
result_t XIMC_API set_calibration_settings | ( | device_t | id, |
const calibration_settings_t * | calibration_settings | ||
) |
Set calibration settings.
This function send structure with calibration settings to controller's memory.
id | an identifier of device | |
[in] | calibration_settings | calibration settings |
result_t XIMC_API set_control_settings | ( | device_t | id, |
const control_settings_t * | control_settings | ||
) |
Set settings of motor control.
When choosing CTL_MODE = 1 switches motor control with the joystick. In this mode, the joystick to the maximum engine tends Move at MaxSpeed [i], where i = 0 if the previous use This mode is not selected another i. Buttons switch the room rate i. When CTL_MODE = 2 is switched on motor control using the Left / right. When you click on the button motor starts to move in the appropriate direction at a speed MaxSpeed [0], at the end of time Timeout [i] motor move at a speed MaxSpeed [i+1]. at Transition from MaxSpeed [i] on MaxSpeed [i +1] to acceleration, as usual.
id | an identifier of device | |
[in] | control_settings | structure contains settings motor control by joystick or buttons left/right. |
result_t XIMC_API set_control_settings_calb | ( | device_t | id, |
const control_settings_calb_t * | control_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Set settings of motor control which use user units.
When choosing CTL_MODE = 1 switches motor control with the joystick. In this mode, the joystick to the maximum engine tends Move at MaxSpeed [i], where i = 0 if the previous use This mode is not selected another i. Buttons switch the room rate i. When CTL_MODE = 2 is switched on motor control using the Left / right. When you click on the button motor starts to move in the appropriate direction at a speed MaxSpeed [0], at the end of time Timeout [i] motor move at a speed MaxSpeed [i+1]. at Transition from MaxSpeed [i] on MaxSpeed [i +1] to acceleration, as usual.
id | an identifier of device | |
[in] | control_settings_calb | structure contains settings motor control by joystick or buttons left/right. |
calibration | user unit settings |
result_t XIMC_API set_controller_name | ( | device_t | id, |
const controller_name_t * | controller_name | ||
) |
Write user controller name and flags of setting from FRAM.
id | an identifier of device | |
[in] | controller_name | structure contains previously set user controller name |
Command of loading a correction table from a text file.
The correction table is used for position correction in case of mechanical inaccuracies. It works for some parameters in _calb commands.
id | an identifier the device | |
[in] | namefile | - the file name must be fully qualified. If the short name is used, the file must be located in the application directory. If the file name is set to NULL, the correction table will be cleared. File format: two tab-separated columns. Column headers are string. Data is real, the point is a determiter. The first column is a coordinate. The second one is the deviation caused by a mechanical error. The maximum length of a table is 100 rows. |
result_t XIMC_API set_ctp_settings | ( | device_t | id, |
const ctp_settings_t * | ctp_settings | ||
) |
Set settings of control position(is only used with stepper motor).
When controlling the step motor with encoder (CTP_BASE 0) it is possible to detect the loss of steps. The controller knows the number of steps per revolution (GENG :: StepsPerRev) and the encoder resolution (GFBS :: IPT). When the control (flag CTP_ENABLED), the controller stores the current position in the footsteps of SM and the current position of the encoder. Further, at each step of the position encoder is converted into steps and if the difference is greater CTPMinError, a flag STATE_CTP_ERROR. When controlling the step motor with speed sensor (CTP_BASE 1), the position is controlled by him. The active edge of input clock controller stores the current value of steps. Further, at each turn checks how many steps shifted. When a mismatch CTPMinError a flag STATE_CTP_ERROR.
id | an identifier of device | |
[in] | ctp_settings | structure contains settings of control position |
result_t XIMC_API set_debug_write | ( | device_t | id, |
const debug_write_t * | debug_write | ||
) |
Write data to firmware for debug purpose.
id | an identifier of device | |
[in] | debug_write | Debug data. |
result_t XIMC_API set_edges_settings | ( | device_t | id, |
const edges_settings_t * | edges_settings | ||
) |
Set border and limit switches settings.
id | an identifier of device | |
[in] | edges_settings | edges settings, specify types of borders, motor behaviour and electrical behaviour of limit switches |
result_t XIMC_API set_edges_settings_calb | ( | device_t | id, |
const edges_settings_calb_t * | edges_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Set border and limit switches settings which use user units.
id | an identifier of device | |
[in] | edges_settings_calb | edges settings, specify types of borders, motor behaviour and electrical behaviour of limit switches |
calibration | user unit settings |
result_t XIMC_API set_emf_settings | ( | device_t | id, |
const emf_settings_t * | emf_settings | ||
) |
Set electromechanical coefficients.
The settings are different for different stepper motors. Please download the new settings when you change the motor.
id | an identifier of device | |
[in] | emf_settings | EMF settings |
result_t XIMC_API set_encoder_information | ( | device_t | id, |
const encoder_information_t * | encoder_information | ||
) |
Set encoder information to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | encoder_information | structure contains information about encoder |
result_t XIMC_API set_encoder_settings | ( | device_t | id, |
const encoder_settings_t * | encoder_settings | ||
) |
Set encoder settings to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | encoder_settings | structure contains encoder settings |
result_t XIMC_API set_engine_advansed_setup | ( | device_t | id, |
const engine_advansed_setup_t * | engine_advansed_setup | ||
) |
Set engine advansed settings.
id | an identifier of device | |
[in] | engine_advansed_setup | EAS settings |
result_t XIMC_API set_engine_settings | ( | device_t | id, |
const engine_settings_t * | engine_settings | ||
) |
Set engine settings.
This function send structure with set of engine settings to controller's memory. These settings specify motor shaft movement algorithm, list of limitations and rated characteristics. Use it when you change motor, encoder, positioner etc. Please note that wrong engine settings lead to device malfunction, can lead to irreversible damage of board.
id | an identifier of device | |
[in] | engine_settings | engine settings |
result_t XIMC_API set_engine_settings_calb | ( | device_t | id, |
const engine_settings_calb_t * | engine_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Set engine settings which use user units.
This function send structure with set of engine settings to controller's memory. These settings specify motor shaft movement algorithm, list of limitations and rated characteristics. Use it when you change motor, encoder, positioner etc. Please note that wrong engine settings lead to device malfunction, can lead to irreversible damage of board.
id | an identifier of device | |
[in] | engine_settings_calb | engine settings |
calibration | user unit settings |
result_t XIMC_API set_entype_settings | ( | device_t | id, |
const entype_settings_t * | entype_settings | ||
) |
Set engine type and driver type.
id | an identifier of device | |
[in] | entype_settings | structure contains settings motor type and power driver type |
result_t XIMC_API set_extended_settings | ( | device_t | id, |
const extended_settings_t * | extended_settings | ||
) |
Set extended settings.
id | an identifier of device | |
[in] | extended_settings | EST settings |
result_t XIMC_API set_extio_settings | ( | device_t | id, |
const extio_settings_t * | extio_settings | ||
) |
Set EXTIO settings.
This function writes a structure with a set of EXTIO settings to controller's memory. By default input event are signalled through rising front and output states are signalled by high logic state.
id | an identifier of device | |
[in] | extio_settings | EXTIO settings |
result_t XIMC_API set_feedback_settings | ( | device_t | id, |
const feedback_settings_t * | feedback_settings | ||
) |
Feedback settings.
id | an identifier of device | |
[in] | IPS | number of encoder counts per shaft revolution. Range: 1..65535. The field is obsolete, it is recommended to write 0 to IPS and use the extended CountsPerTurn field. You may need to update the controller firmware to the latest version. |
[in] | FeedbackType | type of feedback |
[in] | FeedbackFlags | flags of feedback |
[in] | CountsPerTurn | number of encoder counts per shaft revolution. Range: 1..4294967295. To use the CountsPerTurn field, write 0 in the IPS field, otherwise the value from the IPS field will be used. |
result_t XIMC_API set_gear_information | ( | device_t | id, |
const gear_information_t * | gear_information | ||
) |
Set gear information to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | gear_information | structure contains information about step gearhead |
result_t XIMC_API set_gear_settings | ( | device_t | id, |
const gear_settings_t * | gear_settings | ||
) |
Set gear settings to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | gear_settings | structure contains step gearhead settings |
result_t XIMC_API set_hallsensor_information | ( | device_t | id, |
const hallsensor_information_t * | hallsensor_information | ||
) |
Set hall sensor information to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | hallsensor_information | structure contains information about hall sensor |
result_t XIMC_API set_hallsensor_settings | ( | device_t | id, |
const hallsensor_settings_t * | hallsensor_settings | ||
) |
Set hall sensor settings to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | hallsensor_settings | structure contains hall sensor settings |
result_t XIMC_API set_home_settings | ( | device_t | id, |
const home_settings_t * | home_settings | ||
) |
Set home settings.
This function send structure with calibrating position settings to controller's memory.
id | an identifier of device | |
[in] | home_settings | calibrating position settings |
result_t XIMC_API set_home_settings_calb | ( | device_t | id, |
const home_settings_calb_t * | home_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Set home settings which use user units.
This function send structure with calibrating position settings to controller's memory.
id | an identifier of device | |
[in] | home_settings_calb | calibrating position settings |
calibration | user unit settings |
result_t XIMC_API set_joystick_settings | ( | device_t | id, |
const joystick_settings_t * | joystick_settings | ||
) |
Set settings of joystick.
If joystick position is outside DeadZone limits from the central position a movement with speed, defined by the joystick DeadZone edge to 100% deviation, begins. Joystick positions inside DeadZone limits correspond to zero speed (soft stop of motion) and positions beyond Low and High limits correspond MaxSpeed [i] or -MaxSpeed [i] (see command SCTL), where i = 0 by default and can be changed with left/right buttons (see command SCTL). If next speed in list is zero (both integer and microstep parts), the button press is ignored. First speed in list shouldn't be zero. The DeadZone ranges are illustrated on the following picture. !/attachments/download/5563/range25p.png! The relationship between the deviation and the rate is exponential, allowing no switching speed combine high mobility and accuracy. The following picture illustrates this: !/attachments/download/3092/ExpJoystick.png! The nonlinearity parameter is adjustable. Setting it to zero makes deviation/speed relation linear.
id | an identifier of device | |
[in] | joystick_settings | structure contains joystick settings |
void XIMC_API set_logging_callback | ( | logging_callback_t | logging_callback, |
void * | user_data | ||
) |
Sets a logging callback.
Call resets a callback to default (stderr, syslog) if NULL passed.
logging_callback | a callback for log messages |
result_t XIMC_API set_motor_information | ( | device_t | id, |
const motor_information_t * | motor_information | ||
) |
Set motor information to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | motor_information | structure contains motor information |
result_t XIMC_API set_motor_settings | ( | device_t | id, |
const motor_settings_t * | motor_settings | ||
) |
Set motor settings to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | motor_settings | structure contains motor information |
result_t XIMC_API set_move_settings | ( | device_t | id, |
const move_settings_t * | move_settings | ||
) |
Set command setup movement (speed, acceleration, threshold and etc).
id | an identifier of device | |
[in] | move_settings | structure contains move settings: speed, acceleration, deceleration etc. |
result_t XIMC_API set_move_settings_calb | ( | device_t | id, |
const move_settings_calb_t * | move_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Set command setup movement which use user units (speed, acceleration, threshold and etc).
id | an identifier of device | |
[in] | move_settings_calb | structure contains move settings: speed, acceleration, deceleration etc. |
calibration | user unit settings |
result_t XIMC_API set_nonvolatile_memory | ( | device_t | id, |
const nonvolatile_memory_t * | nonvolatile_memory | ||
) |
Write userdata into FRAM.
id | an identifier of device | |
[in] | nonvolatile_memory | structure contains previously set userdata |
result_t XIMC_API set_pid_settings | ( | device_t | id, |
const pid_settings_t * | pid_settings | ||
) |
Set PID settings.
This function send structure with set of PID factors to controller's memory. These settings specify behaviour of PID routine for positioner. These factors are slightly different for different positioners. All boards are supplied with standard set of PID setting on controller's flash memory. Please use it for loading new PID settings when you change positioner. Please note that wrong PID settings lead to device malfunction.
id | an identifier of device | |
[in] | pid_settings | pid settings |
result_t XIMC_API set_position | ( | device_t | id, |
const set_position_t * | the_set_position | ||
) |
Sets any position value in steps and micro for stepper motor and encoder steps of all engines.
It means, that changing main indicator of position.
id | an identifier of device | |
[out] | the_set_position | structure contains move settings: speed, acceleration, deceleration etc. |
result_t XIMC_API set_position_calb | ( | device_t | id, |
const set_position_calb_t * | the_set_position_calb, | ||
const calibration_t * | calibration | ||
) |
Sets any position value and encoder value of all engines which use user units.
It means, that changing main indicator of position.
id | an identifier of device | |
[out] | the_set_position_calb | structure contains move settings: speed, acceleration, deceleration etc. |
calibration | user unit settings |
result_t XIMC_API set_power_settings | ( | device_t | id, |
const power_settings_t * | power_settings | ||
) |
Set settings of step motor power control.
Used with stepper motor only.
id | an identifier of device | |
[in] | power_settings | structure contains settings of step motor power control |
result_t XIMC_API set_secure_settings | ( | device_t | id, |
const secure_settings_t * | secure_settings | ||
) |
Set protection settings.
id | an identifier of device |
secure_settings | structure with secure data |
result_t XIMC_API set_serial_number | ( | device_t | id, |
const serial_number_t * | serial_number | ||
) |
Write device serial number and hardware version to controller's flash memory.
Along with the new serial number and hardware version a "Key" is transmitted. The SN and hardware version are changed and saved when keys match. Can be used by manufacturer only.
id | an identifier of device | |
[in] | serial_number | structure contains new serial number and secret key. |
result_t XIMC_API set_stage_information | ( | device_t | id, |
const stage_information_t * | stage_information | ||
) |
Set stage information to EEPROM.
Can be used by manufacturer only.
id | an identifier of device | |
[in] | stage_information | structure contains stage information |
result_t XIMC_API set_stage_name | ( | device_t | id, |
const stage_name_t * | stage_name | ||
) |
Write user stage name from EEPROM.
id | an identifier of device | |
[in] | stage_name | structure contains previously set user stage name |
result_t XIMC_API set_stage_settings | ( | device_t | id, |
const stage_settings_t * | stage_settings | ||
) |
Set stage settings to EEPROM.
Can be used by manufacturer only
id | an identifier of device | |
[in] | stage_settings | structure contains stage settings |
result_t XIMC_API set_sync_in_settings | ( | device_t | id, |
const sync_in_settings_t * | sync_in_settings | ||
) |
Set input synchronization settings.
This function send structure with set of input synchronization settings, that specify behaviour of input synchronization, to controller's memory. All boards are supplied with standard set of these settings.
id | an identifier of device | |
[in] | sync_in_settings | synchronization settings |
result_t XIMC_API set_sync_in_settings_calb | ( | device_t | id, |
const sync_in_settings_calb_t * | sync_in_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Set input synchronization settings which use user units.
This function send structure with set of input synchronization settings, that specify behaviour of input synchronization, to controller's memory. All boards are supplied with standard set of these settings.
id | an identifier of device | |
[in] | sync_in_settings_calb | synchronization settings |
calibration | user unit settings |
result_t XIMC_API set_sync_out_settings | ( | device_t | id, |
const sync_out_settings_t * | sync_out_settings | ||
) |
Set output synchronization settings.
This function send structure with set of output synchronization settings, that specify behaviour of output synchronization, to controller's memory. All boards are supplied with standard set of these settings.
id | an identifier of device | |
[in] | sync_out_settings | synchronization settings |
result_t XIMC_API set_sync_out_settings_calb | ( | device_t | id, |
const sync_out_settings_calb_t * | sync_out_settings_calb, | ||
const calibration_t * | calibration | ||
) |
Set output synchronization settings which use user units.
This function send structure with set of output synchronization settings, that specify behaviour of output synchronization, to controller's memory. All boards are supplied with standard set of these settings.
id | an identifier of device | |
[in] | sync_out_settings_calb | synchronization settings |
calibration | user unit settings |
result_t XIMC_API set_uart_settings | ( | device_t | id, |
const uart_settings_t * | uart_settings | ||
) |
Set UART settings.
This function send structure with UART settings to controller's memory.
Speed | UART speed | |
[in] | uart_settings | UART settings |
Write controller key.
Can be used by manufacturer only
uri | a uri of device | |
[in] | key | protection key. Range: 0..4294967295 |
Fixing a USB driver error in Windows.
The USB-COM subsystem in the Windows OS does not always work correctly. During operation, the following malfunctions are possible: All attempts to open the device fail. The device can be opened and data can be sent to it, but the response data is not received. These problems are fixed by reconnecting the device or reinitializing it in the Device Manager. The ximc_fix_usbser_sys() function automates the deletion detection process.
void XIMC_API ximc_version | ( | char * | version | ) |
Returns a library version.
version | a buffer to hold a version string, 32 bytes is enough |