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

Header file for libximc library. More...

Go to the source code of this file.

Data Structures

struct  calibration_t
 Calibration companion structure. More...
struct  feedback_settings_t
 Feedback settings. More...
struct  home_settings_t
 Position calibration settings. More...
struct  home_settings_calb_t
struct  move_settings_t
 Move settings. More...
struct  move_settings_calb_t
struct  engine_settings_t
 Engine settings. More...
struct  engine_settings_calb_t
struct  entype_settings_t
 Engine type and driver type settings. More...
struct  power_settings_t
 Step motor power settings. More...
struct  secure_settings_t
 This structure contains raw analog data from ADC embedded on board. More...
struct  edges_settings_t
 Edges settings. More...
struct  edges_settings_calb_t
struct  pid_settings_t
 PID settings. More...
struct  sync_in_settings_t
 Synchronization settings. More...
struct  sync_in_settings_calb_t
struct  sync_out_settings_t
 Synchronization settings. More...
struct  sync_out_settings_calb_t
struct  extio_settings_t
 EXTIO settings. More...
struct  brake_settings_t
 Brake settings. More...
struct  control_settings_t
 Control settings. More...
struct  control_settings_calb_t
struct  joystick_settings_t
 Joystick settings. More...
struct  ctp_settings_t
 Control position settings(is only used with stepper motor). More...
struct  uart_settings_t
 UART settings. More...
struct  controller_name_t
 Controller user name and flags of setting. More...
struct  add_sync_in_action_t
 This command adds one element of the FIFO commands. More...
struct  add_sync_in_action_calb_t
struct  get_position_t
 Position information. More...
struct  get_position_calb_t
struct  set_position_t
 Position information. More...
struct  set_position_calb_t
struct  status_t
 Device state. More...
struct  status_calb_t
struct  chart_data_t
 Additional device state. More...
struct  device_information_t
 Read command controller information. More...
struct  serial_number_t
 Serial number structure. More...
struct  analog_data_t
 Analog data. More...
struct  debug_read_t
 Debug data. More...
struct  stage_name_t
 Stage user name. More...
struct  stage_information_t
 Stage information. More...
struct  stage_settings_t
 Stage settings. More...
struct  motor_information_t
 motor information. More...
struct  motor_settings_t
 motor settings. More...
struct  encoder_information_t
 Encoder information. More...
struct  encoder_settings_t
 Encoder settings. More...
struct  hallsensor_information_t
 Hall sensor information. More...
struct  hallsensor_settings_t
 Hall sensor settings. More...
struct  gear_information_t
 Gear information. More...
struct  gear_settings_t
 Gear setings. More...
struct  accessories_settings_t
 Additional accessories information. More...

Macros

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

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

Specify move states.

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

Specify power states.

See also:
status_t::power_state
get_status
status_t::PWRSts, get_status_impl
#define PWR_STATE_UNKNOWN   0x00
 Unknown state, should never happen.
#define PWR_STATE_OFF   0x01
 Motor windings are disconnected from the driver.
#define PWR_STATE_NORM   0x03
 Motor windings are powered by nominal current.
#define PWR_STATE_REDUCT   0x04
 Motor windings are powered by reduced current to lower power consumption.
#define PWR_STATE_MAX   0x05
 Motor windings are powered by maximum current driver can provide at this voltage.
Status flags

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

See also:
status_t::flags
get_status
status_t::GPIOFlags, get_status_impl
#define STATE_CONTR   0x0003F
 Flags of controller states.
#define STATE_ERRC   0x00001
 Command error encountered.
#define STATE_ERRD   0x00002
 Data integrity error encountered.
#define STATE_ERRV   0x00004
 Value error encountered.
#define STATE_EEPROM_CONNECTED   0x00010
 EEPROM with settings is connected.
#define STATE_SECUR   0x3FFC0
 Flags of security.
#define STATE_ALARM   0x00040
 Controller is in alarm state indicating that something dangerous had happened.
#define STATE_CTP_ERROR   0x00080
 Control position error(is only used with stepper motor).
#define STATE_POWER_OVERHEAT   0x00100
 Power driver overheat.
#define STATE_CONTROLLER_OVERHEAT   0x00200
 Controller overheat.
#define STATE_OVERLOAD_POWER_VOLTAGE   0x00400
 Power voltage exceeds safe limit.
#define STATE_OVERLOAD_POWER_CURRENT   0x00800
 Power current exceeds safe limit.
#define STATE_OVERLOAD_USB_VOLTAGE   0x01000
 USB voltage exceeds safe limit.
#define STATE_LOW_USB_VOLTAGE   0x02000
 USB voltage is insufficient for normal operation.
#define STATE_OVERLOAD_USB_CURRENT   0x04000
 USB current exceeds safe limit.
#define STATE_BORDERS_SWAP_MISSET   0x08000
 Engine stuck at the wrong edge.
#define STATE_LOW_POWER_VOLTAGE   0x10000
 Power voltage is lower than Low Voltage Protection limit.
#define STATE_H_BRIDGE_FAULT   0x20000
 Signal from the driver that fault happened.
#define STATE_DIG_SIGNAL   0xFFFF
 Flags of digital signals.
#define STATE_RIGHT_EDGE   0x0001
 Engine stuck at the right edge.
#define STATE_LEFT_EDGE   0x0002
 Engine stuck at the left edge.
#define STATE_BUTTON_RIGHT   0x0004
 Button "right" state (1 if pressed).
#define STATE_BUTTON_LEFT   0x0008
 Button "left" state (1 if pressed).
#define STATE_GPIO_PINOUT   0x0010
 External GPIO works as Out, if flag set; otherwise works as In.
#define STATE_GPIO_LEVEL   0x0020
 State of external GPIO pin.
#define STATE_HALL_A   0x0040
 State of Hall_a pin.
#define STATE_HALL_B   0x0080
 State of Hall_b pin.
#define STATE_HALL_C   0x0100
 State of Hall_c pin.
#define STATE_BRAKE   0x0200
 State of Brake pin.
#define STATE_REV_SENSOR   0x0400
 State of Revolution sensor pin.
#define STATE_SYNC_INPUT   0x0800
 State of Sync input pin.
#define STATE_SYNC_OUTPUT   0x1000
 State of Sync output pin.
#define STATE_ENC_A   0x2000
 State of encoder A pin.
#define STATE_ENC_B   0x4000
 State of encoder B pin.
Encoder state

Encoder state returned by device query.

See also:
status_t::encsts
get_status
status_t::EncSts, get_status_impl
#define ENC_STATE_ABSENT   0x00
 Encoder is absent.
#define ENC_STATE_UNKNOWN   0x01
 Encoder state is unknown.
#define ENC_STATE_MALFUNC   0x02
 Encoder is connected and malfunctioning.
#define ENC_STATE_REVERS   0x03
 Encoder is connected and operational but counts in otyher direction.
#define ENC_STATE_OK   0x04
 Encoder is connected and working properly.
Winding state

Motor winding state returned by device query.

See also:
status_t::windsts
get_status
status_t::WindSts, get_status_impl
#define WIND_A_STATE_ABSENT   0x00
 Winding A is disconnected.
#define WIND_A_STATE_UNKNOWN   0x01
 Winding A state is unknown.
#define WIND_A_STATE_MALFUNC   0x02
 Winding A is short-circuited.
#define WIND_A_STATE_OK   0x03
 Winding A is connected and working properly.
#define WIND_B_STATE_ABSENT   0x00
 Winding B is disconnected.
#define WIND_B_STATE_UNKNOWN   0x10
 Winding B state is unknown.
#define WIND_B_STATE_MALFUNC   0x20
 Winding B is short-circuited.
#define WIND_B_STATE_OK   0x30
 Winding B is connected and working properly.
Move command state

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

See also:
status_t::mvcmdsts
get_status
status_t::MvCmdSts, get_status_impl
#define MVCMD_NAME_BITS   0x3F
 Move command bit mask.
#define MVCMD_UKNWN   0x00
 Unknown command.
#define MVCMD_MOVE   0x01
 Command move.
#define MVCMD_MOVR   0x02
 Command movr.
#define MVCMD_LEFT   0x03
 Command left.
#define MVCMD_RIGHT   0x04
 Command rigt.
#define MVCMD_STOP   0x05
 Command stop.
#define MVCMD_HOME   0x06
 Command home.
#define MVCMD_LOFT   0x07
 Command loft.
#define MVCMD_SSTP   0x08
 Command soft stop.
#define MVCMD_ERROR   0x40
 Finish state (1 - move command have finished with an error, 0 - move command have finished correctly).
#define MVCMD_RUNNING   0x80
 Move command state (0 - move command have finished, 1 - move command is being executed).
Flags of engine settings

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

See also:
engine_settings_t::flags
set_engine_settings
get_engine_settings
engine_settings_t::EngineFlags, get_engine_settings, set_engine_settings
#define ENGINE_REVERSE   0x01
 Reverse flag.
#define ENGINE_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
 Maxumum motor voltage limit enable flag(is only used with DC motor).
#define ENGINE_LIMIT_CURR   0x40
 Maxumum motor current limit enable flag(is only used with DC motor).
#define ENGINE_LIMIT_RPM   0x80
 Maxumum motor speed limit enable flag.
Flags of microstep mode

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

See also:
engine_settings_t::flags
set_engine_settings
get_engine_settings
engine_settings_t::MicrostepMode, get_engine_settings, set_engine_settings
#define MICROSTEP_MODE_FULL   0x01
 Full step mode.
#define MICROSTEP_MODE_FRAC_2   0x02
 1/2 step mode.
#define MICROSTEP_MODE_FRAC_4   0x03
 1/4 step mode.
#define MICROSTEP_MODE_FRAC_8   0x04
 1/8 step mode.
#define MICROSTEP_MODE_FRAC_16   0x05
 1/16 step mode.
#define MICROSTEP_MODE_FRAC_32   0x06
 1/32 step mode.
#define MICROSTEP_MODE_FRAC_64   0x07
 1/64 step mode.
#define MICROSTEP_MODE_FRAC_128   0x08
 1/128 step mode.
#define MICROSTEP_MODE_FRAC_256   0x09
 1/256 step mode.
Flags of engine type

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

See also:
engine_settings_t::flags
set_entype_settings
get_entype_settings
entype_settings_t::EngineType, get_entype_settings, set_entype_settings
#define ENGINE_TYPE_NONE   0x00
 A value that shouldn't be used.
#define ENGINE_TYPE_DC   0x01
 DC motor.
#define ENGINE_TYPE_2DC   0x02
 2 DC motors.
#define ENGINE_TYPE_STEP   0x03
 Step motor.
#define ENGINE_TYPE_TEST   0x04
 Duty cycle are fixed.
#define ENGINE_TYPE_BRUSHLESS   0x05
 Brushless motor.
Flags of driver type

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

See also:
engine_settings_t::flags
set_entype_settings
get_entype_settings
entype_settings_t::DriverType, get_entype_settings, set_entype_settings
#define DRIVER_TYPE_DISCRETE_FET   0x01
 Driver with discrete FET keys.
#define DRIVER_TYPE_INTEGRATE   0x02
 Driver with integrated IC.
#define DRIVER_TYPE_EXTERNAL   0x03
 External driver.
Flags of power settings of stepper motor

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

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

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

See also:
secure_settings_t::flags
get_secure_settings
set_secure_settings
secure_settings_t::Flags, get_secure_settings, set_secure_settings
#define ALARM_ON_DRIVER_OVERHEATING   0x01
 If this flag is set enter Alarm state on driver overheat signal.
#define LOW_UPWR_PROTECTION   0x02
 If this flag is set turn off motor when voltage is lower than LowUpwrOff.
#define H_BRIDGE_ALERT   0x04
 If this flag is set then turn off the power unit with a signal problem in one of the transistor bridge.
#define ALARM_ON_BORDERS_SWAP_MISSET   0x08
 If this flag is set enter Alarm state on borders swap misset.
#define ALARM_FLAGS_STICKING   0x10
 If this flag is set only a STOP command can turn all alarms to 0.
#define USB_BREAK_RECONNECT   0x20
 If this flag is set USB brake reconnect module will be enable.
Position setting flags

Flags used in setting of position.

See also:
get_position
set_position
set_position_t::PosFlags, set_position
#define SETPOS_IGNORE_POSITION   0x01
 Will not reload position in steps/microsteps if this flag is set.
#define SETPOS_IGNORE_ENCODER   0x02
 Will not reload encoder state if this flag is set.
Feedback type.
#define FEEDBACK_ENCODER   0x01
 Feedback by encoder.
#define FEEDBACK_ENCODERHALL   0x03
 Feedback by Hall detector.
#define FEEDBACK_EMF   0x04
 Feedback by EMF.
#define FEEDBACK_NONE   0x05
 Feedback is absent.
Describes feedback flags.
#define FEEDBACK_ENC_REVERSE   0x01
 Reverse count of encoder.
#define FEEDBACK_HALL_REVERSE   0x02
 Reverce count position on the Hall sensor.
Flags for synchronization input setup

See also:
sync_settings_t::syncin_flags
get_sync_settings
set_sync_settings
sync_in_settings_t::SyncInFlags, get_sync_in_settings, set_sync_in_settings
#define SYNCIN_ENABLED   0x01
 Synchronization in mode is enabled, if this flag is set.
#define SYNCIN_INVERT   0x02
 Trigger on falling edge if flag is set, on rising edge otherwise.
#define SYNCIN_GOTOPOSITION   0x04
 The engine is go to position specified in Position and uPosition, if this flag is set.
Flags of synchronization output

See also:
sync_settings_t::syncout_flags
get_sync_settings
set_sync_settings
sync_out_settings_t::SyncOutFlags, get_sync_out_settings, set_sync_out_settings
#define SYNCOUT_ENABLED   0x01
 Synchronization out pin follows the synchronization logic, if set.
#define SYNCOUT_STATE   0x02
 When output state is fixed by negative SYNCOUT_ENABLED flag, the pin state is in accordance with this flag state.
#define SYNCOUT_INVERT   0x04
 Low level is active, if set, and high level is active otherwise.
#define SYNCOUT_IN_STEPS   0x08
 Use motor steps/encoder pulses instead of milliseconds for output pulse generation if the flag is set.
#define SYNCOUT_ONSTART   0x10
 Generate synchronization pulse when movement starts.
#define SYNCOUT_ONSTOP   0x20
 Generate synchronization pulse when movement stops.
#define SYNCOUT_ONPERIOD   0x40
 Generate synchronization pulse every SyncOutPeriod encoder pulses.
External IO setup flags
#define EXTIO_SETUP_OUTPUT   0x01
 EXTIO works as output if flag is set, works as input otherwise.
#define EXTIO_SETUP_INVERT   0x02
 Interpret EXTIO states and fronts inverted if flag is set.
External IO mode flags
#define EXTIO_SETUP_MODE_IN_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_OUT_OFF   0x00
 EXTIO pin always set in inactive state.
#define EXTIO_SETUP_MODE_OUT_ON   0x10
 EXTIO pin always set in active state.
#define EXTIO_SETUP_MODE_OUT_MOVING   0x20
 EXTIO pin stays active during moving state.
#define EXTIO_SETUP_MODE_OUT_ALARM   0x30
 EXTIO pin stays active during Alarm state.
#define EXTIO_SETUP_MODE_OUT_MOTOR_ON   0x40
 EXTIO pin stays active when windings are powered.
#define EXTIO_SETUP_MODE_OUT_MOTOR_FOUND   0x50
 EXTIO pin stays active when motor is connected (first winding).
Border flags

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

See also:
get_edges_settings
set_edges_settings
edges_settings_t::BorderFlags, get_edges_settings, set_edges_settings
#define BORDER_IS_ENCODER   0x01
 Borders are fixed by predetermined encoder values, if set; borders position on limit switches, if not set.
#define BORDER_STOP_LEFT   0x02
 Motor should stop on left border.
#define BORDER_STOP_RIGHT   0x04
 Motor should stop on right border.
#define BORDERS_SWAP_MISSET_DETECTION   0x08
 Motor should stop on both borders.
Limit switches flags

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

See also:
get_edges_settings
set_edges_settings
edges_settings_t::EnderFlags, get_edges_settings, set_edges_settings
#define ENDER_SWAP   0x01
 First limit switch on the right side, if set; otherwise on the left side.
#define ENDER_SW1_ACTIVE_LOW   0x02
 1 - Limit switch connnected to pin SW1 is triggered by a low level on pin.
#define ENDER_SW2_ACTIVE_LOW   0x04
 1 - Limit switch connnected to pin SW2 is triggered by a low level on pin.
Brake settings flags

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

See also:
get_brake_settings
set_brake_settings
brake_settings_t::BrakeFlags, get_brake_settings, set_brake_settings
#define BRAKE_ENABLED   0x01
 Brake control is enabled, if this flag is set.
#define BRAKE_ENG_PWROFF   0x02
 Brake turns off power of step motor, if this flag is set.
Control flags

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

See also:
get_control_settings
set_control_settings
control_settings_t::Flags, get_control_settings, set_control_settings
#define CONTROL_MODE_BITS   0x03
 Bits to control engine by joystick or buttons.
#define CONTROL_MODE_OFF   0x00
 Control is disabled.
#define CONTROL_MODE_JOY   0x01
 Control by joystick.
#define CONTROL_MODE_LR   0x02
 Control by left/right buttons.
#define CONTROL_BTN_LEFT_PUSHED_OPEN   0x04
 Pushed left button corresponds to open contact, if this flag is set.
#define CONTROL_BTN_RIGHT_PUSHED_OPEN   0x08
 Pushed right button corresponds to open contact, if this flag is set.
Joystick flags
#define JOY_REVERSE   0x01
 Joystick action is reversed.
Position control flags

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

See also:
get_ctp_settings
set_ctp_settings
ctp_settings_t::CTPFlags, get_ctp_settings, set_ctp_settings
#define CTP_ENABLED   0x01
 Position control is enabled, if flag set.
#define CTP_BASE   0x02
 Position control is based on revolution sensor, if this flag is set; otherwise it is based on encoder.
#define CTP_ALARM_ON_ERROR   0x04
 Set ALARM on mismatch, if flag set.
#define REV_SENS_INV   0x08
 Sensor is active when it 0 and invert makes active level 1.
Home settings flags

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

See also:
get_home_setting s
set_home_settings
command_home
home_settings_t::HomeFlags, get_home_settings, set_home_settings
#define HOME_DIR_FIRST   0x01
 Flag defines direction of 1st motion after execution of home command.
#define HOME_DIR_SECOND   0x02
 Flag defines direction of 2nd motion.
#define HOME_MV_SEC_EN   0x04
 Use the second phase of calibration to the home position, if set; otherwise the second phase is skipped.
#define HOME_HALF_MV   0x08
 If the flag is set, the stop signals are ignored in start of second movement the first half-turn.
#define HOME_STOP_FIRST_BITS   0x30
 Bits of the first stop selector.
#define HOME_STOP_FIRST_REV   0x10
 First motion stops by revolution sensor.
#define HOME_STOP_FIRST_SYN   0x20
 First motion stops by synchronization input.
#define HOME_STOP_FIRST_LIM   0x30
 First motion stops by limit switch.
#define HOME_STOP_SECOND_BITS   0xC0
 Bits of the second stop selector.
#define HOME_STOP_SECOND_REV   0x40
 Second motion stops by revolution sensor.
#define HOME_STOP_SECOND_SYN   0x80
 Second motion stops by synchronization input.
#define HOME_STOP_SECOND_LIM   0xC0
 Second motion stops by limit switch.
UART parity flags
#define UART_PARITY_BITS   0x03
 Bits of the parity.
#define UART_PARITY_BIT_EVEN   0x00
 Parity bit 1, if even.
#define UART_PARITY_BIT_ODD   0x01
 Parity bit 1, if odd.
#define UART_PARITY_BIT_SPACE   0x02
 Parity bit always 0.
#define UART_PARITY_BIT_MARK   0x03
 Parity bit always 1.
#define UART_PARITY_BIT_USE   0x04
 None parity.
#define UART_STOP_BIT   0x08
 If set - one stop bit, else two stop bit.
Motor Type flags
#define MOTOR_TYPE_UNKNOWN   0x00
 Unknown type of engine.
#define MOTOR_TYPE_STEP   0x01
 Step engine.
#define MOTOR_TYPE_DC   0x02
 DC engine.
#define MOTOR_TYPE_BLDC   0x03
 BLDC engine.
Encoder settings flags
#define ENCSET_DIFFERENTIAL_OUTPUT   0x001
 If flag is set the encoder has differential output, else single ended output.
#define ENCSET_PUSHPULL_OUTPUT   0x004
 If flag is set the encoder has push-pull output, else open drain output.
#define ENCSET_INDEXCHANNEL_PRESENT   0x010
 If flag is set the encoder has index channel, else encoder hasn`t it.
#define ENCSET_REVOLUTIONSENSOR_PRESENT   0x040
 If flag is set the encoder has revolution sensor, else encoder hasn`t it.
#define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH   0x100
 If flag is set the revolution sensor active state is high logic state, else active state is low logic state.
Magnetic brake settings flags
#define MB_AVAILABLE   0x01
 If flag is set the magnetic brake is available.
#define MB_POWERED_HOLD   0x02
 If this flag is set the magnetic brake is on when powered.
Temperature sensor settings flags
#define TS_TYPE_BITS   0x07
 Bits of the temperature sensor type.
#define TS_TYPE_UNKNOWN   0x00
 Unknow type of sensor.
#define TS_TYPE_THERMOCOUPLE   0x01
 Thermocouple.
#define TS_TYPE_SEMICONDUCTOR   0x02
 The semiconductor temperature sensor.
#define TS_AVAILABLE   0x08
 If flag is set the temperature sensor is available.
#define LS_ON_SW1_AVAILABLE   0x01
 If flag is set the limit switch connnected to pin SW1 is available.
#define LS_ON_SW2_AVAILABLE   0x02
 If flag is set the limit switch connnected to pin SW2 is available.
#define LS_SW1_ACTIVE_LOW   0x04
 If flag is set the limit switch connnected to pin SW1 is triggered by a low level on pin.
#define LS_SW2_ACTIVE_LOW   0x08
 If flag is set the limit switch connnected to pin SW2 is triggered by a low level on pin.
#define LS_SHORTED   0x10
 If flag is set the Limit switches is shorted.

Typedefs

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

Functions

Controller settings setup

Functions for adjusting engine read/write almost all controller settings.

result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t *feedback_settings)
 Set feedback settings.
result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t *feedback_settings)
 Read feedback settings.
result_t XIMC_API set_home_settings (device_t id, const home_settings_t *home_settings)
 Set home settings.
result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t *home_settings_calb, const calibration_t *calibration)
result_t XIMC_API get_home_settings (device_t id, home_settings_t *home_settings)
 Read home settings.
result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t *home_settings_calb, const calibration_t *calibration)
result_t XIMC_API set_move_settings (device_t id, const move_settings_t *move_settings)
 Set command setup movement (speed, acceleration, threshold and etc).
result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t *move_settings_calb, const calibration_t *calibration)
result_t XIMC_API get_move_settings (device_t id, move_settings_t *move_settings)
 Read command setup movement (speed, acceleration, threshold and etc).
result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t *move_settings_calb, const calibration_t *calibration)
result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t *engine_settings)
 Set engine settings.
result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t *engine_settings_calb, const calibration_t *calibration)
result_t XIMC_API get_engine_settings (device_t id, engine_settings_t *engine_settings)
 Read engine settings.
result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t *engine_settings_calb, const calibration_t *calibration)
result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t *entype_settings)
 Set engine type and driver type.
result_t XIMC_API get_entype_settings (device_t id, entype_settings_t *entype_settings)
 Return engine type and driver type.
result_t XIMC_API set_power_settings (device_t id, const power_settings_t *power_settings)
 Set settings of step motor power control.
result_t XIMC_API get_power_settings (device_t id, power_settings_t *power_settings)
 Read settings of step motor power control.
result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t *secure_settings)
 Set protection settings.
result_t XIMC_API get_secure_settings (device_t id, secure_settings_t *secure_settings)
 Read protection settings.
result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t *edges_settings)
 Set border and limit switches settings.
result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t *edges_settings_calb, const calibration_t *calibration)
result_t XIMC_API get_edges_settings (device_t id, edges_settings_t *edges_settings)
 Read border and limit switches settings.
result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t *edges_settings_calb, const calibration_t *calibration)
result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t *pid_settings)
 Set PID settings.
result_t XIMC_API get_pid_settings (device_t id, pid_settings_t *pid_settings)
 Read PID settings.
result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t *sync_in_settings)
 Set input synchronization settings.
result_t XIMC_API set_sync_in_settings_calb (device_t id, const sync_in_settings_calb_t *sync_in_settings_calb, const calibration_t *calibration)
result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t *sync_in_settings)
 Read input synchronization settings.
result_t XIMC_API get_sync_in_settings_calb (device_t id, sync_in_settings_calb_t *sync_in_settings_calb, const calibration_t *calibration)
result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t *sync_out_settings)
 Set output synchronization settings.
result_t XIMC_API set_sync_out_settings_calb (device_t id, const sync_out_settings_calb_t *sync_out_settings_calb, const calibration_t *calibration)
result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t *sync_out_settings)
 Read output synchronization settings.
result_t XIMC_API get_sync_out_settings_calb (device_t id, sync_out_settings_calb_t *sync_out_settings_calb, const calibration_t *calibration)
result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t *extio_settings)
 Set EXTIO settings.
result_t XIMC_API get_extio_settings (device_t id, extio_settings_t *extio_settings)
 Read EXTIO settings.
result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t *brake_settings)
 Set settings of brake control.
result_t XIMC_API get_brake_settings (device_t id, brake_settings_t *brake_settings)
 Read settings of brake control.
result_t XIMC_API set_control_settings (device_t id, const control_settings_t *control_settings)
 Set settings of motor control.
result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t *control_settings_calb, const calibration_t *calibration)
result_t XIMC_API get_control_settings (device_t id, control_settings_t *control_settings)
 Read settings of motor control.
result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t *control_settings_calb, const calibration_t *calibration)
result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t *joystick_settings)
 Set settings of joystick.
result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t *joystick_settings)
 Read settings of joystick.
result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t *ctp_settings)
 Set settings of control position(is only used with stepper motor).
result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t *ctp_settings)
 Read settings of control position(is only used with stepper motor).
result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t *uart_settings)
 Set UART settings.
result_t XIMC_API get_uart_settings (device_t id, uart_settings_t *uart_settings)
 Read UART settings.
result_t XIMC_API set_controller_name (device_t id, const controller_name_t *controller_name)
 Write user controller name and flags of setting from FRAM.
result_t XIMC_API get_controller_name (device_t id, controller_name_t *controller_name)
 Read user controller name and flags of setting from FRAM.
Group of commands movement control
     
result_t XIMC_API command_stop (device_t id)
 Immediately stop the engine, the transition to the STOP, mode key BREAK (winding short-circuited), the regime "retention" is deactivated for DC motors, keeping current in the windings for stepper motors (with Power management settings).
result_t XIMC_API set_add_sync_in_action (device_t id, const add_sync_in_action_t *add_sync_in_action)
 This command adds one element of the FIFO commands that are executed when input clock pulse.
result_t XIMC_API set_add_sync_in_action_calb (device_t id, const add_sync_in_action_calb_t *add_sync_in_action_calb, const calibration_t *calibration)
result_t XIMC_API command_power_off (device_t id)
 Immediately power off motor regardless its state.
result_t XIMC_API command_move (device_t id, int Position, int uPosition)
 Upon receiving the command "move" the engine starts to move with pre-set parameters (speed, acceleration, retention), to the point specified to the Position, uPosition.
result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t *calibration)
result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition)
 Upon receiving the command "movr" engine starts to move with pre-set parameters (speed, acceleration, hold), left or right (depending on the sign of DeltaPosition) by the number of pulses specified in the fields DeltaPosition, uDeltaPosition.
result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t *calibration)
result_t XIMC_API command_home (device_t id)
 The positive direction is to the right.
result_t XIMC_API command_left (device_t id)
 Start continous moving to the left.
result_t XIMC_API command_right (device_t id)
 Start continous moving to the right.
result_t XIMC_API command_loft (device_t id)
 Upon receiving the command "loft" the engine is shifted from the current point to a distance GENG :: Antiplay, then move to the same point.
result_t XIMC_API command_sstp (device_t id)
 soft stop engine.
result_t XIMC_API get_position (device_t id, get_position_t *the_get_position)
 Reads the value position in steps and micro for stepper motor and encoder steps all engines.
result_t XIMC_API get_position_calb (device_t id, get_position_calb_t *the_get_position_calb, const calibration_t *calibration)
result_t XIMC_API set_position (device_t id, const set_position_t *the_set_position)
 Sets any position value in steps and micro for stepper motor and encoder steps of all engines.
result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t *the_set_position_calb, const calibration_t *calibration)
result_t XIMC_API command_zero (device_t id)
 Sets the current position and the position in which the traffic moves by the move command and movr zero for all cases, except for movement to the target position.
Group of commands to save and load settings
     
result_t XIMC_API command_save_settings (device_t id)
 Save all settings from controller's RAM to controller's flash memory, replacing previous data in controller's flash memory.
result_t XIMC_API command_read_settings (device_t id)
 Read all settings from controller's flash memory to controller's RAM, replacing previous data in controller's RAM.
result_t XIMC_API command_eesave_settings (device_t id)
 Save settings from controller's RAM to stage's EEPROM memory, whitch spontaneity connected to stage and it isn`t change without it mechanical reconstruction.
result_t XIMC_API command_eeread_settings (device_t id)
 Read settings from controller's RAM to stage's EEPROM memory, whitch spontaneity connected to stage and it isn`t change without it mechanical reconstruction.
result_t XIMC_API get_chart_data (device_t id, chart_data_t *chart_data)
 Return device electrical parameters, useful for charts.
result_t XIMC_API get_serial_number (device_t id, unsigned int *SerialNumber)
 Read device serial number.
result_t XIMC_API get_firmware_version (device_t id, unsigned int *Major, unsigned int *Minor, unsigned int *Release)
 Read controller's firmware version.
result_t XIMC_API service_command_updf (device_t id)
 Command puts the controller to update the firmware.
Service commands
     
result_t XIMC_API set_serial_number (device_t id, const serial_number_t *serial_number)
 Write device serial number to controller's flash memory.
result_t XIMC_API get_analog_data (device_t id, analog_data_t *analog_data)
 Read analog data structure that contains raw analog data from ADC embedded on board.
result_t XIMC_API get_debug_read (device_t id, debug_read_t *debug_read)
 Read data from firmware for debug purpose.
Group of commands to work with EEPROM
     
result_t XIMC_API set_stage_name (device_t id, const stage_name_t *stage_name)
 Write user stage name from EEPROM.
result_t XIMC_API get_stage_name (device_t id, stage_name_t *stage_name)
 Read user stage name from EEPROM.
result_t XIMC_API set_stage_information (device_t id, const stage_information_t *stage_information)
 Set stage information to EEPROM.
result_t XIMC_API get_stage_information (device_t id, stage_information_t *stage_information)
 Read stage information from EEPROM.
result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t *stage_settings)
 Set stage settings to EEPROM.
result_t XIMC_API get_stage_settings (device_t id, stage_settings_t *stage_settings)
 Read stage settings from EEPROM.
result_t XIMC_API set_motor_information (device_t id, const motor_information_t *motor_information)
 Set motor information to EEPROM.
result_t XIMC_API get_motor_information (device_t id, motor_information_t *motor_information)
 Read motor information from EEPROM.
result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t *motor_settings)
 Set motor settings to EEPROM.
result_t XIMC_API get_motor_settings (device_t id, motor_settings_t *motor_settings)
 Read motor settings from EEPROM.
result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t *encoder_information)
 Set encoder information to EEPROM.
result_t XIMC_API get_encoder_information (device_t id, encoder_information_t *encoder_information)
 Read encoder information from EEPROM.
result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t *encoder_settings)
 Set encoder settings to EEPROM.
result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t *encoder_settings)
 Read encoder settings from EEPROM.
result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t *hallsensor_information)
 Set hall sensor information to EEPROM.
result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t *hallsensor_information)
 Read hall sensor information from EEPROM.
result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t *hallsensor_settings)
 Set hall sensor settings to EEPROM.
result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t *hallsensor_settings)
 Read hall sensor settings from EEPROM.
result_t XIMC_API set_gear_information (device_t id, const gear_information_t *gear_information)
 Set gear information to EEPROM.
result_t XIMC_API get_gear_information (device_t id, gear_information_t *gear_information)
 Read gear information from EEPROM.
result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t *gear_settings)
 Set gear settings to EEPROM.
result_t XIMC_API get_gear_settings (device_t id, gear_settings_t *gear_settings)
 Read gear settings from EEPROM.
result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t *accessories_settings)
 Set additional accessories information to EEPROM.
result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t *accessories_settings)
 Read additional accessories information from EEPROM.
result_t XIMC_API get_bootloader_version (device_t id, unsigned int *Major, unsigned int *Minor, unsigned int *Release)
 Read controller's firmware version.
result_t XIMC_API goto_firmware (device_t id, uint8_t *ret)
 Reboot to firmware.
result_t XIMC_API has_firmware (const char *name, uint8_t *ret)
 Check for firmware on device.
result_t XIMC_API command_update_firmware (const char *name, const uint8_t *data, uint32_t data_size)
 Update firmware.
result_t XIMC_API write_key (const char *name, uint8_t *key)
 Write controller key.
result_t XIMC_API command_reset (device_t id)
 Reset controller.
result_t XIMC_API command_clear_fram (device_t id)
 Clear controller FRAM.

Boards and drivers control

Functions for searching and opening/closing devices

typedef char * pchar
 Nevermind.
typedef void(XIMC_CALLCONVlogging_callback_t )(int loglevel, const wchar_t *message)
 Logging callback prototype.
device_t XIMC_API open_device (const char *name)
 Open a device with OS name name and return identifier of the device which can be used in calls.
result_t XIMC_API close_device (device_t *id)
 Close specified device.
result_t XIMC_API probe_device (const char *name)
 Check if a device with OS name name is XIMC device.
device_enumeration_t XIMC_API enumerate_devices (int probe_flags)
 Enumerate all devices that looks like valid.
result_t XIMC_API free_enumerate_devices (device_enumeration_t device_enumeration)
 Free memory returned by enumerate_devices.
int XIMC_API get_device_count (device_enumeration_t device_enumeration)
 Get device count.
pchar XIMC_API get_device_name (device_enumeration_t device_enumeration, int device_index)
 Get device name from the device enumeration.
result_t XIMC_API get_enumerate_device_serial (device_enumeration_t device_enumeration, int device_index, uint32_t *serial)
 Get device serial number from the device enumeration.
result_t XIMC_API get_enumerate_device_information (device_enumeration_t device_enumeration, int device_index, device_information_t *device_information)
 Get device information from the device enumeration.
result_t XIMC_API reset_locks ()
 Reset library locks in a case of deadlock.
result_t XIMC_API ximc_fix_usbser_sys (const char *device_name)
 Fix for errors in Windows USB driver stack.
void XIMC_API msec_sleep (unsigned int msec)
 Sleeps for a specified amount of time.
void XIMC_API ximc_version (char *version)
 Returns a library version.
void XIMC_API logging_callback_stderr_wide (int loglevel, const wchar_t *message)
 Simple callback for logging to stderr in wide chars.
void XIMC_API logging_callback_stderr_narrow (int loglevel, const wchar_t *message)
 Simple callback for logging to stderr in narrow (single byte) chars.
void XIMC_API set_logging_callback (logging_callback_t logging_callback)
 Sets a logging callback.
result_t XIMC_API get_status (device_t id, status_t *status)
 Return device state.
result_t XIMC_API get_status_calb (device_t id, status_calb_t *status, const calibration_t *calibration)
 Calibrated device state.
result_t XIMC_API get_device_information (device_t id, device_information_t *device_information)
 Return device information.

Detailed Description

Header file for libximc library.


Macro Definition Documentation

#define BORDERS_SWAP_MISSET_DETECTION   0x08

Motor should stop on both borders.

Need to save motor then wrong border settings is set

#define DRIVER_TYPE_DISCRETE_FET   0x01

Driver with discrete FET keys.

Default option.

#define ENGINE_ACCEL_ON   0x10

Acceleration enable flag.

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

#define ENGINE_ANTIPLAY   0x08

Play compensation flag.

If it set, engine makes backlash (play) compensation procedure and reach the predetermined position accurately on low speed.

#define ENGINE_MAX_SPEED   0x04

Max speed flag.

If it is set, engine uses maxumum speed achievable with the present engine settings as nominal speed.

#define ENGINE_REVERSE   0x01

Reverse flag.

It determines motor shaft rotation direction that corresponds to feedback counts increasing. If not set (default), motor shaft rotation direction under positive voltage corresponds to feedback counts increasing and vice versa. Change it if you see that positive directions on motor and feedback are opposite.

#define ENGINE_TYPE_TEST   0x04

Duty cycle are fixed.

Used only manufacturer.

#define ENUMERATE_PROBE   0x01

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

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

#define EXTIO_SETUP_INVERT   0x02

Interpret EXTIO states and fronts inverted if flag is set.

Falling front as input event and low logic level as active state.

#define HOME_DIR_FIRST   0x01

Flag defines direction of 1st motion after execution of home command.

Direction is right, if set; otherwise left.

#define HOME_DIR_SECOND   0x02

Flag defines direction of 2nd motion.

Direction is right, if set; otherwise left.

#define JOY_REVERSE   0x01

Joystick action is reversed.

Joystick deviation to the upper values correspond to negative speeds and vice versa.

#define MVCMD_ERROR   0x40

Finish state (1 - move command have finished with an error, 0 - move command have finished correctly).

This flags is actual when MVCMD_RUNNING signals movement finish.

#define REV_SENS_INV   0x08

Sensor is active when it 0 and invert makes active level 1.

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

#define STATE_ALARM   0x00040

Controller is in alarm state indicating that something dangerous had happened.

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

#define SYNCIN_GOTOPOSITION   0x04

The engine is go to position specified in Position and uPosition, if this flag is set.

And it is shift on the Position and uPosition, if this flag is unset

#define SYNCOUT_ENABLED   0x01

Synchronization out pin follows the synchronization logic, if set.

It governed by SYNCOUT_STATE flag otherwise.

#define XIMC_API

Library import macro Macros allows to automatically import function from shared library.

It automatically expands to dllimport on msvc when including header file


Typedef Documentation

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

Logging callback prototype.

Parameters:
loglevela loglevel
messagea message

Function Documentation

result_t XIMC_API close_device ( device_t id)

Close specified device.

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

Clear controller FRAM.

Can be used by manufacturer only

Parameters:
idan identifier of device
result_t XIMC_API command_eeread_settings ( device_t  id)

Read settings from controller's RAM to stage's EEPROM memory, whitch spontaneity connected to stage and it isn`t change without it mechanical reconstruction.

Parameters:
idan identifier of device
result_t XIMC_API command_eesave_settings ( device_t  id)

Save settings from controller's RAM to stage's EEPROM memory, whitch spontaneity connected to stage and it isn`t change without it mechanical reconstruction.

Can be used by manufacturer only.

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

The positive direction is to the right.

A value of zero reverses the direction of the direction of the flag, the set speed. Restriction imposed by the trailer, act the same, except that the limit switch contact does not stop. Limit the maximum speed, acceleration and deceleration function. 1) moves the motor according to the speed FastHome, uFastHome and flag HOME_DIR_FAST until limit switch, if the flag is set HOME_STOP_ENDS, until the signal from the input synchronization if the flag HOME_STOP_SYNC (as accurately as possible is important to catch the moment of operation limit switch) or until the signal is received from the speed sensor, if the flag HOME_STOP_REV_SN 2) then moves according to the speed SlowHome, uSlowHome and flag HOME_DIR_SLOW until signal from the clock input, if the flag HOME_MV_SEC. If the flag HOME_MV_SEC reset skip this paragraph. 3) then move the motor according to the speed FastHome, uFastHome and flag HOME_DIR_SLOW a distance HomeDelta, uHomeDelta. description of flags and variable see in description for commands GHOM/SHOM

Parameters:
idan identifier of device
See also:
home_settings_t
get_home_settings
set_home_settings
result_t XIMC_API command_left ( device_t  id)

Start continous moving to the left.

Parameters:
idan identifier of device
result_t XIMC_API command_loft ( device_t  id)

Upon receiving the command "loft" the engine is shifted from the current point to a distance GENG :: Antiplay, then move to the same point.

Parameters:
idan identifier of device
result_t XIMC_API command_move ( device_t  id,
int  Position,
int  uPosition 
)

Upon receiving the command "move" the engine starts to move with pre-set parameters (speed, acceleration, retention), to the point specified to the Position, uPosition.

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

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

Upon receiving the command "movr" engine starts to move with pre-set parameters (speed, acceleration, hold), left or right (depending on the sign of DeltaPosition) by the number of pulses specified in the fields DeltaPosition, uDeltaPosition.

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

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

Immediately power off motor regardless its state.

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

Parameters:
idan identifier of device
See also:
get_power_settings
set_power_settings
result_t XIMC_API command_read_settings ( device_t  id)

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

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

Reset controller.

Can be used by manufacturer only

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

Start continous moving to the right.

Parameters:
idan identifier of device
result_t XIMC_API command_save_settings ( device_t  id)

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

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

soft stop engine.

The motor stops with deceleration speed.

Parameters:
idan identifier of device
result_t XIMC_API command_stop ( device_t  id)

Immediately stop the engine, the transition to the STOP, mode key BREAK (winding short-circuited), the regime "retention" is deactivated for DC motors, keeping current in the windings for stepper motors (with Power management settings).

Parameters:
idan identifier of device
result_t XIMC_API command_update_firmware ( const char *  name,
const uint8_t *  data,
uint32_t  data_size 
)

Update firmware.

Service command

Parameters:
namea name of device
datafirmware byte stream
data_sizesize of byte stream
result_t XIMC_API command_zero ( device_t  id)

Sets the current position and the position in which the traffic moves by the move command and movr zero for all cases, except for movement to the target position.

In the latter case, set the zero current position and the target position counted so that the absolute position of the destination is the same. That is, if we were at 400 and moved to 500, then the command Zero makes the current position of 0, and the position of the destination - 100. Does not change the mode of movement that is if the motion is carried, it continues, and if the engine is in the "hold", the type of retention remains.

Parameters:
idan identifier of device
device_enumeration_t XIMC_API enumerate_devices ( int  probe_flags)

Enumerate all devices that looks like valid.

Parameters:
[in]probe_flagsenumerate devices flags
result_t XIMC_API free_enumerate_devices ( device_enumeration_t  device_enumeration)

Free memory returned by enumerate_devices.

Parameters:
[in]device_enumerationopaque pointer to an enumeration device data
result_t XIMC_API get_accessories_settings ( device_t  id,
accessories_settings_t accessories_settings 
)

Read additional accessories information from EEPROM.

Parameters:
idan identifier of device
[out]accessories_settingsstructure contains information about additional accessories
result_t XIMC_API get_analog_data ( device_t  id,
analog_data_t analog_data 
)

Read analog data structure that contains raw analog data from ADC embedded on board.

This function used for device testing and deep recalibraton by manufacturer only.

Parameters:
idan identifier of device
[out]analog_dataanalog data coefficients
result_t XIMC_API get_bootloader_version ( device_t  id,
unsigned int *  Major,
unsigned int *  Minor,
unsigned int *  Release 
)

Read controller's firmware version.

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

Read settings of brake control.

Parameters:
idan identifier of device
[out]brake_settingsstructure contains settings of brake control
result_t XIMC_API get_chart_data ( device_t  id,
chart_data_t chart_data 
)

Return device electrical parameters, useful for charts.

Useful function that fill structure with snapshot of controller voltages and currents.

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

Read settings of motor control.

When choosing CTL_MODE = 1 switches motor control with the joystick. In this mode, the joystick to the maximum engine tends Move at MaxSpeed [i], where i = 0 if the previous use This mode is not selected another i. Buttons switch the room rate i. When CTL_MODE = 2 is switched on motor control using the Left / right. When you click on the button motor starts to move in the appropriate direction at a speed MaxSpeed [0], at the end of time Timeout [i] motor move at a speed MaxSpeed [i+1]. at Transition from MaxSpeed [i] on MaxSpeed [i +1] to acceleration, as usual.

Parameters:
idan identifier of device
[out]control_settingsstructure contains settings motor control by joystick or buttons left/right.
result_t XIMC_API get_controller_name ( device_t  id,
controller_name_t controller_name 
)

Read user controller name and flags of setting from FRAM.

Parameters:
idan identifier of device
[out]controller_namestructure contains previously set user controller name
result_t XIMC_API get_ctp_settings ( device_t  id,
ctp_settings_t ctp_settings 
)

Read settings of control position(is only used with stepper motor).

When controlling the step motor with encoder (CTP_BASE 0) it is possible to detect the loss of steps. The controller knows the number of steps per revolution (GENG :: StepsPerRev) and the encoder resolution (GFBS :: IPT). When the control (flag CTP_ENABLED), the controller stores the current position in the footsteps of SM and the current position of the encoder. Further, at each step of the position encoder is converted into steps and if the difference is greater CTPMinError, a flag STATE_CTP_ERROR. When controlling the step motor with speed sensor (CTP_BASE 1), the position is controlled by him. The active edge of input clock controller stores the current value of steps. Further, at each turn checks how many steps shifted. When a mismatch CTPMinError a flag STATE_CTP_ERROR.

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

Read data from firmware for debug purpose.

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

Parameters:
idan identifier of device
[out]DebugData[128]Debug data.
int XIMC_API get_device_count ( device_enumeration_t  device_enumeration)

Get device count.

Parameters:
[in]device_enumerationopaque pointer to an enumeration device data
result_t XIMC_API get_device_information ( device_t  id,
device_information_t device_information 
)

Return device information.

All fields must point to allocated string buffers with at least 10 bytes. Works with both raw or initialized device.

Parameters:
idan identifier of device
[out]device_informationdevice information Device information.
See also:
get_device_information
pchar XIMC_API get_device_name ( device_enumeration_t  device_enumeration,
int  device_index 
)

Get device name from the device enumeration.

Returns device_index device name.

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

Read border and limit switches settings.

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

Read encoder information from EEPROM.

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

Read encoder settings from EEPROM.

Parameters:
idan identifier of device
[out]encoder_settingsstructure contains encoder settings
result_t XIMC_API get_engine_settings ( device_t  id,
engine_settings_t engine_settings 
)

Read engine settings.

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

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

Return engine type and driver type.

Parameters:
idan identifier of device
[out]EngineTypeengine type
[out]DriverTypedriver type
result_t XIMC_API get_enumerate_device_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 serial number.

Parameters:
[in]device_enumerationopaque pointer to an enumeration device data
[in]device_indexdevice index
[out]device_informationdevice information data
result_t XIMC_API get_enumerate_device_serial ( device_enumeration_t  device_enumeration,
int  device_index,
uint32_t *  serial 
)

Get device serial number from the device enumeration.

Returns device_index device serial number.

Parameters:
[in]device_enumerationopaque pointer to an enumeration device data
[in]device_indexdevice index
[out]serialdevice serial number
result_t XIMC_API get_extio_settings ( device_t  id,
extio_settings_t extio_settings 
)

Read EXTIO settings.

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

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

Read feedback settings.

Parameters:
idan identifier of device
[out]IPSnumber of encoder pulses per shaft revolution. Range: 1..65535
[out]FeedbackTypetype of feedback
[out]FeedbackFlagsflags of feedback
result_t XIMC_API get_firmware_version ( device_t  id,
unsigned int *  Major,
unsigned int *  Minor,
unsigned int *  Release 
)

Read controller's firmware version.

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

Read gear information from EEPROM.

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

Read gear settings from EEPROM.

Parameters:
idan identifier of device
[out]gear_settingsstructure contains step gearhead settings
result_t XIMC_API get_hallsensor_information ( device_t  id,
hallsensor_information_t hallsensor_information 
)

Read hall sensor information from EEPROM.

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

Read hall sensor settings from EEPROM.

Parameters:
idan identifier of device
[out]hallsensor_settingsstructure contains hall sensor settings
result_t XIMC_API get_home_settings ( device_t  id,
home_settings_t home_settings 
)

Read home settings.

This function fill structure with settings of calibrating position.

See also:
home_settings_t
Parameters:
idan identifier of device
[out]home_settingscalibrating position settings
result_t XIMC_API get_joystick_settings ( device_t  id,
joystick_settings_t joystick_settings 
)

Read settings of joystick.

If joystick position is outside DeadZone limits from the central position a movement with speed, defined by the joystick DeadZone edge to 100% deviation, begins. Joystick positions inside DeadZone limits correspond to zero speed (soft stop of motion) and positions beyond Low and High limits correspond MaxSpeed [i] or -MaxSpeed [i] (see command SCTL), where i = 0 by default and can be changed with left/right buttons (see command SCTL). If next speed in list is zero (both integer and microstep parts), the button press is ignored. First speed in list shouldn't be zero. The DeadZone ranges are illustrated on the following picture. !/attachments/download/5563/range25p.png! The relationship between the deviation and the rate is exponential, allowing no switching speed combine high mobility and accuracy. The following picture illustrates this: !/attachments/download/3092/ExpJoystick.png! The nonlinearity parameter is adjustable. Setting it to zero makes deviation/speed relation linear.

Parameters:
idan identifier of device
[out]joystick_settingsstructure contains joystick settings
result_t XIMC_API get_motor_information ( device_t  id,
motor_information_t motor_information 
)

Read motor information from EEPROM.

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

Read motor settings from EEPROM.

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

Read command setup movement (speed, acceleration, threshold and etc).

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

Read PID settings.

This function fill structure with set of motor PID settings stored in controller's memory. These settings specify behaviour of PID routine for voltage. These factors are slightly different for different positioners. All boards are supplied with standart set of PID setting on controller's flash memory.

See also:
set_pid_settings
Parameters:
idan identifier of device
[out]pid_settingspid settings
result_t XIMC_API get_position ( device_t  id,
get_position_t the_get_position 
)

Reads the value position in steps and micro for stepper motor and encoder steps all engines.

Parameters:
idan identifier of device
[out]positionstructure contains move settings: speed, acceleration, deceleration etc.
result_t XIMC_API get_power_settings ( device_t  id,
power_settings_t power_settings 
)

Read settings of step motor power control.

Used with stepper motor only.

Parameters:
idan identifier of device
[out]power_settingsstructure contains settings of step motor power control
result_t XIMC_API get_secure_settings ( device_t  id,
secure_settings_t secure_settings 
)

Read protection settings.

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

Read device serial number.

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

Read stage information from EEPROM.

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

Read user stage name from EEPROM.

Parameters:
idan identifier of device
[out]stage_namestructure contains previously set user stage name
result_t XIMC_API get_stage_settings ( device_t  id,
stage_settings_t stage_settings 
)

Read stage settings from EEPROM.

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

Return device state.

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

Calibrated device state.

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

See also:
get_status
result_t XIMC_API get_sync_in_settings ( device_t  id,
sync_in_settings_t sync_in_settings 
)

Read input synchronization settings.

This function fill structure with set of input synchronization settings, modes, periods and flags, that specify behaviour of input synchronization. All boards are supplied with standart set of these settings.

See also:
set_sync_in_settings
Parameters:
idan identifier of device
[out]sync_in_settingssynchronization settings
result_t XIMC_API get_sync_out_settings ( device_t  id,
sync_out_settings_t sync_out_settings 
)

Read output synchronization settings.

This function fill structure with set of output synchronization settings, modes, periods and flags, that specify behaviour of output synchronization. All boards are supplied with standart set of these settings.

See also:
set_sync_out_settings
Parameters:
idan identifier of device
[out]sync_out_settingssynchronization settings
result_t XIMC_API get_uart_settings ( device_t  id,
uart_settings_t uart_settings 
)

Read UART settings.

This function fill structure with UART settings.

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

Reboot to firmware.

Parameters:
idan identifier of device
[out]retRESULT_OK, if reboot to firmware is possible. Reboot is done after reply to this command. RESULT_NO_FIRMWARE, if firmware is not found. RESULT_ALREADY_IN_FIRMWARE, if this command was sent when controller is already in firmware.
result_t XIMC_API has_firmware ( const char *  name,
uint8_t *  ret 
)

Check for firmware on device.

Parameters:
namea name of device
[out]retnon-zero if firmware existed
void XIMC_API logging_callback_stderr_narrow ( int  loglevel,
const wchar_t *  message 
)

Simple callback for logging to stderr in narrow (single byte) chars.

Parameters:
loglevela loglevel
messagea message
void XIMC_API logging_callback_stderr_wide ( int  loglevel,
const wchar_t *  message 
)

Simple callback for logging to stderr in wide chars.

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

Sleeps for a specified amount of time.

Parameters:
msectime in milliseconds
device_t XIMC_API open_device ( const char *  name)

Open a device with OS name name and return identifier of the device which can be used in calls.

Parameters:
[in]name- a device name - e.g. COM3 or /dev/tty.s123
result_t XIMC_API probe_device ( const char *  name)

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

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

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

Command puts the controller to update the firmware.

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

result_t XIMC_API set_accessories_settings ( device_t  id,
const accessories_settings_t accessories_settings 
)

Set additional accessories information to EEPROM.

Can be used by manufacturer only.

Parameters:
idan identifier of device
[in]accessories_settingsstructure contains information about additional accessories
result_t XIMC_API set_add_sync_in_action ( device_t  id,
const add_sync_in_action_t add_sync_in_action 
)

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

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

Parameters:
idan identifier of device
result_t XIMC_API set_brake_settings ( device_t  id,
const brake_settings_t brake_settings 
)

Set settings of brake control.

Parameters:
idan identifier of device
[in]brake_settingsstructure contains settings of brake control
result_t XIMC_API set_control_settings ( device_t  id,
const control_settings_t control_settings 
)

Set settings of motor control.

When choosing CTL_MODE = 1 switches motor control with the joystick. In this mode, the joystick to the maximum engine tends Move at MaxSpeed [i], where i = 0 if the previous use This mode is not selected another i. Buttons switch the room rate i. When CTL_MODE = 2 is switched on motor control using the Left / right. When you click on the button motor starts to move in the appropriate direction at a speed MaxSpeed [0], at the end of time Timeout [i] motor move at a speed MaxSpeed [i+1]. at Transition from MaxSpeed [i] on MaxSpeed [i +1] to acceleration, as usual.

Parameters:
idan identifier of device
[in]control_settingsstructure contains settings motor control by joystick or buttons left/right.
result_t XIMC_API set_controller_name ( device_t  id,
const controller_name_t controller_name 
)

Write user controller name and flags of setting from FRAM.

Parameters:
idan identifier of device
[in]controller_namestructure contains previously set user controller name
result_t XIMC_API set_ctp_settings ( device_t  id,
const ctp_settings_t ctp_settings 
)

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

When controlling the step motor with encoder (CTP_BASE 0) it is possible to detect the loss of steps. The controller knows the number of steps per revolution (GENG :: StepsPerRev) and the encoder resolution (GFBS :: IPT). When the control (flag CTP_ENABLED), the controller stores the current position in the footsteps of SM and the current position of the encoder. Further, at each step of the position encoder is converted into steps and if the difference is greater CTPMinError, a flag STATE_CTP_ERROR. When controlling the step motor with speed sensor (CTP_BASE 1), the position is controlled by him. The active edge of input clock controller stores the current value of steps. Further, at each turn checks how many steps shifted. When a mismatch CTPMinError a flag STATE_CTP_ERROR.

Parameters:
idan identifier of device
[in]ctp_settingsstructure contains settings of control position
result_t XIMC_API set_edges_settings ( device_t  id,
const edges_settings_t edges_settings 
)

Set border and limit switches settings.

See also:
set_edges_settings
Parameters:
idan identifier of device
[in]edges_settingsedges settings, specify types of borders, motor behaviour and electrical behaviour of limit switches
result_t XIMC_API set_encoder_information ( device_t  id,
const encoder_information_t encoder_information 
)

Set encoder information to EEPROM.

Can be used by manufacturer only.

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

Set encoder settings to EEPROM.

Can be used by manufacturer only.

Parameters:
idan identifier of device
[in]encoder_settingsstructure contains encoder settings
result_t XIMC_API set_engine_settings ( device_t  id,
const engine_settings_t engine_settings 
)

Set engine settings.

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

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

Set engine type and driver type.

Parameters:
idan identifier of device
[in]EngineTypeengine type
[in]DriverTypedriver type
result_t XIMC_API set_extio_settings ( device_t  id,
const extio_settings_t extio_settings 
)

Set EXTIO settings.

This function writes a structure with a set of EXTIO settings to controller's memory. By default input event are signalled through rising front and output states are signalled by high logic state.

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

Set feedback settings.

Parameters:
idan identifier of device
[in]IPSnumber of encoder pulses per shaft revolution. Range: 1..65535
[in]FeedbackTypetype of feedback
[in]FeedbackFlagsflags of feedback
result_t XIMC_API set_gear_information ( device_t  id,
const gear_information_t gear_information 
)

Set gear information to EEPROM.

Can be used by manufacturer only.

Parameters:
idan identifier of device
[in]gear_informationstructure contains information about step gearhead
result_t XIMC_API set_gear_settings ( device_t  id,
const gear_settings_t gear_settings 
)

Set gear settings to EEPROM.

Can be used by manufacturer only.

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

Set hall sensor information to EEPROM.

Can be used by manufacturer only.

Parameters:
idan identifier of device
[in]hallsensor_informationstructure contains information about hall sensor
result_t XIMC_API set_hallsensor_settings ( device_t  id,
const hallsensor_settings_t hallsensor_settings 
)

Set hall sensor settings to EEPROM.

Can be used by manufacturer only.

Parameters:
idan identifier of device
[in]hallsensor_settingsstructure contains hall sensor settings
result_t XIMC_API set_home_settings ( device_t  id,
const home_settings_t home_settings 
)

Set home settings.

This function send structure with calibrating position settings to controller's memory.

See also:
home_settings_t
Parameters:
idan identifier of device
[in]home_settingscalibrating position settings
result_t XIMC_API set_joystick_settings ( device_t  id,
const joystick_settings_t joystick_settings 
)

Set settings of joystick.

If joystick position is outside DeadZone limits from the central position a movement with speed, defined by the joystick DeadZone edge to 100% deviation, begins. Joystick positions inside DeadZone limits correspond to zero speed (soft stop of motion) and positions beyond Low and High limits correspond MaxSpeed [i] or -MaxSpeed [i] (see command SCTL), where i = 0 by default and can be changed with left/right buttons (see command SCTL). If next speed in list is zero (both integer and microstep parts), the button press is ignored. First speed in list shouldn't be zero. The DeadZone ranges are illustrated on the following picture. !/attachments/download/5563/range25p.png! The relationship between the deviation and the rate is exponential, allowing no switching speed combine high mobility and accuracy. The following picture illustrates this: !/attachments/download/3092/ExpJoystick.png! The nonlinearity parameter is adjustable. Setting it to zero makes deviation/speed relation linear.

Parameters:
idan identifier of device
[in]joystick_settingsstructure contains joystick settings
void XIMC_API set_logging_callback ( logging_callback_t  logging_callback)

Sets a logging callback.

Call resets a callback to default (stderr, syslog) if NULL passed.

Parameters:
logging_callbacka callback for log messages
result_t XIMC_API set_motor_information ( device_t  id,
const motor_information_t motor_information 
)

Set motor information to EEPROM.

Can be used by manufacturer only.

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

Set motor settings to EEPROM.

Can be used by manufacturer only.

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

Set command setup movement (speed, acceleration, threshold and etc).

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

Set PID settings.

This function send structure with set of PID factors to controller's memory. These settings specify behaviour of PID routine for voltage. These factors are slightly different for different positioners. All boards are supplied with standart set of PID setting on controller's flash memory. Please use it for loading new PID settings when you change positioner. Please note that wrong PID settings lead to device malfunction.

See also:
get_pid_settings
Parameters:
idan identifier of device
[in]pid_settingspid settings
result_t XIMC_API set_position ( device_t  id,
const set_position_t the_set_position 
)

Sets any position value in steps and micro for stepper motor and encoder steps of all engines.

It means, that changing main indicator of position.

Parameters:
idan identifier of device
[out]positionstructure contains move settings: speed, acceleration, deceleration etc.
result_t XIMC_API set_power_settings ( device_t  id,
const power_settings_t power_settings 
)

Set settings of step motor power control.

Used with stepper motor only.

Parameters:
idan identifier of device
[in]power_settingsstructure contains settings of step motor power control
result_t XIMC_API set_secure_settings ( device_t  id,
const secure_settings_t secure_settings 
)

Set protection settings.

Parameters:
idan identifier of device
secure_settingsstructure with secure data
See also:
status_t::flags
result_t XIMC_API set_serial_number ( device_t  id,
const serial_number_t serial_number 
)

Write device serial number to controller's flash memory.

Along with the new serial number a "Key" is transmitted. The SN is changed and saved when keys match. Can be used by manufacturer only.

Parameters:
idan identifier of device
[in]serialnumber structure contains new serial number and secret key.
result_t XIMC_API set_stage_information ( device_t  id,
const stage_information_t stage_information 
)

Set stage information to EEPROM.

Can be used by manufacturer only.

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

Write user stage name from EEPROM.

Parameters:
idan identifier of device
[in]stage_namestructure contains previously set user stage name
result_t XIMC_API set_stage_settings ( device_t  id,
const stage_settings_t stage_settings 
)

Set stage settings to EEPROM.

Can be used by manufacturer only

Parameters:
idan identifier of device
[in]stage_settingsstructure contains stage settings
result_t XIMC_API set_sync_in_settings ( device_t  id,
const sync_in_settings_t sync_in_settings 
)

Set input synchronization settings.

This function send structure with set of input synchronization settings, that specify behaviour of input synchronization, to controller's memory. All boards are supplied with standart set of these settings.

See also:
get_sync_in_settings
Parameters:
idan identifier of device
[in]sync_in_settingssynchronization settings
result_t XIMC_API set_sync_out_settings ( device_t  id,
const sync_out_settings_t sync_out_settings 
)

Set output synchronization settings.

This function send structure with set of output synchronization settings, that specify behaviour of output synchronization, to controller's memory. All boards are supplied with standart set of these settings.

See also:
get_sync_out_settings
Parameters:
idan identifier of device
[in]sync_out_settingssynchronization settings
result_t XIMC_API set_uart_settings ( device_t  id,
const uart_settings_t uart_settings 
)

Set UART settings.

This function send structure with UART settings to controller's memory.

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

Write controller key.

Can be used by manufacturer only

Parameters:
namea name of device
[in]keyprotection key. Range: 0..4294967295
result_t XIMC_API ximc_fix_usbser_sys ( const char *  device_name)

Fix for errors in Windows USB driver stack.

Resets a driver if a device exists and in a hanged state.

void XIMC_API ximc_version ( char *  version)

Returns a library version.

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