libximc  2.10.5
Data Structures | Macros | Typedefs
ximc.h File Reference

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
struct  move_settings_t
 Move settings. More...
struct  move_settings_calb_t
struct  engine_settings_t
 Movement limitations and settings, related to the motor. More...
struct  engine_settings_calb_t
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
struct  pid_settings_t
 PID settings. More...
struct  sync_in_settings_t
 Synchronization settings. More...
struct  sync_in_settings_calb_t
struct  sync_out_settings_t
 Synchronization settings. More...
struct  sync_out_settings_calb_t
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
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  command_add_sync_in_action_t
 This command adds one element of the FIFO commands. More...
struct  command_add_sync_in_action_calb_t
struct  get_position_t
 Position information. More...
struct  get_position_calb_t
struct  set_position_t
 Position information. More...
struct  set_position_calb_t
struct  status_t
 Device state. More...
struct  status_calb_t
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...
struct  command_change_motor_t
 Change motor - command for switching output relay. More...

Macros

#define XIMC_API
 Library import macro Macros allows to automatically import function from shared library.
#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

Specify move states.

See Also
get_status
status_t::move_state
status_t::MoveSts, get_status_impl
#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

Specify power states.

See Also
status_t::power_state
get_status
status_t::PWRSts, get_status_impl
#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

GPIO state flags returned by device query. Contains boolean part of controller state. May be combined with bitwise OR.

See Also
status_t::flags
get_status
status_t::GPIOFlags, get_status_impl
#define STATE_CONTR   0x00003F
 Flags of controller states.
#define STATE_ERRC   0x000001
 Command error encountered.
#define STATE_ERRD   0x000002
 Data integrity error encountered.
#define STATE_ERRV   0x000004
 Value error encountered.
#define STATE_EEPROM_CONNECTED   0x000010
 EEPROM with settings is connected.
#define STATE_IS_HOMED   0x000020
 Calibration performed.
#define STATE_SECUR   0x73FFC0
 Flags of security.
#define STATE_ALARM   0x000040
 Controller is in alarm state indicating that something dangerous had happened.
#define STATE_CTP_ERROR   0x000080
 Control position error(is only used with stepper motor).
#define STATE_POWER_OVERHEAT   0x000100
 Power driver overheat.
#define STATE_CONTROLLER_OVERHEAT   0x000200
 Controller overheat.
#define STATE_OVERLOAD_POWER_VOLTAGE   0x000400
 Power voltage exceeds safe limit.
#define STATE_OVERLOAD_POWER_CURRENT   0x000800
 Power current exceeds safe limit.
#define STATE_OVERLOAD_USB_VOLTAGE   0x001000
 USB voltage exceeds safe limit.
#define STATE_LOW_USB_VOLTAGE   0x002000
 USB voltage is insufficient for normal operation.
#define STATE_OVERLOAD_USB_CURRENT   0x004000
 USB current exceeds safe limit.
#define STATE_BORDERS_SWAP_MISSET   0x008000
 Engine stuck at the wrong edge.
#define STATE_LOW_POWER_VOLTAGE   0x010000
 Power voltage is lower than Low Voltage Protection limit.
#define STATE_H_BRIDGE_FAULT   0x020000
 Signal from the driver that fault happened.
#define STATE_CURRENT_MOTOR_BITS   0x0C0000
 Bits indicating the current operating motor on boards with multiple outputs for engine mounting.
#define STATE_CURRENT_MOTOR0   0x000000
 Motor 0.
#define STATE_CURRENT_MOTOR1   0x040000
 Motor 1.
#define STATE_CURRENT_MOTOR2   0x080000
 Motor 2.
#define STATE_CURRENT_MOTOR3   0x0C0000
 Motor 3.
#define STATE_WINDING_RES_MISMATCH   0x100000
 The difference between winding resistances is too large.
#define STATE_ENCODER_FAULT   0x200000
 Signal from the encoder that fault happened.
#define STATE_MOTOR_CURRENT_LIMIT   0x400000
 Current limit exceeded.
#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

Encoder state returned by device query.

See Also
status_t::encsts
get_status
status_t::EncSts, get_status_impl
#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

Motor winding state returned by device query.

See Also
status_t::windsts
get_status
status_t::WindSts, get_status_impl
#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

Move command (command_move, command_movr, command_left, command_right, command_stop, command_home, command_loft, command_sstp) and its state (run, finished, error).

See Also
status_t::mvcmdsts
get_status
status_t::MvCmdSts, get_status_impl
#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 engine settings

Specify motor shaft movement algorithm and list of limitations. Flags returned by query of engine settings. May be combined with bitwise OR.

See Also
engine_settings_t::flags
set_engine_settings
get_engine_settings
engine_settings_t::EngineFlags, get_engine_settings, set_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

Specify settings of microstep mode. Using with step motors. Flags returned by query of engine settings. May be combined with bitwise OR

See Also
engine_settings_t::flags
set_engine_settings
get_engine_settings
engine_settings_t::MicrostepMode, get_engine_settings, set_engine_settings
#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

Specify motor type. Flags returned by query of engine settings.

See Also
engine_settings_t::flags
set_entype_settings
get_entype_settings
entype_settings_t::EngineType, get_entype_settings, set_entype_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

Specify driver type. Flags returned by query of engine settings.

See Also
engine_settings_t::flags
set_entype_settings
get_entype_settings
entype_settings_t::DriverType, get_entype_settings, set_entype_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

Specify power settings. Flags returned by query of power settings.

See Also
power_settings_t::flags
get_power_settings
set_power_settings
power_settings_t::PowerFlags, get_power_settings, set_power_settings
#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

Specify secure settings. Flags returned by query of secure settings.

See Also
secure_settings_t::flags
get_secure_settings
set_secure_settings
secure_settings_t::Flags, get_secure_settings, set_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.
Position setting flags

Flags used in setting of position.

See Also
get_position
set_position
set_position_t::PosFlags, set_position
#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.
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

See Also
sync_settings_t::syncin_flags
get_sync_settings
set_sync_settings
sync_in_settings_t::SyncInFlags, get_sync_in_settings, set_sync_in_settings
#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

See Also
sync_settings_t::syncout_flags
get_sync_settings
set_sync_settings
sync_out_settings_t::SyncOutFlags, get_sync_out_settings, set_sync_out_settings
#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
#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.
#define EXTIO_SETUP_MODE_OUT_MOTOR_FOUND   0x50
 EXTIO pin stays active when motor is connected (first winding).
Border flags

Specify types of borders and motor behaviour on borders. May be combined with bitwise OR.

See Also
get_edges_settings
set_edges_settings
edges_settings_t::BorderFlags, get_edges_settings, set_edges_settings
#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

Specify electrical behaviour of limit switches like order and pulled positions. May be combined with bitwise OR.

See Also
get_edges_settings
set_edges_settings
edges_settings_t::EnderFlags, get_edges_settings, set_edges_settings
#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

Specify behaviour of brake. May be combined with bitwise OR.

See Also
get_brake_settings
set_brake_settings
brake_settings_t::BrakeFlags, get_brake_settings, set_brake_settings
#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

Specify motor control settings by joystick or buttons. May be combined with bitwise OR.

See Also
get_control_settings
set_control_settings
control_settings_t::Flags, get_control_settings, set_control_settings
#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

Specify settings of position control. May be combined with bitwise OR.

See Also
get_ctp_settings
set_ctp_settings
ctp_settings_t::CTPFlags, get_ctp_settings, set_ctp_settings
#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

Specify behaviour for home command. May be combined with bitwise OR.

See Also
get_home_setting s
set_home_settings
command_home
home_settings_t::HomeFlags, get_home_settings, set_home_settings
#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.

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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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.
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_add_sync_in_action (device_t id, const command_add_sync_in_action_t *the_command_add_sync_in_action)
 This command adds one element of the FIFO commands that are executed when input clock pulse.
result_t XIMC_API command_add_sync_in_action_calb (device_t id, const command_add_sync_in_action_calb_t *the_command_add_sync_in_action_calb, const calibration_t *calibration)
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)
result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition)
 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.
result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t *calibration)
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)
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)
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 command_change_motor (device_t id, const command_change_motor_t *the_command_change_motor)
 Change motor - command for switching output relay.
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

Functions for searching and opening/closing devices

typedef char * pchar
 Nevermind.
typedef void(XIMC_CALLCONVlogging_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 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 ()
 Reset library locks in a case of deadlock.
result_t XIMC_API ximc_fix_usbser_sys (const char *device_uri)
 Fix for errors in Windows USB driver stack.
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)
 Calibrated 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.

Detailed Description

Header file for libximc library.

Macro Definition Documentation

#define ALARM_ON_DRIVER_OVERHEATING   0x01

If this flag is set enter Alarm state on driver overheat signal.

#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_FOUND   0x50

EXTIO pin stays active when motor is connected (first winding).

#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_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 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   0x000040

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   0x008000

Engine stuck at the wrong edge.

#define STATE_BRAKE   0x0200

State of Brake pin.

#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   0x00003F

Flags of controller states.

#define STATE_CONTROLLER_OVERHEAT   0x000200

Controller overheat.

#define STATE_CTP_ERROR   0x000080

Control position error(is only used with stepper motor).

#define STATE_CURRENT_MOTOR0   0x000000

Motor 0.

#define STATE_CURRENT_MOTOR1   0x040000

Motor 1.

#define STATE_CURRENT_MOTOR2   0x080000

Motor 2.

#define STATE_CURRENT_MOTOR3   0x0C0000

Motor 3.

#define STATE_CURRENT_MOTOR_BITS   0x0C0000

Bits indicating the current operating motor on boards with multiple outputs for engine mounting.

#define STATE_DIG_SIGNAL   0xFFFF

Flags of digital signals.

#define STATE_EEPROM_CONNECTED   0x000010

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_ERRC   0x000001

Command error encountered.

#define STATE_ERRD   0x000002

Data integrity error encountered.

#define STATE_ERRV   0x000004

Value error encountered.

#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   0x002000

USB voltage is insufficient for normal operation.

#define STATE_OVERLOAD_POWER_CURRENT   0x000800

Power current exceeds safe limit.

#define STATE_OVERLOAD_POWER_VOLTAGE   0x000400

Power voltage exceeds safe limit.

#define STATE_OVERLOAD_USB_CURRENT   0x004000

USB current exceeds safe limit.

#define STATE_OVERLOAD_USB_VOLTAGE   0x001000

USB voltage exceeds safe limit.

#define STATE_POWER_OVERHEAT   0x000100

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   0x73FFC0

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 Documentation

typedef void(XIMC_CALLCONV * logging_callback_t)(int loglevel, const wchar_t *message, void *user_data)

Logging callback prototype.

Parameters
loglevela loglevel
messagea message

Function Documentation

result_t XIMC_API close_device ( device_t id)

Close specified device.

Parameters
idan identifier of device
result_t XIMC_API command_add_sync_in_action ( device_t  id,
const command_add_sync_in_action_t the_command_add_sync_in_action 
)

This command adds one element of the FIFO commands that are executed when input clock pulse.

Each pulse synchronization or perform that action, which is described in SSNI, if the buffer is empty, or the oldest loaded into the buffer action to temporarily replace the speed and coordinate in SSNI. In the latter case this action is erased from the buffer. The number of remaining empty buffer elements can be found in the structure of GETS.

Parameters
idan identifier of device
result_t XIMC_API command_change_motor ( device_t  id,
const command_change_motor_t the_command_change_motor 
)

Change motor - command for switching output relay.

Parameters
idan identifier of device
result_t XIMC_API command_clear_fram ( device_t  id)

Clear controller FRAM.

Can be used by manufacturer only

Parameters
idan identifier of device
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.

Parameters
idan identifier of device
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.

Can be used by manufacturer only.

Parameters
idan identifier of device
result_t XIMC_API command_home ( device_t  id)

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

Parameters
idan identifier of device
See Also
home_settings_t
get_home_settings
set_home_settings
result_t XIMC_API command_homezero ( device_t  id)

Make home command, wait until it is finished and make zero command.

This is a convinient way to calibrate zero position.

Parameters
idan identifier of device
[out]retRESULT_OK if controller has finished home & zero correctly or result of first controller query that returned anything other than RESULT_OK.
result_t XIMC_API command_left ( device_t  id)

Start continous moving to the left.

Parameters
idan identifier of device
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.

Parameters
idan identifier of device
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.

For stepper motor uPosition sets the microstep, for DC motor this field is not used.

Parameters
Positionposition to move.
uPositionpart of the position to move, microsteps. Range: -255..255.
idan identifier of device
result_t XIMC_API command_movr ( device_t  id,
int  DeltaPosition,
int  uDeltaPosition 
)

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.

Parameters
DeltaPositionshift from initial position.
uDeltaPositionpart of the offset shift, microsteps. Range: -255..255.
idan identifier of device
result_t XIMC_API command_power_off ( device_t  id)

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.

Parameters
idan identifier of device
See Also
get_power_settings
set_power_settings
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.

Parameters
idan identifier of device
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.

Parameters
idan identifier of device
result_t XIMC_API command_reset ( device_t  id)

Reset controller.

Can be used by manufacturer only

Parameters
idan identifier of device
result_t XIMC_API command_right ( device_t  id)

Start continous moving to the right.

Parameters
idan identifier of device
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.

Parameters
idan identifier of device
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.

Parameters
idan identifier of device
result_t XIMC_API command_sstp ( device_t  id)

Soft stop engine.

The motor stops with deceleration speed.

Parameters
idan identifier of device
result_t XIMC_API command_start_measurements ( device_t  id)

Start measurements and buffering of speed, following error.

Parameters
idan identifier of device
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).

Parameters
idan 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

Parameters
uria uri of device
datafirmware byte stream
data_sizesize of byte stream
result_t XIMC_API command_wait_for_stop ( device_t  id,
uint32_t  refresh_interval_ms 
)

Wait for stop.

Parameters
idan identifier of device
refresh_interval_msStatus 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]retRESULT_OK if controller has stopped and result of the first get_status command which returned anything other than RESULT_OK otherwise.
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.

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.

Parameters
idan identifier of device
device_enumeration_t XIMC_API enumerate_devices ( int  enumerate_flags,
const char *  hints 
)

Enumerate all devices that looks like valid.

Parameters
[in]enumerate_flagsenumerate devices flags
[in]hintsextended information hints is a string of form "key=value\nkey2=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. 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.

Parameters
[in]device_enumerationopaque 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.

Parameters
idan identifier of device
[out]accessories_settingsstructure 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.

Parameters
idan identifier of device
[out]analog_dataanalog 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.

Parameters
idan identifier of device
[out]Majormajor version
[out]Minorminor version
[out]Releaserelease version
result_t XIMC_API get_brake_settings ( device_t  id,
brake_settings_t brake_settings 
)

Read settings of brake control.

Parameters
idan identifier of device
[out]brake_settingsstructure 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.

See Also
calibration_settings_t
Parameters
idan identifier of device
[out]calibration_settingscalibration 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.

See Also
chart_data_t
Parameters
idan identifier of device
[out]chart_datastructure 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.

Parameters
idan identifier of device
[out]control_settingsstructure contains settings motor control by joystick or buttons left/right.
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.

Parameters
idan identifier of device
[out]controller_namestructure 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.

Parameters
idan identifier of device
[out]ctp_settingsstructure 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.

Parameters
idan identifier of device
[out]debug_readDebug data.
int XIMC_API get_device_count ( device_enumeration_t  device_enumeration)

Get device count.

Parameters
[in]device_enumerationopaque 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.

Parameters
idan identifier of device
[out]device_informationdevice information Device information.
See Also
get_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.

Parameters
[in]device_enumerationopaque pointer to an enumeration device data
[in]device_indexdevice index
result_t XIMC_API get_edges_settings ( device_t  id,
edges_settings_t edges_settings 
)

Read border and limit switches settings.

See Also
set_edges_settings
Parameters
idan identifier of device
[out]edges_settingsedges settings, specify types of borders, motor behaviour and electrical behaviour of limit switches
result_t XIMC_API get_encoder_information ( device_t  id,
encoder_information_t encoder_information 
)

Read encoder information from EEPROM.

Parameters
idan identifier of device
[out]encoder_informationstructure contains information about encoder
result_t XIMC_API get_encoder_settings ( device_t  id,
encoder_settings_t encoder_settings 
)

Read encoder settings from EEPROM.

Parameters
idan identifier of device
[out]encoder_settingsstructure contains encoder 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.

See Also
set_engine_settings
Parameters
idan identifier of device
[out]engine_settingsengine settings
result_t XIMC_API get_entype_settings ( device_t  id,
entype_settings_t entype_settings 
)

Return engine type and driver type.

Parameters
idan identifier of device
[out]EngineTypeengine type
[out]DriverTypedriver 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.

Parameters
[in]device_enumerationopaque pointer to an enumeration device data
[in]device_indexdevice index
[out]controller_namecontroller 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.

Parameters
[in]device_enumerationopaque pointer to an enumeration device data
[in]device_indexdevice index
[out]device_informationdevice 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.

Parameters
[in]device_enumerationopaque pointer to an enumeration device data
[in]device_indexdevice index
[out]device_network_informationdevice 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.

Parameters
[in]device_enumerationopaque pointer to an enumeration device data
[in]device_indexdevice index
[out]serialdevice 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.

Parameters
[in]device_enumerationopaque pointer to an enumeration device data
[in]device_indexdevice index
[out]stage_namestage name
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.

See Also
set_extio_settings
Parameters
idan identifier of device
[out]extio_settingsEXTIO settings
result_t XIMC_API get_feedback_settings ( device_t  id,
feedback_settings_t feedback_settings 
)

Feedback settings.

Parameters
idan identifier of device
[out]IPSnumber 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]FeedbackTypetype of feedback
[out]FeedbackFlagsflags of feedback
[out]CountsPerTurnnumber 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.

Parameters
idan identifier of device
[out]Majormajor version
[out]Minorminor version
[out]Releaserelease version
result_t XIMC_API get_gear_information ( device_t  id,
gear_information_t gear_information 
)

Read gear information from EEPROM.

Parameters
idan identifier of device
[out]gear_informationstructure 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.

Parameters
idan identifier of device
[out]gear_settingsstructure 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.

Parameters
idan identifier of device
[out]theresult 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.

Parameters
idan identifier of device
[out]hallsensor_informationstructure 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.

Parameters
idan identifier of device
[out]hallsensor_settingsstructure 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.

See Also
home_settings_t
Parameters
idan identifier of device
[out]home_settingscalibrating position settings
result_t XIMC_API get_init_random ( device_t  id,
init_random_t init_random 
)

Read random number from controller.

Parameters
idan identifier of device
[out]randomsequence 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.

Parameters
idan identifier of device
[out]joystick_settingsstructure 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.

See Also
get_measurements_t
Parameters
idan identifier of device
[out]get_measurementsstructure 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.

Parameters
idan identifier of device
[out]motor_informationstructure contains motor information
result_t XIMC_API get_motor_settings ( device_t  id,
motor_settings_t motor_settings 
)

Read motor settings from EEPROM.

Parameters
idan identifier of device
[out]motor_settingsstructure 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).

Parameters
idan identifier of device
[out]move_settingsstructure contains move settings: speed, acceleration, deceleration etc.
result_t XIMC_API get_nonvolatile_memory ( device_t  id,
nonvolatile_memory_t nonvolatile_memory 
)

Read userdata from FRAM.

Parameters
idan identifier of device
[out]nonvolatile_memorystructure 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.

See Also
set_pid_settings
Parameters
idan identifier of device
[out]pid_settingspid 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.

Parameters
idan identifier of device
[out]positionstructure contains move settings: speed, acceleration, deceleration etc.
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.

Parameters
idan identifier of device
[out]power_settingsstructure 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.

Parameters
idan identifier of device
[out]secure_settingscritical parameter settings to protect the hardware
See Also
status_t::flags
result_t XIMC_API get_serial_number ( device_t  id,
unsigned int *  SerialNumber 
)

Read device serial number.

Parameters
idan identifier of device
[out]serialserial number
result_t XIMC_API get_stage_information ( device_t  id,
stage_information_t stage_information 
)

Read stage information from EEPROM.

Parameters
idan identifier of device
[out]stage_informationstructure contains stage information
result_t XIMC_API get_stage_name ( device_t  id,
stage_name_t stage_name 
)

Read user stage name from EEPROM.

Parameters
idan identifier of device
[out]stage_namestructure 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.

Parameters
idan identifier of device
[out]stage_settingsstructure contains stage settings
result_t XIMC_API get_status ( device_t  id,
status_t status 
)

Return device state.

Parameters
idan identifier of device
[out]statusstructure with snapshot of controller status Device state. Useful structure that contains current controller status, including speed, position and boolean flags.
See Also
get_status
result_t XIMC_API get_status_calb ( device_t  id,
status_calb_t status,
const calibration_t calibration 
)

Calibrated device state.

Useful structure that contains current controller status, including speed, position and boolean flags.

See Also
get_status
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.

See Also
set_sync_in_settings
Parameters
idan identifier of device
[out]sync_in_settingssynchronization 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.

See Also
set_sync_out_settings
Parameters
idan identifier of device
[out]sync_out_settingssynchronization 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.

See Also
uart_settings_t
Parameters
SpeedUART speed
[out]uart_settingsUART settings
result_t XIMC_API goto_firmware ( device_t  id,
uint8_t *  ret 
)

Reboot to firmware.

Parameters
idan identifier of device
[out]retRESULT_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.
result_t XIMC_API has_firmware ( const char *  uri,
uint8_t *  ret 
)

Check for firmware on device.

Parameters
uria uri of device
[out]retnon-zero if firmware existed
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.

Parameters
loglevela loglevel
messagea 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.

Parameters
loglevela loglevel
messagea message
void XIMC_API msec_sleep ( unsigned int  msec)

Sleeps for a specified amount of time.

Parameters
msectime in milliseconds
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.

Parameters
[in]uria 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.
result_t XIMC_API probe_device ( const char *  uri)

Check if a device with OS uri uri is XIMC device.

Be carefuly with this call because it sends some data to the device.

Parameters
[in]uri- a device uri
result_t XIMC_API service_command_updf ( device_t  id)

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.

Parameters
idan identifier of device
[in]accessories_settingsstructure contains information about additional accessories
result_t XIMC_API set_bindy_key ( const char *  keyfilepath)

Set network encryption layer (bindy) key.

Parameters
[in]keyfilepathfull 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.

Parameters
idan identifier of device
[in]brake_settingsstructure 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.

See Also
calibration_settings_t
Parameters
idan identifier of device
[in]calibration_settingscalibration 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.

Parameters
idan identifier of device
[in]control_settingsstructure contains settings motor control by joystick or buttons left/right.
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.

Parameters
idan identifier of device
[in]controller_namestructure contains previously set user controller name
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.

Parameters
idan identifier of device
[in]ctp_settingsstructure 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.

Parameters
idan identifier of device
[in]debug_writeDebug data.
result_t XIMC_API set_edges_settings ( device_t  id,
const edges_settings_t edges_settings 
)

Set border and limit switches settings.

See Also
set_edges_settings
Parameters
idan identifier of device
[in]edges_settingsedges settings, specify types of borders, motor behaviour and electrical behaviour of limit switches
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.

Parameters
idan identifier of device
[in]encoder_informationstructure 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.

Parameters
idan identifier of device
[in]encoder_settingsstructure contains encoder 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.

See Also
get_engine_settings
Parameters
idan identifier of device
[in]engine_settingsengine settings
result_t XIMC_API set_entype_settings ( device_t  id,
const entype_settings_t entype_settings 
)

Set engine type and driver type.

Parameters
idan identifier of device
[in]EngineTypeengine type
[in]DriverTypedriver type
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.

See Also
get_extio_settings
Parameters
idan identifier of device
[in]extio_settingsEXTIO settings
result_t XIMC_API set_feedback_settings ( device_t  id,
const feedback_settings_t feedback_settings 
)

Feedback settings.

Parameters
idan identifier of device
[in]IPSnumber 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]FeedbackTypetype of feedback
[in]FeedbackFlagsflags of feedback
[in]CountsPerTurnnumber 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.

Parameters
idan identifier of device
[in]gear_informationstructure 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.

Parameters
idan identifier of device
[in]gear_settingsstructure 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.

Parameters
idan identifier of device
[in]hallsensor_informationstructure 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.

Parameters
idan identifier of device
[in]hallsensor_settingsstructure 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.

See Also
home_settings_t
Parameters
idan identifier of device
[in]home_settingscalibrating position 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.

Parameters
idan identifier of device
[in]joystick_settingsstructure 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.

Parameters
logging_callbacka 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.

Parameters
idan identifier of device
[in]motor_informationstructure 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.

Parameters
idan identifier of device
[in]motor_settingsstructure 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).

Parameters
idan identifier of device
[in]move_settingsstructure contains move settings: speed, acceleration, deceleration etc.
result_t XIMC_API set_nonvolatile_memory ( device_t  id,
const nonvolatile_memory_t nonvolatile_memory 
)

Write userdata into FRAM.

Parameters
idan identifier of device
[in]nonvolatile_memorystructure 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.

See Also
get_pid_settings
Parameters
idan identifier of device
[in]pid_settingspid 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.

Parameters
idan identifier of device
[out]positionstructure contains move settings: speed, acceleration, deceleration etc.
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.

Parameters
idan identifier of device
[in]power_settingsstructure 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.

Parameters
idan identifier of device
secure_settingsstructure with secure data
See Also
status_t::flags
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.

Parameters
idan identifier of device
[in]serialnumber 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.

Parameters
idan identifier of device
[in]stage_informationstructure 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.

Parameters
idan identifier of device
[in]stage_namestructure 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

Parameters
idan identifier of device
[in]stage_settingsstructure 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.

See Also
get_sync_in_settings
Parameters
idan identifier of device
[in]sync_in_settingssynchronization 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.

See Also
get_sync_out_settings
Parameters
idan identifier of device
[in]sync_out_settingssynchronization 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.

See Also
uart_settings_t
Parameters
SpeedUART speed
[in]uart_settingsUART settings
result_t XIMC_API write_key ( const char *  uri,
uint8_t *  key 
)

Write controller key.

Can be used by manufacturer only

Parameters
uria uri of device
[in]keyprotection key. Range: 0..4294967295
result_t XIMC_API ximc_fix_usbser_sys ( const char *  device_uri)

Fix for errors in Windows USB driver stack.

USB subsystem on Windows does not always work correctly. The following bugs are possible: the device cannot be opened at all, or the device can be opened and written to, but it will not respond with data. These errors can be fixed by device reconnection or removal-rescan in device manager. ximc_fix_usbser_sys() is a shortcut function to do the remove-rescan process. You should call this function if libximc library cannot open the device which was not physically removed from the system or if the device does not respond.

void XIMC_API ximc_version ( char *  version)

Returns a library version.

Parameters
versiona buffer to hold a version string, 32 bytes is enough