libximc  2.12.1
ximc.h
Go to the documentation of this file.
1 #ifndef INC_XIMC_H
2 #define INC_XIMC_H
3 
19 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
20  #define XIMC_API __stdcall
21 #else
22  #ifdef LIBXIMC_EXPORTS
23  #define XIMC_API __attribute__((visibility("default")))
24  #else
25  #define XIMC_API
26  #endif
27 #endif
28 
33 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
34  #define XIMC_CALLCONV __stdcall
35 #else
36  #define XIMC_CALLCONV
37 #endif
38 
43 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
44 #define XIMC_RETTYPE unsigned int
45 #else
46 #define XIMC_RETTYPE void*
47 #endif
48 
49 
50 #if !defined(XIMC_NO_STDINT)
51 
52 #if ( (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)) && !defined(MATLAB_IMPORT)
53 // msvc types burden
54 typedef __int8 int8_t;
55 typedef __int16 int16_t;
56 typedef __int32 int32_t;
57 typedef __int64 int64_t;
58 typedef unsigned __int8 uint8_t;
59 typedef unsigned __int16 uint16_t;
60 typedef unsigned __int32 uint32_t;
61 typedef unsigned __int64 uint64_t;
62 #else
63 #include <stdint.h>
64 #endif
65 
66 /* labview doesn't speak C99 */
67 #if defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)
68 typedef unsigned __int64 ulong_t;
69 typedef __int64 long_t;
70 #else
71 typedef unsigned long long ulong_t;
72 typedef long long long_t;
73 #endif
74 
75 #endif
76 
77 #include <time.h>
78 
79 #if defined(__cplusplus)
80 extern "C"
81 {
82 #endif
83 
84 
93  typedef int device_t;
94 
103  typedef int result_t;
104 
113  #if defined(_WIN64) || defined(__LP64__) || defined(LABVIEW64_IMPORT)
114  typedef uint64_t device_enumeration_t;
115  #else
116  typedef uint32_t device_enumeration_t;
117  #endif
118  //typedef device_enumeration_t* pdevice_enumeration_t;
119 
128 #define device_undefined -1
129 
138 
147 #define result_ok 0
148 
157 #define result_error -1
158 
167 #define result_not_implemented -2
168 
177 #define result_value_error -3
178 
187 #define result_nodevice -4
188 
190 
199 
208 #define LOGLEVEL_ERROR 0x01
209 
217 #define LOGLEVEL_WARNING 0x02
218 
226 #define LOGLEVEL_INFO 0x03
227 
235 #define LOGLEVEL_DEBUG 0x04
236 
237 
238 
246  typedef struct calibration_t
247  {
248  double A;
249  unsigned int MicrostepMode;
250  } calibration_t;
251 
260  {
261  uint32_t ipv4;
262  char nodename[16];
263  uint32_t axis_state;
264  char locker_username[16];
265  char locker_nodename[16];
266  time_t locked_time;
268 
269 
270 
272 #define LIBXIMC_VERSION 2.12.1
273 
277 #define LIBXIMC_PROTOCOL_VERSION 20.1
278 
281 /*
282  ------------------------------------------
283  BEGIN OF GENERATED struct declarations
284  ------------------------------------------
285 */
286 
296 #define ENUMERATE_PROBE 0x01
297 #define ENUMERATE_ALL_COM 0x02
298 #define ENUMERATE_NETWORK 0x04
300 
301 
317 #define MOVE_STATE_MOVING 0x01
318 #define MOVE_STATE_TARGET_SPEED 0x02
319 #define MOVE_STATE_ANTIPLAY 0x04
321 
322 
336 #define EEPROM_PRECEDENCE 0x01
338 
339 
355 #define PWR_STATE_UNKNOWN 0x00
356 #define PWR_STATE_OFF 0x01
357 #define PWR_STATE_NORM 0x03
358 #define PWR_STATE_REDUCT 0x04
359 #define PWR_STATE_MAX 0x05
361 
362 
380 #define STATE_CONTR 0x000003F
381 #define STATE_ERRC 0x0000001
382 #define STATE_ERRD 0x0000002
383 #define STATE_ERRV 0x0000004
384 #define STATE_EEPROM_CONNECTED 0x0000010
385 #define STATE_IS_HOMED 0x0000020
386 #define STATE_SECUR 0x1B3FFC0
387 #define STATE_ALARM 0x0000040
388 #define STATE_CTP_ERROR 0x0000080
389 #define STATE_POWER_OVERHEAT 0x0000100
390 #define STATE_CONTROLLER_OVERHEAT 0x0000200
391 #define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400
392 #define STATE_OVERLOAD_POWER_CURRENT 0x0000800
393 #define STATE_OVERLOAD_USB_VOLTAGE 0x0001000
394 #define STATE_LOW_USB_VOLTAGE 0x0002000
395 #define STATE_OVERLOAD_USB_CURRENT 0x0004000
396 #define STATE_BORDERS_SWAP_MISSET 0x0008000
397 #define STATE_LOW_POWER_VOLTAGE 0x0010000
398 #define STATE_H_BRIDGE_FAULT 0x0020000
399 #define STATE_CURRENT_MOTOR_BITS 0x00C0000
400 #define STATE_CURRENT_MOTOR0 0x0000000
401 #define STATE_CURRENT_MOTOR1 0x0040000
402 #define STATE_CURRENT_MOTOR2 0x0080000
403 #define STATE_CURRENT_MOTOR3 0x00C0000
404 #define STATE_WINDING_RES_MISMATCH 0x0100000
405 #define STATE_ENCODER_FAULT 0x0200000
406 #define STATE_ENGINE_RESPONSE_ERROR 0x0800000
407 #define STATE_EXTIO_ALARM 0x1000000
409 
410 
428 #define STATE_DIG_SIGNAL 0xFFFF
429 #define STATE_RIGHT_EDGE 0x0001
430 #define STATE_LEFT_EDGE 0x0002
431 #define STATE_BUTTON_RIGHT 0x0004
432 #define STATE_BUTTON_LEFT 0x0008
433 #define STATE_GPIO_PINOUT 0x0010
434 #define STATE_GPIO_LEVEL 0x0020
435 #define STATE_BRAKE 0x0200
436 #define STATE_REV_SENSOR 0x0400
437 #define STATE_SYNC_INPUT 0x0800
438 #define STATE_SYNC_OUTPUT 0x1000
439 #define STATE_ENC_A 0x2000
440 #define STATE_ENC_B 0x4000
442 
443 
459 #define ENC_STATE_ABSENT 0x00
460 #define ENC_STATE_UNKNOWN 0x01
461 #define ENC_STATE_MALFUNC 0x02
462 #define ENC_STATE_REVERS 0x03
463 #define ENC_STATE_OK 0x04
465 
466 
482 #define WIND_A_STATE_ABSENT 0x00
483 #define WIND_A_STATE_UNKNOWN 0x01
484 #define WIND_A_STATE_MALFUNC 0x02
485 #define WIND_A_STATE_OK 0x03
486 #define WIND_B_STATE_ABSENT 0x00
487 #define WIND_B_STATE_UNKNOWN 0x10
488 #define WIND_B_STATE_MALFUNC 0x20
489 #define WIND_B_STATE_OK 0x30
491 
492 
510 #define MVCMD_NAME_BITS 0x3F
511 #define MVCMD_UKNWN 0x00
512 #define MVCMD_MOVE 0x01
513 #define MVCMD_MOVR 0x02
514 #define MVCMD_LEFT 0x03
515 #define MVCMD_RIGHT 0x04
516 #define MVCMD_STOP 0x05
517 #define MVCMD_HOME 0x06
518 #define MVCMD_LOFT 0x07
519 #define MVCMD_SSTP 0x08
520 #define MVCMD_ERROR 0x40
521 #define MVCMD_RUNNING 0x80
523 
524 
543 #define ENGINE_REVERSE 0x01
544 #define ENGINE_CURRENT_AS_RMS 0x02
545 #define ENGINE_MAX_SPEED 0x04
546 #define ENGINE_ANTIPLAY 0x08
547 #define ENGINE_ACCEL_ON 0x10
548 #define ENGINE_LIMIT_VOLT 0x20
549 #define ENGINE_LIMIT_CURR 0x40
550 #define ENGINE_LIMIT_RPM 0x80
552 
553 
572 #define MICROSTEP_MODE_FULL 0x01
573 #define MICROSTEP_MODE_FRAC_2 0x02
574 #define MICROSTEP_MODE_FRAC_4 0x03
575 #define MICROSTEP_MODE_FRAC_8 0x04
576 #define MICROSTEP_MODE_FRAC_16 0x05
577 #define MICROSTEP_MODE_FRAC_32 0x06
578 #define MICROSTEP_MODE_FRAC_64 0x07
579 #define MICROSTEP_MODE_FRAC_128 0x08
580 #define MICROSTEP_MODE_FRAC_256 0x09
582 
583 
602 #define ENGINE_TYPE_NONE 0x00
603 #define ENGINE_TYPE_DC 0x01
604 #define ENGINE_TYPE_2DC 0x02
605 #define ENGINE_TYPE_STEP 0x03
606 #define ENGINE_TYPE_TEST 0x04
607 #define ENGINE_TYPE_BRUSHLESS 0x05
609 
610 
629 #define DRIVER_TYPE_DISCRETE_FET 0x01
630 #define DRIVER_TYPE_INTEGRATE 0x02
631 #define DRIVER_TYPE_EXTERNAL 0x03
633 
634 
651 #define POWER_REDUCT_ENABLED 0x01
652 #define POWER_OFF_ENABLED 0x02
653 #define POWER_SMOOTH_CURRENT 0x04
655 
656 
673 #define ALARM_ON_DRIVER_OVERHEATING 0x01
674 #define LOW_UPWR_PROTECTION 0x02
675 #define H_BRIDGE_ALERT 0x04
676 #define ALARM_ON_BORDERS_SWAP_MISSET 0x08
677 #define ALARM_FLAGS_STICKING 0x10
678 #define USB_BREAK_RECONNECT 0x20
679 #define ALARM_WINDING_MISMATCH 0x40
680 #define ALARM_ENGINE_RESPONSE 0x80
682 
683 
699 #define SETPOS_IGNORE_POSITION 0x01
700 #define SETPOS_IGNORE_ENCODER 0x02
702 
703 
717 #define FEEDBACK_ENCODER 0x01
718 #define FEEDBACK_EMF 0x04
719 #define FEEDBACK_NONE 0x05
720 #define FEEDBACK_ENCODER_MEDIATED 0x06
722 
723 
737 #define FEEDBACK_ENC_REVERSE 0x01
738 #define FEEDBACK_ENC_TYPE_BITS 0xC0
739 #define FEEDBACK_ENC_TYPE_AUTO 0x00
740 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
741 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
743 
744 
759 #define SYNCIN_ENABLED 0x01
760 #define SYNCIN_INVERT 0x02
761 #define SYNCIN_GOTOPOSITION 0x04
763 
764 
779 #define SYNCOUT_ENABLED 0x01
780 #define SYNCOUT_STATE 0x02
781 #define SYNCOUT_INVERT 0x04
782 #define SYNCOUT_IN_STEPS 0x08
783 #define SYNCOUT_ONSTART 0x10
784 #define SYNCOUT_ONSTOP 0x20
785 #define SYNCOUT_ONPERIOD 0x40
787 
788 
803 #define EXTIO_SETUP_OUTPUT 0x01
804 #define EXTIO_SETUP_INVERT 0x02
806 
807 
822 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
823 #define EXTIO_SETUP_MODE_IN_NOP 0x00
824 #define EXTIO_SETUP_MODE_IN_STOP 0x01
825 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
826 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
827 #define EXTIO_SETUP_MODE_IN_HOME 0x04
828 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
829 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
830 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
831 #define EXTIO_SETUP_MODE_OUT_ON 0x10
832 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
833 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
834 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
835 #define EXTIO_SETUP_MODE_OUT_MOTOR_FOUND 0x50
837 
838 
856 #define BORDER_IS_ENCODER 0x01
857 #define BORDER_STOP_LEFT 0x02
858 #define BORDER_STOP_RIGHT 0x04
859 #define BORDERS_SWAP_MISSET_DETECTION 0x08
861 
862 
880 #define ENDER_SWAP 0x01
881 #define ENDER_SW1_ACTIVE_LOW 0x02
882 #define ENDER_SW2_ACTIVE_LOW 0x04
884 
885 
903 #define BRAKE_ENABLED 0x01
904 #define BRAKE_ENG_PWROFF 0x02
906 
907 
925 #define CONTROL_MODE_BITS 0x03
926 #define CONTROL_MODE_OFF 0x00
927 #define CONTROL_MODE_JOY 0x01
928 #define CONTROL_MODE_LR 0x02
929 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
930 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
932 
933 
949 #define JOY_REVERSE 0x01
951 
952 
970 #define CTP_ENABLED 0x01
971 #define CTP_BASE 0x02
972 #define CTP_ALARM_ON_ERROR 0x04
973 #define REV_SENS_INV 0x08
974 #define CTP_ERROR_CORRECTION 0x10
976 
977 
996 #define HOME_DIR_FIRST 0x001
997 #define HOME_DIR_SECOND 0x002
998 #define HOME_MV_SEC_EN 0x004
999 #define HOME_HALF_MV 0x008
1000 #define HOME_STOP_FIRST_BITS 0x030
1001 #define HOME_STOP_FIRST_REV 0x010
1002 #define HOME_STOP_FIRST_SYN 0x020
1003 #define HOME_STOP_FIRST_LIM 0x030
1004 #define HOME_STOP_SECOND_BITS 0x0C0
1005 #define HOME_STOP_SECOND_REV 0x040
1006 #define HOME_STOP_SECOND_SYN 0x080
1007 #define HOME_STOP_SECOND_LIM 0x0C0
1008 #define HOME_USE_FAST 0x100
1010 
1011 
1023 #define UART_PARITY_BITS 0x03
1024 #define UART_PARITY_BIT_EVEN 0x00
1025 #define UART_PARITY_BIT_ODD 0x01
1026 #define UART_PARITY_BIT_SPACE 0x02
1027 #define UART_PARITY_BIT_MARK 0x03
1028 #define UART_PARITY_BIT_USE 0x04
1029 #define UART_STOP_BIT 0x08
1031 
1032 
1044 #define MOTOR_TYPE_UNKNOWN 0x00
1045 #define MOTOR_TYPE_STEP 0x01
1046 #define MOTOR_TYPE_DC 0x02
1047 #define MOTOR_TYPE_BLDC 0x03
1049 
1050 
1062 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1063 #define ENCSET_PUSHPULL_OUTPUT 0x004
1064 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1065 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1066 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1068 
1069 
1081 #define MB_AVAILABLE 0x01
1082 #define MB_POWERED_HOLD 0x02
1084 
1085 
1097 #define TS_TYPE_BITS 0x07
1098 #define TS_TYPE_UNKNOWN 0x00
1099 #define TS_TYPE_THERMOCOUPLE 0x01
1100 #define TS_TYPE_SEMICONDUCTOR 0x02
1101 #define TS_AVAILABLE 0x08
1103 
1104 
1116 #define LS_ON_SW1_AVAILABLE 0x01
1117 #define LS_ON_SW2_AVAILABLE 0x02
1118 #define LS_SW1_ACTIVE_LOW 0x04
1119 #define LS_SW2_ACTIVE_LOW 0x08
1120 #define LS_SHORTED 0x10
1122 
1123 
1137 #define BACK_EMF_INDUCTANCE_AUTO 0x01
1138 #define BACK_EMF_RESISTANCE_AUTO 0x02
1139 #define BACK_EMF_KM_AUTO 0x04
1141 
1142 
1154  typedef struct
1155  {
1156  unsigned int IPS;
1157  unsigned int FeedbackType;
1158  unsigned int FeedbackFlags;
1159  unsigned int CountsPerTurn;
1161 
1177  typedef struct
1178  {
1179  unsigned int FastHome;
1180  unsigned int uFastHome;
1181  unsigned int SlowHome;
1182  unsigned int uSlowHome;
1185  unsigned int HomeFlags;
1186  } home_settings_t;
1187 
1203  typedef struct
1204  {
1205  float FastHome;
1206  float SlowHome;
1207  float HomeDelta;
1208  unsigned int HomeFlags;
1210 
1222  typedef struct
1223  {
1224  unsigned int Speed;
1225  unsigned int uSpeed;
1226  unsigned int Accel;
1227  unsigned int Decel;
1228  unsigned int AntiplaySpeed;
1229  unsigned int uAntiplaySpeed;
1230  } move_settings_t;
1231 
1243  typedef struct
1244  {
1245  float Speed;
1246  float Accel;
1247  float Decel;
1250 
1271  typedef struct
1272  {
1273  unsigned int NomVoltage;
1274  unsigned int NomCurrent;
1275  unsigned int NomSpeed;
1276  unsigned int uNomSpeed;
1277  unsigned int EngineFlags;
1278  int Antiplay;
1279  unsigned int MicrostepMode;
1280  unsigned int StepsPerRev;
1282 
1303  typedef struct
1304  {
1305  unsigned int NomVoltage;
1306  unsigned int NomCurrent;
1307  float NomSpeed;
1308  unsigned int EngineFlags;
1309  float Antiplay;
1310  unsigned int MicrostepMode;
1311  unsigned int StepsPerRev;
1313 
1330  typedef struct
1331  {
1332  unsigned int EngineType;
1333  unsigned int DriverType;
1335 
1347  typedef struct
1348  {
1349  unsigned int HoldCurrent;
1350  unsigned int CurrReductDelay;
1351  unsigned int PowerOffDelay;
1352  unsigned int CurrentSetTime;
1353  unsigned int PowerFlags;
1354  } power_settings_t;
1355 
1369  typedef struct
1370  {
1371  unsigned int LowUpwrOff;
1372  unsigned int CriticalIpwr;
1373  unsigned int CriticalUpwr;
1374  unsigned int CriticalT;
1375  unsigned int CriticalIusb;
1376  unsigned int CriticalUusb;
1377  unsigned int MinimumUusb;
1378  unsigned int Flags;
1380 
1398  typedef struct
1399  {
1400  unsigned int BorderFlags;
1401  unsigned int EnderFlags;
1406  } edges_settings_t;
1407 
1425  typedef struct
1426  {
1427  unsigned int BorderFlags;
1428  unsigned int EnderFlags;
1429  float LeftBorder;
1430  float RightBorder;
1432 
1456  typedef struct
1457  {
1458  unsigned int KpU;
1459  unsigned int KiU;
1460  unsigned int KdU;
1461  float Kpf;
1462  float Kif;
1463  float Kdf;
1464  } pid_settings_t;
1465 
1481  typedef struct
1482  {
1483  unsigned int SyncInFlags;
1484  unsigned int ClutterTime;
1485  int Position;
1487  unsigned int Speed;
1488  unsigned int uSpeed;
1490 
1506  typedef struct
1507  {
1508  unsigned int SyncInFlags;
1509  unsigned int ClutterTime;
1510  float Position;
1511  float Speed;
1513 
1529  typedef struct
1530  {
1531  unsigned int SyncOutFlags;
1532  unsigned int SyncOutPulseSteps;
1533  unsigned int SyncOutPeriod;
1534  unsigned int Accuracy;
1535  unsigned int uAccuracy;
1537 
1553  typedef struct
1554  {
1555  unsigned int SyncOutFlags;
1556  unsigned int SyncOutPulseSteps;
1557  unsigned int SyncOutPeriod;
1558  float Accuracy;
1560 
1577  typedef struct
1578  {
1579  unsigned int EXTIOSetupFlags;
1580  unsigned int EXTIOModeFlags;
1581  } extio_settings_t;
1582 
1596  typedef struct
1597  {
1598  unsigned int t1;
1599  unsigned int t2;
1600  unsigned int t3;
1601  unsigned int t4;
1602  unsigned int BrakeFlags;
1603  } brake_settings_t;
1604 
1634  typedef struct
1635  {
1636  unsigned int MaxSpeed[10];
1637  unsigned int uMaxSpeed[10];
1638  unsigned int Timeout[9];
1639  unsigned int MaxClickTime;
1640  unsigned int Flags;
1644 
1674  typedef struct
1675  {
1676  float MaxSpeed[10];
1677  unsigned int Timeout[9];
1678  unsigned int MaxClickTime;
1679  unsigned int Flags;
1682 
1711  typedef struct
1712  {
1713  unsigned int JoyLowEnd;
1714  unsigned int JoyCenter;
1715  unsigned int JoyHighEnd;
1716  unsigned int ExpFactor;
1717  unsigned int DeadZone;
1718  unsigned int JoyFlags;
1720 
1754  typedef struct
1755  {
1756  unsigned int CTPMinError;
1757  unsigned int CTPFlags;
1758  } ctp_settings_t;
1759 
1773  typedef struct
1774  {
1775  unsigned int Speed;
1776  unsigned int UARTSetupFlags;
1777  } uart_settings_t;
1778 
1792  typedef struct
1793  {
1794  float CSS1_A;
1795  float CSS1_B;
1796  float CSS2_A;
1797  float CSS2_B;
1801 
1811  typedef struct
1812  {
1813  char ControllerName[17];
1814  unsigned int CtrlFlags;
1816 
1826  typedef struct
1827  {
1828  unsigned int UserData[7];
1830 
1852  typedef struct
1853  {
1854  float L;
1855  float R;
1856  float Km;
1857  unsigned int BackEMFFlags;
1858  } emf_settings_t;
1859 
1874  typedef struct
1875  {
1876  unsigned int stepcloseloop_Kw;
1877  unsigned int stepcloseloop_Kp_low;
1878  unsigned int stepcloseloop_Kp_high;
1880 
1895  typedef struct
1896  {
1897  unsigned int Param1;
1899 
1909  typedef struct
1910  {
1911  int Position;
1913  unsigned int Time;
1915 
1925  typedef struct
1926  {
1927  float Position;
1928  unsigned int Time;
1930 
1945  typedef struct
1946  {
1947  int Position;
1949  long_t EncPosition;
1950  } get_position_t;
1951 
1965  typedef struct
1966  {
1967  float Position;
1968  long_t EncPosition;
1970 
1985  typedef struct
1986  {
1987  int Position;
1989  long_t EncPosition;
1990  unsigned int PosFlags;
1991  } set_position_t;
1992 
2007  typedef struct
2008  {
2009  float Position;
2010  long_t EncPosition;
2011  unsigned int PosFlags;
2013 
2025  typedef struct
2026  {
2027  unsigned int MoveSts;
2028  unsigned int MvCmdSts;
2029  unsigned int PWRSts;
2030  unsigned int EncSts;
2031  unsigned int WindSts;
2034  long_t EncPosition;
2035  int CurSpeed;
2037  int Ipwr;
2038  int Upwr;
2039  int Iusb;
2040  int Uusb;
2041  int CurT;
2042  unsigned int Flags;
2043  unsigned int GPIOFlags;
2044  unsigned int CmdBufFreeSpace;
2045  } status_t;
2046 
2058  typedef struct
2059  {
2060  unsigned int MoveSts;
2061  unsigned int MvCmdSts;
2062  unsigned int PWRSts;
2063  unsigned int EncSts;
2064  unsigned int WindSts;
2065  float CurPosition;
2066  long_t EncPosition;
2067  float CurSpeed;
2068  int Ipwr;
2069  int Upwr;
2070  int Iusb;
2071  int Uusb;
2072  int CurT;
2073  unsigned int Flags;
2074  unsigned int GPIOFlags;
2075  unsigned int CmdBufFreeSpace;
2076  } status_calb_t;
2077 
2088  typedef struct
2089  {
2090  int Speed[25];
2091  int Error[25];
2092  unsigned int Length;
2093  } measurements_t;
2094 
2107  typedef struct
2108  {
2115  unsigned int Pot;
2116  unsigned int Joy;
2118  } chart_data_t;
2119 
2136  typedef struct
2137  {
2138  char Manufacturer[5];
2139  char ManufacturerId[3];
2140  char ProductDescription[9];
2141  unsigned int Major;
2142  unsigned int Minor;
2143  unsigned int Release;
2145 
2161  typedef struct
2162  {
2163  unsigned int SN;
2164  uint8_t Key[32];
2165  unsigned int Major;
2166  unsigned int Minor;
2167  unsigned int Release;
2168  } serial_number_t;
2169 
2184  typedef struct
2185  {
2186  unsigned int A1Voltage_ADC;
2187  unsigned int A2Voltage_ADC;
2188  unsigned int B1Voltage_ADC;
2189  unsigned int B2Voltage_ADC;
2190  unsigned int SupVoltage_ADC;
2191  unsigned int ACurrent_ADC;
2192  unsigned int BCurrent_ADC;
2193  unsigned int FullCurrent_ADC;
2194  unsigned int Temp_ADC;
2195  unsigned int Joy_ADC;
2196  unsigned int Pot_ADC;
2197  unsigned int L5_ADC;
2198  unsigned int H5_ADC;
2204  int ACurrent;
2205  int BCurrent;
2207  int Temp;
2208  int Joy;
2209  int Pot;
2210  int L5;
2211  int H5;
2212  unsigned int deprecated;
2213  int R;
2214  int L;
2215  } analog_data_t;
2216 
2228  typedef struct
2229  {
2230  uint8_t DebugData[128];
2231  } debug_read_t;
2232 
2244  typedef struct
2245  {
2246  uint8_t DebugData[128];
2247  } debug_write_t;
2248 
2258  typedef struct
2259  {
2260  char PositionerName[17];
2261  } stage_name_t;
2262 
2274  typedef struct
2275  {
2276  char Manufacturer[17];
2277  char PartNumber[25];
2279 
2291  typedef struct
2292  {
2294  char Units[9];
2295  float MaxSpeed;
2296  float TravelRange;
2302  } stage_settings_t;
2303 
2315  typedef struct
2316  {
2317  char Manufacturer[17];
2318  char PartNumber[25];
2320 
2332  typedef struct
2333  {
2334  unsigned int MotorType;
2335  unsigned int ReservedField;
2336  unsigned int Poles;
2337  unsigned int Phases;
2346  float StallTorque;
2352  float MaxSpeed;
2353  float MaxCurrent;
2356  float NoLoadSpeed;
2357  } motor_settings_t;
2358 
2370  typedef struct
2371  {
2372  char Manufacturer[17];
2373  char PartNumber[25];
2375 
2387  typedef struct
2388  {
2393  unsigned int PPR;
2394  unsigned int EncoderSettings;
2396 
2408  typedef struct
2409  {
2410  char Manufacturer[17];
2411  char PartNumber[25];
2413 
2425  typedef struct
2426  {
2431  unsigned int PPR;
2433 
2445  typedef struct
2446  {
2447  char Manufacturer[17];
2448  char PartNumber[25];
2450 
2462  typedef struct
2463  {
2464  float ReductionIn;
2470  float Efficiency;
2471  } gear_settings_t;
2472 
2484  typedef struct
2485  {
2486  char MagneticBrakeInfo[25];
2489  float MBTorque;
2490  unsigned int MBSettings;
2491  char TemperatureSensorInfo[25];
2492  float TSMin;
2493  float TSMax;
2494  float TSGrad;
2495  unsigned int TSSettings;
2496  unsigned int LimitSwitchesSettings;
2498 
2510  typedef struct
2511  {
2512  uint8_t key[16];
2513  } init_random_t;
2514 
2524  typedef struct
2525  {
2526  unsigned int UniqueID0;
2527  unsigned int UniqueID1;
2528  unsigned int UniqueID2;
2529  unsigned int UniqueID3;
2531 
2541  typedef struct
2542  {
2543  unsigned int Motor;
2545 
2546 /*
2547  --------------------------------------------
2548  BEGIN OF GENERATED function declarations
2549  --------------------------------------------
2550 */
2551 
2564 
2583  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2584 
2603  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2604 
2621  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2622 
2641  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2642 
2659  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2660 
2679  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2680 
2693  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2694 
2709  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2710 
2723  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2724 
2739  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2740 
2762  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2763 
2787  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2788 
2808  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2809 
2831  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2832 
2845  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2846 
2859  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
2860 
2874  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
2875 
2890  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
2891 
2905  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
2906 
2920  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
2921 
2936  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
2937 
2962  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
2963 
2978  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
2979 
3004  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3005 
3029  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
3030 
3051  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
3052 
3070  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
3071 
3091  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);
3092 
3110  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
3111 
3131  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);
3132 
3150  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
3151 
3171  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);
3172 
3187  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
3188 
3208  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);
3209 
3228  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
3229 
3245  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
3246 
3259  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
3260 
3273  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
3274 
3303  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
3304 
3335  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3336 
3365  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
3366 
3397  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3398 
3434  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
3435 
3471  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
3472 
3507  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
3508 
3543  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3544 
3561  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3562 
3579  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3580 
3597  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3598 
3615  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3616 
3629  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3630 
3643  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3644 
3657  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3658 
3671  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3672 
3691  result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t* emf_settings);
3692 
3709  result_t XIMC_API get_emf_settings (device_t id, emf_settings_t* emf_settings);
3710 
3725  result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t* engine_advansed_setup);
3726 
3741  result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t* engine_advansed_setup);
3742 
3757  result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t* extended_settings);
3758 
3773  result_t XIMC_API get_extended_settings (device_t id, extended_settings_t* extended_settings);
3774 
3775 
3777 
3790 
3808  result_t XIMC_API command_stop (device_t id);
3809 
3829  result_t XIMC_API command_add_sync_in_action (device_t id, const command_add_sync_in_action_t* the_command_add_sync_in_action);
3830 
3852  result_t XIMC_API command_add_sync_in_action_calb (device_t id, const command_add_sync_in_action_calb_t* the_command_add_sync_in_action_calb, const calibration_t* calibration);
3853 
3872  result_t XIMC_API command_power_off (device_t id);
3873 
3893  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
3894 
3922  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
3923 
3947  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
3948 
3980  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
3981 
4021  result_t XIMC_API command_home (device_t id);
4022 
4033  result_t XIMC_API command_left (device_t id);
4034 
4045  result_t XIMC_API command_right (device_t id);
4046 
4059  result_t XIMC_API command_loft (device_t id);
4060 
4071  result_t XIMC_API command_sstp (device_t id);
4072 
4087  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
4088 
4113  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
4114 
4131  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
4132 
4150  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
4151 
4174  result_t XIMC_API command_zero (device_t id);
4175 
4176 
4178 
4191 
4202  result_t XIMC_API command_save_settings (device_t id);
4203 
4214  result_t XIMC_API command_read_settings (device_t id);
4215 
4226  result_t XIMC_API command_save_robust_settings (device_t id);
4227 
4238  result_t XIMC_API command_read_robust_settings (device_t id);
4239 
4252  result_t XIMC_API command_eesave_settings (device_t id);
4253 
4265  result_t XIMC_API command_eeread_settings (device_t id);
4266 
4277  result_t XIMC_API command_start_measurements (device_t id);
4278 
4297  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
4298 
4315  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
4316 
4329  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
4330 
4347  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4348 
4359  result_t XIMC_API service_command_updf (device_t id);
4360 
4361 
4363 
4376 
4395  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
4396 
4411  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
4412 
4427  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
4428 
4441  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
4442 
4443 
4445 
4458 
4471  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
4472 
4485  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
4486 
4501  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
4502 
4515  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
4516 
4531  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
4532 
4545  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
4546 
4561  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
4562 
4575  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
4576 
4591  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
4592 
4605  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
4606 
4621  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
4622 
4635  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
4636 
4651  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
4652 
4665  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
4666 
4681  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
4682 
4695  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
4696 
4711  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
4712 
4725  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
4726 
4741  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
4742 
4755  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
4756 
4771  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4772 
4785  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4786 
4801  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4802 
4815  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4816 
4833  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4834 
4847  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4848 
4865  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4866 
4877  result_t XIMC_API command_change_motor (device_t id, const command_change_motor_t* the_command_change_motor);
4878 
4879 
4880 /*
4881  -------------------------
4882  END OF GENERATED CODE
4883  -------------------------
4884 */
4885 
4886 /* hand-crafted functions begin */
4887 
4900  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
4901 
4914  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
4915 
4931  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
4932 
4947  result_t XIMC_API write_key (const char* uri, uint8_t* key);
4948 
4961  result_t XIMC_API command_reset(device_t id);
4962 
4975  result_t XIMC_API command_clear_fram(device_t id);
4976 
4978 
4979  // ------------------------------------
4980 
4992 
5019  device_t XIMC_API open_device (const char* uri);
5020 
5031  result_t XIMC_API close_device (device_t* id);
5032 
5082  result_t XIMC_API load_correction_table(device_t* id, const char* namefile);
5083 
5096  result_t XIMC_API probe_device (const char* uri);
5097 
5110  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5111 
5136  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5137 
5148  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5149 
5160  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5161 
5170  typedef char* pchar;
5171 
5186  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5187 
5188 
5205  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5206 
5223  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5224 
5241  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5242 
5259  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5260 
5277  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5278 
5286  result_t XIMC_API reset_locks ();
5287 
5307  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5308 
5309 
5319  void XIMC_API msec_sleep (unsigned int msec);
5320 
5330  void XIMC_API ximc_version (char* version);
5331 
5332 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5333 
5345  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5346 
5358  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5359 
5371  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5372 
5385  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5386 
5387 #endif
5388 
5412  result_t XIMC_API get_status (device_t id, status_t* status);
5413 
5439  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5440 
5466  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5467 
5486  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5487 
5500  result_t XIMC_API command_homezero(device_t id);
5502 
5503 #if defined(__cplusplus)
5504 };
5505 #endif
5506 
5507 #endif
5508 
5509 // vim: ts=4 shiftwidth=4
5510