libximc  2.14.13
ximc.h
Go to the documentation of this file.
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 
260  typedef struct calibration_t
261  {
262  double A;
263  unsigned int MicrostepMode;
264  } calibration_t;
265 
274  {
275  uint32_t ipv4;
276  char nodename[16];
278  uint32_t axis_state;
279  char locker_username[16];
280  char locker_nodename[16];
281  time_t locked_time;
283 
284 
285 
287 #define LIBXIMC_VERSION 2.14.13
288 
292 #define LIBXIMC_PROTOCOL_VERSION 20.7
293 
296 /*
297  ------------------------------------------
298  BEGIN OF GENERATED struct declarations
299  ------------------------------------------
300 */
301 
313 #define ENUMERATE_PROBE 0x01
314 #define ENUMERATE_ALL_COM 0x02
315 #define ENUMERATE_NETWORK 0x04
317 
318 
335 #define MOVE_STATE_MOVING 0x01
336 #define MOVE_STATE_TARGET_SPEED 0x02
337 #define MOVE_STATE_ANTIPLAY 0x04
339 
340 
356 #define EEPROM_PRECEDENCE 0x01
358 
359 
376 #define PWR_STATE_UNKNOWN 0x00
377 #define PWR_STATE_OFF 0x01
378 #define PWR_STATE_NORM 0x03
379 #define PWR_STATE_REDUCT 0x04
380 #define PWR_STATE_MAX 0x05
382 
383 
402 #define STATE_CONTR 0x000003F
403 #define STATE_ERRC 0x0000001
404 #define STATE_ERRD 0x0000002
405 #define STATE_ERRV 0x0000004
406 #define STATE_EEPROM_CONNECTED 0x0000010
407 #define STATE_IS_HOMED 0x0000020
408 #define STATE_SECUR 0x1B3FFC0
409 #define STATE_ALARM 0x0000040
410 #define STATE_CTP_ERROR 0x0000080
411 #define STATE_POWER_OVERHEAT 0x0000100
412 #define STATE_CONTROLLER_OVERHEAT 0x0000200
413 #define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400
414 #define STATE_OVERLOAD_POWER_CURRENT 0x0000800
415 #define STATE_OVERLOAD_USB_VOLTAGE 0x0001000
416 #define STATE_LOW_USB_VOLTAGE 0x0002000
417 #define STATE_OVERLOAD_USB_CURRENT 0x0004000
418 #define STATE_BORDERS_SWAP_MISSET 0x0008000
419 #define STATE_LOW_POWER_VOLTAGE 0x0010000
420 #define STATE_H_BRIDGE_FAULT 0x0020000
421 #define STATE_WINDING_RES_MISMATCH 0x0100000
422 #define STATE_ENCODER_FAULT 0x0200000
423 #define STATE_ENGINE_RESPONSE_ERROR 0x0800000
424 #define STATE_EXTIO_ALARM 0x1000000
426 
427 
446 #define STATE_DIG_SIGNAL 0xFFFF
447 #define STATE_RIGHT_EDGE 0x0001
448 #define STATE_LEFT_EDGE 0x0002
449 #define STATE_BUTTON_RIGHT 0x0004
450 #define STATE_BUTTON_LEFT 0x0008
451 #define STATE_GPIO_PINOUT 0x0010
452 #define STATE_GPIO_LEVEL 0x0020
453 #define STATE_BRAKE 0x0200
454 #define STATE_REV_SENSOR 0x0400
455 #define STATE_SYNC_INPUT 0x0800
456 #define STATE_SYNC_OUTPUT 0x1000
457 #define STATE_ENC_A 0x2000
458 #define STATE_ENC_B 0x4000
460 
461 
478 #define ENC_STATE_ABSENT 0x00
479 #define ENC_STATE_UNKNOWN 0x01
480 #define ENC_STATE_MALFUNC 0x02
481 #define ENC_STATE_REVERS 0x03
482 #define ENC_STATE_OK 0x04
484 
485 
502 #define WIND_A_STATE_ABSENT 0x00
503 #define WIND_A_STATE_UNKNOWN 0x01
504 #define WIND_A_STATE_MALFUNC 0x02
505 #define WIND_A_STATE_OK 0x03
506 #define WIND_B_STATE_ABSENT 0x00
507 #define WIND_B_STATE_UNKNOWN 0x10
508 #define WIND_B_STATE_MALFUNC 0x20
509 #define WIND_B_STATE_OK 0x30
511 
512 
531 #define MVCMD_NAME_BITS 0x3F
532 #define MVCMD_UKNWN 0x00
533 #define MVCMD_MOVE 0x01
534 #define MVCMD_MOVR 0x02
535 #define MVCMD_LEFT 0x03
536 #define MVCMD_RIGHT 0x04
537 #define MVCMD_STOP 0x05
538 #define MVCMD_HOME 0x06
539 #define MVCMD_LOFT 0x07
540 #define MVCMD_SSTP 0x08
541 #define MVCMD_ERROR 0x40
542 #define MVCMD_RUNNING 0x80
544 
545 
565 #define RPM_DIV_1000 0x01
567 
568 
588 #define ENGINE_REVERSE 0x01
589 #define ENGINE_CURRENT_AS_RMS 0x02
590 #define ENGINE_MAX_SPEED 0x04
591 #define ENGINE_ANTIPLAY 0x08
592 #define ENGINE_ACCEL_ON 0x10
593 #define ENGINE_LIMIT_VOLT 0x20
594 #define ENGINE_LIMIT_CURR 0x40
595 #define ENGINE_LIMIT_RPM 0x80
597 
598 
619 #define MICROSTEP_MODE_FULL 0x01
620 #define MICROSTEP_MODE_FRAC_2 0x02
621 #define MICROSTEP_MODE_FRAC_4 0x03
622 #define MICROSTEP_MODE_FRAC_8 0x04
623 #define MICROSTEP_MODE_FRAC_16 0x05
624 #define MICROSTEP_MODE_FRAC_32 0x06
625 #define MICROSTEP_MODE_FRAC_64 0x07
626 #define MICROSTEP_MODE_FRAC_128 0x08
627 #define MICROSTEP_MODE_FRAC_256 0x09
629 
630 
651 #define ENGINE_TYPE_NONE 0x00
652 #define ENGINE_TYPE_DC 0x01
653 #define ENGINE_TYPE_2DC 0x02
654 #define ENGINE_TYPE_STEP 0x03
655 #define ENGINE_TYPE_TEST 0x04
656 #define ENGINE_TYPE_BRUSHLESS 0x05
658 
659 
680 #define DRIVER_TYPE_DISCRETE_FET 0x01
681 #define DRIVER_TYPE_INTEGRATE 0x02
682 #define DRIVER_TYPE_EXTERNAL 0x03
684 
685 
704 #define POWER_REDUCT_ENABLED 0x01
705 #define POWER_OFF_ENABLED 0x02
706 #define POWER_SMOOTH_CURRENT 0x04
708 
709 
728 #define ALARM_ON_DRIVER_OVERHEATING 0x01
729 #define LOW_UPWR_PROTECTION 0x02
730 #define H_BRIDGE_ALERT 0x04
731 #define ALARM_ON_BORDERS_SWAP_MISSET 0x08
732 #define ALARM_FLAGS_STICKING 0x10
733 #define USB_BREAK_RECONNECT 0x20
734 #define ALARM_WINDING_MISMATCH 0x40
735 #define ALARM_ENGINE_RESPONSE 0x80
737 
738 
756 #define SETPOS_IGNORE_POSITION 0x01
757 #define SETPOS_IGNORE_ENCODER 0x02
759 
760 
776 #define FEEDBACK_ENCODER 0x01
777 #define FEEDBACK_EMF 0x04
778 #define FEEDBACK_NONE 0x05
779 #define FEEDBACK_ENCODER_MEDIATED 0x06
781 
782 
798 #define FEEDBACK_ENC_REVERSE 0x01
799 #define FEEDBACK_ENC_TYPE_BITS 0xC0
800 #define FEEDBACK_ENC_TYPE_AUTO 0x00
801 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
802 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
804 
805 
819 #define SYNCIN_ENABLED 0x01
820 #define SYNCIN_INVERT 0x02
821 #define SYNCIN_GOTOPOSITION 0x04
823 
824 
838 #define SYNCOUT_ENABLED 0x01
839 #define SYNCOUT_STATE 0x02
840 #define SYNCOUT_INVERT 0x04
841 #define SYNCOUT_IN_STEPS 0x08
842 #define SYNCOUT_ONSTART 0x10
843 #define SYNCOUT_ONSTOP 0x20
844 #define SYNCOUT_ONPERIOD 0x40
846 
847 
863 #define EXTIO_SETUP_OUTPUT 0x01
864 #define EXTIO_SETUP_INVERT 0x02
866 
867 
884 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
885 #define EXTIO_SETUP_MODE_IN_NOP 0x00
886 #define EXTIO_SETUP_MODE_IN_STOP 0x01
887 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
888 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
889 #define EXTIO_SETUP_MODE_IN_HOME 0x04
890 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
891 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
892 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
893 #define EXTIO_SETUP_MODE_OUT_ON 0x10
894 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
895 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
896 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
898 
899 
919 #define BORDER_IS_ENCODER 0x01
920 #define BORDER_STOP_LEFT 0x02
921 #define BORDER_STOP_RIGHT 0x04
922 #define BORDERS_SWAP_MISSET_DETECTION 0x08
924 
925 
945 #define ENDER_SWAP 0x01
946 #define ENDER_SW1_ACTIVE_LOW 0x02
947 #define ENDER_SW2_ACTIVE_LOW 0x04
949 
950 
970 #define BRAKE_ENABLED 0x01
971 #define BRAKE_ENG_PWROFF 0x02
973 
974 
994 #define CONTROL_MODE_BITS 0x03
995 #define CONTROL_MODE_OFF 0x00
996 #define CONTROL_MODE_JOY 0x01
997 #define CONTROL_MODE_LR 0x02
998 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
999 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
1001 
1002 
1020 #define JOY_REVERSE 0x01
1022 
1023 
1043 #define CTP_ENABLED 0x01
1044 #define CTP_BASE 0x02
1045 #define CTP_ALARM_ON_ERROR 0x04
1046 #define REV_SENS_INV 0x08
1047 #define CTP_ERROR_CORRECTION 0x10
1049 
1050 
1071 #define HOME_DIR_FIRST 0x001
1072 #define HOME_DIR_SECOND 0x002
1073 #define HOME_MV_SEC_EN 0x004
1074 #define HOME_HALF_MV 0x008
1075 #define HOME_STOP_FIRST_BITS 0x030
1076 #define HOME_STOP_FIRST_REV 0x010
1077 #define HOME_STOP_FIRST_SYN 0x020
1078 #define HOME_STOP_FIRST_LIM 0x030
1079 #define HOME_STOP_SECOND_BITS 0x0C0
1080 #define HOME_STOP_SECOND_REV 0x040
1081 #define HOME_STOP_SECOND_SYN 0x080
1082 #define HOME_STOP_SECOND_LIM 0x0C0
1083 #define HOME_USE_FAST 0x100
1085 
1086 
1100 #define UART_PARITY_BITS 0x03
1101 #define UART_PARITY_BIT_EVEN 0x00
1102 #define UART_PARITY_BIT_ODD 0x01
1103 #define UART_PARITY_BIT_SPACE 0x02
1104 #define UART_PARITY_BIT_MARK 0x03
1105 #define UART_PARITY_BIT_USE 0x04
1106 #define UART_STOP_BIT 0x08
1108 
1109 
1123 #define MOTOR_TYPE_UNKNOWN 0x00
1124 #define MOTOR_TYPE_STEP 0x01
1125 #define MOTOR_TYPE_DC 0x02
1126 #define MOTOR_TYPE_BLDC 0x03
1128 
1129 
1143 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1144 #define ENCSET_PUSHPULL_OUTPUT 0x004
1145 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1146 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1147 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1149 
1150 
1164 #define MB_AVAILABLE 0x01
1165 #define MB_POWERED_HOLD 0x02
1167 
1168 
1182 #define TS_TYPE_BITS 0x07
1183 #define TS_TYPE_UNKNOWN 0x00
1184 #define TS_TYPE_THERMOCOUPLE 0x01
1185 #define TS_TYPE_SEMICONDUCTOR 0x02
1186 #define TS_AVAILABLE 0x08
1188 
1189 
1203 #define LS_ON_SW1_AVAILABLE 0x01
1204 #define LS_ON_SW2_AVAILABLE 0x02
1205 #define LS_SW1_ACTIVE_LOW 0x04
1206 #define LS_SW2_ACTIVE_LOW 0x08
1207 #define LS_SHORTED 0x10
1209 
1210 
1226 #define BACK_EMF_INDUCTANCE_AUTO 0x01
1227 #define BACK_EMF_RESISTANCE_AUTO 0x02
1228 #define BACK_EMF_KM_AUTO 0x04
1230 
1231 
1243  typedef struct
1244  {
1245  unsigned int IPS;
1246  unsigned int FeedbackType;
1247  unsigned int FeedbackFlags;
1248  unsigned int CountsPerTurn;
1250 
1266  typedef struct
1267  {
1268  unsigned int FastHome;
1269  unsigned int uFastHome;
1270  unsigned int SlowHome;
1271  unsigned int uSlowHome;
1274  unsigned int HomeFlags;
1275  } home_settings_t;
1276 
1292  typedef struct
1293  {
1294  float FastHome;
1295  float SlowHome;
1296  float HomeDelta;
1297  unsigned int HomeFlags;
1299 
1311  typedef struct
1312  {
1313  unsigned int Speed;
1314  unsigned int uSpeed;
1315  unsigned int Accel;
1316  unsigned int Decel;
1317  unsigned int AntiplaySpeed;
1318  unsigned int uAntiplaySpeed;
1319  unsigned int MoveFlags;
1320  } move_settings_t;
1321 
1333  typedef struct
1334  {
1335  float Speed;
1336  float Accel;
1337  float Decel;
1339  unsigned int MoveFlags;
1341 
1362  typedef struct
1363  {
1364  unsigned int NomVoltage;
1365  unsigned int NomCurrent;
1366  unsigned int NomSpeed;
1367  unsigned int uNomSpeed;
1368  unsigned int EngineFlags;
1369  int Antiplay;
1370  unsigned int MicrostepMode;
1371  unsigned int StepsPerRev;
1373 
1394  typedef struct
1395  {
1396  unsigned int NomVoltage;
1397  unsigned int NomCurrent;
1398  float NomSpeed;
1399  unsigned int EngineFlags;
1400  float Antiplay;
1401  unsigned int MicrostepMode;
1402  unsigned int StepsPerRev;
1404 
1421  typedef struct
1422  {
1423  unsigned int EngineType;
1424  unsigned int DriverType;
1426 
1438  typedef struct
1439  {
1440  unsigned int HoldCurrent;
1441  unsigned int CurrReductDelay;
1442  unsigned int PowerOffDelay;
1443  unsigned int CurrentSetTime;
1444  unsigned int PowerFlags;
1445  } power_settings_t;
1446 
1460  typedef struct
1461  {
1462  unsigned int LowUpwrOff;
1463  unsigned int CriticalIpwr;
1464  unsigned int CriticalUpwr;
1465  unsigned int CriticalT;
1466  unsigned int CriticalIusb;
1467  unsigned int CriticalUusb;
1468  unsigned int MinimumUusb;
1469  unsigned int Flags;
1471 
1489  typedef struct
1490  {
1491  unsigned int BorderFlags;
1492  unsigned int EnderFlags;
1497  } edges_settings_t;
1498 
1516  typedef struct
1517  {
1518  unsigned int BorderFlags;
1519  unsigned int EnderFlags;
1520  float LeftBorder;
1521  float RightBorder;
1523 
1547  typedef struct
1548  {
1549  unsigned int KpU;
1550  unsigned int KiU;
1551  unsigned int KdU;
1552  float Kpf;
1553  float Kif;
1554  float Kdf;
1555  } pid_settings_t;
1556 
1572  typedef struct
1573  {
1574  unsigned int SyncInFlags;
1575  unsigned int ClutterTime;
1576  int Position;
1578  unsigned int Speed;
1579  unsigned int uSpeed;
1581 
1597  typedef struct
1598  {
1599  unsigned int SyncInFlags;
1600  unsigned int ClutterTime;
1601  float Position;
1602  float Speed;
1604 
1620  typedef struct
1621  {
1622  unsigned int SyncOutFlags;
1623  unsigned int SyncOutPulseSteps;
1624  unsigned int SyncOutPeriod;
1625  unsigned int Accuracy;
1626  unsigned int uAccuracy;
1628 
1644  typedef struct
1645  {
1646  unsigned int SyncOutFlags;
1647  unsigned int SyncOutPulseSteps;
1648  unsigned int SyncOutPeriod;
1649  float Accuracy;
1651 
1668  typedef struct
1669  {
1670  unsigned int EXTIOSetupFlags;
1671  unsigned int EXTIOModeFlags;
1672  } extio_settings_t;
1673 
1687  typedef struct
1688  {
1689  unsigned int t1;
1690  unsigned int t2;
1691  unsigned int t3;
1692  unsigned int t4;
1693  unsigned int BrakeFlags;
1694  } brake_settings_t;
1695 
1725  typedef struct
1726  {
1727  unsigned int MaxSpeed[10];
1728  unsigned int uMaxSpeed[10];
1729  unsigned int Timeout[9];
1730  unsigned int MaxClickTime;
1731  unsigned int Flags;
1735 
1765  typedef struct
1766  {
1767  float MaxSpeed[10];
1768  unsigned int Timeout[9];
1769  unsigned int MaxClickTime;
1770  unsigned int Flags;
1773 
1802  typedef struct
1803  {
1804  unsigned int JoyLowEnd;
1805  unsigned int JoyCenter;
1806  unsigned int JoyHighEnd;
1807  unsigned int ExpFactor;
1808  unsigned int DeadZone;
1809  unsigned int JoyFlags;
1811 
1845  typedef struct
1846  {
1847  unsigned int CTPMinError;
1848  unsigned int CTPFlags;
1849  } ctp_settings_t;
1850 
1864  typedef struct
1865  {
1866  unsigned int Speed;
1867  unsigned int UARTSetupFlags;
1868  } uart_settings_t;
1869 
1883  typedef struct
1884  {
1885  unsigned int DHCPEnabled;
1886  unsigned int IPv4Address[4];
1887  unsigned int SubnetMask[4];
1888  unsigned int DefaultGateway[4];
1890 
1904  typedef struct
1905  {
1906  unsigned int UserPassword[20];
1908 
1922  typedef struct
1923  {
1924  float CSS1_A;
1925  float CSS1_B;
1926  float CSS2_A;
1927  float CSS2_B;
1931 
1941  typedef struct
1942  {
1943  char ControllerName[17];
1944  unsigned int CtrlFlags;
1946 
1956  typedef struct
1957  {
1958  unsigned int UserData[7];
1960 
1982  typedef struct
1983  {
1984  float L;
1985  float R;
1986  float Km;
1987  unsigned int BackEMFFlags;
1988  } emf_settings_t;
1989 
2004  typedef struct
2005  {
2006  unsigned int stepcloseloop_Kw;
2007  unsigned int stepcloseloop_Kp_low;
2008  unsigned int stepcloseloop_Kp_high;
2010 
2028  typedef struct
2029  {
2030  unsigned int Param1;
2032 
2047  typedef struct
2048  {
2049  int Position;
2051  long_t EncPosition;
2052  } get_position_t;
2053 
2067  typedef struct
2068  {
2069  float Position;
2070  long_t EncPosition;
2072 
2087  typedef struct
2088  {
2089  int Position;
2091  long_t EncPosition;
2092  unsigned int PosFlags;
2093  } set_position_t;
2094 
2109  typedef struct
2110  {
2111  float Position;
2112  long_t EncPosition;
2113  unsigned int PosFlags;
2115 
2127  typedef struct
2128  {
2129  unsigned int MoveSts;
2130  unsigned int MvCmdSts;
2131  unsigned int PWRSts;
2132  unsigned int EncSts;
2133  unsigned int WindSts;
2136  long_t EncPosition;
2137  int CurSpeed;
2139  int Ipwr;
2140  int Upwr;
2141  int Iusb;
2142  int Uusb;
2143  int CurT;
2144  unsigned int Flags;
2145  unsigned int GPIOFlags;
2146  unsigned int CmdBufFreeSpace;
2147  } status_t;
2148 
2160  typedef struct
2161  {
2162  unsigned int MoveSts;
2163  unsigned int MvCmdSts;
2164  unsigned int PWRSts;
2165  unsigned int EncSts;
2166  unsigned int WindSts;
2167  float CurPosition;
2168  long_t EncPosition;
2169  float CurSpeed;
2170  int Ipwr;
2171  int Upwr;
2172  int Iusb;
2173  int Uusb;
2174  int CurT;
2175  unsigned int Flags;
2176  unsigned int GPIOFlags;
2177  unsigned int CmdBufFreeSpace;
2178  } status_calb_t;
2179 
2190  typedef struct
2191  {
2192  int Speed[25];
2193  int Error[25];
2194  unsigned int Length;
2195  } measurements_t;
2196 
2209  typedef struct
2210  {
2217  unsigned int Pot;
2218  unsigned int Joy;
2220  } chart_data_t;
2221 
2238  typedef struct
2239  {
2240  char Manufacturer[5];
2241  char ManufacturerId[3];
2242  char ProductDescription[9];
2243  unsigned int Major;
2244  unsigned int Minor;
2245  unsigned int Release;
2247 
2263  typedef struct
2264  {
2265  unsigned int SN;
2266  uint8_t Key[32];
2267  unsigned int Major;
2268  unsigned int Minor;
2269  unsigned int Release;
2270  } serial_number_t;
2271 
2286  typedef struct
2287  {
2288  unsigned int A1Voltage_ADC;
2289  unsigned int A2Voltage_ADC;
2290  unsigned int B1Voltage_ADC;
2291  unsigned int B2Voltage_ADC;
2292  unsigned int SupVoltage_ADC;
2293  unsigned int ACurrent_ADC;
2294  unsigned int BCurrent_ADC;
2295  unsigned int FullCurrent_ADC;
2296  unsigned int Temp_ADC;
2297  unsigned int Joy_ADC;
2298  unsigned int Pot_ADC;
2299  unsigned int L5_ADC;
2300  unsigned int H5_ADC;
2306  int ACurrent;
2307  int BCurrent;
2309  int Temp;
2310  int Joy;
2311  int Pot;
2312  int L5;
2313  int H5;
2314  unsigned int deprecated;
2315  int R;
2316  int L;
2317  } analog_data_t;
2318 
2330  typedef struct
2331  {
2332  uint8_t DebugData[128];
2333  } debug_read_t;
2334 
2346  typedef struct
2347  {
2348  uint8_t DebugData[128];
2349  } debug_write_t;
2350 
2360  typedef struct
2361  {
2362  char PositionerName[17];
2363  } stage_name_t;
2364 
2376  typedef struct
2377  {
2378  char Manufacturer[17];
2379  char PartNumber[25];
2381 
2393  typedef struct
2394  {
2396  char Units[9];
2397  float MaxSpeed;
2398  float TravelRange;
2404  } stage_settings_t;
2405 
2417  typedef struct
2418  {
2419  char Manufacturer[17];
2420  char PartNumber[25];
2422 
2434  typedef struct
2435  {
2436  unsigned int MotorType;
2437  unsigned int ReservedField;
2438  unsigned int Poles;
2439  unsigned int Phases;
2448  float StallTorque;
2454  float MaxSpeed;
2455  float MaxCurrent;
2458  float NoLoadSpeed;
2459  } motor_settings_t;
2460 
2472  typedef struct
2473  {
2474  char Manufacturer[17];
2475  char PartNumber[25];
2477 
2489  typedef struct
2490  {
2495  unsigned int PPR;
2496  unsigned int EncoderSettings;
2498 
2510  typedef struct
2511  {
2512  char Manufacturer[17];
2513  char PartNumber[25];
2515 
2527  typedef struct
2528  {
2533  unsigned int PPR;
2535 
2547  typedef struct
2548  {
2549  char Manufacturer[17];
2550  char PartNumber[25];
2552 
2564  typedef struct
2565  {
2566  float ReductionIn;
2572  float Efficiency;
2573  } gear_settings_t;
2574 
2586  typedef struct
2587  {
2588  char MagneticBrakeInfo[25];
2591  float MBTorque;
2592  unsigned int MBSettings;
2593  char TemperatureSensorInfo[25];
2594  float TSMin;
2595  float TSMax;
2596  float TSGrad;
2597  unsigned int TSSettings;
2598  unsigned int LimitSwitchesSettings;
2600 
2612  typedef struct
2613  {
2614  uint8_t key[16];
2615  } init_random_t;
2616 
2626  typedef struct
2627  {
2628  unsigned int UniqueID0;
2629  unsigned int UniqueID1;
2630  unsigned int UniqueID2;
2631  unsigned int UniqueID3;
2633 
2634 /*
2635  --------------------------------------------
2636  BEGIN OF GENERATED function declarations
2637  --------------------------------------------
2638 */
2639 
2652 
2671  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2672 
2691  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2692 
2709  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2710 
2729  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2730 
2747  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2748 
2767  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2768 
2781  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2782 
2797  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2798 
2811  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2812 
2827  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2828 
2850  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2851 
2875  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2876 
2896  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2897 
2919  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2920 
2933  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2934 
2947  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
2948 
2962  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
2963 
2978  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
2979 
2993  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
2994 
3008  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
3009 
3024  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
3025 
3050  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3051 
3066  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
3067 
3092  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3093 
3117  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
3118 
3139  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
3140 
3158  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
3159 
3179  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);
3180 
3198  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
3199 
3219  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);
3220 
3238  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
3239 
3259  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);
3260 
3275  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
3276 
3296  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);
3297 
3316  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
3317 
3333  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
3334 
3347  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
3348 
3361  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
3362 
3391  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
3392 
3423  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3424 
3453  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
3454 
3485  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3486 
3522  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
3523 
3559  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
3560 
3595  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
3596 
3631  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3632 
3649  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3650 
3667  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3668 
3688  result_t XIMC_API set_network_settings (device_t id, const network_settings_t* network_settings);
3689 
3709  result_t XIMC_API get_network_settings (device_t id, network_settings_t* network_settings);
3710 
3724  result_t XIMC_API set_password_settings (device_t id, const password_settings_t* password_settings);
3725 
3739  result_t XIMC_API get_password_settings (device_t id, password_settings_t* password_settings);
3740 
3757  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3758 
3775  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3776 
3789  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3790 
3803  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3804 
3817  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3818 
3831  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3832 
3851  result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t* emf_settings);
3852 
3869  result_t XIMC_API get_emf_settings (device_t id, emf_settings_t* emf_settings);
3870 
3885  result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t* engine_advansed_setup);
3886 
3901  result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t* engine_advansed_setup);
3902 
3917  result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t* extended_settings);
3918 
3933  result_t XIMC_API get_extended_settings (device_t id, extended_settings_t* extended_settings);
3934 
3935 
3937 
3950 
3970  result_t XIMC_API command_stop (device_t id);
3971 
3990  result_t XIMC_API command_power_off (device_t id);
3991 
4011  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
4012 
4040  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
4041 
4065  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
4066 
4098  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
4099 
4139  result_t XIMC_API command_home (device_t id);
4140 
4151  result_t XIMC_API command_left (device_t id);
4152 
4163  result_t XIMC_API command_right (device_t id);
4164 
4177  result_t XIMC_API command_loft (device_t id);
4178 
4189  result_t XIMC_API command_sstp (device_t id);
4190 
4205  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
4206 
4231  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
4232 
4249  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
4250 
4268  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
4269 
4292  result_t XIMC_API command_zero (device_t id);
4293 
4294 
4296 
4309 
4320  result_t XIMC_API command_save_settings (device_t id);
4321 
4332  result_t XIMC_API command_read_settings (device_t id);
4333 
4344  result_t XIMC_API command_save_robust_settings (device_t id);
4345 
4356  result_t XIMC_API command_read_robust_settings (device_t id);
4357 
4370  result_t XIMC_API command_eesave_settings (device_t id);
4371 
4383  result_t XIMC_API command_eeread_settings (device_t id);
4384 
4395  result_t XIMC_API command_start_measurements (device_t id);
4396 
4415  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
4416 
4433  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
4434 
4447  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
4448 
4465  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4466 
4477  result_t XIMC_API service_command_updf (device_t id);
4478 
4479 
4481 
4494 
4513  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
4514 
4529  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
4530 
4545  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
4546 
4559  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
4560 
4561 
4563 
4576 
4589  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
4590 
4603  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
4604 
4619  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
4620 
4633  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
4634 
4649  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
4650 
4663  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
4664 
4679  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
4680 
4693  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
4694 
4709  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
4710 
4723  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
4724 
4739  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
4740 
4753  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
4754 
4769  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
4770 
4783  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
4784 
4799  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
4800 
4813  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
4814 
4829  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
4830 
4843  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
4844 
4859  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
4860 
4873  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
4874 
4889  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4890 
4903  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4904 
4919  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4920 
4933  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4934 
4951  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4952 
4965  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4966 
4983  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4984 
4985 
4986 /*
4987  -------------------------
4988  END OF GENERATED CODE
4989  -------------------------
4990 */
4991 
4992 /* hand-crafted functions begin */
4993 
5006  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
5007 
5020  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
5021 
5037  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
5038 
5053  result_t XIMC_API write_key (const char* uri, uint8_t* key);
5054 
5067  result_t XIMC_API command_reset(device_t id);
5068 
5081  result_t XIMC_API command_clear_fram(device_t id);
5082 
5084 
5085  // ------------------------------------
5086 
5098 
5129  device_t XIMC_API open_device (const char* uri);
5130 
5145  result_t XIMC_API close_device (device_t* id);
5146 
5202  result_t XIMC_API load_correction_table(device_t* id, const char* namefile);
5203 
5253  result_t XIMC_API set_correction_table(device_t id, const char* namefile);
5254 
5267  result_t XIMC_API probe_device (const char* uri);
5268 
5281  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5282 
5309  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5310 
5321  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5322 
5333  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5334 
5343  typedef char* pchar;
5344 
5359  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5360 
5361 
5378  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5379 
5396  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5397 
5414  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5415 
5432  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5433 
5450  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5451 
5461  result_t XIMC_API reset_locks ();
5462 
5478  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5479 
5480 
5490  void XIMC_API msec_sleep (unsigned int msec);
5491 
5501  void XIMC_API ximc_version (char* version);
5502 
5503 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5504 
5516  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5517 
5529  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5530 
5542  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5543 
5556  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5557 
5558 #endif
5559 
5583  result_t XIMC_API get_status (device_t id, status_t* status);
5584 
5610  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5611 
5637  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5638 
5657  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5658 
5671  result_t XIMC_API command_homezero(device_t id);
5673 
5674 #if defined(__cplusplus)
5675 };
5676 #endif
5677 
5678 #endif
5679 
5680 // vim: ts=4 shiftwidth=4
5681