libximc: ximc.h File Reference

libximc 3.0.3

Data Structures | Macros | Typedefs
ximc.h File Reference

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 protection parameters: critical electrical values, flags for protection algorithms. 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_advanced_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 structure contains a sequence of measured axis motion parameters - velocities and position errors. 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
#define | XIMC_CALLCONV
#define | XIMC_RETTYPE void*
#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
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
This is a bit mask for bitwise operations. See also set_controller_name get_controller_name controller_name_t::CtrlFlags, get_controller_name, set_controller_name
#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. Note The ENCD flag is only active in the None and EMF modes. In other modes, such as Encoder and Encoder Mediated, it is not used, as these modes cannot operate without an encoder. After the controller is powered on, the flag will be in the unknown state — a movement is required to determine the position. As the movement occurs, the flag’s value may change. 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_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 | BRAKING_OVERVOLTAGE_PROTECTION 0x20
| If this flag is set, the firmware will close ground switches of H-bridge to disconnect motor from power circuit on overvoltage.
#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.
This is a bit mask for bitwise operations. See also set_feedback_settings get_feedback_settings feedback_settings_t::FeedbackType, get_feedback_settings, set_feedback_settings
#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.
This is a bit mask for bitwise operations. See also set_feedback_settings get_feedback_settings feedback_settings_t::FeedbackFlags, get_feedback_settings, set_feedback_settings
#define | FEEDBACK_ENC_REVERSE 0x01
| Reverse count of encoder.
#define | FEEDBACK_ENC_ADAPTIVE_HOLDING 0x02
| Enables the adaptive holding algorithm.
#define | FEEDBACK_ENC_FILTER_NONE 0x00
| Disable the internal filter of the encoder signal.
#define | FEEDBACK_ENC_FILTER_WEAK 0x10
| Weak noise filtering: the maximum encoder signal frequency is 3 MHz.
#define | FEEDBACK_ENC_FILTER_MEDIUM 0x20
| Medium noise filtering: the maximum encoder signal frequency is 1 MHz.
#define | FEEDBACK_ENC_FILTER_STRONG 0x30
| Strong noise filtering: the maximum encoder signal frequency is 300 kHz.
#define | FEEDBACK_ENC_FILTER_BITS 0x30
| Bits responsible for setting the internal filter of the encoder signal.
#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.
#define | FEEDBACK_ENC_TYPE_BITS 0xC0
| Bits of the encoder type.
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
This is a bit mask for bitwise operations. See also get_extio_settings set_extio_settings extio_settings_t::EXTIOSetupFlags, get_extio_settings, set_extio_settings
#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
This is a bit mask for bitwise operations. See also accessories_settings_t::LimitSwitchesSettings, get_accessories_settings, set_accessories_settings
#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.
This is a bit mask for bitwise operations. See also set_emf_settings get_emf_settings emf_settings_t::BackEMFFlags, get_emf_settings, set_emf_settings
#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

## 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)
| Set 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 with user units.
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)
| Read motor control settings with user units.
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_advanced_setup (device_t id, const engine_advanced_setup_t *engine_advanced_setup)
| Set engine advanced settings.
result_t XIMC_API | get_engine_advanced_setup (device_t id, engine_advanced_setup_t *engine_advanced_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.

## 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
typedef struct calibration_t | calibration_t
| Calibration structure
typedef struct device_network_information_t | device_network_information_t
| Device network information structure.

## Boards and drivers control
Functions for searching and opening/closing devices
typedef char * | pchar
| Nevermind
typedef void(XIMC_CALLCONV * | logging_callback_t) (int loglevel, const wchar_t *message, void *user_data)
| Logging callback prototype
device_t XIMC_API | open_device (const char *uri)
| Open a device with OS uri 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 | 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.
device_enumeration_t XIMC_API | enumerate_devices (int enumerate_flags, const char *hints)
| Search and list of available 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.
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

## ◆ ALARM_ON_DRIVER_OVERHEATING

#define ALARM_ON_DRIVER_OVERHEATING 0x01

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

## ◆ BACK_EMF_INDUCTANCE_AUTO

#define BACK_EMF_INDUCTANCE_AUTO 0x01

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

## ◆ BACK_EMF_KM_AUTO

#define BACK_EMF_KM_AUTO 0x04

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

## ◆ BACK_EMF_RESISTANCE_AUTO

#define BACK_EMF_RESISTANCE_AUTO 0x02

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

## ◆ BORDER_IS_ENCODER

#define BORDER_IS_ENCODER 0x01

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

## ◆ BORDER_STOP_LEFT

#define BORDER_STOP_LEFT 0x02

The motor should stop on the left border.

## ◆ BORDER_STOP_RIGHT

#define BORDER_STOP_RIGHT 0x04

Motor should stop on right border.

## ◆ BORDERS_SWAP_MISSET_DETECTION

#define BORDERS_SWAP_MISSET_DETECTION 0x08

Motor should stop on both borders.

Need to save the motor when wrong border settings is set

## ◆ BRAKE_ENABLED

#define BRAKE_ENABLED 0x01

Brake control is enabled if this flag is set.

## ◆ BRAKE_ENG_PWROFF

#define BRAKE_ENG_PWROFF 0x02

Brake turns the stepper motor power off if this flag is set.

## ◆ BRAKING_OVERVOLTAGE_PROTECTION

#define BRAKING_OVERVOLTAGE_PROTECTION 0x20

If this flag is set, the firmware will close ground switches of H-bridge to disconnect motor from power circuit on overvoltage.

## ◆ CONTROL_BTN_LEFT_PUSHED_OPEN

#define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04

Pushed left button corresponds to the open contact if this flag is set.

## ◆ CONTROL_BTN_RIGHT_PUSHED_OPEN

#define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08

Pushed right button corresponds to open contact if this flag is set.

## ◆ CONTROL_MODE_BITS

#define CONTROL_MODE_BITS 0x03

Bits to control the engine by joystick or buttons.

## ◆ CONTROL_MODE_JOY

#define CONTROL_MODE_JOY 0x01

Control by joystick.

## ◆ CONTROL_MODE_LR

#define CONTROL_MODE_LR 0x02

Control by left/right buttons.

## ◆ CONTROL_MODE_OFF

#define CONTROL_MODE_OFF 0x00

Control is disabled.

## ◆ CTP_ALARM_ON_ERROR

#define CTP_ALARM_ON_ERROR 0x04

Set ALARM on mismatch if the flag is set.

## ◆ CTP_BASE

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

## ◆ CTP_ENABLED

#define CTP_ENABLED 0x01

The position control is enabled if the flag is set.

## ◆ CTP_ERROR_CORRECTION

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

## ◆ DRIVER_TYPE_EXTERNAL

#define DRIVER_TYPE_EXTERNAL 0x03

External driver.

## ◆ DRIVER_TYPE_INTEGRATE

#define DRIVER_TYPE_INTEGRATE 0x02

Driver with integrated IC.

## ◆ EEPROM_PRECEDENCE

#define EEPROM_PRECEDENCE 0x01

If the flag is set, settings from external EEPROM override controller settings.

## ◆ ENC_STATE_ABSENT

#define ENC_STATE_ABSENT 0x00

Encoder is absent.

## ◆ ENC_STATE_MALFUNC

#define ENC_STATE_MALFUNC 0x02

Encoder is connected and malfunctioning.

## ◆ ENC_STATE_OK

#define ENC_STATE_OK 0x04

Encoder is connected and working properly.

## ◆ ENC_STATE_REVERS

#define ENC_STATE_REVERS 0x03

Encoder is connected and operational but counts in other direction.

## ◆ ENC_STATE_UNKNOWN

#define ENC_STATE_UNKNOWN 0x01

Encoder state is unknown.

## ◆ ENDER_SW1_ACTIVE_LOW

#define ENDER_SW1_ACTIVE_LOW 0x02

1 - Limit switch connected to pin SW1 is triggered by a low level on pin.

## ◆ ENDER_SW2_ACTIVE_LOW

#define ENDER_SW2_ACTIVE_LOW 0x04

1 - Limit switch connected to pin SW2 is triggered by a low level on pin.

## ◆ ENDER_SWAP

#define ENDER_SWAP 0x01

First limit switch on the right side, if set; otherwise on the left side.

## ◆ ENGINE_ACCEL_ON

#define ENGINE_ACCEL_ON 0x10

Acceleration enable flag.

If it set, motion begins with acceleration and ends with deceleration.

## ◆ ENGINE_ANTIPLAY

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

## ◆ ENGINE_CURRENT_AS_RMS

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

## ◆ ENGINE_LIMIT_CURR

#define ENGINE_LIMIT_CURR 0x40

Maximum motor current limit enable flag (is only used with DC motor).

## ◆ ENGINE_LIMIT_RPM

#define ENGINE_LIMIT_RPM 0x80

Maximum motor speed limit enable flag.

## ◆ ENGINE_LIMIT_VOLT

#define ENGINE_LIMIT_VOLT 0x20

Maximum motor voltage limit enable flag (is only used with DC motor).

## ◆ ENGINE_MAX_SPEED

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

## ◆ ENGINE_REVERSE

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

## ◆ ENGINE_TYPE_2DC

#define ENGINE_TYPE_2DC 0x02

2 DC motors.

## ◆ ENGINE_TYPE_BRUSHLESS

#define ENGINE_TYPE_BRUSHLESS 0x05

Brushless motor.

## ◆ ENGINE_TYPE_DC

#define ENGINE_TYPE_DC 0x01

DC motor.

## ◆ ENGINE_TYPE_NONE

#define ENGINE_TYPE_NONE 0x00

A value that shouldn't be used.

## ◆ ENGINE_TYPE_STEP

#define ENGINE_TYPE_STEP 0x03

Step motor.

## ◆ ENGINE_TYPE_TEST

#define ENGINE_TYPE_TEST 0x04

Duty cycle are fixed.

Used only manufacturer.

## ◆ ENUMERATE_PROBE

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

## ◆ EXTIO_SETUP_INVERT

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

## ◆ EXTIO_SETUP_MODE_IN_ALARM

#define EXTIO_SETUP_MODE_IN_ALARM 0x05

Set Alarm when the signal goes to the active state.

## ◆ EXTIO_SETUP_MODE_IN_BITS

#define EXTIO_SETUP_MODE_IN_BITS 0x0F

Bits of the behavior selector when the signal on input goes to the active state.

## ◆ EXTIO_SETUP_MODE_IN_HOME

#define EXTIO_SETUP_MODE_IN_HOME 0x04

Issue HOME command.

## ◆ EXTIO_SETUP_MODE_IN_MOVR

#define EXTIO_SETUP_MODE_IN_MOVR 0x03

Issue MOVR command with last used settings.

## ◆ EXTIO_SETUP_MODE_IN_NOP

#define EXTIO_SETUP_MODE_IN_NOP 0x00

Do nothing.

## ◆ EXTIO_SETUP_MODE_IN_PWOF

#define EXTIO_SETUP_MODE_IN_PWOF 0x02

Issue PWOF command, powering off all engine windings.

## ◆ EXTIO_SETUP_MODE_IN_STOP

#define EXTIO_SETUP_MODE_IN_STOP 0x01

Issue STOP command, ceasing the engine movement.

## ◆ EXTIO_SETUP_MODE_OUT_ALARM

#define EXTIO_SETUP_MODE_OUT_ALARM 0x30

EXTIO pin stays active during the alarm state.

## ◆ EXTIO_SETUP_MODE_OUT_BITS

#define EXTIO_SETUP_MODE_OUT_BITS 0xF0

Bits of the output behavior selection.

## ◆ EXTIO_SETUP_MODE_OUT_MOTOR_ON

#define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40

EXTIO pin stays active when windings are powered.

## ◆ EXTIO_SETUP_MODE_OUT_MOVING

#define EXTIO_SETUP_MODE_OUT_MOVING 0x20

EXTIO pin stays active during moving state.

## ◆ EXTIO_SETUP_MODE_OUT_OFF

#define EXTIO_SETUP_MODE_OUT_OFF 0x00

EXTIO pin always set in inactive state.

## ◆ EXTIO_SETUP_MODE_OUT_ON

#define EXTIO_SETUP_MODE_OUT_ON 0x10

EXTIO pin always set in active state.

## ◆ EXTIO_SETUP_OUTPUT

#define EXTIO_SETUP_OUTPUT 0x01

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

## ◆ FEEDBACK_EMF

#define FEEDBACK_EMF 0x04

Feedback by EMF.

## ◆ FEEDBACK_ENC_ADAPTIVE_HOLDING

#define FEEDBACK_ENC_ADAPTIVE_HOLDING 0x02

Enables the adaptive holding algorithm.

## ◆ FEEDBACK_ENC_FILTER_BITS

#define FEEDBACK_ENC_FILTER_BITS 0x30

Bits responsible for setting the internal filter of the encoder signal.

## ◆ FEEDBACK_ENC_FILTER_MEDIUM

#define FEEDBACK_ENC_FILTER_MEDIUM 0x20

Medium noise filtering: the maximum encoder signal frequency is 1 MHz.

## ◆ FEEDBACK_ENC_FILTER_NONE

#define FEEDBACK_ENC_FILTER_NONE 0x00

Disable the internal filter of the encoder signal.

## ◆ FEEDBACK_ENC_FILTER_STRONG

#define FEEDBACK_ENC_FILTER_STRONG 0x30

Strong noise filtering: the maximum encoder signal frequency is 300 kHz.

## ◆ FEEDBACK_ENC_FILTER_WEAK

#define FEEDBACK_ENC_FILTER_WEAK 0x10

Weak noise filtering: the maximum encoder signal frequency is 3 MHz.

## ◆ FEEDBACK_ENC_REVERSE

#define FEEDBACK_ENC_REVERSE 0x01

Reverse count of encoder.

## ◆ FEEDBACK_ENC_TYPE_AUTO

#define FEEDBACK_ENC_TYPE_AUTO 0x00

Auto detect encoder type.

## ◆ FEEDBACK_ENC_TYPE_BITS

#define FEEDBACK_ENC_TYPE_BITS 0xC0

Bits of the encoder type.

## ◆ FEEDBACK_ENC_TYPE_DIFFERENTIAL

#define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80

Differential encoder.

## ◆ FEEDBACK_ENC_TYPE_SINGLE_ENDED

#define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40

Single-ended encoder.

## ◆ FEEDBACK_ENCODER

#define FEEDBACK_ENCODER 0x01

Feedback by encoder.

## ◆ FEEDBACK_ENCODER_MEDIATED

#define FEEDBACK_ENCODER_MEDIATED 0x06

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

## ◆ FEEDBACK_NONE

#define FEEDBACK_NONE 0x05

Feedback is absent.

## ◆ H_BRIDGE_ALERT

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

## ◆ HOME_DIR_FIRST

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

## ◆ HOME_DIR_SECOND

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

## ◆ HOME_HALF_MV

#define HOME_HALF_MV 0x008

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

## ◆ HOME_MV_SEC_EN

#define HOME_MV_SEC_EN 0x004

Use the second phase of calibration to the home position, if set; otherwise the second phase is skipped.

## ◆ HOME_STOP_FIRST_BITS

#define HOME_STOP_FIRST_BITS 0x030

Bits of the first stop selector.

## ◆ HOME_STOP_FIRST_LIM

#define HOME_STOP_FIRST_LIM 0x030

First motion stops by limit switch.

## ◆ HOME_STOP_FIRST_REV

#define HOME_STOP_FIRST_REV 0x010

First motion stops by revolution sensor.

## ◆ HOME_STOP_FIRST_SYN

#define HOME_STOP_FIRST_SYN 0x020

First motion stops by synchronization input.

## ◆ HOME_STOP_SECOND_BITS

#define HOME_STOP_SECOND_BITS 0x0C0

Bits of the second stop selector.

## ◆ HOME_STOP_SECOND_LIM

#define HOME_STOP_SECOND_LIM 0x0C0

Second motion stops by limit switch.

## ◆ HOME_STOP_SECOND_REV

#define HOME_STOP_SECOND_REV 0x040

Second motion stops by revolution sensor.

## ◆ HOME_STOP_SECOND_SYN

#define HOME_STOP_SECOND_SYN 0x080

Second motion stops by synchronization input.

## ◆ HOME_USE_FAST

#define HOME_USE_FAST 0x100

Use the fast algorithm of calibration to the home position, if set; otherwise the traditional algorithm.

## ◆ JOY_REVERSE

#define JOY_REVERSE 0x01

Joystick action is reversed.

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

## ◆ LOW_UPWR_PROTECTION

#define LOW_UPWR_PROTECTION 0x02

If this flag is set, turn off the motor when the voltage is lower than LowUpwrOff.

## ◆ MICROSTEP_MODE_FRAC_128

#define MICROSTEP_MODE_FRAC_128 0x08

1/128-step mode.

## ◆ MICROSTEP_MODE_FRAC_16

#define MICROSTEP_MODE_FRAC_16 0x05

1/16-step mode.

## ◆ MICROSTEP_MODE_FRAC_2

#define MICROSTEP_MODE_FRAC_2 0x02

1/2-step mode.

## ◆ MICROSTEP_MODE_FRAC_256

#define MICROSTEP_MODE_FRAC_256 0x09

1/256-step mode.

## ◆ MICROSTEP_MODE_FRAC_32

#define MICROSTEP_MODE_FRAC_32 0x06

1/32-step mode.

## ◆ MICROSTEP_MODE_FRAC_4

#define MICROSTEP_MODE_FRAC_4 0x03

1/4-step mode.

## ◆ MICROSTEP_MODE_FRAC_64

#define MICROSTEP_MODE_FRAC_64 0x07

1/64-step mode.

## ◆ MICROSTEP_MODE_FRAC_8

#define MICROSTEP_MODE_FRAC_8 0x04

1/8-step mode.

## ◆ MICROSTEP_MODE_FULL

#define MICROSTEP_MODE_FULL 0x01

Full step mode.

## ◆ MOVE_STATE_ANTIPLAY

#define MOVE_STATE_ANTIPLAY 0x04

Motor is playing compensation, if flag set.

## ◆ MOVE_STATE_MOVING

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

## ◆ MOVE_STATE_TARGET_SPEED

#define MOVE_STATE_TARGET_SPEED 0x02

Target speed is reached, if flag set.

## ◆ MVCMD_ERROR

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

## ◆ MVCMD_HOME

#define MVCMD_HOME 0x06

Command home.

## ◆ MVCMD_LEFT

#define MVCMD_LEFT 0x03

Command left.

## ◆ MVCMD_LOFT

#define MVCMD_LOFT 0x07

Command loft.

## ◆ MVCMD_MOVE

#define MVCMD_MOVE 0x01

Command move.

## ◆ MVCMD_MOVR

#define MVCMD_MOVR 0x02

Command movr.

## ◆ MVCMD_NAME_BITS

#define MVCMD_NAME_BITS 0x3F

Move command bit mask.

## ◆ MVCMD_RIGHT

#define MVCMD_RIGHT 0x04

Command rigt.

## ◆ MVCMD_RUNNING

#define MVCMD_RUNNING 0x80

Move command state (0 - move command has finished, 1 - move command is being executed).

## ◆ MVCMD_SSTP

#define MVCMD_SSTP 0x08

Command soft stop.

## ◆ MVCMD_STOP

#define MVCMD_STOP 0x05

Command stop.

## ◆ MVCMD_UKNWN

#define MVCMD_UKNWN 0x00

Unknown command.

## ◆ POWER_OFF_ENABLED

#define POWER_OFF_ENABLED 0x02

Power off is enabled after PowerOffDelay if this flag is set.

## ◆ POWER_REDUCT_ENABLED

#define POWER_REDUCT_ENABLED 0x01

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

## ◆ POWER_SMOOTH_CURRENT

#define POWER_SMOOTH_CURRENT 0x04

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

## ◆ PWR_STATE_MAX

#define PWR_STATE_MAX 0x05

Motor windings are powered by the maximum current driver can provide at this voltage.

## ◆ PWR_STATE_NORM

#define PWR_STATE_NORM 0x03

Motor windings are powered by nominal current.

## ◆ PWR_STATE_OFF

#define PWR_STATE_OFF 0x01

Motor windings are disconnected from the driver.

## ◆ PWR_STATE_REDUCT

#define PWR_STATE_REDUCT 0x04

Motor windings are powered by reduced current to lower power consumption.

## ◆ PWR_STATE_UNKNOWN

#define PWR_STATE_UNKNOWN 0x00

Unknown state, should never happen.

## ◆ REV_SENS_INV

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

## ◆ RPM_DIV_1000

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

## ◆ SETPOS_IGNORE_ENCODER

#define SETPOS_IGNORE_ENCODER 0x02

Will not reload encoder state if this flag is set.

## ◆ SETPOS_IGNORE_POSITION

#define SETPOS_IGNORE_POSITION 0x01

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

## ◆ STATE_ALARM

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

## ◆ STATE_BORDERS_SWAP_MISSET

#define STATE_BORDERS_SWAP_MISSET 0x0008000

Engine stuck at the wrong edge.

## ◆ STATE_BRAKE

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

## ◆ STATE_BUTTON_LEFT

#define STATE_BUTTON_LEFT 0x0008

Button "left" state (1 if pressed).

## ◆ STATE_BUTTON_RIGHT

#define STATE_BUTTON_RIGHT 0x0004

Button "right" state (1 if pressed).

## ◆ STATE_CONTR

#define STATE_CONTR 0x000003F

Flags of controller states.

## ◆ STATE_CONTROLLER_OVERHEAT

#define STATE_CONTROLLER_OVERHEAT 0x0000200

Controller overheat.

## ◆ STATE_CTP_ERROR

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

## ◆ STATE_DIG_SIGNAL

#define STATE_DIG_SIGNAL 0xFFFF

Flags of digital signals.

## ◆ STATE_EEPROM_CONNECTED

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

## ◆ STATE_ENC_A

#define STATE_ENC_A 0x2000

State of encoder A pin.

## ◆ STATE_ENC_B

#define STATE_ENC_B 0x4000

State of encoder B pin.

## ◆ STATE_ENGINE_RESPONSE_ERROR

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

## ◆ STATE_ERRC

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

## ◆ STATE_ERRD

#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/RS-232 interface.

## ◆ STATE_ERRV

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

## ◆ STATE_EXTIO_ALARM

#define STATE_EXTIO_ALARM 0x1000000

The error is caused by the external EXTIO input signal.

## ◆ STATE_GPIO_LEVEL

#define STATE_GPIO_LEVEL 0x0020

State of external GPIO pin.

## ◆ STATE_GPIO_PINOUT

#define STATE_GPIO_PINOUT 0x0010

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

## ◆ STATE_IS_HOMED

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

## ◆ STATE_LEFT_EDGE

#define STATE_LEFT_EDGE 0x0002

Engine stuck at the left edge.

## ◆ STATE_LOW_USB_VOLTAGE

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

## ◆ STATE_OVERLOAD_POWER_CURRENT

#define STATE_OVERLOAD_POWER_CURRENT 0x0000800

Power current exceeds safe limit.

## ◆ STATE_OVERLOAD_POWER_VOLTAGE

#define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400

Power voltage exceeds safe limit.

## ◆ STATE_OVERLOAD_USB_CURRENT

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

## ◆ STATE_OVERLOAD_USB_VOLTAGE

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

## ◆ STATE_POWER_OVERHEAT

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

## ◆ STATE_REV_SENSOR

#define STATE_REV_SENSOR 0x0400

State of Revolution sensor pin.

## ◆ STATE_RIGHT_EDGE

#define STATE_RIGHT_EDGE 0x0001

Engine stuck at the right edge.

## ◆ STATE_SECUR

#define STATE_SECUR 0x1B3FFC0

Security flags.

## ◆ STATE_SYNC_INPUT

#define STATE_SYNC_INPUT 0x0800

State of Sync input pin.

## ◆ STATE_SYNC_OUTPUT

#define STATE_SYNC_OUTPUT 0x1000

State of Sync output pin.

## ◆ STATE_WINDING_RES_MISMATCH

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

## ◆ SYNCIN_ENABLED

#define SYNCIN_ENABLED 0x01

Synchronization in mode is enabled if this flag is set.

## ◆ SYNCIN_GOTOPOSITION

#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

## ◆ SYNCIN_INVERT

#define SYNCIN_INVERT 0x02

Trigger on falling edge if flag is set, on rising edge otherwise.

## ◆ SYNCOUT_ENABLED

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

## ◆ SYNCOUT_IN_STEPS

#define SYNCOUT_IN_STEPS 0x08

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

## ◆ SYNCOUT_INVERT

#define SYNCOUT_INVERT 0x04

The low level is active if the flag is set.

Otherwise, the high level is active.

## ◆ SYNCOUT_ONPERIOD

#define SYNCOUT_ONPERIOD 0x40

Generate a synchronization pulse every SyncOutPeriod encoder pulses.

## ◆ SYNCOUT_ONSTART

#define SYNCOUT_ONSTART 0x10

Generate a synchronization pulse when movement starts.

## ◆ SYNCOUT_ONSTOP

#define SYNCOUT_ONSTOP 0x20

Generate a synchronization pulse when movement stops.

## ◆ SYNCOUT_STATE

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

## ◆ UART_PARITY_BITS

#define UART_PARITY_BITS 0x03

Bits of the parity.

## ◆ WIND_A_STATE_ABSENT

#define WIND_A_STATE_ABSENT 0x00

Winding A is disconnected.

## ◆ WIND_A_STATE_MALFUNC

#define WIND_A_STATE_MALFUNC 0x02

Winding A is short-circuited.

## ◆ WIND_A_STATE_OK

#define WIND_A_STATE_OK 0x03

Winding A is connected and working properly.

## ◆ WIND_A_STATE_UNKNOWN

#define WIND_A_STATE_UNKNOWN 0x01

Winding A state is unknown.

## ◆ WIND_B_STATE_ABSENT

#define WIND_B_STATE_ABSENT 0x00

Winding B is disconnected.

## ◆ WIND_B_STATE_MALFUNC

#define WIND_B_STATE_MALFUNC 0x20

Winding B is short-circuited.

## ◆ WIND_B_STATE_OK

#define WIND_B_STATE_OK 0x30

Winding B is connected and working properly.

## ◆ WIND_B_STATE_UNKNOWN

#define WIND_B_STATE_UNKNOWN 0x10

Winding B state is unknown.

## ◆ XIMC_API

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

## ◆ XIMC_CALLCONV

#define XIMC_CALLCONV

Library calling convention macros.

## ◆ XIMC_RETTYPE

#define XIMC_RETTYPE void*

Thread return type.

## Typedef Documentation

## ◆ calibration_t

typedef struct calibration_t calibration_t

Calibration structure

Where to find all values for calculations?

- XILab (don’t forget to load the profile for your positioner. The profile should match the full name of your positioner, e.g., 8MT173-25-MEn1.cfg):
  - In XILab settings, go to the "User units" tab. Divide the second number by the first one — this is your A coefficient.
  - In the "DC motor" / "BLDC motor" / "Stepper motor" tab (depending on your motor type), find the "Encoder counts per turn" field and use it in the formula for calculating coefficient B.
- Profile file (open with any text editor; make sure it matches the full name of your positioner, e.g., 8MT173-25-MEn1.cfg):
  - Find Step_multiplier= and Unit_multiplier=. Divide the second by the first — this is your A coefficient.
  - Find Encoder_CPT= and use this value in the B coefficient formula instead of ENCODER_COUNTS_PER_TURN.

How to calculate Speed, Accel, Decel, and AntiplaySpeed in user units when using a stepper motor with encoder or DC/BLDC motor?

1. Load the correct profile in XILab for your positioner (e.g., 8MT173-25-MEn1.cfg).
2. Enable Feedback encoder mode if not already enabled.
3. Enter speed in the "Working speed" field in user units.
4. In the "User units" tab, disable the "User units" flag to see RPM.

5. Multiply the RPM value from "Working speed" by coefficient B. Example: 480 * 0.0000009375 = 0.00045. This value for the 8MT173-25-MEn1 in Encoder mode equals 2 mm/s.

   Acceleration, deceleration, and antiplay speed are calculated the same way.

## ◆ device_network_information_t

typedef struct device_network_information_t device_network_information_t

Device network information structure.

## ◆ logging_callback_t

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

Logging callback prototype

Parameters

  loglevel | a loglevel
  message | a message

## Function Documentation

## ◆ close_device()

result_t XIMC_API close_device | ( | device_t * | id | ) |

Close specified device

Parameters

  id | an identifier of device

Note
  The id parameter in this function is a C pointer, unlike most library functions that use this parameter

## ◆ command_clear_fram()

result_t XIMC_API command_clear_fram | ( | device_t | id | ) |

Clear controller FRAM.

Can be used by manufacturer only

Parameters

  id | an identifier of device

## ◆ command_eeread_settings()

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

  id | An identifier of a device

## ◆ command_eesave_settings()

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

  id | An identifier of a device

## ◆ command_home()

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

  id | An identifier of a device

See also
  home_settings_t
  get_home_settings
  set_home_settings

## ◆ command_homezero()

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

  | id | an identifier of device
  [out] | ret | RESULT_OK if controller has finished home & zero correctly or result of first controller query that returned anything other than RESULT_OK.

## ◆ command_left()

result_t XIMC_API command_left | ( | device_t | id | ) |

Start continuous moving to the left.

Parameters

  id | An identifier of a device

## ◆ command_loft()

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

  id | An identifier of a device

## ◆ command_move()

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

  id | An identifier of a device
  Position | position to move.
  uPosition | the 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).

## ◆ command_move_calb()

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

  id | An identifier of a device
  Position | position to move.
  calibration | user unit settings

Note
  The parameter Position is adjusted by the correction table.

## ◆ command_movr()

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

  DeltaPosition | shift from initial position.
  uDeltaPosition | the 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).
  id | An identifier of a device

## ◆ command_movr_calb()

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

  DeltaPosition | shift from initial position.
  id | An identifier of a device
  user | unit 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.

## ◆ command_power_off()

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

  id | An identifier of a device

See also
  get_power_settings
  set_power_settings

## ◆ command_read_robust_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

  id | An identifier of a device

## ◆ command_read_settings()

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

  id | An identifier of a device

## ◆ command_reset()

result_t XIMC_API command_reset | ( | device_t | id | ) |

Reset controller.

Can be used by manufacturer only

Parameters

  id | an identifier of device

## ◆ command_right()

result_t XIMC_API command_right | ( | device_t | id | ) |

Start continuous moving to the right.

Parameters

  id | An identifier of a device

## ◆ command_save_robust_settings()

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

  id | An identifier of a device

## ◆ command_save_settings()

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

  id | An identifier of a device

## ◆ command_sstp()

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

  id | An identifier of a device

## ◆ command_start_measurements()

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

  id | An identifier of a device

## ◆ command_stop()

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

  id | An identifier of a device

## ◆ command_update_firmware()

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

  uri | a uri of device
  data | firmware byte stream
  data_size | size of byte stream

## ◆ command_wait_for_stop()

result_t XIMC_API command_wait_for_stop | ( | device_t | id,
|  | uint32_t | refresh_interval_ms )

Wait for stop

Parameters

  | id | an identifier of device
  | refresh_interval_ms | Status refresh interval. The function waits this number of milliseconds between get_status requests to the controller. Recommended value of this parameter is 10 ms. Use values of less than 3 ms only when necessary - small refresh interval values do not significantly increase response time of the function, but they create substantially more traffic in controller-computer data channel.
  [out] | ret | RESULT_OK if controller has stopped and result of the first get_status command which returned anything other than RESULT_OK otherwise.

## ◆ command_zero()

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

  id | An identifier of a device

## ◆ enumerate_devices()

device_enumeration_t XIMC_API enumerate_devices | ( | int | enumerate_flags,
|  | const char * | hints )

Search and list of available devices.

By default, it creates a list of devices connected to this computer and presented as COM ports. Additionally, you can enable the search for network devices. Devices found in the local network will be included in the same list.
To obtain information from the collected list, use the corresponding functions with the `get_enumerate_` prefix and the received `device_enumeration` identifier.
After finishing working with the list of found devices, you should free up memory using the `free_enumerate_devices()` function.

Parameters

  [in] | enumerate_flags | a set of flags that specify search modes. Flags can be used together via bitwise "OR": `ENUMERATE_NETWORK` - enables searching for network devices. If the flag is set, network devices will be added to the general list. If the flag is not set, the list will only include devices connected to this computer. `ENUMERATE_ALL_COM` - when enabled, queries all COM port devices in the system. When disabled, queries only devices whose names match the XIMC device mask ("XIMC Motor Controller" in Windows, `/dev/ximc/` and `/dev/ttyACM/` on Linux/Mac). `ENUMERATE_PROBE` - enables checking of devices and collecting additional information (serial number, version, model, name...). If this flag is set, only devices that are guaranteed to be open will be added to the list, but devices connected via RS232 converters may not be included. If the flag is not set, the list will include more devices (in particular, devices explicitly listed in `hints` will be included), but availability and compatibility with this library is not guaranteed.
  [in] | hints | additional information to improve the search efficiency. It makes sense to use in case of complex network configuration, when automatic search may not find everything. Format - string `"key1=value1\nkey2=value2"`. Unknown keys are ignored. One key can have several values, which are listed separated by commas: `key=value1,value2,value3`. Valid keys: `addr` - list of URLs of network controllers or servers with connected controllers. The field is used together with the `ENUMERATE_NETWORK` flag. Protocols and address formats: `xi-tcp://<ip-address> - network controllers and controllers connected via Ethernet-RS232 converters. If the `ENUMERATE_PROBE` flag is not set, all listed devices will be included in the list.` `xi-net://<ip-address> - network multi-axis systems, xi-net servers. The request for information about the availability of controllers at these addresses will be made regardless of the results of the automatic network search procedure.` ``adapter_addr` - list of IP addresses of local network adapters through which the search should be performed. If the key is missing or no adapters are specified, the search is performed on all adapters.`

Returns
  ``device_enumeration` - device list identifier. Used to obtain information about devices using functions with `get_enumerate_` prefixes.`

Examples of use:
  `

      // Search for local devices without checking
      device_enumeration_t device_enumeration = enumerate_devices(0, "");
      // Search for local devices with verification
      device_enumeration_t device_enumeration = enumerate_devices(ENUMERATE_PROBE, "");
      // Fully automatic search for local and network devices
      device_enumeration_t device_enumeration = enumerate_devices(ENUMERATE_NETWORK, "");
      // Search for local and network devices
      // using the local computer adapter with the address 192.168.0.100
      // and explicit requests to the network controller with the address 192.168.0.11
      // and the xi-net server with the address 192.168.0.10
      device_enumeration_t device_enumeration = enumerate_devices(
      ENUMERATE_NETWORK,
      "addr=192.168.0.10,xi-tcp://192.168.0.11\nadapter_addr=192.168.0.100"
      );

  `

## ◆ free_enumerate_devices()

result_t XIMC_API free_enumerate_devices | ( | device_enumeration_t | device_enumeration | ) |

Free memory returned by enumerate_devices.

Parameters

  [in] | device_enumeration | opaque pointer to an enumeration device data

## ◆ get_accessories_settings()

result_t XIMC_API get_accessories_settings | ( | device_t | id,
|  | accessories_settings_t * | accessories_settings )

Deprecated.

Read additional accessory information from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | accessories_settings | structure contains information about additional accessories

## ◆ get_analog_data()

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

  | id | An identifier of a device
  [out] | analog_data | analog data coefficients

## ◆ get_bootloader_version()

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

  | id | An identifier of a device
  [out] | Major | major version
  [out] | Minor | minor version
  [out] | Release | release version

## ◆ get_brake_settings()

result_t XIMC_API get_brake_settings | ( | device_t | id,
|  | brake_settings_t * | brake_settings )

Read break control settings.

Parameters

  | id | An identifier of a device
  [out] | brake_settings | structure contains settings of brake control

## ◆ get_calibration_settings()

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

  | id | An identifier of a device
  [out] | calibration_settings | calibration settings

## ◆ get_chart_data()

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

  | id | An identifier of a device
  [out] | chart_data | structure with a snapshot of controller parameters.

## ◆ get_control_settings()

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

  | id | An identifier of a device
  [out] | control_settings | structure contains settings motor control by joystick or buttons left/right.

## ◆ get_control_settings_calb()

result_t XIMC_API get_control_settings_calb | ( | device_t | id,
|  | control_settings_calb_t * | control_settings_calb,
|  | const calibration_t * | calibration )

Read motor control settings with user units.

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

  | id | An identifier of a device
  [out] | control_settings_calb | structure contains user unit motor control settings.
  | calibration | user unit settings

## ◆ get_controller_name()

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

  | id | An identifier of a device
  [out] | controller_name | structure contains previously set user controller name

## ◆ get_ctp_settings()

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

  | id | An identifier of a device
  [out] | ctp_settings | structure contains position control settings.

## ◆ get_debug_read()

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

  | id | An identifier of a device
  [out] | debug_read | Debug data.

## ◆ get_device_count()

int XIMC_API get_device_count | ( | device_enumeration_t | device_enumeration | ) |

Get device count.

Parameters

  [in] | device_enumeration | opaque pointer to an enumeration device data

## ◆ get_device_information()

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

  | id | an identifier of device
  [out] | device_information | device information Device information.

See also
  get_device_information

## ◆ get_device_name()

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_enumeration | opaque pointer to an enumeration device data
  [in] | device_index | device index

## ◆ get_edges_settings()

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

  | id | An identifier of a device
  [out] | edges_settings | edges settings, types of borders, motor behavior and electrical behavior of limit switches

## ◆ get_edges_settings_calb()

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

  | id | An identifier of a device
  [out] | edges_settings_calb | edges settings, types of borders, motor behavior and electrical behavior of limit switches
  | calibration | user unit settings

Note
  Attention! Some parameters of the edges_settings_calb structure are corrected by the coordinate correction table.

## ◆ get_emf_settings()

result_t XIMC_API get_emf_settings | ( | device_t | id,
|  | emf_settings_t * | emf_settings )

Read electromechanical settings.

The settings are different for different stepper motors.

See also
  set_emf_settings

Parameters

  | id | An identifier of a device
  [out] | emf_settings | EMF settings

## ◆ get_encoder_information()

result_t XIMC_API get_encoder_information | ( | device_t | id,
|  | encoder_information_t * | encoder_information )

Deprecated.

Read encoder information from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | encoder_information | structure contains information about encoder

## ◆ get_encoder_settings()

result_t XIMC_API get_encoder_settings | ( | device_t | id,
|  | encoder_settings_t * | encoder_settings )

Deprecated.

Read encoder settings from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | encoder_settings | structure contains encoder settings

## ◆ get_engine_advanced_setup()

result_t XIMC_API get_engine_advanced_setup | ( | device_t | id,
|  | engine_advanced_setup_t * | engine_advanced_setup )

Read engine advanced settings.

Manufacturer only.

See also
  set_engine_advanced_setup

Parameters

  | id | An identifier of a device
  [out] | engine_advanced_setup | EAS settings

## ◆ get_engine_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

  | id | An identifier of a device
  [out] | engine_settings | engine settings

## ◆ get_engine_settings_calb()

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

  | id | An identifier of a device
  [out] | engine_settings_calb | engine settings
  | calibration | user unit settings

## ◆ get_entype_settings()

result_t XIMC_API get_entype_settings | ( | device_t | id,
|  | entype_settings_t * | entype_settings )

Return engine type and driver type.

Parameters

  | id | An identifier of a device
  [out] | entype_settings | structure contains motor type and power driver type settings

## ◆ get_enumerate_device_controller_name()

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_enumeration | opaque pointer to an enumeration device data
  [in] | device_index | device index
  [out] | controller_name | controller name

## ◆ get_enumerate_device_information()

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_enumeration | opaque pointer to an enumeration device data
  [in] | device_index | device index
  [out] | device_information | device information data

## ◆ get_enumerate_device_network_information()

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_enumeration | opaque pointer to an enumeration device data
  [in] | device_index | device index
  [out] | device_network_information | device network information data

## ◆ get_enumerate_device_serial()

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_enumeration | opaque pointer to an enumeration device data
  [in] | device_index | device index
  [out] | serial | device serial number

## ◆ get_enumerate_device_stage_name()

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_enumeration | opaque pointer to an enumeration device data
  [in] | device_index | device index
  [out] | stage_name | stage name

## ◆ get_extended_settings()

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

  | id | An identifier of a device
  [out] | extended_settings | EST settings

## ◆ get_extio_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

  | id | An identifier of a device
  [out] | extio_settings | EXTIO settings

## ◆ get_feedback_settings()

result_t XIMC_API get_feedback_settings | ( | device_t | id,
|  | feedback_settings_t * | feedback_settings )

Feedback settings.

Parameters

  | id | An identifier of a device
  [out] | IPS | number of encoder counts per shaft revolution. Range: 1..65535. The field is obsolete, it is recommended to write 0 to IPS and use the extended CountsPerTurn field. You may need to update the controller firmware to the latest version.
  [out] | FeedbackType | type of feedback
  [out] | FeedbackFlags | flags of feedback
  [out] | CountsPerTurn | number of encoder counts per shaft revolution. Range: 1..4294967295. To use the CountsPerTurn field, write 0 in the IPS field, otherwise the value from the IPS field will be used.

## ◆ get_firmware_version()

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

  | id | An identifier of a device
  [out] | Major | major version
  [out] | Minor | minor version
  [out] | Release | release version

## ◆ get_gear_information()

result_t XIMC_API get_gear_information | ( | device_t | id,
|  | gear_information_t * | gear_information )

Deprecated.

Read gear information from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | gear_information | structure contains information about step gearhead

## ◆ get_gear_settings()

result_t XIMC_API get_gear_settings | ( | device_t | id,
|  | gear_settings_t * | gear_settings )

Deprecated.

Read gear settings from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | gear_settings | structure contains step gearhead settings

## ◆ get_globally_unique_identifier()

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

  | id | An identifier of a device
  [out] | globally_unique_identifier | the result of fields 0-3 concatenated defines the unique 128-bit device identifier.

## ◆ get_hallsensor_information()

result_t XIMC_API get_hallsensor_information | ( | device_t | id,
|  | hallsensor_information_t * | hallsensor_information )

Deprecated.

Read hall sensor information from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | hallsensor_information | structure contains information about hall sensor

## ◆ get_hallsensor_settings()

result_t XIMC_API get_hallsensor_settings | ( | device_t | id,
|  | hallsensor_settings_t * | hallsensor_settings )

Deprecated.

Read hall sensor settings from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | hallsensor_settings | structure contains hall sensor settings

## ◆ get_home_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

  | id | An identifier of a device
  [out] | home_settings | calibrating position settings

## ◆ get_home_settings_calb()

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

  | id | An identifier of a device
  [out] | home_settings_calb | calibrating position settings
  | calibration | user unit settings

## ◆ get_init_random()

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

  | id | An identifier of a device
  [out] | init_random | random sequence generated by the controller

## ◆ get_joystick_settings()

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 from the DeadZone limit to the maximum deviation. Joystick positions inside DeadZone limits correspond to zero speed (a "soft stop" command is issued continuously), 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. DeadZone is defined in 0.1% units. 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

  | id | An identifier of a device
  [out] | joystick_settings | structure contains joystick settings

## ◆ get_measurements()

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

  | id | An identifier of a device
  [out] | measurements | structure with buffer and its length.

## ◆ get_motor_information()

result_t XIMC_API get_motor_information | ( | device_t | id,
|  | motor_information_t * | motor_information )

Deprecated.

Read motor information from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | motor_information | structure contains motor information

## ◆ get_motor_settings()

result_t XIMC_API get_motor_settings | ( | device_t | id,
|  | motor_settings_t * | motor_settings )

Deprecated.

Read motor settings from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | motor_settings | structure contains motor settings

## ◆ get_move_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

  | id | An identifier of a device
  [out] | move_settings | structure contains move settings: speed, acceleration, deceleration etc.

## ◆ get_move_settings_calb()

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

  | id | An identifier of a device
  [out] | move_settings_calb | structure contains move settings: speed, acceleration, deceleration etc.
  | calibration | user unit settings

## ◆ get_network_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

  DHCPEnabled | DHCP 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

## ◆ get_nonvolatile_memory()

result_t XIMC_API get_nonvolatile_memory | ( | device_t | id,
|  | nonvolatile_memory_t * | nonvolatile_memory )

Read user data from FRAM.

Parameters

  | id | An identifier of a device
  [out] | nonvolatile_memory | structure contains previously set user data.

## ◆ get_password_settings()

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

## ◆ get_pid_settings()

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

  | id | An identifier of a device
  [out] | pid_settings | PID settings

## ◆ get_position()

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

  | id | An identifier of a device
  [out] | the_get_position | structure contains motor position.

## ◆ get_position_calb()

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

  | id | An identifier of a device
  [out] | the_get_position_calb | structure contains motor position.
  | calibration | user unit settings

Note
  Attention! Some parameters of the get_position_calb structure are corrected by the coordinate correction table.

## ◆ get_power_settings()

result_t XIMC_API get_power_settings | ( | device_t | id,
|  | power_settings_t * | power_settings )

Read settings of step motor power control.

Used with a stepper motor only.

Parameters

  | id | An identifier of a device
  [out] | power_settings | structure contains settings of step motor power control

## ◆ get_secure_settings()

result_t XIMC_API get_secure_settings | ( | device_t | id,
|  | secure_settings_t * | secure_settings )

Read protection settings.

Parameters

  | id | An identifier of a device
  [out] | secure_settings | critical parameter settings to protect the hardware

See also
  status_t::flags

## ◆ get_serial_number()

result_t XIMC_API get_serial_number | ( | device_t | id,
|  | unsigned int * | SerialNumber )

Read device serial number.

Parameters

  | id | An identifier of a device
  [out] | SerialNumber | serial number

## ◆ get_stage_information()

result_t XIMC_API get_stage_information | ( | device_t | id,
|  | stage_information_t * | stage_information )

Deprecated.

Read stage information from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | stage_information | structure contains stage information

## ◆ get_stage_name()

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

  | id | An identifier of a device
  [out] | stage_name | structure contains the previously set user's stage name.

## ◆ get_stage_settings()

result_t XIMC_API get_stage_settings | ( | device_t | id,
|  | stage_settings_t * | stage_settings )

Deprecated.

Read stage settings from the EEPROM.

Parameters

  | id | An identifier of a device
  [out] | stage_settings | structure contains stage settings

## ◆ get_status()

result_t XIMC_API get_status | ( | device_t | id,
|  | status_t * | status )

Return device state.

Parameters

  | id | an identifier of device
  [out] | status | structure with snapshot of controller status Device state. Useful structure that contains current controller status, including speed, position and boolean flags.

See also
  get_status

## ◆ get_status_calb()

result_t XIMC_API get_status_calb | ( | device_t | id,
|  | status_calb_t * | status,
|  | const calibration_t * | calibration )

Return device state.

Parameters

  | id | an identifier of device
  [out] | status | structure with snapshot of controller status
  | calibration | user unit settings Calibrated device state. Useful structure that contains current controller status, including speed, position and boolean flags.

See also
  get_status

## ◆ get_sync_in_settings()

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

  | id | An identifier of a device
  [out] | sync_in_settings | synchronization settings

## ◆ get_sync_in_settings_calb()

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

  | id | An identifier of a device
  [out] | sync_in_settings_calb | synchronization settings
  | calibration | user unit settings

## ◆ get_sync_out_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

  | id | An identifier of a device
  [out] | sync_out_settings | synchronization settings

## ◆ get_sync_out_settings_calb()

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

  | id | An identifier of a device
  [out] | sync_out_settings_calb | synchronization settings
  | calibration | user unit settings

## ◆ get_uart_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

  | Speed | UART speed
  [out] | uart_settings | UART settings

## ◆ goto_firmware()

result_t XIMC_API goto_firmware | ( | device_t | id,
|  | uint8_t * | ret )

Reboot to firmware

Parameters

  | id | an identifier of device
  [out] | ret | RESULT_OK, if reboot to firmware is possible. Reboot is done after reply to this command. RESULT_NO_FIRMWARE, if firmware is not found. RESULT_ALREADY_IN_FIRMWARE, if this command was sent when controller is already in firmware.

## ◆ has_firmware()

result_t XIMC_API has_firmware | ( | const char * | uri,
|  | uint8_t * | ret )

Check for firmware on device

Parameters

  | uri | a uri of device
  [out] | ret | non-zero if firmware existed

## ◆ logging_callback_stderr_narrow()

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

  loglevel | a loglevel
  message | a message

## ◆ logging_callback_stderr_wide()

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

  loglevel | a loglevel
  message | a message

## ◆ msec_sleep()

void XIMC_API msec_sleep | ( | unsigned int | msec | ) |

Sleeps for a specified amount of time

Parameters

  msec | time in milliseconds

## ◆ open_device()

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 TCP protocol, use "xi-tcp://<ip/host>:<port>. For example, "xi-tcp://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.

## ◆ probe_device()

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

## ◆ reset_locks()

result_t XIMC_API reset_locks | ( |  | ) |

Resets the error of incorrect data transmission.

## ◆ service_command_updf()

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.

## ◆ set_accessories_settings()

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

  | id | An identifier of a device
  [in] | accessories_settings | structure contains information about additional accessories

## ◆ set_brake_settings()

result_t XIMC_API set_brake_settings | ( | device_t | id,
|  | const brake_settings_t * | brake_settings )

Set brake control settings.

Parameters

  | id | An identifier of a device
  [in] | brake_settings | structure contains brake control settings

## ◆ set_calibration_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

  | id | An identifier of a device
  [in] | calibration_settings | calibration settings

## ◆ set_control_settings()

result_t XIMC_API set_control_settings | ( | device_t | id,
|  | const control_settings_t * | control_settings )

Set 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

  | id | An identifier of a device
  [in] | control_settings | structure contains motor control settings.

## ◆ set_control_settings_calb()

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 with user units.

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

  | id | An identifier of a device
  [in] | control_settings_calb | structure contains motor control settings.
  | calibration | user unit settings

## ◆ set_controller_name()

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

  | id | An identifier of a device
  [in] | controller_name | structure contains the previously set user's controller name

## ◆ set_correction_table()

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

  | id | an 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

## ◆ set_ctp_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).

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

  | id | An identifier of a device
  [in] | ctp_settings | structure contains position control settings.

## ◆ set_debug_write()

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

  | id | An identifier of a device
  [in] | debug_write | Debug data.

## ◆ set_edges_settings()

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

  | id | An identifier of a device
  [in] | edges_settings | edges settings, specify types of borders, motor behavior and electrical behavior of limit switches

## ◆ set_edges_settings_calb()

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

  | id | An identifier of a device
  [in] | edges_settings_calb | edges settings, specify types of borders, motor behavior and electrical behavior of limit switches
  | calibration | user unit settings

Note
  Attention! Some parameters of the edges_settings_calb structure are corrected by the coordinate correction table.

## ◆ set_emf_settings()

result_t XIMC_API set_emf_settings | ( | device_t | id,
|  | const emf_settings_t * | emf_settings )

Set electromechanical coefficients.

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

See also
  get_emf_settings

Parameters

  | id | An identifier of a device
  [in] | emf_settings | EMF settings

## ◆ set_encoder_information()

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

  | id | An identifier of a device
  [in] | encoder_information | structure contains information about encoder

## ◆ set_encoder_settings()

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

  | id | An identifier of a device
  [in] | encoder_settings | structure contains encoder settings

## ◆ set_engine_advanced_setup()

result_t XIMC_API set_engine_advanced_setup | ( | device_t | id,
|  | const engine_advanced_setup_t * | engine_advanced_setup )

Set engine advanced settings.

Manufacturer only.

See also
  get_engine_advanced_setup

Parameters

  | id | An identifier of a device
  [in] | engine_advanced_setup | EAS settings

## ◆ set_engine_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

  | id | An identifier of a device
  [in] | engine_settings | engine settings

## ◆ set_engine_settings_calb()

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

  | id | An identifier of a device
  [in] | engine_settings_calb | engine settings
  | calibration | user unit settings

## ◆ set_entype_settings()

result_t XIMC_API set_entype_settings | ( | device_t | id,
|  | const entype_settings_t * | entype_settings )

Set engine type and driver type.

Parameters

  | id | An identifier of a device
  [in] | entype_settings | structure contains motor type and power driver type settings

## ◆ set_extended_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

  | id | An identifier of a device
  [in] | extended_settings | EST settings

## ◆ set_extio_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

  | id | An identifier of a device
  [in] | extio_settings | EXTIO settings

## ◆ set_feedback_settings()

result_t XIMC_API set_feedback_settings | ( | device_t | id,
|  | const feedback_settings_t * | feedback_settings )

Feedback settings.

Parameters

  | id | An identifier of a device
  [in] | IPS | number of encoder counts per shaft revolution. Range: 1..65535. The field is obsolete, it is recommended to write 0 to IPS and use the extended CountsPerTurn field. You may need to update the controller firmware to the latest version.
  [in] | FeedbackType | type of feedback
  [in] | FeedbackFlags | flags of feedback
  [in] | CountsPerTurn | number of encoder counts per shaft revolution. Range: 1..4294967295. To use the CountsPerTurn field, write 0 in the IPS field, otherwise the value from the IPS field will be used.

## ◆ set_gear_information()

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

  | id | An identifier of a device
  [in] | gear_information | structure contains information about step gearhead

## ◆ set_gear_settings()

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

  | id | An identifier of a device
  [in] | gear_settings | structure contains step gearhead settings

## ◆ set_hallsensor_information()

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

  | id | An identifier of a device
  [in] | hallsensor_information | structure contains information about hall sensor

## ◆ set_hallsensor_settings()

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

  | id | An identifier of a device
  [in] | hallsensor_settings | structure contains hall sensor settings

## ◆ set_home_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

  | id | An identifier of a device
  [in] | home_settings | calibrating position settings

## ◆ set_home_settings_calb()

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

  | id | An identifier of a device
  [in] | home_settings_calb | calibrating position settings
  | calibration | user unit settings

## ◆ set_joystick_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 from the DeadZone limit to the maximum deviation. Joystick positions inside DeadZone limits correspond to zero speed (a "soft stop" command is issued continuously), 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. DeadZone is defined in 0.1% units. 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

  | id | An identifier of a device
  [in] | joystick_settings | structure contains joystick settings

## ◆ set_logging_callback()

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_callback | a callback for log messages

## ◆ set_motor_information()

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

  | id | An identifier of a device
  [in] | motor_information | structure contains motor information

## ◆ set_motor_settings()

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

  | id | An identifier of a device
  [in] | motor_settings | structure contains motor information

## ◆ set_move_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.).

Parameters

  | id | An identifier of a device
  [in] | move_settings | structure contains move settings: speed, acceleration, deceleration etc.

## ◆ set_move_settings_calb()

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

  | id | An identifier of a device
  [in] | move_settings_calb | structure contains move settings: speed, acceleration, deceleration etc.
  | calibration | user unit settings

## ◆ set_network_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

  DHCPEnabled | DHCP 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

## ◆ set_nonvolatile_memory()

result_t XIMC_API set_nonvolatile_memory | ( | device_t | id,
|  | const nonvolatile_memory_t * | nonvolatile_memory )

Write user data into the FRAM.

Parameters

  | id | An identifier of a device
  [in] | nonvolatile_memory | user data.

## ◆ set_password_settings()

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

## ◆ set_pid_settings()

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

  | id | An identifier of a device
  [in] | pid_settings | PID settings

## ◆ set_position()

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

  | id | An identifier of a device
  [out] | the_set_position | structure contains motor position.

## ◆ set_position_calb()

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

  | id | An identifier of a device
  [out] | the_set_position_calb | structure contains motor position.
  | calibration | user unit settings

## ◆ set_power_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

  | id | An identifier of a device
  [in] | power_settings | structure contains settings of step motor power control

## ◆ set_secure_settings()

result_t XIMC_API set_secure_settings | ( | device_t | id,
|  | const secure_settings_t * | secure_settings )

Set protection settings.

Parameters

  id | An identifier of a device
  secure_settings | structure with secure data

See also
  status_t::flags

## ◆ set_serial_number()

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. Used from the loader only.

Parameters

  | id | An identifier of a device
  [in] | serial_number | structure contains new serial number and secret key.

## ◆ set_stage_information()

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

  | id | An identifier of a device
  [in] | stage_information | structure contains stage information

## ◆ set_stage_name()

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

  | id | An identifier of a device
  [in] | stage_name | structure contains the previously set user's stage name.

## ◆ set_stage_settings()

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

  | id | An identifier of a device
  [in] | stage_settings | structure contains stage settings

## ◆ set_sync_in_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

  | id | An identifier of a device
  [in] | sync_in_settings | synchronization settings

## ◆ set_sync_in_settings_calb()

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

  | id | An identifier of a device
  [in] | sync_in_settings_calb | synchronization settings
  | calibration | user unit settings

## ◆ set_sync_out_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

  | id | An identifier of a device
  [in] | sync_out_settings | synchronization settings

## ◆ set_sync_out_settings_calb()

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

  | id | An identifier of a device
  [in] | sync_out_settings_calb | synchronization settings
  | calibration | user unit settings

## ◆ set_uart_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

  | Speed | UART speed
  [in] | uart_settings | UART settings

## ◆ write_key()

result_t XIMC_API write_key | ( | const char * | uri,
|  | uint8_t * | key )

Write controller key.

Can be used by manufacturer only

Parameters

  | uri | a uri of device
  [in] | key | protection key. Range: 0..4294967295

## ◆ ximc_version()

void XIMC_API ximc_version | ( | char * | version | ) |

Returns a library version

Parameters

  version | a buffer to hold a version string, 32 bytes is enough