libximc  2.14.27
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 structure. More...
struct  device_network_information_t
 Device network information structure. More...
struct  feedback_settings_t
 Feedback settings. More...
struct  home_settings_t
 Position calibration settings. More...
struct  home_settings_calb_t
 Position calibration settings which use user units. More...
struct  move_settings_t
 Move settings. More...
struct  move_settings_calb_t
 User units move settings. More...
struct  engine_settings_t
 Movement limitations and settings related to the motor. More...
struct  engine_settings_calb_t
 Movement limitations and settings, related to the motor. More...
struct  entype_settings_t
 Engine type and driver type settings. More...
struct  power_settings_t
 Step motor power settings. More...
struct  secure_settings_t
 This structure contains raw analog data from ADC embedded on board. More...
struct  edges_settings_t
 Edges settings. More...
struct  edges_settings_calb_t
 User unit edges settings. More...
struct  pid_settings_t
 PID settings. More...
struct  sync_in_settings_t
 Synchronization settings. More...
struct  sync_in_settings_calb_t
 User unit synchronization settings. More...
struct  sync_out_settings_t
 Synchronization settings. More...
struct  sync_out_settings_calb_t
 Synchronization settings which use user units. More...
struct  extio_settings_t
 EXTIO settings. More...
struct  brake_settings_t
 Brake settings. More...
struct  control_settings_t
 Control settings. More...
struct  control_settings_calb_t
 User unit control settings. More...
struct  joystick_settings_t
 Joystick settings. More...
struct  ctp_settings_t
 Control position settings (used with stepper motor only) More...
struct  uart_settings_t
 UART settings. More...
struct  network_settings_t
 Network settings. More...
struct  password_settings_t
 The web-page user password. More...
struct  calibration_settings_t
 Calibration settings. More...
struct  controller_name_t
 Controller name and settings flags. More...
struct  nonvolatile_memory_t
 Structure contains user data to save into the FRAM. More...
struct  emf_settings_t
 EMF settings. More...
struct  engine_advansed_setup_t
 EAS settings. More...
struct  extended_settings_t
 EST settings This data is stored in the controller's flash memory. More...
struct  get_position_t
 Position information. More...
struct  get_position_calb_t
 Position information. More...
struct  set_position_t
 Position information. More...
struct  set_position_calb_t
 User unit position information. More...
struct  status_t
 Device state. More...
struct  status_calb_t
 User unit device's state. More...
struct  measurements_t
 The buffer holds no more than 25 points. More...
struct  chart_data_t
 Additional device state. More...
struct  device_information_t
 Controller information structure. More...
struct  serial_number_t
 The structure contains a new serial number, hardware version, and valid key. 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 username. More...
struct  stage_information_t
 Deprecated. More...
struct  stage_settings_t
 Deprecated. More...
struct  motor_information_t
 Deprecated. More...
struct  motor_settings_t
 Deprecated. More...
struct  encoder_information_t
 Deprecated. More...
struct  encoder_settings_t
 Deprecated. More...
struct  hallsensor_information_t
 Deprecated. More...
struct  hallsensor_settings_t
 Deprecated. More...
struct  gear_information_t
 Deprecated. More...
struct  gear_settings_t
 Deprecated. More...
struct  accessories_settings_t
 Deprecated. More...
struct  init_random_t
 Random key. More...
struct  globally_unique_identifier_t
 Globally unique identifier. More...

Macros

#define XIMC_API
 Library import macro.
#define XIMC_CALLCONV
 Library calling convention macros.
#define XIMC_RETTYPE   void*
 Thread return type.
#define device_undefined   -1
 Handle specified undefined device.
Result statuses
#define result_ok   0
 success
#define result_error   -1
 generic error
#define result_not_implemented   -2
 function is not implemented
#define result_value_error   -3
 value error
#define result_nodevice   -4
 device is lost
Logging level
#define LOGLEVEL_ERROR   0x01
 Logging level - error.
#define LOGLEVEL_WARNING   0x02
 Logging level - warning.
#define LOGLEVEL_INFO   0x03
 Logging level - info.
#define LOGLEVEL_DEBUG   0x04
 Logging level - debug.
Enumerate devices flags

This is a bit mask for bitwise operations.

#define ENUMERATE_PROBE   0x01
 Check if a device with an OS name is a XIMC device.
#define ENUMERATE_ALL_COM   0x02
 Check all COM devices.
#define ENUMERATE_NETWORK   0x04
 Check network devices.
Flags of move state

This is a bit mask for bitwise operations. Specify move states.

See Also
get_status
status_t::MoveSts, get_status_impl
#define MOVE_STATE_MOVING   0x01
 This flag indicates that the controller is trying to move the motor.
#define MOVE_STATE_TARGET_SPEED   0x02
 Target speed is reached, if flag set.
#define MOVE_STATE_ANTIPLAY   0x04
 Motor is playing compensation, if flag set.
Flags of internal controller settings
#define EEPROM_PRECEDENCE   0x01
 If the flag is set, settings from external EEPROM override controller settings.
Flags of power state of stepper motor

This is a bit mask for bitwise operations. Specify power states.

See Also
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 the maximum current driver can provide at this voltage.
Status flags

This is a bit mask for bitwise operations. Controller flags returned by device query. Contains boolean part of controller state. May be combined with bitwise OR.

See Also
get_status
status_t::Flags, get_status_impl
#define STATE_CONTR   0x000003F
 Flags of controller states.
#define STATE_ERRC   0x0000001
 Command error encountered.
#define STATE_ERRD   0x0000002
 Data integrity error encountered.
#define STATE_ERRV   0x0000004
 Value error encountered.
#define STATE_EEPROM_CONNECTED   0x0000010
 EEPROM with settings is connected.
#define STATE_IS_HOMED   0x0000020
 Calibration performed.
#define STATE_SECUR   0x1B3FFC0
 Security flags.
#define STATE_ALARM   0x0000040
 The controller is in an alarm state, indicating that something dangerous has happened.
#define STATE_CTP_ERROR   0x0000080
 Control position error (is only used with stepper motor).
#define STATE_POWER_OVERHEAT   0x0000100
 Power driver overheat.
#define STATE_CONTROLLER_OVERHEAT   0x0000200
 Controller overheat.
#define STATE_OVERLOAD_POWER_VOLTAGE   0x0000400
 Power voltage exceeds safe limit.
#define STATE_OVERLOAD_POWER_CURRENT   0x0000800
 Power current exceeds safe limit.
#define STATE_OVERLOAD_USB_VOLTAGE   0x0001000
 Deprecated.
#define STATE_LOW_USB_VOLTAGE   0x0002000
 Deprecated.
#define STATE_OVERLOAD_USB_CURRENT   0x0004000
 Deprecated.
#define STATE_BORDERS_SWAP_MISSET   0x0008000
 Engine stuck at the wrong edge.
#define STATE_LOW_POWER_VOLTAGE   0x0010000
 Power voltage is lower than Low Voltage Protection limit.
#define STATE_H_BRIDGE_FAULT   0x0020000
 Signal from the driver that fault happened.
#define STATE_WINDING_RES_MISMATCH   0x0100000
 The difference between winding resistances is too large.
#define STATE_ENCODER_FAULT   0x0200000
 Signal from the encoder that fault happened.
#define STATE_ENGINE_RESPONSE_ERROR   0x0800000
 Error response of the engine control action.
#define STATE_EXTIO_ALARM   0x1000000
 The error is caused by the external EXTIO input signal.
Status flags of the GPIO outputs

This is a bit mask for bitwise operations. GPIO state flags returned by device query. Contains boolean part of controller state. May be combined with bitwise OR.

See Also
get_status
status_t::GPIOFlags, get_status_impl
#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 the flag is set; otherwise, it works as in.
#define STATE_GPIO_LEVEL   0x0020
 State of external GPIO pin.
#define STATE_BRAKE   0x0200
 State of Brake pin.
#define STATE_REV_SENSOR   0x0400
 State of Revolution sensor pin.
#define STATE_SYNC_INPUT   0x0800
 State of Sync input pin.
#define STATE_SYNC_OUTPUT   0x1000
 State of Sync output pin.
#define STATE_ENC_A   0x2000
 State of encoder A pin.
#define STATE_ENC_B   0x4000
 State of encoder B pin.
Encoder state

This is a bit mask for bitwise operations. Encoder state returned by device query.

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

This is a bit mask for bitwise operations. Motor winding state returned by device query.

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

This is a bit mask for bitwise operations. Move command (command_move, command_movr, command_left, command_right, command_stop, command_home, command_loft, command_sstp) and its state (run, finished, error).

See Also
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 has finished with an error, 0 - move command has finished correctly).
#define MVCMD_RUNNING   0x80
 Move command state (0 - move command has finished, 1 - move command is being executed).
Flags of the motion parameters

This is a bit mask for bitwise operations. Specify the motor shaft movement algorithm and list of limitations. Flags returned by the query of get_move_settings.

See Also
set_move_settings
get_move_settings
move_settings_t::MoveFlags, get_move_settings, set_move_settings
#define RPM_DIV_1000   0x01
 This flag indicates that the operating speed specified in the command is set in milliRPM.
Flags of engine settings

This is a bit mask for bitwise operations. Specify the motor shaft movement algorithm and list of limitations. Flags returned by query of engine settings. May be combined with bitwise OR.

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

This is a bit mask for bitwise operations. Specify settings for microstep mode. Used 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

This is a bit mask for bitwise operations. 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

This is a bit mask for bitwise operations. 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

This is a bit mask for bitwise operations. Flags returned by query of engine settings. Specify power settings. Flags returned by query of power settings.

See Also
get_power_settings
set_power_settings
power_settings_t::PowerFlags, get_power_settings, set_power_settings
#define POWER_REDUCT_ENABLED   0x01
 Current reduction is enabled after CurrReductDelay if this flag is set.
#define POWER_OFF_ENABLED   0x02
 Power off is enabled after PowerOffDelay if this flag is set.
#define POWER_SMOOTH_CURRENT   0x04
 Current ramp-up/down are performed smoothly during current_set_time if this flag is set.
Flags of secure settings

This is a bit mask for bitwise operations. Flags returned by query of engine settings. Specify secure settings. Flags returned by query of secure settings.

See Also
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 the alarm state on the driver overheat signal.
#define LOW_UPWR_PROTECTION   0x02
 If this flag is set, turn off the motor when the 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, the USB brake reconnect module will be enabled.
#define ALARM_WINDING_MISMATCH   0x40
 If this flag is set, enter Alarm state when windings mismatch.
#define ALARM_ENGINE_RESPONSE   0x80
 If this flag is set, enter the Alarm state on response of the engine control action.
Position setting flags

This is a bit mask for bitwise operations. Flags used in setting 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.
#define FEEDBACK_ENCODER_MEDIATED   0x06
 Feedback by encoder mediated by mechanical transmission (for example leadscrew).
Describes feedback flags.
#define FEEDBACK_ENC_REVERSE   0x01
 Reverse count of encoder.
#define FEEDBACK_ENC_TYPE_BITS   0xC0
 Bits of the encoder type.
#define FEEDBACK_ENC_TYPE_AUTO   0x00
 Auto detect encoder type.
#define FEEDBACK_ENC_TYPE_SINGLE_ENDED   0x40
 Single-ended encoder.
#define FEEDBACK_ENC_TYPE_DIFFERENTIAL   0x80
 Differential encoder.
Flags for synchronization input setup

This is a bit mask for bitwise operations.

See Also
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 going to the position specified in Position and uPosition if this flag is set.
Flags of synchronization output

This is a bit mask for bitwise operations.

See Also
sync_out_settings_t::SyncOutFlags, get_sync_out_settings, set_sync_out_settings
#define SYNCOUT_ENABLED   0x01
 The synchronization out pin follows the synchronization logic if the flag is set.
#define SYNCOUT_STATE   0x02
 When the output state is fixed by the negative SYNCOUT_ENABLED flag, the pin state is in accordance with this flag state.
#define SYNCOUT_INVERT   0x04
 The low level is active if the flag is set.
#define SYNCOUT_IN_STEPS   0x08
 Use motor steps or encoder pulses instead of milliseconds for output pulse generation if the flag is set.
#define SYNCOUT_ONSTART   0x10
 Generate a synchronization pulse when movement starts.
#define SYNCOUT_ONSTOP   0x20
 Generate a synchronization pulse when movement stops.
#define SYNCOUT_ONPERIOD   0x40
 Generate a synchronization pulse every SyncOutPeriod encoder pulses.
External IO setup flags
#define EXTIO_SETUP_OUTPUT   0x01
 EXTIO works as output if the flag is set, works as input otherwise.
#define EXTIO_SETUP_INVERT   0x02
 Interpret EXTIO state inverted if the flag is set.
External IO mode flags

This is a bit mask for bitwise operations.

See Also
extio_settings_t::extio_mode_flags
get_extio_settings
set_extio_settings
extio_settings_t::EXTIOModeFlags, get_extio_settings, set_extio_settings
#define EXTIO_SETUP_MODE_IN_BITS   0x0F
 Bits of the behavior 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 behavior 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 the alarm state.
#define EXTIO_SETUP_MODE_OUT_MOTOR_ON   0x40
 EXTIO pin stays active when windings are powered.
Border flags

This is a bit mask for bitwise operations. Specify types of borders and motor behavior 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 are placed on limit switches, if not set.
#define BORDER_STOP_LEFT   0x02
 The motor should stop on the 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

This is a bit mask for bitwise operations. Specify electrical behavior 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 connected to pin SW1 is triggered by a low level on pin.
#define ENDER_SW2_ACTIVE_LOW   0x04
 1 - Limit switch connected to pin SW2 is triggered by a low level on pin.
Brake settings flags

This is a bit mask for bitwise operations. Specify behavior 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 the stepper motor power off if this flag is set.
Control flags

This is a bit mask for bitwise operations. 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 the 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 the 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

This is a bit mask for bitwise operations. Control joystick states.

See Also
set_joystick_settings
get_joystick_settings
joystick_settings_t::JoyFlags, get_joystick_settings, set_joystick_settings
#define JOY_REVERSE   0x01
 Joystick action is reversed.
Position control flags

This is a bit mask for bitwise operations. Specify control position settings. 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
 The position control is enabled if the flag is set.
#define CTP_BASE   0x02
 The position control is based on the revolution sensor if this flag is set; otherwise, it is based on the encoder.
#define CTP_ALARM_ON_ERROR   0x04
 Set ALARM on mismatch if the flag is set.
#define REV_SENS_INV   0x08
 Typically, the sensor is active when it is at 0, and inversion makes active at 1.
#define CTP_ERROR_CORRECTION   0x10
 Correct errors that appear when slippage occurs if the flag is set.
Home settings flags

This is a bit mask for bitwise operations. Specify home command behavior. May be combined with bitwise OR.

See Also
get_home_settings
set_home_settings
command_home
home_settings_t::HomeFlags, get_home_settings, set_home_settings
#define HOME_DIR_FIRST   0x001
 The flag defines the direction of the 1st motion after execution of the home command.
#define HOME_DIR_SECOND   0x002
 The flag defines the direction of the 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 during the first half-turn of the second movement.
#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

This is a bit mask for bitwise operations.

See Also
uart_settings_t::UARTSetupFlags, get_uart_settings, set_uart_settings
#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

This is a bit mask for bitwise operations.

See Also
motor_settings_t::MotorType, get_motor_settings, set_motor_settings
#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

This is a bit mask for bitwise operations.

See Also
encoder_settings_t::EncoderSettings, get_encoder_settings, set_encoder_settings
#define ENCSET_DIFFERENTIAL_OUTPUT   0x001
 If the flag is set, the encoder has differential output, otherwise single-ended output.
#define ENCSET_PUSHPULL_OUTPUT   0x004
 If the flag is set the encoder has push-pull output, otherwise open drain output.
#define ENCSET_INDEXCHANNEL_PRESENT   0x010
 If the flag is set, the encoder has an extra indexed channel.
#define ENCSET_REVOLUTIONSENSOR_PRESENT   0x040
 If the flag is set, the encoder has the revolution sensor.
#define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH   0x100
 If the flag is set, the revolution sensor's active state is high logic state; otherwise, the active state is low logic state.
Magnetic brake settings flags

This is a bit mask for bitwise operations.

See Also
accessories_settings_t::MBSettings, get_accessories_settings, set_accessories_settings
#define MB_AVAILABLE   0x01
 If the 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
 Unknown type of sensor.
#define TS_TYPE_THERMOCOUPLE   0x01
 Thermocouple.
#define TS_TYPE_SEMICONDUCTOR   0x02
 The semiconductor temperature sensor.
#define TS_AVAILABLE   0x08
 If the flag is set, the temperature sensor is available.
#define LS_ON_SW1_AVAILABLE   0x01
 If the flag is set, the limit switch connected to pin SW1 is available.
#define LS_ON_SW2_AVAILABLE   0x02
 If the flag is set, the limit switch connected to pin SW2 is available.
#define LS_SW1_ACTIVE_LOW   0x04
 If the flag is set, the limit switch connected to pin SW1 is triggered by a low level on the pin.
#define LS_SW2_ACTIVE_LOW   0x08
 If the flag is set, the limit switch connected to pin SW2 is triggered by a low level on pin.
#define LS_SHORTED   0x10
 If the flag is set, the limit switches are shorted.
Flags of auto-detection of characteristics of windings of the engine.
#define BACK_EMF_INDUCTANCE_AUTO   0x01
 Flag of auto-detection of inductance of windings of the engine.
#define BACK_EMF_RESISTANCE_AUTO   0x02
 Flag of auto-detection of resistance of windings of the engine.
#define BACK_EMF_KM_AUTO   0x04
 Flag of auto-detection of electromechanical coefficient of the engine.

Typedefs

typedef unsigned long long ulong_t
typedef long long long_t
typedef int device_t
 Type describes device identifier.
typedef int result_t
 Type specifies result of any operation.
typedef uint32_t device_enumeration_t
 Type describes device enumeration structure.
typedef struct calibration_t calibration_t
 Calibration structure.
typedef struct
device_network_information_t 
device_network_information_t
 Device network information structure.

Functions

Controller settings setup

Read and write functions for almost all controller settings.

result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t *feedback_settings)
 Feedback settings.
result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t *feedback_settings)
 Feedback settings.
result_t XIMC_API set_home_settings (device_t id, const home_settings_t *home_settings)
 Set home settings.
result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t *home_settings_calb, const calibration_t *calibration)
 Set user unit home settings.
result_t XIMC_API get_home_settings (device_t id, home_settings_t *home_settings)
 Read home settings.
result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t *home_settings_calb, const calibration_t *calibration)
 Read user unit home settings.
result_t XIMC_API set_move_settings (device_t id, const move_settings_t *move_settings)
 Movement settings set command (speed, acceleration, threshold, etc.).
result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t *move_settings_calb, const calibration_t *calibration)
 User unit movement settings set command (speed, acceleration, threshold, etc.).
result_t XIMC_API get_move_settings (device_t id, move_settings_t *move_settings)
 Movement settings read command (speed, acceleration, threshold, etc.).
result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t *move_settings_calb, const calibration_t *calibration)
 User unit movement settings read command (speed, acceleration, threshold, etc.).
result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t *engine_settings)
 Set engine settings.
result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t *engine_settings_calb, const calibration_t *calibration)
 Set user unit engine settings.
result_t XIMC_API get_engine_settings (device_t id, engine_settings_t *engine_settings)
 Read engine settings.
result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t *engine_settings_calb, const calibration_t *calibration)
 Read user unit engine settings.
result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t *entype_settings)
 Set engine type and driver type.
result_t XIMC_API get_entype_settings (device_t id, entype_settings_t *entype_settings)
 Return engine type and driver type.
result_t XIMC_API set_power_settings (device_t id, const power_settings_t *power_settings)
 Set settings of step motor power control.
result_t XIMC_API get_power_settings (device_t id, power_settings_t *power_settings)
 Read settings of step motor power control.
result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t *secure_settings)
 Set protection settings.
result_t XIMC_API get_secure_settings (device_t id, secure_settings_t *secure_settings)
 Read protection settings.
result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t *edges_settings)
 Set border and limit switches settings.
result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t *edges_settings_calb, const calibration_t *calibration)
 Set border and limit switches settings in user units.
result_t XIMC_API get_edges_settings (device_t id, edges_settings_t *edges_settings)
 Read border and limit switches settings.
result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t *edges_settings_calb, const calibration_t *calibration)
 Read border and limit switches settings in user units.
result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t *pid_settings)
 Set PID settings.
result_t XIMC_API get_pid_settings (device_t id, pid_settings_t *pid_settings)
 Read PID settings.
result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t *sync_in_settings)
 Set input synchronization settings.
result_t XIMC_API set_sync_in_settings_calb (device_t id, const sync_in_settings_calb_t *sync_in_settings_calb, const calibration_t *calibration)
 Set input user unit synchronization settings.
result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t *sync_in_settings)
 Read input synchronization settings.
result_t XIMC_API get_sync_in_settings_calb (device_t id, sync_in_settings_calb_t *sync_in_settings_calb, const calibration_t *calibration)
 Read input user unit synchronization settings.
result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t *sync_out_settings)
 Set output synchronization settings.
result_t XIMC_API set_sync_out_settings_calb (device_t id, const sync_out_settings_calb_t *sync_out_settings_calb, const calibration_t *calibration)
 Set output user unit synchronization settings.
result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t *sync_out_settings)
 Read output synchronization settings.
result_t XIMC_API get_sync_out_settings_calb (device_t id, sync_out_settings_calb_t *sync_out_settings_calb, const calibration_t *calibration)
 Read output user unit synchronization settings.
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 brake control settings.
result_t XIMC_API get_brake_settings (device_t id, brake_settings_t *brake_settings)
 Read break control settings.
result_t XIMC_API set_control_settings (device_t id, const control_settings_t *control_settings)
 Read motor control settings.
result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t *control_settings_calb, const calibration_t *calibration)
 Set motor control settings.
result_t XIMC_API get_control_settings (device_t id, control_settings_t *control_settings)
 Read motor control settings.
result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t *control_settings_calb, const calibration_t *calibration)
 Set calibrated motor control settings.
result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t *joystick_settings)
 Set joystick position.
result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t *joystick_settings)
 Read joystick settings.
result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t *ctp_settings)
 Set control position settings (used with stepper motor only).
result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t *ctp_settings)
 Read control position settings (used with stepper motor only).
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_network_settings (device_t id, const network_settings_t *network_settings)
 Set network settings.
result_t XIMC_API get_network_settings (device_t id, network_settings_t *network_settings)
 Read network settings.
result_t XIMC_API set_password_settings (device_t id, const password_settings_t *password_settings)
 Sets the password.
result_t XIMC_API get_password_settings (device_t id, password_settings_t *password_settings)
 Read the password.
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's controller name and internal settings to the FRAM.
result_t XIMC_API get_controller_name (device_t id, controller_name_t *controller_name)
 Read user's controller name and internal settings from the FRAM.
result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t *nonvolatile_memory)
 Write user data into the FRAM.
result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t *nonvolatile_memory)
 Read user data from FRAM.
result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t *emf_settings)
 Set electromechanical coefficients.
result_t XIMC_API get_emf_settings (device_t id, emf_settings_t *emf_settings)
 Read electromechanical settings.
result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t *engine_advansed_setup)
 Set engine advanced settings.
result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t *engine_advansed_setup)
 Read engine advanced settings.
result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t *extended_settings)
 Set extended settings.
result_t XIMC_API get_extended_settings (device_t id, extended_settings_t *extended_settings)
 Read extended settings.
Group of commands movement control
result_t XIMC_API command_stop (device_t id)
 Immediately stops the engine, moves it to the STOP state, and sets switches to BREAK mode (windings are short-circuited).
result_t XIMC_API command_power_off (device_t id)
 Immediately power off the motor regardless its state.
result_t XIMC_API command_move (device_t id, int Position, int uPosition)
 Move to position.
result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t *calibration)
 Move to position using user units.
result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition)
 Shift by a set offset.
result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t *calibration)
 Shift by a set offset using user units.
result_t XIMC_API command_home (device_t id)
 Moving to home position.
result_t XIMC_API command_left (device_t id)
 Start continuous moving to the left.
result_t XIMC_API command_right (device_t id)
 Start continuous 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 position to a distance Antiplay defined in engine settings.
result_t XIMC_API command_sstp (device_t id)
 Soft stop the engine.
result_t XIMC_API get_position (device_t id, get_position_t *the_get_position)
 Reads the value position in steps and microsteps for stepper motor and encoder steps for all engines.
result_t XIMC_API get_position_calb (device_t id, get_position_calb_t *the_get_position_calb, const calibration_t *calibration)
 Reads position value in user units for stepper motor and encoder steps for all engines.
result_t XIMC_API set_position (device_t id, const set_position_t *the_set_position)
 Sets position in steps and microsteps for stepper motor.
result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t *the_set_position_calb, const calibration_t *calibration)
 Sets any position value and encoder value of all engines.
result_t XIMC_API command_zero (device_t id)
 Sets the current position to 0.
Group of save settings and load settings commands
result_t XIMC_API command_save_settings (device_t id)
 Save all settings from the controller's RAM to the controller's flash memory, replacing previous data in the flash memory.
result_t XIMC_API command_read_settings (device_t id)
 Read all settings from the controller's flash memory to the controller's RAM, replacing previous data in the RAM.
result_t XIMC_API command_save_robust_settings (device_t id)
 Save important settings (calibration coefficients, etc.) from the controller's RAM to the controller's flash memory, replacing previous data in the flash memory.
result_t XIMC_API command_read_robust_settings (device_t id)
 Read important settings (calibration coefficients, etc.) from the controller's flash memory to the controller's RAM, replacing previous data in the RAM.
result_t XIMC_API command_eesave_settings (device_t id)
 Save settings from the controller's RAM to the stage's EEPROM.
result_t XIMC_API command_eeread_settings (device_t id)
 Read settings from the stage's EEPROM to the controller's RAM.
result_t XIMC_API command_start_measurements (device_t id)
 Start measurements and buffering of speed and the speed error (target speed minus real speed).
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 speed error graph.
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 the controller's firmware version.
result_t XIMC_API service_command_updf (device_t id)
 The command switches the controller to update the firmware state.
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 the controller's flash memory.
result_t XIMC_API get_analog_data (device_t id, analog_data_t *analog_data)
 Read the analog data structure that contains raw analog data from the embedded ADC.
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.
A group of EEPROM commands
result_t XIMC_API set_stage_name (device_t id, const stage_name_t *stage_name)
 Write the user's stage name to EEPROM.
result_t XIMC_API get_stage_name (device_t id, stage_name_t *stage_name)
 Read the user's stage name from the EEPROM.
result_t XIMC_API set_stage_information (device_t id, const stage_information_t *stage_information)
 Deprecated.
result_t XIMC_API get_stage_information (device_t id, stage_information_t *stage_information)
 Deprecated.
result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t *stage_settings)
 Deprecated.
result_t XIMC_API get_stage_settings (device_t id, stage_settings_t *stage_settings)
 Deprecated.
result_t XIMC_API set_motor_information (device_t id, const motor_information_t *motor_information)
 Deprecated.
result_t XIMC_API get_motor_information (device_t id, motor_information_t *motor_information)
 Deprecated.
result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t *motor_settings)
 Deprecated.
result_t XIMC_API get_motor_settings (device_t id, motor_settings_t *motor_settings)
 Deprecated.
result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t *encoder_information)
 Deprecated.
result_t XIMC_API get_encoder_information (device_t id, encoder_information_t *encoder_information)
 Deprecated.
result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t *encoder_settings)
 Deprecated.
result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t *encoder_settings)
 Deprecated.
result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t *hallsensor_information)
 Deprecated.
result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t *hallsensor_information)
 Deprecated.
result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t *hallsensor_settings)
 Deprecated.
result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t *hallsensor_settings)
 Deprecated.
result_t XIMC_API set_gear_information (device_t id, const gear_information_t *gear_information)
 Deprecated.
result_t XIMC_API get_gear_information (device_t id, gear_information_t *gear_information)
 Deprecated.
result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t *gear_settings)
 Deprecated.
result_t XIMC_API get_gear_settings (device_t id, gear_settings_t *gear_settings)
 Deprecated.
result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t *accessories_settings)
 Deprecated.
result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t *accessories_settings)
 Deprecated.
result_t XIMC_API get_bootloader_version (device_t id, unsigned int *Major, unsigned int *Minor, unsigned int *Release)
 Read the controller's bootloader version.
result_t XIMC_API get_init_random (device_t id, init_random_t *init_random)
 Read a random number from the 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 device, but is not a random value.
result_t XIMC_API goto_firmware (device_t id, uint8_t *ret)
 Reboot to firmware.
result_t XIMC_API has_firmware (const char *uri, uint8_t *ret)
 Check for firmware on device.
result_t XIMC_API command_update_firmware (const char *uri, const uint8_t *data, uint32_t data_size)
 Update firmware.
result_t XIMC_API write_key (const char *uri, uint8_t *key)
 Write controller key.
result_t XIMC_API command_reset (device_t id)
 Reset controller.
result_t XIMC_API command_clear_fram (device_t id)
 Clear controller FRAM.

Boards and drivers control

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 and return identifier of the device which can be used in calls.
result_t XIMC_API close_device (device_t *id)
 Close specified device.
result_t XIMC_API load_correction_table (device_t *id, const char *namefile)
 Command of loading a correction table from a text file (this function is deprecated).
result_t XIMC_API set_correction_table (device_t id, const char *namefile)
 Command of loading a correction table from a text file.
result_t XIMC_API probe_device (const char *uri)
 Check if a device with OS uri uri is XIMC device.
result_t XIMC_API set_bindy_key (const char *keyfilepath)
 Deprecated.
device_enumeration_t XIMC_API enumerate_devices (int enumerate_flags, const char *hints)
 Enumerate all XIMC-compatible devices.
result_t XIMC_API free_enumerate_devices (device_enumeration_t device_enumeration)
 Free memory returned by enumerate_devices.
int XIMC_API get_device_count (device_enumeration_t device_enumeration)
 Get device count.
pchar XIMC_API get_device_name (device_enumeration_t device_enumeration, int device_index)
 Get device name from the device enumeration.
result_t XIMC_API get_enumerate_device_serial (device_enumeration_t device_enumeration, int device_index, uint32_t *serial)
 Get device serial number from the device enumeration.
result_t XIMC_API get_enumerate_device_information (device_enumeration_t device_enumeration, int device_index, device_information_t *device_information)
 Get device information from the device enumeration.
result_t XIMC_API get_enumerate_device_controller_name (device_enumeration_t device_enumeration, int device_index, controller_name_t *controller_name)
 Get controller name from the device enumeration.
result_t XIMC_API get_enumerate_device_stage_name (device_enumeration_t device_enumeration, int device_index, stage_name_t *stage_name)
 Get stage name from the device enumeration.
result_t XIMC_API get_enumerate_device_network_information (device_enumeration_t device_enumeration, int device_index, device_network_information_t *device_network_information)
 Get device network information from the device enumeration.
result_t XIMC_API reset_locks ()
 Resets the error of incorrect data transmission.
result_t XIMC_API ximc_fix_usbser_sys (const char *device_uri)
 (Deprecated) Fixing a USB driver error in Windows.
void XIMC_API msec_sleep (unsigned int msec)
 Sleeps for a specified amount of time.
void XIMC_API ximc_version (char *version)
 Returns a library version.
void XIMC_API logging_callback_stderr_wide (int loglevel, const wchar_t *message, void *user_data)
 Simple callback for logging to stderr in wide chars.
void XIMC_API logging_callback_stderr_narrow (int loglevel, const wchar_t *message, void *user_data)
 Simple callback for logging to stderr in narrow (single byte) chars.
void XIMC_API set_logging_callback (logging_callback_t logging_callback, void *user_data)
 Sets a logging callback.
result_t XIMC_API get_status (device_t id, status_t *status)
 Return device state.
result_t XIMC_API get_status_calb (device_t id, status_calb_t *status, const calibration_t *calibration)
 Return device state.
result_t XIMC_API get_device_information (device_t id, device_information_t *device_information)
 Return device information.
result_t XIMC_API command_wait_for_stop (device_t id, uint32_t refresh_interval_ms)
 Wait for stop.
result_t XIMC_API command_homezero (device_t id)
 Make home command, wait until it is finished and make zero command.

Detailed Description

Header file for libximc library.

Macro Definition Documentation

#define ALARM_ON_DRIVER_OVERHEATING   0x01

If this flag is set, enter the alarm state on the driver overheat signal.

#define BACK_EMF_INDUCTANCE_AUTO   0x01

Flag of auto-detection of inductance of windings of the engine.

#define BACK_EMF_KM_AUTO   0x04

Flag of auto-detection of electromechanical coefficient of the engine.

#define BACK_EMF_RESISTANCE_AUTO   0x02

Flag of auto-detection of resistance of windings of the engine.

#define BORDER_IS_ENCODER   0x01

Borders are fixed by predetermined encoder values, if set; borders are placed on limit switches, if not set.

#define BORDER_STOP_LEFT   0x02

The motor should stop on the 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 the motor when 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 the stepper motor power off if this flag is set.

#define CONTROL_BTN_LEFT_PUSHED_OPEN   0x04

Pushed left button corresponds to the 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 the 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 the flag is set.

#define CTP_BASE   0x02

The position control is based on the revolution sensor if this flag is set; otherwise, it is based on the encoder.

#define CTP_ENABLED   0x01

The position control is enabled if the flag is set.

#define CTP_ERROR_CORRECTION   0x10

Correct errors that appear when slippage occurs if the flag is set.

It works only with the encoder. Incompatible with the 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 connected to pin SW1 is triggered by a low level on pin.

#define ENDER_SW2_ACTIVE_LOW   0x04

1 - Limit switch connected 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 is set, the engine makes backlash (play) compensation and reaches the predetermined position accurately at low speed.

#define ENGINE_CURRENT_AS_RMS   0x02

Engine current meaning flag.

If the flag is unset, then the engine's current value is interpreted as the maximum amplitude value. If the flag is set, then the engine current value is interpreted as the 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, the engine uses the maximum speed achievable with the present engine settings as its 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 an OS name is a XIMC device.

Be careful with this flag because it sends some data to the device.

#define EXTIO_SETUP_INVERT   0x02

Interpret EXTIO state inverted if the flag is set.

A falling front is treated as an input event and a low logic level as an 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 behavior 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 the alarm state.

#define EXTIO_SETUP_MODE_OUT_BITS   0xF0

Bits of the output behavior selection.

#define EXTIO_SETUP_MODE_OUT_MOTOR_ON   0x40

EXTIO pin stays active when windings are powered.

#define EXTIO_SETUP_MODE_OUT_MOVING   0x20

EXTIO pin stays active during moving state.

#define EXTIO_SETUP_MODE_OUT_OFF   0x00

EXTIO pin always set in inactive state.

#define EXTIO_SETUP_MODE_OUT_ON   0x10

EXTIO pin always set in active state.

#define EXTIO_SETUP_OUTPUT   0x01

EXTIO works as output if the flag is set, works as input otherwise.

#define FEEDBACK_EMF   0x04

Feedback by EMF.

#define FEEDBACK_ENC_REVERSE   0x01

Reverse count of encoder.

#define FEEDBACK_ENC_TYPE_AUTO   0x00

Auto detect encoder type.

#define FEEDBACK_ENC_TYPE_BITS   0xC0

Bits of the encoder type.

#define FEEDBACK_ENC_TYPE_DIFFERENTIAL   0x80

Differential encoder.

#define FEEDBACK_ENC_TYPE_SINGLE_ENDED   0x40

Single-ended encoder.

#define FEEDBACK_ENCODER   0x01

Feedback by encoder.

#define FEEDBACK_ENCODER_MEDIATED   0x06

Feedback by encoder mediated by mechanical transmission (for example leadscrew).

#define FEEDBACK_NONE   0x05

Feedback is absent.

#define H_BRIDGE_ALERT   0x04

If this flag is set then turn off the power unit with a signal problem in one of the transistor bridge.

#define HOME_DIR_FIRST   0x001

The flag defines the direction of the 1st motion after execution of the home command.

The direction is to the right if the flag is set, and to the left otherwise.

#define HOME_DIR_SECOND   0x002

The flag defines the direction of the 2nd motion.

The direction is to the right if the flag is set, and to the left otherwise.

#define HOME_HALF_MV   0x008

If the flag is set, the stop signals are ignored during the first half-turn of the second movement.

#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.

The joystick deviation to the upper values corresponds to negative speed and vice versa.

#define LOW_UPWR_PROTECTION   0x02

If this flag is set, turn off the motor when the 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 the controller is trying to move the motor.

Don't use this flag to wait for the completion of the movement command. Use the 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 has finished with an error, 0 - move command has finished correctly).

This flag makes sense when MVCMD_RUNNING signals movement completion.

#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 has 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 is enabled after PowerOffDelay if this flag is set.

#define POWER_REDUCT_ENABLED   0x01

Current reduction is enabled after CurrReductDelay if this flag is set.

#define POWER_SMOOTH_CURRENT   0x04

Current ramp-up/down are performed smoothly during current_set_time if this flag is set.

#define PWR_STATE_MAX   0x05

Motor windings are powered by the 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

Typically, the sensor is active when it is at 0, and inversion makes active at 1.

That is, if you do not invert, it is normal logic - 0 is the activation.

#define RPM_DIV_1000   0x01

This flag indicates that the operating speed specified in the command is set in milliRPM.

Applicable only for ENCODER feedback mode and only for BLDC motors.

#define SETPOS_IGNORE_ENCODER   0x02

Will not reload encoder state if this flag is set.

#define SETPOS_IGNORE_POSITION   0x01

Will not reload position in steps/microsteps if this flag is set.

#define STATE_ALARM   0x0000040

The controller is in an alarm state, indicating that something dangerous has happened.

Most commands are ignored in this state. To reset the flag, a STOP command must be issued.

#define STATE_BORDERS_SWAP_MISSET   0x0008000

Engine stuck at the wrong edge.

#define STATE_BRAKE   0x0200

State of Brake pin.

Flag "1" - if the pin state brake is not powered (brake is clamped), "0" - if the pin state brake is powered (brake is unclamped).

#define STATE_BUTTON_LEFT   0x0008

Button "left" state (1 if pressed).

#define STATE_BUTTON_RIGHT   0x0004

Button "right" state (1 if pressed).

#define STATE_CONTR   0x000003F

Flags of controller states.

#define STATE_CONTROLLER_OVERHEAT   0x0000200

Controller overheat.

#define STATE_CTP_ERROR   0x0000080

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

The flag is set when the encoder position and step position are too far apart.

#define STATE_DIG_SIGNAL   0xFFFF

Flags of digital signals.

#define STATE_EEPROM_CONNECTED   0x0000010

EEPROM with settings is connected.

The built-in stage profile is uploaded from the EEPROM memory chip if the EEPROM_PRECEDENCE flag is set, allowing you to connect various stages to the controller with automatic setup.

#define STATE_ENC_A   0x2000

State of encoder A pin.

#define STATE_ENC_B   0x4000

State of encoder B pin.

#define STATE_ENGINE_RESPONSE_ERROR   0x0800000

Error response of the engine control action.

Motor control algorithm failure means that it can't make the correct decisions with the feedback data it receives. A single failure may be caused by a mechanical problem. A repeating failure can be caused by incorrect motor settings.

#define STATE_ERRC   0x0000001

Command error encountered.

The command received is not in the list of controller known commands. The most possible reason is the outdated firmware.

#define STATE_ERRD   0x0000002

Data integrity error encountered.

The data inside the command and its CRC code do not correspond. Therefore, the data can't be considered valid. This error may be caused by EMI in the UART/RS232 interface.

#define STATE_ERRV   0x0000004

Value error encountered.

The values in the command can't be applied without correction because they fall outside the valid range. Corrected values were used instead of the original ones.

#define STATE_EXTIO_ALARM   0x1000000

The error is caused by the external EXTIO input signal.

#define STATE_GPIO_LEVEL   0x0020

State of external GPIO pin.

#define STATE_GPIO_PINOUT   0x0010

External GPIO works as out if the flag is set; otherwise, it works as in.

#define STATE_IS_HOMED   0x0000020

Calibration performed.

This means that the relative position scale is calibrated against a hardware absolute position sensor, like a limit switch. Drops after loss of calibration, like harsh stops and possibly skipped steps.

#define STATE_LEFT_EDGE   0x0002

Engine stuck at the left edge.

#define STATE_LOW_USB_VOLTAGE   0x0002000

Deprecated.

USB voltage is insufficient for normal operation. This field is left for compatibility. Software should not rely on the value of this field.

#define STATE_OVERLOAD_POWER_CURRENT   0x0000800

Power current exceeds safe limit.

#define STATE_OVERLOAD_POWER_VOLTAGE   0x0000400

Power voltage exceeds safe limit.

#define STATE_OVERLOAD_USB_CURRENT   0x0004000

Deprecated.

USB current exceeds safe limit. This field is left for compatibility. Software should not rely on the value of this field.

#define STATE_OVERLOAD_USB_VOLTAGE   0x0001000

Deprecated.

USB voltage exceeds safe limit. This field is left for compatibility. Software should not rely on the value of this field.

#define STATE_POWER_OVERHEAT   0x0000100

Power driver overheat.

Motor control is disabled until some cooldown occurs. This should not happen with boxed versions of the controller. This may happen with the bare-board version of the controller with a custom radiator. Redesign your radiator.

#define STATE_REV_SENSOR   0x0400

State of Revolution sensor pin.

#define STATE_RIGHT_EDGE   0x0001

Engine stuck at the right edge.

#define STATE_SECUR   0x1B3FFC0

Security flags.

#define STATE_SYNC_INPUT   0x0800

State of Sync input pin.

#define STATE_SYNC_OUTPUT   0x1000

State of Sync output pin.

#define STATE_WINDING_RES_MISMATCH   0x0100000

The difference between winding resistances is too large.

This usually happens with a damaged stepper motor with partially short-circuited windings.

#define SYNCIN_ENABLED   0x01

Synchronization in mode is enabled if this flag is set.

#define SYNCIN_GOTOPOSITION   0x04

The engine is going to the position specified in Position and uPosition if this flag is set.

And it is shifting 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

The synchronization out pin follows the synchronization logic if the flag is set.

Otherwise, it is governed by the SYNCOUT_STATE flag.

#define SYNCOUT_IN_STEPS   0x08

Use motor steps or encoder pulses instead of milliseconds for output pulse generation if the flag is set.

#define SYNCOUT_INVERT   0x04

The low level is active if the flag is set.

Otherwise, the high level is active.

#define SYNCOUT_ONPERIOD   0x40

Generate a synchronization pulse every SyncOutPeriod encoder pulses.

#define SYNCOUT_ONSTART   0x10

Generate a synchronization pulse when movement starts.

#define SYNCOUT_ONSTOP   0x20

Generate a synchronization pulse when movement stops.

#define SYNCOUT_STATE   0x02

When the output state is fixed by the 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
Note
The id parameter in this function is a C pointer, unlike most library functions that use this parameter
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 the stage's EEPROM to the controller's RAM.

This operation is performed automatically at the connection of the stage with an EEPROM to the controller. Can be used by the manufacturer only.

Parameters
idAn identifier of a device
result_t XIMC_API command_eesave_settings ( device_t  id)

Save settings from the controller's RAM to the stage's EEPROM.

Can be used by the manufacturer only.

Parameters
idAn identifier of a device
result_t XIMC_API command_home ( device_t  id)

Moving to home position.

Moving algorithm:

1) Moves the motor according to the speed FastHome, uFastHome and flag HOME_DIR_FAST until the limit switch if the HOME_STOP_ENDS flag is set. Or moves the motor until the input synchronization signal occurs if the flag HOME_STOP_SYNC is set. Or moves until the revolution sensor signal occurs if the flag HOME_STOP_REV_SN is set.

2) Then moves according to the speed SlowHome, uSlowHome and flag HOME_DIR_SLOW until the input clock signal occurs if the flag HOME_MV_SEC is set. If the flag HOME_MV_SEC is reset, skip this step.

3) Then shifts the motor according to the speed FastHome, uFastHome and the flag HOME_DIR_SLOW by HomeDelta distance, uHomeDelta.

See GHOM/SHOM commands' description for details on home flags.

Moving settings can be set by set_home_settings/set_home_settings_calb.

Parameters
idAn identifier of a 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 continuous moving to the left.

Parameters
idAn identifier of a device
result_t XIMC_API command_loft ( device_t  id)

Upon receiving the command "loft", the engine is shifted from the current position to a distance Antiplay defined in engine settings.

Then moves to the initial position.

Parameters
idAn identifier of a device
result_t XIMC_API command_move ( device_t  id,
int  Position,
int  uPosition 
)

Move to position.

Upon receiving the command "move" the engine starts to move with pre-set parameters (speed, acceleration, retention), to the point specified by Position and uPosition. uPosition sets the microstep position of a stepper motor. In the case of DC motor, this field is ignored.

Parameters
idAn identifier of a device
Positionposition to move.
uPositionthe fractional part of the position to move, in microsteps. The microstep size and the range of valid values for this field depend on the selected step division mode (see the MicrostepMode field in engine_settings).
result_t XIMC_API command_move_calb ( device_t  id,
float  Position,
const calibration_t calibration 
)

Move to position using user units.

Upon receiving the command "move" the engine starts to move with preset parameters (speed, acceleration, retention), to the point specified by Position.

Parameters
idAn identifier of a device
Positionposition to move.
calibrationuser unit settings
Note
The parameter Position is adjusted by the correction table.
result_t XIMC_API command_movr ( device_t  id,
int  DeltaPosition,
int  uDeltaPosition 
)

Shift by a set offset.

Upon receiving the command "movr", the engine starts to move with preset parameters (speed, acceleration, hold) left or right (depending on the sign of DeltaPosition). It moves by the number of steps specified in the fields DeltaPosition and uDeltaPosition. uDeltaPosition sets the microstep offset for a stepper motor. In the case of a DC motor, this field is ignored.

Parameters
DeltaPositionshift from initial position.
uDeltaPositionthe fractional part of the offset shift, in microsteps. The microstep size and the range of valid values for this field depend on the selected step division mode (see the MicrostepMode field in engine_settings).
idAn identifier of a device
result_t XIMC_API command_movr_calb ( device_t  id,
float  DeltaPosition,
const calibration_t calibration 
)

Shift by a set offset using user units.

Upon receiving the command "movr", the engine starts to move with preset parameters (speed, acceleration, hold) left or right (depending on the sign of DeltaPosition). It moves by the distance specified in the field DeltaPosition.

Parameters
DeltaPositionshift from initial position.
idAn identifier of a device
userunit calibration settings
Note
The final coordinate is calculated using DeltaPosition and adjusted by the correction table. However, the correction cannot be done if the motor moves. movr sets the target position equal to the current target position, shifted by delta. But the library can't determine the current target position while moving. So there is no possibility of calculating the final position and correcting it with the correction table.
result_t XIMC_API command_power_off ( device_t  id)

Immediately power off the motor regardless its state.

Shouldn't be used during motion as the motor could be powered on again automatically to continue movement. The command is designed to manually power off the motor. When automatic power off after stop is required, use the power management system.

Parameters
idAn identifier of a 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, etc.) from the controller's flash memory to the controller's RAM, replacing previous data in the RAM.

Manufacturer only.

Parameters
idAn identifier of a device
result_t XIMC_API command_read_settings ( device_t  id)

Read all settings from the controller's flash memory to the controller's RAM, replacing previous data in the RAM.

Parameters
idAn identifier of a 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 continuous moving to the right.

Parameters
idAn identifier of a device
result_t XIMC_API command_save_robust_settings ( device_t  id)

Save important settings (calibration coefficients, etc.) from the controller's RAM to the controller's flash memory, replacing previous data in the flash memory.

Manufacturer only.

Parameters
idAn identifier of a device
result_t XIMC_API command_save_settings ( device_t  id)

Save all settings from the controller's RAM to the controller's flash memory, replacing previous data in the flash memory.

Parameters
idAn identifier of a device
result_t XIMC_API command_sstp ( device_t  id)

Soft stop the engine.

The motor is slowing down with the deceleration specified in move_settings.

Parameters
idAn identifier of a device
result_t XIMC_API command_start_measurements ( device_t  id)

Start measurements and buffering of speed and the speed error (target speed minus real speed).

Parameters
idAn identifier of a device
result_t XIMC_API command_stop ( device_t  id)

Immediately stops the engine, moves it to the STOP state, and sets switches to BREAK mode (windings are short-circuited).

The holding regime is deactivated for DC motors, keeping current in the windings for stepper motors (to control it, see Power management settings).

When this command is called, the ALARM flag is reset.

Parameters
idAn identifier of a device
result_t XIMC_API command_update_firmware ( const char *  uri,
const uint8_t *  data,
uint32_t  data_size 
)

Update firmware.

Manufacturer only. 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 to 0.

Sets the target position of the move command and the movr command to zero for all cases except for movement to the target position. In the latter case, the target position is calculated so that the absolute position of the destination stays the same. For example, if we were at 400 and moved to 500, then the command Zero makes the current position 0 and the position of the destination 100. It does not change the mode of movement. If the motion is carried, it continues, and if the engine is in the "hold", the type of retention remains.

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

Enumerate all XIMC-compatible devices.

Parameters
[in]enumerate_flagsenumerate devices flags
[in]hintsextended search information
hints is a string of form "key=value \n key2=value2". Unrecognized key-value pairs are ignored. Key list: addr (required!) - mandatory flag used together with the 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. Example: "addr=192.168.1.1,172.16.2.3". Absent value means broadcast discovery. Example: "addr=". 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. Example: "addr= \n adapter_addr=192.168.0.100".
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 
)

Deprecated.

Read additional accessory information from the EEPROM.

Parameters
idAn identifier of a 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 the analog data structure that contains raw analog data from the embedded ADC.

This function is used for device testing and deep recalibration by the manufacturer only.

Parameters
idAn identifier of a 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 the controller's bootloader version.

Parameters
idAn identifier of a 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 break control settings.

Parameters
idAn identifier of a 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.

Manufacturer only. This function reads the structure with calibration settings. These settings are used to convert bare ADC values to winding currents in mA and the full current in mA. Parameters are grouped into pairs, XXX_A and XXX_B, representing linear equation coefficients. The first one is the slope, the second one is the constant term. Thus, XXX_Current[mA] = XXX_A[mA/ADC]*XXX_ADC_CODE[ADC] + XXX_B[mA].

See Also
calibration_settings_t
Parameters
idAn identifier of a 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.

A useful function that fills the structure with a snapshot of the controller voltages and currents.

See Also
chart_data_t
Parameters
idAn identifier of a device
[out]chart_datastructure with a snapshot of controller parameters.
result_t XIMC_API get_control_settings ( device_t  id,
control_settings_t control_settings 
)

Read motor control settings.

In case of CTL_MODE=1, joystick motor control is enabled. In this mode, while the joystick is maximally displaced, the engine tends to move at MaxSpeed[i]. i=0 if another value hasn't been set at the previous usage. To change the speed index "i", use the buttons.

In case of CTL_MODE=2, the motor is controlled by the left/right buttons. When you click on the button, the motor starts moving in the appropriate direction at a speed MaxSpeed[0]. After Timeout[i], motor moves at speed MaxSpeed[i+1]. At the transition between MaxSpeed[i] and MaxSpeed[i+1] the motor just accelerates/decelerates as usual.

Parameters
idAn identifier of a device
[out]control_settingsstructure contains settings motor control by joystick or buttons left/right.
result_t XIMC_API get_control_settings_calb ( device_t  id,
control_settings_calb_t control_settings_calb,
const calibration_t calibration 
)

Set calibrated motor control settings.

In case of CTL_MODE=1, the joystick motor control is enabled. In this mode, while the joystick is maximally displaced, the engine tends to move at MaxSpeed[i]. i=0 if another value hasn't been set at the previous usage. To change the speed index "i", use the buttons.

In case of CTL_MODE=2, the motor is controlled by the left/right buttons. When you click on the button, the motor starts moving in the appropriate direction at a speed MaxSpeed[0]. After Timeout[i], motor moves at speed MaxSpeed[i+1]. At the transition between MaxSpeed[i] and MaxSpeed[i+1] the motor just accelerates/decelerates as usual.

Parameters
idAn identifier of a device
[out]control_settings_calbstructure contains user unit motor control settings.
calibrationuser unit settings
result_t XIMC_API get_controller_name ( device_t  id,
controller_name_t controller_name 
)

Read user's controller name and internal settings from the FRAM.

Parameters
idAn identifier of a 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 control position settings (used with stepper motor only).

When controlling the step motor with an 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 is enabled (CTP_ENABLED is set), the controller stores the current position in the steps of SM and the current position of the encoder. Next, the encoder position is converted into steps at each step, and if the difference between the current position in steps and the encoder position is greater than CTPMinError, the flag STATE_CTP_ERROR is set.

Alternatively, the stepper motor may be controlled with the speed sensor (CTP_BASE 1). In this mode, at the active edges of the input clock, the controller stores the current value of steps. Then, at each revolution, the controller checks how many steps have been passed. When the difference is over the CTPMinError, the STATE_CTP_ERROR flag is set.

Parameters
idAn identifier of a device
[out]ctp_settingsstructure contains position control settings.
result_t XIMC_API get_debug_read ( device_t  id,
debug_read_t debug_read 
)

Read data from firmware for debug purpose.

Manufacturer only. Its use depends on context, firmware version and previous history.

Parameters
idAn identifier of a 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 a device
[out]edges_settingsedges settings, types of borders, motor behavior and electrical behavior of limit switches
result_t XIMC_API get_edges_settings_calb ( device_t  id,
edges_settings_calb_t edges_settings_calb,
const calibration_t calibration 
)

Read border and limit switches settings in user units.

See Also
set_edges_settings_calb
Parameters
idAn identifier of a device
[out]edges_settings_calbedges settings, types of borders, motor behavior and electrical behavior of limit switches
calibrationuser unit settings
Note
Attention! Some parameters of the edges_settings_calb structure are corrected by the coordinate correction table.
result_t XIMC_API get_emf_settings ( device_t  id,
emf_settings_t emf_settings 
)

Read electromechanical settings.

The settings are different for different stepper motors.

See Also
set_emf_settings
Parameters
idAn identifier of a device
[out]emf_settingsEMF settings
result_t XIMC_API get_encoder_information ( device_t  id,
encoder_information_t encoder_information 
)

Deprecated.

Read encoder information from the EEPROM.

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

Deprecated.

Read encoder settings from the EEPROM.

Parameters
idAn identifier of a device
[out]encoder_settingsstructure contains encoder settings
result_t XIMC_API get_engine_advansed_setup ( device_t  id,
engine_advansed_setup_t engine_advansed_setup 
)

Read engine advanced settings.

See Also
set_engine_advansed_setup
Parameters
idAn identifier of a device
[out]engine_advansed_setupEAS settings
result_t XIMC_API get_engine_settings ( device_t  id,
engine_settings_t engine_settings 
)

Read engine settings.

This function reads the structure containing a set of useful motor settings stored in the 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 a device
[out]engine_settingsengine settings
result_t XIMC_API get_engine_settings_calb ( device_t  id,
engine_settings_calb_t engine_settings_calb,
const calibration_t calibration 
)

Read user unit engine settings.

This function reads the structure containing a set of useful motor settings stored in the controller's memory. These settings specify the motor shaft movement algorithm, list of limitations and rated characteristics.

See Also
set_engine_settings
Parameters
idAn identifier of a device
[out]engine_settings_calbengine settings
calibrationuser unit 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 a device
[out]entype_settingsstructure contains motor type and power driver type settings
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_extended_settings ( device_t  id,
extended_settings_t extended_settings 
)

Read extended settings.

Currently, it is not in use.

See Also
set_extended_settings
Parameters
idAn identifier of a device
[out]extended_settingsEST settings
result_t XIMC_API get_extio_settings ( device_t  id,
extio_settings_t extio_settings 
)

Read EXTIO settings.

This function reads a structure with a set of EXTIO settings from the controller's memory.

See Also
set_extio_settings
Parameters
idAn identifier of a 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 a 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 the controller's firmware version.

Parameters
idAn identifier of a 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 
)

Deprecated.

Read gear information from the EEPROM.

Parameters
idAn identifier of a device
[out]gear_informationstructure contains information about step gearhead
result_t XIMC_API get_gear_settings ( device_t  id,
gear_settings_t gear_settings 
)

Deprecated.

Read gear settings from the EEPROM.

Parameters
idAn identifier of a 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 device, but is not a random value.

Manufacturer only. 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 a device
[out]globally_unique_identifierthe result of fields 0-3 concatenated defines the unique 128-bit device identifier.
result_t XIMC_API get_hallsensor_information ( device_t  id,
hallsensor_information_t hallsensor_information 
)

Deprecated.

Read hall sensor information from the EEPROM.

Parameters
idAn identifier of a device
[out]hallsensor_informationstructure contains information about hall sensor
result_t XIMC_API get_hallsensor_settings ( device_t  id,
hallsensor_settings_t hallsensor_settings 
)

Deprecated.

Read hall sensor settings from the EEPROM.

Parameters
idAn identifier of a 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 reads the structure with home position settings.

See Also
home_settings_t
Parameters
idAn identifier of a device
[out]home_settingscalibrating position settings
result_t XIMC_API get_home_settings_calb ( device_t  id,
home_settings_calb_t home_settings_calb,
const calibration_t calibration 
)

Read user unit home settings.

This function reads the structure with home position settings.

See Also
home_settings_calb_t
Parameters
idAn identifier of a device
[out]home_settings_calbcalibrating position settings
calibrationuser unit settings
result_t XIMC_API get_init_random ( device_t  id,
init_random_t init_random 
)

Read a random number from the controller.

Manufacturer only.

Parameters
idAn identifier of a device
[out]init_randomrandom sequence generated by the controller
result_t XIMC_API get_joystick_settings ( device_t  id,
joystick_settings_t joystick_settings 
)

Read joystick settings.

If joystick position falls outside DeadZone limits, a movement begins. The speed is defined by the joystick's position in the range of the DeadZone limit to the maximum deviation. Joystick positions inside DeadZone limits correspond to zero speed (a soft stop of the motion), and positions beyond Low and High limits correspond to MaxSpeed[i] or -MaxSpeed[i] (see command SCTL), where i = 0 by default and can be changed with the left/right buttons (see command SCTL). If the next speed in the list is zero (both integer and microstep parts), the button press is ignored. The first speed in the list shouldn't be zero. See the Joystick control section on https://doc.xisupport.com/en/8smc5-usb/8SMCn-USB/Technical_specification/Additional_features/Joystick_control.html for more information.

Parameters
idAn identifier of a 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 speed error graph.

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 full, it is recommended to repeat the readings every 5 ms until the buffer again becomes filled with 20 points.

To stop measurements just stop reading data. After buffer overflow measurements will stop automatically.

See Also
measurements_t
Parameters
idAn identifier of a device
[out]measurementsstructure with buffer and its length.
result_t XIMC_API get_motor_information ( device_t  id,
motor_information_t motor_information 
)

Deprecated.

Read motor information from the EEPROM.

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

Deprecated.

Read motor settings from the EEPROM.

Parameters
idAn identifier of a device
[out]motor_settingsstructure contains motor settings
result_t XIMC_API get_move_settings ( device_t  id,
move_settings_t move_settings 
)

Movement settings read command (speed, acceleration, threshold, etc.).

Parameters
idAn identifier of a device
[out]move_settingsstructure contains move settings: speed, acceleration, deceleration etc.
result_t XIMC_API get_move_settings_calb ( device_t  id,
move_settings_calb_t move_settings_calb,
const calibration_t calibration 
)

User unit movement settings read command (speed, acceleration, threshold, etc.).

Parameters
idAn identifier of a device
[out]move_settings_calbstructure contains move settings: speed, acceleration, deceleration etc.
calibrationuser unit settings
result_t XIMC_API get_network_settings ( device_t  id,
network_settings_t network_settings 
)

Read network settings.

Manufacturer only. This function returns the current network settings.

See Also
net_settings_t
Parameters
DHCPEnabledDHCP enabled (1) or not (0)
IPv4Address[4]Array[4] with an IP address
SubnetMask[4]Array[4] with a subnet mask address
DefaultGateway[4]Array[4] with a default gateway address
result_t XIMC_API get_nonvolatile_memory ( device_t  id,
nonvolatile_memory_t nonvolatile_memory 
)

Read user data from FRAM.

Parameters
idAn identifier of a device
[out]nonvolatile_memorystructure contains previously set user data.
result_t XIMC_API get_password_settings ( device_t  id,
password_settings_t password_settings 
)

Read the password.

Manufacturer only. This function reads the user password for the device's web-page.

See Also
pwd_settings_t
Parameters
UserPassword[20]Password for web-page
result_t XIMC_API get_pid_settings ( device_t  id,
pid_settings_t pid_settings 
)

Read PID settings.

This function reads the structure containing a set of motor PID settings stored in the controller's memory. These settings specify the behavior of the PID routine for the positioner. These factors are slightly different for different positioners. All boards are supplied with the standard set of PID settings in the controller's flash memory.

See Also
set_pid_settings
Parameters
idAn identifier of a 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 microsteps for stepper motor and encoder steps for all engines.

Parameters
idAn identifier of a device
[out]the_get_positionstructure contains motor position.
result_t XIMC_API get_position_calb ( device_t  id,
get_position_calb_t the_get_position_calb,
const calibration_t calibration 
)

Reads position value in user units for stepper motor and encoder steps for all engines.

Parameters
idAn identifier of a device
[out]the_get_position_calbstructure contains motor position.
calibrationuser unit settings
Note
Attention! Some parameters of the get_position_calb structure are corrected by the coordinate correction table.
result_t XIMC_API get_power_settings ( device_t  id,
power_settings_t power_settings 
)

Read settings of step motor power control.

Used with a stepper motor only.

Parameters
idAn identifier of a 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 a 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 a device
[out]SerialNumberserial number
result_t XIMC_API get_stage_information ( device_t  id,
stage_information_t stage_information 
)

Deprecated.

Read stage information from the EEPROM.

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

Read the user's stage name from the EEPROM.

Parameters
idAn identifier of a device
[out]stage_namestructure contains the previously set user's stage name.
result_t XIMC_API get_stage_settings ( device_t  id,
stage_settings_t stage_settings 
)

Deprecated.

Read stage settings from the EEPROM.

Parameters
idAn identifier of a 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 
)

Return device state.

Parameters
idan identifier of device
[out]statusstructure with snapshot of controller status
calibrationuser unit settings 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 reads the structure with a set of input synchronization settings, modes, periods and flags that specify the behavior of input synchronization. All boards are supplied with the standard set of these settings.

See Also
set_sync_in_settings
Parameters
idAn identifier of a device
[out]sync_in_settingssynchronization settings
result_t XIMC_API get_sync_in_settings_calb ( device_t  id,
sync_in_settings_calb_t sync_in_settings_calb,
const calibration_t calibration 
)

Read input user unit synchronization settings.

This function reads the structure with a set of input synchronization settings, modes, periods and flags that specify the behavior of input synchronization. All boards are supplied with the standard set of these settings.

See Also
set_sync_in_settings_calb
Parameters
idAn identifier of a device
[out]sync_in_settings_calbsynchronization settings
calibrationuser unit settings
result_t XIMC_API get_sync_out_settings ( device_t  id,
sync_out_settings_t sync_out_settings 
)

Read output synchronization settings.

This function reads the structure containing a set of output synchronization settings, modes, periods and flags that specify the behavior of output synchronization. All boards are supplied with the standard set of these settings.

See Also
set_sync_out_settings
Parameters
idAn identifier of a device
[out]sync_out_settingssynchronization settings
result_t XIMC_API get_sync_out_settings_calb ( device_t  id,
sync_out_settings_calb_t sync_out_settings_calb,
const calibration_t calibration 
)

Read output user unit synchronization settings.

This function reads the structure containing a set of output synchronization settings, modes, periods and flags that specify the behavior of output synchronization. All boards are supplied with the standard set of these settings.

See Also
set_sync_in_settings_calb
Parameters
idAn identifier of a device
[out]sync_out_settings_calbsynchronization settings
calibrationuser unit settings
result_t XIMC_API get_uart_settings ( device_t  id,
uart_settings_t uart_settings 
)

Read UART settings.

This function reads the structure containing 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
result_t XIMC_API load_correction_table ( device_t id,
const char *  namefile 
)

Command of loading a correction table from a text file (this function is deprecated).

Use the function set_correction_table(device_t id, const char* namefile). The correction table is used for position correction in case of mechanical inaccuracies. It works for some parameters in _calb commands.

Parameters
idan identifier the device
[in]namefile- the file name must be fully qualified. If the short name is used, the file must be located in the application directory. If the file name is set to NULL, the correction table will be cleared. File format: two tab-separated columns. Column headers are string. Data is real, the point is a determiter. The first column is a coordinate. The second one is the deviation caused by a mechanical error. The maximum length of a table is 100 rows.
Note
The id parameter in this function is a C pointer, unlike most library functions that use this parameter
See Also
command_move
get_position_calb
get_position_calb_t
get_status_calb
status_calb_t
get_edges_settings_calb
set_edges_settings_calb
edges_settings_calb_t
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 and return identifier of the device which can be used in calls.

Parameters
[in]uri- a device URI. Device URI has a form of "xi-com:port" or "xi-net://host/serial" or "xi-emu:///abs_path_to_file". For POSIX systems one can ommit root-slash in abs_path_to_file; for example, "xi-emu:///home/user/virt_controller.bin". In case of USB-COM port, the "port" is the OS device URI. For example, "xi-com:\\\\.\\COM3" in Windows (note that double-backslash will be transformed to single-backslash) or "xi-com:///dev/ttyACM0" 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". In case of UDP protocol, use "xi-udp://<ip/host>:<port>. For example, "xi-udp://192.168.0.1:1818". In case of virtual device, the "abs_file_to_file" is the full path to the virtual device's file. If it doesn't exist, then it is created and 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)

The command switches the controller to update the firmware state.

Manufacturer only. After receiving this command, the firmware board sets a flag (for loader), sends an echo reply, and restarts the controller.

result_t XIMC_API set_accessories_settings ( device_t  id,
const accessories_settings_t accessories_settings 
)

Deprecated.

Set additional accessories' information to the EEPROM. Can be used by the manufacturer only.

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

Deprecated.

Left for compatibility Do just nothing.

result_t XIMC_API set_brake_settings ( device_t  id,
const brake_settings_t brake_settings 
)

Set brake control settings.

Parameters
idAn identifier of a device
[in]brake_settingsstructure contains brake control settings
result_t XIMC_API set_calibration_settings ( device_t  id,
const calibration_settings_t calibration_settings 
)

Set calibration settings.

Manufacturer only. This function sends the structure with calibration settings to the controller's memory. These settings are used to convert bare ADC values to winding currents in mA and the full current in mA. Parameters are grouped into pairs, XXX_A and XXX_B, representing linear equation coefficients. The first one is the slope, the second one is the constant term. Thus, XXX_Current[mA] = XXX_A[mA/ADC]*XXX_ADC_CODE[ADC] + XXX_B[mA].

See Also
calibration_settings_t
Parameters
idAn identifier of a device
[in]calibration_settingscalibration settings
result_t XIMC_API set_control_settings ( device_t  id,
const control_settings_t control_settings 
)

Read motor control settings.

In case of CTL_MODE=1, joystick motor control is enabled. In this mode, the joystick is maximally displaced, the engine tends to move at MaxSpeed[i]. i=0 if another value hasn't been set at the previous usage. To change the speed index "i", use the buttons.

In case of CTL_MODE=2, the motor is controlled by the left/right buttons. When you click on the button, the motor starts moving in the appropriate direction at a speed MaxSpeed[0]. After Timeout[i], motor moves at speed MaxSpeed[i+1]. At the transition between MaxSpeed[i] and MaxSpeed[i+1] the motor just accelerates/decelerates as usual.

Parameters
idAn identifier of a device
[in]control_settingsstructure contains motor control settings.
result_t XIMC_API set_control_settings_calb ( device_t  id,
const control_settings_calb_t control_settings_calb,
const calibration_t calibration 
)

Set motor control settings.

In case of CTL_MODE=1, joystick motor control is enabled. In this mode, while the joystick is maximally displaced, the engine tends to move at MaxSpeed[i]. i=0 if another value hasn't been set at the previous usage. To change the speed index "i", use the buttons.

In case of CTL_MODE=2, the motor is controlled by the left/right buttons. When you click on the button, the motor starts moving in the appropriate direction at a speed MaxSpeed[0]. After Timeout[i], motor moves at speed MaxSpeed[i+1]. At the transition between MaxSpeed[i] and MaxSpeed[i+1] the motor just accelerates/decelerates as usual.

Parameters
idAn identifier of a device
[in]control_settings_calbstructure contains motor control settings.
calibrationuser unit settings
result_t XIMC_API set_controller_name ( device_t  id,
const controller_name_t controller_name 
)

Write user's controller name and internal settings to the FRAM.

Parameters
idAn identifier of a device
[in]controller_namestructure contains the previously set user's controller name
result_t XIMC_API set_correction_table ( device_t  id,
const char *  namefile 
)

Command of loading a correction table from a text file.

The correction table is used for position correction in case of mechanical inaccuracies. It works for some parameters in _calb commands.

Parameters
idan identifier the device
[in]namefile- the file name must be either a full path or a relative path. If the file name is set to NULL, the correction table will be cleared. File format: two tab-separated columns. Column headers are strings. Data is real, the dot is a delimiter. The first column is a coordinate. The second one is the deviation caused by a mechanical error. The maximum length of a table is 100 rows. Coordinate column must be sorted in ascending order.
See Also
command_move
get_position_calb
get_position_calb_t
get_status_calb
status_calb_t
get_edges_settings_calb
set_edges_settings_calb
edges_settings_calb_t
result_t XIMC_API set_ctp_settings ( device_t  id,
const ctp_settings_t ctp_settings 
)

Set control position settings (used with stepper motor only).

When controlling the step motor with the 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 is enabled (CTP_ENABLED is set), the controller stores the current position in the steps of SM and the current position of the encoder. Next, the encoder position is converted into steps at each step, and if the difference between the current position in steps and the encoder position is greater than CTPMinError, the flag STATE_CTP_ERROR is set.

Alternatively, the stepper motor may be controlled with the speed sensor (CTP_BASE 1). In this mode, at the active edges of the input clock, the controller stores the current value of steps. Then, at each revolution, the controller checks how many steps have been passed. When the difference is over the CTPMinError, the STATE_CTP_ERROR flag is set.

Parameters
idAn identifier of a device
[in]ctp_settingsstructure contains position control settings.
result_t XIMC_API set_debug_write ( device_t  id,
const debug_write_t debug_write 
)

Write data to firmware for debug purpose.

Manufacturer only.

Parameters
idAn identifier of a 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
get_edges_settings
Parameters
idAn identifier of a device
[in]edges_settingsedges settings, specify types of borders, motor behavior and electrical behavior of limit switches
result_t XIMC_API set_edges_settings_calb ( device_t  id,
const edges_settings_calb_t edges_settings_calb,
const calibration_t calibration 
)

Set border and limit switches settings in user units.

See Also
get_edges_settings_calb
Parameters
idAn identifier of a device
[in]edges_settings_calbedges settings, specify types of borders, motor behavior and electrical behavior of limit switches
calibrationuser unit settings
Note
Attention! Some parameters of the edges_settings_calb structure are corrected by the coordinate correction table.
result_t XIMC_API set_emf_settings ( device_t  id,
const emf_settings_t emf_settings 
)

Set electromechanical coefficients.

The settings are different for different stepper motors. Please set new settings when you change the motor.

See Also
get_emf_settings
Parameters
idAn identifier of a device
[in]emf_settingsEMF settings
result_t XIMC_API set_encoder_information ( device_t  id,
const encoder_information_t encoder_information 
)

Deprecated.

Set encoder information to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a device
[in]encoder_informationstructure contains information about encoder
result_t XIMC_API set_encoder_settings ( device_t  id,
const encoder_settings_t encoder_settings 
)

Deprecated.

Set encoder settings to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a device
[in]encoder_settingsstructure contains encoder settings
result_t XIMC_API set_engine_advansed_setup ( device_t  id,
const engine_advansed_setup_t engine_advansed_setup 
)

Set engine advanced settings.

See Also
get_engine_advansed_setup
Parameters
idAn identifier of a device
[in]engine_advansed_setupEAS settings
result_t XIMC_API set_engine_settings ( device_t  id,
const engine_settings_t engine_settings 
)

Set engine settings.

This function sends a structure with a set of engine settings to the controller's memory. These settings specify the motor shaft movement algorithm, list of limitations and rated characteristics. Use it when you change the motor, encoder, positioner, etc. Please note that wrong engine settings may lead to device malfunction, which can cause irreversible damage to the board.

See Also
get_engine_settings
Parameters
idAn identifier of a device
[in]engine_settingsengine settings
result_t XIMC_API set_engine_settings_calb ( device_t  id,
const engine_settings_calb_t engine_settings_calb,
const calibration_t calibration 
)

Set user unit engine settings.

This function sends a structure with a set of engine settings to the controller's memory. These settings specify the motor shaft movement algorithm, list of limitations and rated characteristics. Use it when you change the motor, encoder, positioner etc. Please note that wrong engine settings may lead to device malfunction, which can cause irreversible damage to the board.

See Also
get_engine_settings
Parameters
idAn identifier of a device
[in]engine_settings_calbengine settings
calibrationuser unit 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 a device
[in]entype_settingsstructure contains motor type and power driver type settings
result_t XIMC_API set_extended_settings ( device_t  id,
const extended_settings_t extended_settings 
)

Set extended settings.

Currently, it is not in use.

See Also
get_extended_settings
Parameters
idAn identifier of a device
[in]extended_settingsEST settings
result_t XIMC_API set_extio_settings ( device_t  id,
const extio_settings_t extio_settings 
)

Set EXTIO settings.

This function sends the structure with a set of EXTIO settings to the controller's memory. By default, input events are signaled through a rising front, and output states are signaled by a high logic state.

See Also
get_extio_settings
Parameters
idAn identifier of a 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 a 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 
)

Deprecated.

Set gear information to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a 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 
)

Deprecated.

Set gear settings to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a device
[in]gear_settingsstructure contains step gearhead settings
result_t XIMC_API set_hallsensor_information ( device_t  id,
const hallsensor_information_t hallsensor_information 
)

Deprecated.

Set hall sensor information to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a 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 
)

Deprecated.

Set hall sensor settings to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a 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 sends home position structure to the controller's memory.

See Also
home_settings_t
Parameters
idAn identifier of a device
[in]home_settingscalibrating position settings
result_t XIMC_API set_home_settings_calb ( device_t  id,
const home_settings_calb_t home_settings_calb,
const calibration_t calibration 
)

Set user unit home settings.

This function sends home position structure to the controller's memory.

See Also
home_settings_calb_t
Parameters
idAn identifier of a device
[in]home_settings_calbcalibrating position settings
calibrationuser unit settings
result_t XIMC_API set_joystick_settings ( device_t  id,
const joystick_settings_t joystick_settings 
)

Set joystick position.

If joystick position falls outside DeadZone limits, a movement begins. The speed is defined by the joystick's position in the range of the DeadZone limit to the maximum deviation. Joystick positions inside DeadZone limits correspond to zero speed (a soft stop of motion), and positions beyond Low and High limits correspond to MaxSpeed[i] or -MaxSpeed[i] (see command SCTL), where i = 0 by default and can be changed with the left/right buttons (see command SCTL). If the next speed in the list is zero (both integer and microstep parts), the button press is ignored. The first speed in the list shouldn't be zero. See the Joystick control section on https://doc.xisupport.com/en/8smc5-usb/8SMCn-USB/Technical_specification/Additional_features/Joystick_control.html for more information.

Parameters
idAn identifier of a 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 
)

Deprecated.

Set motor information to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a device
[in]motor_informationstructure contains motor information
result_t XIMC_API set_motor_settings ( device_t  id,
const motor_settings_t motor_settings 
)

Deprecated.

Set motor settings to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a device
[in]motor_settingsstructure contains motor information
result_t XIMC_API set_move_settings ( device_t  id,
const move_settings_t move_settings 
)

Movement settings set command (speed, acceleration, threshold, etc.).

Parameters
idAn identifier of a device
[in]move_settingsstructure contains move settings: speed, acceleration, deceleration etc.
result_t XIMC_API set_move_settings_calb ( device_t  id,
const move_settings_calb_t move_settings_calb,
const calibration_t calibration 
)

User unit movement settings set command (speed, acceleration, threshold, etc.).

Parameters
idAn identifier of a device
[in]move_settings_calbstructure contains move settings: speed, acceleration, deceleration etc.
calibrationuser unit settings
result_t XIMC_API set_network_settings ( device_t  id,
const network_settings_t network_settings 
)

Set network settings.

Manufacturer only. This function sets the desired network settings.

See Also
net_settings_t
Parameters
DHCPEnabledDHCP enabled (1) or not (0)
IPv4Address[4]Array[4] with an IP address
SubnetMask[4]Array[4] with a subnet mask address
DefaultGateway[4]Array[4] with a default gateway address
result_t XIMC_API set_nonvolatile_memory ( device_t  id,
const nonvolatile_memory_t nonvolatile_memory 
)

Write user data into the FRAM.

Parameters
idAn identifier of a device
[in]nonvolatile_memoryuser data.
result_t XIMC_API set_password_settings ( device_t  id,
const password_settings_t password_settings 
)

Sets the password.

Manufacturer only. This function sets the user password for the device's web-page.

See Also
pwd_settings_t
Parameters
UserPassword[20]Password for web-page
result_t XIMC_API set_pid_settings ( device_t  id,
const pid_settings_t pid_settings 
)

Set PID settings.

This function sends the structure with a set of PID factors to the controller's memory. These settings specify the behavior of the PID routine for the positioner. These factors are slightly different for different positioners. All boards are supplied with the standard set of PID settings in the 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 a device
[in]pid_settingsPID settings
result_t XIMC_API set_position ( device_t  id,
const set_position_t the_set_position 
)

Sets position in steps and microsteps for stepper motor.

Sets encoder position for all engines.

Parameters
idAn identifier of a device
[out]the_set_positionstructure contains motor position.
result_t XIMC_API set_position_calb ( device_t  id,
const set_position_calb_t the_set_position_calb,
const calibration_t calibration 
)

Sets any position value and encoder value of all engines.

In user units.

Parameters
idAn identifier of a device
[out]the_set_position_calbstructure contains motor position.
calibrationuser unit settings
result_t XIMC_API set_power_settings ( device_t  id,
const power_settings_t power_settings 
)

Set settings of step motor power control.

Used with a stepper motor only.

Parameters
idAn identifier of a 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 a 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 the 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 the manufacturer only.

Parameters
idAn identifier of a device
[in]serial_numberstructure contains new serial number and secret key.
result_t XIMC_API set_stage_information ( device_t  id,
const stage_information_t stage_information 
)

Deprecated.

Set stage information to the EEPROM. Can be used by the manufacturer only.

Parameters
idAn identifier of a device
[in]stage_informationstructure contains stage information
result_t XIMC_API set_stage_name ( device_t  id,
const stage_name_t stage_name 
)

Write the user's stage name to EEPROM.

Parameters
idAn identifier of a device
[in]stage_namestructure contains the previously set user's stage name.
result_t XIMC_API set_stage_settings ( device_t  id,
const stage_settings_t stage_settings 
)

Deprecated.

Set stage settings to the EEPROM. Can be used by the manufacturer only

Parameters
idAn identifier of a 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 sends the structure with a set of input synchronization settings that specify the behavior of input synchronization to the controller's memory. All boards are supplied with the standard set of these settings.

See Also
get_sync_in_settings
Parameters
idAn identifier of a device
[in]sync_in_settingssynchronization settings
result_t XIMC_API set_sync_in_settings_calb ( device_t  id,
const sync_in_settings_calb_t sync_in_settings_calb,
const calibration_t calibration 
)

Set input user unit synchronization settings.

This function sends the structure with a set of input synchronization settings that specify the behavior of input synchronization to the controller's memory. All boards are supplied with the standard set of these settings.

See Also
get_sync_in_settings_calb
Parameters
idAn identifier of a device
[in]sync_in_settings_calbsynchronization settings
calibrationuser unit settings
result_t XIMC_API set_sync_out_settings ( device_t  id,
const sync_out_settings_t sync_out_settings 
)

Set output synchronization settings.

This function sends the structure with a set of output synchronization settings that specify the behavior of output synchronization to the controller's memory. All boards are supplied with the standard set of these settings.

See Also
get_sync_out_settings
Parameters
idAn identifier of a device
[in]sync_out_settingssynchronization settings
result_t XIMC_API set_sync_out_settings_calb ( device_t  id,
const sync_out_settings_calb_t sync_out_settings_calb,
const calibration_t calibration 
)

Set output user unit synchronization settings.

This function sends the structure with a set of output synchronization settings that specify the behavior of output synchronization to the controller's memory. All boards are supplied with the standard set of these settings.

See Also
get_sync_in_settings_calb
Parameters
idAn identifier of a device
[in]sync_out_settings_calbsynchronization settings
calibrationuser unit settings
result_t XIMC_API set_uart_settings ( device_t  id,
const uart_settings_t uart_settings 
)

Set UART settings.

This function sends the structure with UART settings to the 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)

(Deprecated) Fixing a USB driver error in Windows.

The USB-COM subsystem in the Windows OS does not always work correctly. During operation, the following malfunctions are possible: All attempts to open the device fail. The device can be opened and data can be sent to it, but the response data is not received. These problems are fixed by reconnecting the device or reinitializing it in the Device Manager. The ximc_fix_usbser_sys() function automates the deletion detection process.

void XIMC_API ximc_version ( char *  version)

Returns a library version.

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