libximc  2.14.29
ximc.h
См. документацию.
1 #ifndef INC_XIMC_H
2 #define INC_XIMC_H
3 
25 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
26  #define XIMC_API __stdcall
27 #else
28  #ifdef LIBXIMC_EXPORTS
29  #define XIMC_API __attribute__((visibility("default")))
30  #else
31  #define XIMC_API
32  #endif
33 #endif
34 
43 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
44  #define XIMC_CALLCONV __stdcall
45 #else
46  #define XIMC_CALLCONV
47 #endif
48 
57 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
58 #define XIMC_RETTYPE unsigned int
59 #else
60 #define XIMC_RETTYPE void*
61 #endif
62 
63 
64 #if !defined(XIMC_NO_STDINT)
65 
66 #if ( (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)) && !defined(MATLAB_IMPORT)
67 // msvc types burden
68 typedef __int8 int8_t;
69 typedef __int16 int16_t;
70 typedef __int32 int32_t;
71 typedef __int64 int64_t;
72 typedef unsigned __int8 uint8_t;
73 typedef unsigned __int16 uint16_t;
74 typedef unsigned __int32 uint32_t;
75 typedef unsigned __int64 uint64_t;
76 #else
77 #include <stdint.h>
78 #endif
79 
80 /* labview doesn't speak C99 */
81 #if defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)
82 typedef unsigned __int64 ulong_t;
83 typedef __int64 long_t;
84 #else
85 typedef unsigned long long ulong_t;
86 typedef long long long_t;
87 #endif
88 
89 #endif
90 
91 #include <time.h>
92 
93 #if defined(__cplusplus)
94 extern "C"
95 {
96 #endif
97 
98 
107  typedef int device_t;
108 
117  typedef int result_t;
118 
127  #if defined(_WIN64) || defined(__LP64__) || defined(LABVIEW64_IMPORT)
128  typedef uint64_t device_enumeration_t;
129  #else
130  typedef uint32_t device_enumeration_t;
131  #endif
132  //typedef device_enumeration_t* pdevice_enumeration_t;
133 
142 #define device_undefined -1
143 
152 
161 #define result_ok 0
162 
171 #define result_error -1
172 
181 #define result_not_implemented -2
182 
191 #define result_value_error -3
192 
201 #define result_nodevice -4
202 
204 
213 
222 #define LOGLEVEL_ERROR 0x01
223 
231 #define LOGLEVEL_WARNING 0x02
232 
240 #define LOGLEVEL_INFO 0x03
241 
249 #define LOGLEVEL_DEBUG 0x04
250 
251 
252 
296  typedef struct calibration_t
297  {
298  double A;
326  unsigned int MicrostepMode;
327  } calibration_t;
328 
337  {
338  uint32_t ipv4;
339  char nodename[16];
341  uint32_t axis_state;
342  char locker_username[16];
343  char locker_nodename[16];
344  time_t locked_time;
346 
347 
348 
350 #define LIBXIMC_VERSION 2.14.29
351 
355 #define LIBXIMC_PROTOCOL_VERSION 20.9
356 
359 /*
360  ------------------------------------------
361  BEGIN OF GENERATED struct declarations
362  ------------------------------------------
363 */
364 
376 #define ENUMERATE_PROBE 0x01
377 #define ENUMERATE_ALL_COM 0x02
378 #define ENUMERATE_NETWORK 0x04
380 
381 
398 #define MOVE_STATE_MOVING 0x01
399 #define MOVE_STATE_TARGET_SPEED 0x02
400 #define MOVE_STATE_ANTIPLAY 0x04
402 
403 
419 #define EEPROM_PRECEDENCE 0x01
421 
422 
439 #define PWR_STATE_UNKNOWN 0x00
440 #define PWR_STATE_OFF 0x01
441 #define PWR_STATE_NORM 0x03
442 #define PWR_STATE_REDUCT 0x04
443 #define PWR_STATE_MAX 0x05
445 
446 
465 #define STATE_CONTR 0x000003F
466 #define STATE_ERRC 0x0000001
467 #define STATE_ERRD 0x0000002
468 #define STATE_ERRV 0x0000004
469 #define STATE_EEPROM_CONNECTED 0x0000010
470 #define STATE_IS_HOMED 0x0000020
471 #define STATE_SECUR 0x1B3FFC0
472 #define STATE_ALARM 0x0000040
473 #define STATE_CTP_ERROR 0x0000080
474 #define STATE_POWER_OVERHEAT 0x0000100
475 #define STATE_CONTROLLER_OVERHEAT 0x0000200
476 #define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400
477 #define STATE_OVERLOAD_POWER_CURRENT 0x0000800
478 #define STATE_OVERLOAD_USB_VOLTAGE 0x0001000
479 #define STATE_LOW_USB_VOLTAGE 0x0002000
480 #define STATE_OVERLOAD_USB_CURRENT 0x0004000
481 #define STATE_BORDERS_SWAP_MISSET 0x0008000
482 #define STATE_LOW_POWER_VOLTAGE 0x0010000
483 #define STATE_H_BRIDGE_FAULT 0x0020000
484 #define STATE_WINDING_RES_MISMATCH 0x0100000
485 #define STATE_ENCODER_FAULT 0x0200000
486 #define STATE_ENGINE_RESPONSE_ERROR 0x0800000
487 #define STATE_EXTIO_ALARM 0x1000000
489 
490 
509 #define STATE_DIG_SIGNAL 0xFFFF
510 #define STATE_RIGHT_EDGE 0x0001
511 #define STATE_LEFT_EDGE 0x0002
512 #define STATE_BUTTON_RIGHT 0x0004
513 #define STATE_BUTTON_LEFT 0x0008
514 #define STATE_GPIO_PINOUT 0x0010
515 #define STATE_GPIO_LEVEL 0x0020
516 #define STATE_BRAKE 0x0200
517 #define STATE_REV_SENSOR 0x0400
518 #define STATE_SYNC_INPUT 0x0800
519 #define STATE_SYNC_OUTPUT 0x1000
520 #define STATE_ENC_A 0x2000
521 #define STATE_ENC_B 0x4000
523 
524 
541 #define ENC_STATE_ABSENT 0x00
542 #define ENC_STATE_UNKNOWN 0x01
543 #define ENC_STATE_MALFUNC 0x02
544 #define ENC_STATE_REVERS 0x03
545 #define ENC_STATE_OK 0x04
547 
548 
565 #define WIND_A_STATE_ABSENT 0x00
566 #define WIND_A_STATE_UNKNOWN 0x01
567 #define WIND_A_STATE_MALFUNC 0x02
568 #define WIND_A_STATE_OK 0x03
569 #define WIND_B_STATE_ABSENT 0x00
570 #define WIND_B_STATE_UNKNOWN 0x10
571 #define WIND_B_STATE_MALFUNC 0x20
572 #define WIND_B_STATE_OK 0x30
574 
575 
594 #define MVCMD_NAME_BITS 0x3F
595 #define MVCMD_UKNWN 0x00
596 #define MVCMD_MOVE 0x01
597 #define MVCMD_MOVR 0x02
598 #define MVCMD_LEFT 0x03
599 #define MVCMD_RIGHT 0x04
600 #define MVCMD_STOP 0x05
601 #define MVCMD_HOME 0x06
602 #define MVCMD_LOFT 0x07
603 #define MVCMD_SSTP 0x08
604 #define MVCMD_ERROR 0x40
605 #define MVCMD_RUNNING 0x80
607 
608 
628 #define RPM_DIV_1000 0x01
630 
631 
651 #define ENGINE_REVERSE 0x01
652 #define ENGINE_CURRENT_AS_RMS 0x02
653 #define ENGINE_MAX_SPEED 0x04
654 #define ENGINE_ANTIPLAY 0x08
655 #define ENGINE_ACCEL_ON 0x10
656 #define ENGINE_LIMIT_VOLT 0x20
657 #define ENGINE_LIMIT_CURR 0x40
658 #define ENGINE_LIMIT_RPM 0x80
660 
661 
682 #define MICROSTEP_MODE_FULL 0x01
683 #define MICROSTEP_MODE_FRAC_2 0x02
684 #define MICROSTEP_MODE_FRAC_4 0x03
685 #define MICROSTEP_MODE_FRAC_8 0x04
686 #define MICROSTEP_MODE_FRAC_16 0x05
687 #define MICROSTEP_MODE_FRAC_32 0x06
688 #define MICROSTEP_MODE_FRAC_64 0x07
689 #define MICROSTEP_MODE_FRAC_128 0x08
690 #define MICROSTEP_MODE_FRAC_256 0x09
692 
693 
714 #define ENGINE_TYPE_NONE 0x00
715 #define ENGINE_TYPE_DC 0x01
716 #define ENGINE_TYPE_2DC 0x02
717 #define ENGINE_TYPE_STEP 0x03
718 #define ENGINE_TYPE_TEST 0x04
719 #define ENGINE_TYPE_BRUSHLESS 0x05
721 
722 
743 #define DRIVER_TYPE_DISCRETE_FET 0x01
744 #define DRIVER_TYPE_INTEGRATE 0x02
745 #define DRIVER_TYPE_EXTERNAL 0x03
747 
748 
767 #define POWER_REDUCT_ENABLED 0x01
768 #define POWER_OFF_ENABLED 0x02
769 #define POWER_SMOOTH_CURRENT 0x04
771 
772 
791 #define ALARM_ON_DRIVER_OVERHEATING 0x01
792 #define LOW_UPWR_PROTECTION 0x02
793 #define H_BRIDGE_ALERT 0x04
794 #define ALARM_ON_BORDERS_SWAP_MISSET 0x08
795 #define ALARM_FLAGS_STICKING 0x10
796 #define USB_BREAK_RECONNECT 0x20
797 #define ALARM_WINDING_MISMATCH 0x40
798 #define ALARM_ENGINE_RESPONSE 0x80
800 
801 
819 #define SETPOS_IGNORE_POSITION 0x01
820 #define SETPOS_IGNORE_ENCODER 0x02
822 
823 
839 #define FEEDBACK_ENCODER 0x01
840 #define FEEDBACK_EMF 0x04
841 #define FEEDBACK_NONE 0x05
842 #define FEEDBACK_ENCODER_MEDIATED 0x06
844 
845 
861 #define FEEDBACK_ENC_REVERSE 0x01
862 #define FEEDBACK_ENC_TYPE_BITS 0xC0
863 #define FEEDBACK_ENC_TYPE_AUTO 0x00
864 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
865 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
867 
868 
882 #define SYNCIN_ENABLED 0x01
883 #define SYNCIN_INVERT 0x02
884 #define SYNCIN_GOTOPOSITION 0x04
886 
887 
901 #define SYNCOUT_ENABLED 0x01
902 #define SYNCOUT_STATE 0x02
903 #define SYNCOUT_INVERT 0x04
904 #define SYNCOUT_IN_STEPS 0x08
905 #define SYNCOUT_ONSTART 0x10
906 #define SYNCOUT_ONSTOP 0x20
907 #define SYNCOUT_ONPERIOD 0x40
909 
910 
926 #define EXTIO_SETUP_OUTPUT 0x01
927 #define EXTIO_SETUP_INVERT 0x02
929 
930 
947 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
948 #define EXTIO_SETUP_MODE_IN_NOP 0x00
949 #define EXTIO_SETUP_MODE_IN_STOP 0x01
950 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
951 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
952 #define EXTIO_SETUP_MODE_IN_HOME 0x04
953 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
954 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
955 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
956 #define EXTIO_SETUP_MODE_OUT_ON 0x10
957 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
958 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
959 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
961 
962 
982 #define BORDER_IS_ENCODER 0x01
983 #define BORDER_STOP_LEFT 0x02
984 #define BORDER_STOP_RIGHT 0x04
985 #define BORDERS_SWAP_MISSET_DETECTION 0x08
987 
988 
1008 #define ENDER_SWAP 0x01
1009 #define ENDER_SW1_ACTIVE_LOW 0x02
1010 #define ENDER_SW2_ACTIVE_LOW 0x04
1012 
1013 
1033 #define BRAKE_ENABLED 0x01
1034 #define BRAKE_ENG_PWROFF 0x02
1036 
1037 
1057 #define CONTROL_MODE_BITS 0x03
1058 #define CONTROL_MODE_OFF 0x00
1059 #define CONTROL_MODE_JOY 0x01
1060 #define CONTROL_MODE_LR 0x02
1061 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
1062 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
1064 
1065 
1083 #define JOY_REVERSE 0x01
1085 
1086 
1106 #define CTP_ENABLED 0x01
1107 #define CTP_BASE 0x02
1108 #define CTP_ALARM_ON_ERROR 0x04
1109 #define REV_SENS_INV 0x08
1110 #define CTP_ERROR_CORRECTION 0x10
1112 
1113 
1134 #define HOME_DIR_FIRST 0x001
1135 #define HOME_DIR_SECOND 0x002
1136 #define HOME_MV_SEC_EN 0x004
1137 #define HOME_HALF_MV 0x008
1138 #define HOME_STOP_FIRST_BITS 0x030
1139 #define HOME_STOP_FIRST_REV 0x010
1140 #define HOME_STOP_FIRST_SYN 0x020
1141 #define HOME_STOP_FIRST_LIM 0x030
1142 #define HOME_STOP_SECOND_BITS 0x0C0
1143 #define HOME_STOP_SECOND_REV 0x040
1144 #define HOME_STOP_SECOND_SYN 0x080
1145 #define HOME_STOP_SECOND_LIM 0x0C0
1146 #define HOME_USE_FAST 0x100
1148 
1149 
1163 #define UART_PARITY_BITS 0x03
1164 #define UART_PARITY_BIT_EVEN 0x00
1165 #define UART_PARITY_BIT_ODD 0x01
1166 #define UART_PARITY_BIT_SPACE 0x02
1167 #define UART_PARITY_BIT_MARK 0x03
1168 #define UART_PARITY_BIT_USE 0x04
1169 #define UART_STOP_BIT 0x08
1171 
1172 
1186 #define MOTOR_TYPE_UNKNOWN 0x00
1187 #define MOTOR_TYPE_STEP 0x01
1188 #define MOTOR_TYPE_DC 0x02
1189 #define MOTOR_TYPE_BLDC 0x03
1191 
1192 
1206 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1207 #define ENCSET_PUSHPULL_OUTPUT 0x004
1208 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1209 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1210 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1212 
1213 
1227 #define MB_AVAILABLE 0x01
1228 #define MB_POWERED_HOLD 0x02
1230 
1231 
1245 #define TS_TYPE_BITS 0x07
1246 #define TS_TYPE_UNKNOWN 0x00
1247 #define TS_TYPE_THERMOCOUPLE 0x01
1248 #define TS_TYPE_SEMICONDUCTOR 0x02
1249 #define TS_AVAILABLE 0x08
1251 
1252 
1266 #define LS_ON_SW1_AVAILABLE 0x01
1267 #define LS_ON_SW2_AVAILABLE 0x02
1268 #define LS_SW1_ACTIVE_LOW 0x04
1269 #define LS_SW2_ACTIVE_LOW 0x08
1270 #define LS_SHORTED 0x10
1272 
1273 
1289 #define BACK_EMF_INDUCTANCE_AUTO 0x01
1290 #define BACK_EMF_RESISTANCE_AUTO 0x02
1291 #define BACK_EMF_KM_AUTO 0x04
1293 
1294 
1306  typedef struct
1307  {
1308  unsigned int IPS;
1309  unsigned int FeedbackType;
1310  unsigned int FeedbackFlags;
1311  unsigned int CountsPerTurn;
1313 
1328  typedef struct
1329  {
1330  unsigned int FastHome;
1331  unsigned int uFastHome;
1332  unsigned int SlowHome;
1333  unsigned int uSlowHome;
1336  unsigned int HomeFlags;
1337  } home_settings_t;
1338 
1354  typedef struct
1355  {
1356  float FastHome;
1357  float SlowHome;
1358  float HomeDelta;
1359  unsigned int HomeFlags;
1361 
1373  typedef struct
1374  {
1375  unsigned int Speed;
1376  unsigned int uSpeed;
1377  unsigned int Accel;
1378  unsigned int Decel;
1379  unsigned int AntiplaySpeed;
1380  unsigned int uAntiplaySpeed;
1381  unsigned int MoveFlags;
1382  } move_settings_t;
1383 
1395  typedef struct
1396  {
1397  float Speed;
1409  float Accel;
1421  float Decel;
1433  float AntiplaySpeed;
1445  unsigned int MoveFlags;
1447 
1464  typedef struct
1465  {
1466  unsigned int NomVoltage;
1467  unsigned int NomCurrent;
1468  unsigned int NomSpeed;
1469  unsigned int uNomSpeed;
1470  unsigned int EngineFlags;
1471  int Antiplay;
1472  unsigned int MicrostepMode;
1473  unsigned int StepsPerRev;
1475 
1493  typedef struct
1494  {
1495  unsigned int NomVoltage;
1496  unsigned int NomCurrent;
1497  float NomSpeed;
1498  unsigned int EngineFlags;
1499  float Antiplay;
1500  unsigned int MicrostepMode;
1501  unsigned int StepsPerRev;
1503 
1520  typedef struct
1521  {
1522  unsigned int EngineType;
1523  unsigned int DriverType;
1525 
1537  typedef struct
1538  {
1539  unsigned int HoldCurrent;
1540  unsigned int CurrReductDelay;
1541  unsigned int PowerOffDelay;
1542  unsigned int CurrentSetTime;
1543  unsigned int PowerFlags;
1544  } power_settings_t;
1545 
1559  typedef struct
1560  {
1561  unsigned int LowUpwrOff;
1562  unsigned int CriticalIpwr;
1563  unsigned int CriticalUpwr;
1564  unsigned int CriticalT;
1565  unsigned int CriticalIusb;
1566  unsigned int CriticalUusb;
1567  unsigned int MinimumUusb;
1568  unsigned int Flags;
1570 
1586  typedef struct
1587  {
1588  unsigned int BorderFlags;
1589  unsigned int EnderFlags;
1594  } edges_settings_t;
1595 
1611  typedef struct
1612  {
1613  unsigned int BorderFlags;
1614  unsigned int EnderFlags;
1615  float LeftBorder;
1616  float RightBorder;
1618 
1636  typedef struct
1637  {
1638  unsigned int KpU;
1639  unsigned int KiU;
1640  unsigned int KdU;
1641  float Kpf;
1642  float Kif;
1643  float Kdf;
1644  } pid_settings_t;
1645 
1660  typedef struct
1661  {
1662  unsigned int SyncInFlags;
1663  unsigned int ClutterTime;
1664  int Position;
1666  unsigned int Speed;
1667  unsigned int uSpeed;
1669 
1683  typedef struct
1684  {
1685  unsigned int SyncInFlags;
1686  unsigned int ClutterTime;
1687  float Position;
1688  float Speed;
1690 
1704  typedef struct
1705  {
1706  unsigned int SyncOutFlags;
1707  unsigned int SyncOutPulseSteps;
1708  unsigned int SyncOutPeriod;
1709  unsigned int Accuracy;
1710  unsigned int uAccuracy;
1712 
1727  typedef struct
1728  {
1729  unsigned int SyncOutFlags;
1730  unsigned int SyncOutPulseSteps;
1731  unsigned int SyncOutPeriod;
1732  float Accuracy;
1734 
1751  typedef struct
1752  {
1753  unsigned int EXTIOSetupFlags;
1754  unsigned int EXTIOModeFlags;
1755  } extio_settings_t;
1756 
1771  typedef struct
1772  {
1773  unsigned int t1;
1774  unsigned int t2;
1775  unsigned int t3;
1776  unsigned int t4;
1777  unsigned int BrakeFlags;
1778  } brake_settings_t;
1779 
1805  typedef struct
1806  {
1807  unsigned int MaxSpeed[10];
1808  unsigned int uMaxSpeed[10];
1809  unsigned int Timeout[9];
1810  unsigned int MaxClickTime;
1811  unsigned int Flags;
1815 
1841  typedef struct
1842  {
1843  float MaxSpeed[10];
1844  unsigned int Timeout[9];
1845  unsigned int MaxClickTime;
1846  unsigned int Flags;
1849 
1882  typedef struct
1883  {
1884  unsigned int JoyLowEnd;
1885  unsigned int JoyCenter;
1886  unsigned int JoyHighEnd;
1887  unsigned int ExpFactor;
1888  unsigned int DeadZone;
1889  unsigned int JoyFlags;
1891 
1910  typedef struct
1911  {
1912  unsigned int CTPMinError;
1913  unsigned int CTPFlags;
1914  } ctp_settings_t;
1915 
1930  typedef struct
1931  {
1932  unsigned int Speed;
1933  unsigned int UARTSetupFlags;
1934  } uart_settings_t;
1935 
1949  typedef struct
1950  {
1951  unsigned int DHCPEnabled;
1952  unsigned int IPv4Address[4];
1953  unsigned int SubnetMask[4];
1954  unsigned int DefaultGateway[4];
1956 
1970  typedef struct
1971  {
1972  char UserPassword[21];
1974 
1989  typedef struct
1990  {
1991  float CSS1_A;
1992  float CSS1_B;
1993  float CSS2_A;
1994  float CSS2_B;
1998 
2008  typedef struct
2009  {
2010  char ControllerName[17];
2011  unsigned int CtrlFlags;
2013 
2023  typedef struct
2024  {
2025  unsigned int UserData[7];
2027 
2046  typedef struct
2047  {
2048  float L;
2049  float R;
2050  float Km;
2051  unsigned int BackEMFFlags;
2052  } emf_settings_t;
2053 
2069  typedef struct
2070  {
2071  unsigned int stepcloseloop_Kw;
2072  unsigned int stepcloseloop_Kp_low;
2073  unsigned int stepcloseloop_Kp_high;
2075 
2091  typedef struct
2092  {
2093  unsigned int Param1;
2095 
2110  typedef struct
2111  {
2112  int Position;
2114  long_t EncPosition;
2115  } get_position_t;
2116 
2130  typedef struct
2131  {
2132  float Position;
2133  long_t EncPosition;
2135 
2148  typedef struct
2149  {
2150  int Position;
2152  long_t EncPosition;
2153  unsigned int PosFlags;
2154  } set_position_t;
2155 
2168  typedef struct
2169  {
2170  float Position;
2171  long_t EncPosition;
2172  unsigned int PosFlags;
2174 
2187  typedef struct
2188  {
2189  unsigned int MoveSts;
2190  unsigned int MvCmdSts;
2191  unsigned int PWRSts;
2192  unsigned int EncSts;
2193  unsigned int WindSts;
2196  long_t EncPosition;
2197  int CurSpeed;
2199  int Ipwr;
2200  int Upwr;
2201  int Iusb;
2202  int Uusb;
2203  int CurT;
2204  unsigned int Flags;
2205  unsigned int GPIOFlags;
2206  unsigned int CmdBufFreeSpace;
2207  } status_t;
2208 
2221  typedef struct
2222  {
2223  unsigned int MoveSts;
2224  unsigned int MvCmdSts;
2225  unsigned int PWRSts;
2226  unsigned int EncSts;
2227  unsigned int WindSts;
2228  float CurPosition;
2229  long_t EncPosition;
2230  float CurSpeed;
2231  int Ipwr;
2232  int Upwr;
2233  int Iusb;
2234  int Uusb;
2235  int CurT;
2236  unsigned int Flags;
2237  unsigned int GPIOFlags;
2238  unsigned int CmdBufFreeSpace;
2239  } status_calb_t;
2240 
2251  typedef struct
2252  {
2253  int Speed[25];
2254  int Error[25];
2255  unsigned int Length;
2256  } measurements_t;
2257 
2271  typedef struct
2272  {
2279  unsigned int Pot;
2280  unsigned int Joy;
2282  } chart_data_t;
2283 
2294  typedef struct
2295  {
2296  char Manufacturer[5];
2297  char ManufacturerId[3];
2298  char ProductDescription[9];
2299  unsigned int Major;
2300  unsigned int Minor;
2301  unsigned int Release;
2303 
2314  typedef struct
2315  {
2316  unsigned int SN;
2317  uint8_t Key[32];
2318  unsigned int Major;
2319  unsigned int Minor;
2320  unsigned int Release;
2321  } serial_number_t;
2322 
2336  typedef struct
2337  {
2338  unsigned int A1Voltage_ADC;
2339  unsigned int A2Voltage_ADC;
2340  unsigned int B1Voltage_ADC;
2341  unsigned int B2Voltage_ADC;
2342  unsigned int SupVoltage_ADC;
2343  unsigned int ACurrent_ADC;
2344  unsigned int BCurrent_ADC;
2345  unsigned int FullCurrent_ADC;
2346  unsigned int Temp_ADC;
2347  unsigned int Joy_ADC;
2348  unsigned int Pot_ADC;
2349  unsigned int L5_ADC;
2350  unsigned int H5_ADC;
2356  int ACurrent;
2357  int BCurrent;
2359  int Temp;
2360  int Joy;
2361  int Pot;
2362  int L5;
2363  int H5;
2364  unsigned int deprecated;
2365  int R;
2366  int L;
2367  } analog_data_t;
2368 
2380  typedef struct
2381  {
2382  uint8_t DebugData[128];
2383  } debug_read_t;
2384 
2396  typedef struct
2397  {
2398  uint8_t DebugData[128];
2399  } debug_write_t;
2400 
2410  typedef struct
2411  {
2412  char PositionerName[17];
2413  } stage_name_t;
2414 
2426  typedef struct
2427  {
2428  char Manufacturer[17];
2429  char PartNumber[25];
2431 
2443  typedef struct
2444  {
2446  char Units[9];
2447  float MaxSpeed;
2448  float TravelRange;
2454  } stage_settings_t;
2455 
2467  typedef struct
2468  {
2469  char Manufacturer[17];
2470  char PartNumber[25];
2472 
2484  typedef struct
2485  {
2486  unsigned int MotorType;
2487  unsigned int ReservedField;
2488  unsigned int Poles;
2489  unsigned int Phases;
2498  float StallTorque;
2504  float MaxSpeed;
2505  float MaxCurrent;
2508  float NoLoadSpeed;
2509  } motor_settings_t;
2510 
2522  typedef struct
2523  {
2524  char Manufacturer[17];
2525  char PartNumber[25];
2527 
2539  typedef struct
2540  {
2545  unsigned int PPR;
2546  unsigned int EncoderSettings;
2548 
2560  typedef struct
2561  {
2562  char Manufacturer[17];
2563  char PartNumber[25];
2565 
2577  typedef struct
2578  {
2583  unsigned int PPR;
2585 
2597  typedef struct
2598  {
2599  char Manufacturer[17];
2600  char PartNumber[25];
2602 
2614  typedef struct
2615  {
2616  float ReductionIn;
2622  float Efficiency;
2623  } gear_settings_t;
2624 
2636  typedef struct
2637  {
2638  char MagneticBrakeInfo[25];
2641  float MBTorque;
2642  unsigned int MBSettings;
2643  char TemperatureSensorInfo[25];
2644  float TSMin;
2645  float TSMax;
2646  float TSGrad;
2647  unsigned int TSSettings;
2648  unsigned int LimitSwitchesSettings;
2650 
2663  typedef struct
2664  {
2665  uint8_t key[16];
2666  } init_random_t;
2667 
2677  typedef struct
2678  {
2679  unsigned int UniqueID0;
2680  unsigned int UniqueID1;
2681  unsigned int UniqueID2;
2682  unsigned int UniqueID3;
2684 
2685 /*
2686  --------------------------------------------
2687  BEGIN OF GENERATED function declarations
2688  --------------------------------------------
2689 */
2690 
2703 
2722  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2723 
2742  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2743 
2760  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2761 
2780  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2781 
2798  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2799 
2818  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2819 
2832  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2833 
2848  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2849 
2862  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2863 
2878  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2879 
2898  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2899 
2920  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2921 
2940  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2941 
2962  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2963 
2976  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2977 
2990  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
2991 
3005  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
3006 
3021  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
3022 
3036  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
3037 
3051  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
3052 
3067  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
3068 
3093  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3094 
3109  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
3110 
3135  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3136 
3155  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
3156 
3174  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
3175 
3192  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
3193 
3212  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);
3213 
3230  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
3231 
3250  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);
3251 
3268  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
3269 
3288  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);
3289 
3304  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
3305 
3324  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);
3325 
3343  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
3344 
3360  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
3361 
3374  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
3375 
3388  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
3389 
3414  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
3415 
3442  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3443 
3468  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
3469 
3496  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3497 
3526  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
3527 
3556  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
3557 
3577  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
3578 
3596  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3597 
3614  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3615 
3632  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3633 
3653  result_t XIMC_API set_network_settings (device_t id, const network_settings_t* network_settings);
3654 
3674  result_t XIMC_API get_network_settings (device_t id, network_settings_t* network_settings);
3675 
3689  result_t XIMC_API set_password_settings (device_t id, const password_settings_t* password_settings);
3690 
3704  result_t XIMC_API get_password_settings (device_t id, password_settings_t* password_settings);
3705 
3722  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3723 
3740  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3741 
3754  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3755 
3768  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3769 
3782  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3783 
3796  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3797 
3815  result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t* emf_settings);
3816 
3833  result_t XIMC_API get_emf_settings (device_t id, emf_settings_t* emf_settings);
3834 
3849  result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t* engine_advansed_setup);
3850 
3865  result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t* engine_advansed_setup);
3866 
3881  result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t* extended_settings);
3882 
3897  result_t XIMC_API get_extended_settings (device_t id, extended_settings_t* extended_settings);
3898 
3899 
3901 
3914 
3932  result_t XIMC_API command_stop (device_t id);
3933 
3948  result_t XIMC_API command_power_off (device_t id);
3949 
3968  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
3969 
3996  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
3997 
4014  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
4015 
4040  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
4041 
4077  result_t XIMC_API command_home (device_t id);
4078 
4089  result_t XIMC_API command_left (device_t id);
4090 
4101  result_t XIMC_API command_right (device_t id);
4102 
4114  result_t XIMC_API command_loft (device_t id);
4115 
4126  result_t XIMC_API command_sstp (device_t id);
4127 
4141  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
4142 
4165  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
4166 
4181  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
4182 
4197  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
4198 
4209  result_t XIMC_API command_zero (device_t id);
4210 
4211 
4213 
4226 
4237  result_t XIMC_API command_save_settings (device_t id);
4238 
4249  result_t XIMC_API command_read_settings (device_t id);
4250 
4261  result_t XIMC_API command_save_robust_settings (device_t id);
4262 
4273  result_t XIMC_API command_read_robust_settings (device_t id);
4274 
4287  result_t XIMC_API command_eesave_settings (device_t id);
4288 
4299  result_t XIMC_API command_eeread_settings (device_t id);
4300 
4311  result_t XIMC_API command_start_measurements (device_t id);
4312 
4331  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
4332 
4349  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
4350 
4363  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
4364 
4381  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4382 
4393  result_t XIMC_API service_command_updf (device_t id);
4394 
4395 
4397 
4410 
4429  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
4430 
4443  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
4444 
4459  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
4460 
4473  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
4474 
4475 
4477 
4490 
4503  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
4504 
4517  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
4518 
4533  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
4534 
4547  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
4548 
4563  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
4564 
4577  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
4578 
4593  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
4594 
4607  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
4608 
4623  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
4624 
4637  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
4638 
4653  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
4654 
4667  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
4668 
4683  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
4684 
4697  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
4698 
4713  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
4714 
4727  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
4728 
4743  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
4744 
4757  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
4758 
4773  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
4774 
4787  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
4788 
4803  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4804 
4817  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4818 
4833  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4834 
4847  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4848 
4865  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4866 
4879  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4880 
4896  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4897 
4898 
4899 /*
4900  -------------------------
4901  END OF GENERATED CODE
4902  -------------------------
4903 */
4904 
4905 /* hand-crafted functions begin */
4906 
4919  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
4920 
4933  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
4934 
4950  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
4951 
4966  result_t XIMC_API write_key (const char* uri, uint8_t* key);
4967 
4980  result_t XIMC_API command_reset(device_t id);
4981 
4994  result_t XIMC_API command_clear_fram(device_t id);
4995 
4997 
4998  // ------------------------------------
4999 
5011 
5039  device_t XIMC_API open_device (const char* uri);
5040 
5055  result_t XIMC_API close_device (device_t* id);
5056 
5112  result_t XIMC_API load_correction_table(device_t* id, const char* namefile);
5113 
5158  result_t XIMC_API set_correction_table(device_t id, const char* namefile);
5159 
5172  result_t XIMC_API probe_device (const char* uri);
5173 
5183  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5184 
5211  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5212 
5223  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5224 
5235  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5236 
5245  typedef char* pchar;
5246 
5261  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5262 
5263 
5280  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5281 
5298  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5299 
5316  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5317 
5334  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5335 
5352  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5353 
5361  result_t XIMC_API reset_locks ();
5362 
5378  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5379 
5380 
5390  void XIMC_API msec_sleep (unsigned int msec);
5391 
5401  void XIMC_API ximc_version (char* version);
5402 
5403 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5404 
5416  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5417 
5429  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5430 
5442  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5443 
5456  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5457 
5458 #endif
5459 
5483  result_t XIMC_API get_status (device_t id, status_t* status);
5484 
5510  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5511 
5537  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5538 
5557  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5558 
5571  result_t XIMC_API command_homezero(device_t id);
5573 
5574 #if defined(__cplusplus)
5575 };
5576 #endif
5577 
5578 #endif
5579 
5580 // vim: ts=4 shiftwidth=4
5581