libximc  2.13.6
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];
277  uint32_t axis_state;
278  char locker_username[16];
279  char locker_nodename[16];
280  time_t locked_time;
282 
283 
284 
286 #define LIBXIMC_VERSION 2.13.6
287 
291 #define LIBXIMC_PROTOCOL_VERSION 20.5
292 
295 /*
296  ------------------------------------------
297  BEGIN OF GENERATED struct declarations
298  ------------------------------------------
299 */
300 
312 #define ENUMERATE_PROBE 0x01
313 #define ENUMERATE_ALL_COM 0x02
314 #define ENUMERATE_NETWORK 0x04
316 
317 
334 #define MOVE_STATE_MOVING 0x01
335 #define MOVE_STATE_TARGET_SPEED 0x02
336 #define MOVE_STATE_ANTIPLAY 0x04
338 
339 
355 #define EEPROM_PRECEDENCE 0x01
357 
358 
375 #define PWR_STATE_UNKNOWN 0x00
376 #define PWR_STATE_OFF 0x01
377 #define PWR_STATE_NORM 0x03
378 #define PWR_STATE_REDUCT 0x04
379 #define PWR_STATE_MAX 0x05
381 
382 
401 #define STATE_CONTR 0x000003F
402 #define STATE_ERRC 0x0000001
403 #define STATE_ERRD 0x0000002
404 #define STATE_ERRV 0x0000004
405 #define STATE_EEPROM_CONNECTED 0x0000010
406 #define STATE_IS_HOMED 0x0000020
407 #define STATE_SECUR 0x1B3FFC0
408 #define STATE_ALARM 0x0000040
409 #define STATE_CTP_ERROR 0x0000080
410 #define STATE_POWER_OVERHEAT 0x0000100
411 #define STATE_CONTROLLER_OVERHEAT 0x0000200
412 #define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400
413 #define STATE_OVERLOAD_POWER_CURRENT 0x0000800
414 #define STATE_OVERLOAD_USB_VOLTAGE 0x0001000
415 #define STATE_LOW_USB_VOLTAGE 0x0002000
416 #define STATE_OVERLOAD_USB_CURRENT 0x0004000
417 #define STATE_BORDERS_SWAP_MISSET 0x0008000
418 #define STATE_LOW_POWER_VOLTAGE 0x0010000
419 #define STATE_H_BRIDGE_FAULT 0x0020000
420 #define STATE_WINDING_RES_MISMATCH 0x0100000
421 #define STATE_ENCODER_FAULT 0x0200000
422 #define STATE_ENGINE_RESPONSE_ERROR 0x0800000
423 #define STATE_EXTIO_ALARM 0x1000000
425 
426 
445 #define STATE_DIG_SIGNAL 0xFFFF
446 #define STATE_RIGHT_EDGE 0x0001
447 #define STATE_LEFT_EDGE 0x0002
448 #define STATE_BUTTON_RIGHT 0x0004
449 #define STATE_BUTTON_LEFT 0x0008
450 #define STATE_GPIO_PINOUT 0x0010
451 #define STATE_GPIO_LEVEL 0x0020
452 #define STATE_BRAKE 0x0200
453 #define STATE_REV_SENSOR 0x0400
454 #define STATE_SYNC_INPUT 0x0800
455 #define STATE_SYNC_OUTPUT 0x1000
456 #define STATE_ENC_A 0x2000
457 #define STATE_ENC_B 0x4000
459 
460 
477 #define ENC_STATE_ABSENT 0x00
478 #define ENC_STATE_UNKNOWN 0x01
479 #define ENC_STATE_MALFUNC 0x02
480 #define ENC_STATE_REVERS 0x03
481 #define ENC_STATE_OK 0x04
483 
484 
501 #define WIND_A_STATE_ABSENT 0x00
502 #define WIND_A_STATE_UNKNOWN 0x01
503 #define WIND_A_STATE_MALFUNC 0x02
504 #define WIND_A_STATE_OK 0x03
505 #define WIND_B_STATE_ABSENT 0x00
506 #define WIND_B_STATE_UNKNOWN 0x10
507 #define WIND_B_STATE_MALFUNC 0x20
508 #define WIND_B_STATE_OK 0x30
510 
511 
530 #define MVCMD_NAME_BITS 0x3F
531 #define MVCMD_UKNWN 0x00
532 #define MVCMD_MOVE 0x01
533 #define MVCMD_MOVR 0x02
534 #define MVCMD_LEFT 0x03
535 #define MVCMD_RIGHT 0x04
536 #define MVCMD_STOP 0x05
537 #define MVCMD_HOME 0x06
538 #define MVCMD_LOFT 0x07
539 #define MVCMD_SSTP 0x08
540 #define MVCMD_ERROR 0x40
541 #define MVCMD_RUNNING 0x80
543 
544 
564 #define RPM_DIV_1000 0x01
566 
567 
587 #define ENGINE_REVERSE 0x01
588 #define ENGINE_CURRENT_AS_RMS 0x02
589 #define ENGINE_MAX_SPEED 0x04
590 #define ENGINE_ANTIPLAY 0x08
591 #define ENGINE_ACCEL_ON 0x10
592 #define ENGINE_LIMIT_VOLT 0x20
593 #define ENGINE_LIMIT_CURR 0x40
594 #define ENGINE_LIMIT_RPM 0x80
596 
597 
618 #define MICROSTEP_MODE_FULL 0x01
619 #define MICROSTEP_MODE_FRAC_2 0x02
620 #define MICROSTEP_MODE_FRAC_4 0x03
621 #define MICROSTEP_MODE_FRAC_8 0x04
622 #define MICROSTEP_MODE_FRAC_16 0x05
623 #define MICROSTEP_MODE_FRAC_32 0x06
624 #define MICROSTEP_MODE_FRAC_64 0x07
625 #define MICROSTEP_MODE_FRAC_128 0x08
626 #define MICROSTEP_MODE_FRAC_256 0x09
628 
629 
650 #define ENGINE_TYPE_NONE 0x00
651 #define ENGINE_TYPE_DC 0x01
652 #define ENGINE_TYPE_2DC 0x02
653 #define ENGINE_TYPE_STEP 0x03
654 #define ENGINE_TYPE_TEST 0x04
655 #define ENGINE_TYPE_BRUSHLESS 0x05
657 
658 
679 #define DRIVER_TYPE_DISCRETE_FET 0x01
680 #define DRIVER_TYPE_INTEGRATE 0x02
681 #define DRIVER_TYPE_EXTERNAL 0x03
683 
684 
703 #define POWER_REDUCT_ENABLED 0x01
704 #define POWER_OFF_ENABLED 0x02
705 #define POWER_SMOOTH_CURRENT 0x04
707 
708 
727 #define ALARM_ON_DRIVER_OVERHEATING 0x01
728 #define LOW_UPWR_PROTECTION 0x02
729 #define H_BRIDGE_ALERT 0x04
730 #define ALARM_ON_BORDERS_SWAP_MISSET 0x08
731 #define ALARM_FLAGS_STICKING 0x10
732 #define USB_BREAK_RECONNECT 0x20
733 #define ALARM_WINDING_MISMATCH 0x40
734 #define ALARM_ENGINE_RESPONSE 0x80
736 
737 
755 #define SETPOS_IGNORE_POSITION 0x01
756 #define SETPOS_IGNORE_ENCODER 0x02
758 
759 
775 #define FEEDBACK_ENCODER 0x01
776 #define FEEDBACK_EMF 0x04
777 #define FEEDBACK_NONE 0x05
778 #define FEEDBACK_ENCODER_MEDIATED 0x06
780 
781 
797 #define FEEDBACK_ENC_REVERSE 0x01
798 #define FEEDBACK_ENC_TYPE_BITS 0xC0
799 #define FEEDBACK_ENC_TYPE_AUTO 0x00
800 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
801 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
803 
804 
818 #define SYNCIN_ENABLED 0x01
819 #define SYNCIN_INVERT 0x02
820 #define SYNCIN_GOTOPOSITION 0x04
822 
823 
837 #define SYNCOUT_ENABLED 0x01
838 #define SYNCOUT_STATE 0x02
839 #define SYNCOUT_INVERT 0x04
840 #define SYNCOUT_IN_STEPS 0x08
841 #define SYNCOUT_ONSTART 0x10
842 #define SYNCOUT_ONSTOP 0x20
843 #define SYNCOUT_ONPERIOD 0x40
845 
846 
862 #define EXTIO_SETUP_OUTPUT 0x01
863 #define EXTIO_SETUP_INVERT 0x02
865 
866 
883 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
884 #define EXTIO_SETUP_MODE_IN_NOP 0x00
885 #define EXTIO_SETUP_MODE_IN_STOP 0x01
886 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
887 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
888 #define EXTIO_SETUP_MODE_IN_HOME 0x04
889 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
890 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
891 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
892 #define EXTIO_SETUP_MODE_OUT_ON 0x10
893 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
894 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
895 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
897 
898 
918 #define BORDER_IS_ENCODER 0x01
919 #define BORDER_STOP_LEFT 0x02
920 #define BORDER_STOP_RIGHT 0x04
921 #define BORDERS_SWAP_MISSET_DETECTION 0x08
923 
924 
944 #define ENDER_SWAP 0x01
945 #define ENDER_SW1_ACTIVE_LOW 0x02
946 #define ENDER_SW2_ACTIVE_LOW 0x04
948 
949 
969 #define BRAKE_ENABLED 0x01
970 #define BRAKE_ENG_PWROFF 0x02
972 
973 
993 #define CONTROL_MODE_BITS 0x03
994 #define CONTROL_MODE_OFF 0x00
995 #define CONTROL_MODE_JOY 0x01
996 #define CONTROL_MODE_LR 0x02
997 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
998 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
1000 
1001 
1019 #define JOY_REVERSE 0x01
1021 
1022 
1042 #define CTP_ENABLED 0x01
1043 #define CTP_BASE 0x02
1044 #define CTP_ALARM_ON_ERROR 0x04
1045 #define REV_SENS_INV 0x08
1046 #define CTP_ERROR_CORRECTION 0x10
1048 
1049 
1070 #define HOME_DIR_FIRST 0x001
1071 #define HOME_DIR_SECOND 0x002
1072 #define HOME_MV_SEC_EN 0x004
1073 #define HOME_HALF_MV 0x008
1074 #define HOME_STOP_FIRST_BITS 0x030
1075 #define HOME_STOP_FIRST_REV 0x010
1076 #define HOME_STOP_FIRST_SYN 0x020
1077 #define HOME_STOP_FIRST_LIM 0x030
1078 #define HOME_STOP_SECOND_BITS 0x0C0
1079 #define HOME_STOP_SECOND_REV 0x040
1080 #define HOME_STOP_SECOND_SYN 0x080
1081 #define HOME_STOP_SECOND_LIM 0x0C0
1082 #define HOME_USE_FAST 0x100
1084 
1085 
1099 #define UART_PARITY_BITS 0x03
1100 #define UART_PARITY_BIT_EVEN 0x00
1101 #define UART_PARITY_BIT_ODD 0x01
1102 #define UART_PARITY_BIT_SPACE 0x02
1103 #define UART_PARITY_BIT_MARK 0x03
1104 #define UART_PARITY_BIT_USE 0x04
1105 #define UART_STOP_BIT 0x08
1107 
1108 
1122 #define MOTOR_TYPE_UNKNOWN 0x00
1123 #define MOTOR_TYPE_STEP 0x01
1124 #define MOTOR_TYPE_DC 0x02
1125 #define MOTOR_TYPE_BLDC 0x03
1127 
1128 
1142 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1143 #define ENCSET_PUSHPULL_OUTPUT 0x004
1144 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1145 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1146 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1148 
1149 
1163 #define MB_AVAILABLE 0x01
1164 #define MB_POWERED_HOLD 0x02
1166 
1167 
1181 #define TS_TYPE_BITS 0x07
1182 #define TS_TYPE_UNKNOWN 0x00
1183 #define TS_TYPE_THERMOCOUPLE 0x01
1184 #define TS_TYPE_SEMICONDUCTOR 0x02
1185 #define TS_AVAILABLE 0x08
1187 
1188 
1202 #define LS_ON_SW1_AVAILABLE 0x01
1203 #define LS_ON_SW2_AVAILABLE 0x02
1204 #define LS_SW1_ACTIVE_LOW 0x04
1205 #define LS_SW2_ACTIVE_LOW 0x08
1206 #define LS_SHORTED 0x10
1208 
1209 
1225 #define BACK_EMF_INDUCTANCE_AUTO 0x01
1226 #define BACK_EMF_RESISTANCE_AUTO 0x02
1227 #define BACK_EMF_KM_AUTO 0x04
1229 
1230 
1242  typedef struct
1243  {
1244  unsigned int IPS;
1245  unsigned int FeedbackType;
1246  unsigned int FeedbackFlags;
1247  unsigned int CountsPerTurn;
1249 
1265  typedef struct
1266  {
1267  unsigned int FastHome;
1268  unsigned int uFastHome;
1269  unsigned int SlowHome;
1270  unsigned int uSlowHome;
1273  unsigned int HomeFlags;
1274  } home_settings_t;
1275 
1291  typedef struct
1292  {
1293  float FastHome;
1294  float SlowHome;
1295  float HomeDelta;
1296  unsigned int HomeFlags;
1298 
1310  typedef struct
1311  {
1312  unsigned int Speed;
1313  unsigned int uSpeed;
1314  unsigned int Accel;
1315  unsigned int Decel;
1316  unsigned int AntiplaySpeed;
1317  unsigned int uAntiplaySpeed;
1318  unsigned int MoveFlags;
1319  } move_settings_t;
1320 
1332  typedef struct
1333  {
1334  float Speed;
1335  float Accel;
1336  float Decel;
1338  unsigned int MoveFlags;
1340 
1361  typedef struct
1362  {
1363  unsigned int NomVoltage;
1364  unsigned int NomCurrent;
1365  unsigned int NomSpeed;
1366  unsigned int uNomSpeed;
1367  unsigned int EngineFlags;
1368  int Antiplay;
1369  unsigned int MicrostepMode;
1370  unsigned int StepsPerRev;
1372 
1393  typedef struct
1394  {
1395  unsigned int NomVoltage;
1396  unsigned int NomCurrent;
1397  float NomSpeed;
1398  unsigned int EngineFlags;
1399  float Antiplay;
1400  unsigned int MicrostepMode;
1401  unsigned int StepsPerRev;
1403 
1420  typedef struct
1421  {
1422  unsigned int EngineType;
1423  unsigned int DriverType;
1425 
1437  typedef struct
1438  {
1439  unsigned int HoldCurrent;
1440  unsigned int CurrReductDelay;
1441  unsigned int PowerOffDelay;
1442  unsigned int CurrentSetTime;
1443  unsigned int PowerFlags;
1444  } power_settings_t;
1445 
1459  typedef struct
1460  {
1461  unsigned int LowUpwrOff;
1462  unsigned int CriticalIpwr;
1463  unsigned int CriticalUpwr;
1464  unsigned int CriticalT;
1465  unsigned int CriticalIusb;
1466  unsigned int CriticalUusb;
1467  unsigned int MinimumUusb;
1468  unsigned int Flags;
1470 
1488  typedef struct
1489  {
1490  unsigned int BorderFlags;
1491  unsigned int EnderFlags;
1496  } edges_settings_t;
1497 
1515  typedef struct
1516  {
1517  unsigned int BorderFlags;
1518  unsigned int EnderFlags;
1519  float LeftBorder;
1520  float RightBorder;
1522 
1546  typedef struct
1547  {
1548  unsigned int KpU;
1549  unsigned int KiU;
1550  unsigned int KdU;
1551  float Kpf;
1552  float Kif;
1553  float Kdf;
1554  } pid_settings_t;
1555 
1571  typedef struct
1572  {
1573  unsigned int SyncInFlags;
1574  unsigned int ClutterTime;
1575  int Position;
1577  unsigned int Speed;
1578  unsigned int uSpeed;
1580 
1596  typedef struct
1597  {
1598  unsigned int SyncInFlags;
1599  unsigned int ClutterTime;
1600  float Position;
1601  float Speed;
1603 
1619  typedef struct
1620  {
1621  unsigned int SyncOutFlags;
1622  unsigned int SyncOutPulseSteps;
1623  unsigned int SyncOutPeriod;
1624  unsigned int Accuracy;
1625  unsigned int uAccuracy;
1627 
1643  typedef struct
1644  {
1645  unsigned int SyncOutFlags;
1646  unsigned int SyncOutPulseSteps;
1647  unsigned int SyncOutPeriod;
1648  float Accuracy;
1650 
1667  typedef struct
1668  {
1669  unsigned int EXTIOSetupFlags;
1670  unsigned int EXTIOModeFlags;
1671  } extio_settings_t;
1672 
1686  typedef struct
1687  {
1688  unsigned int t1;
1689  unsigned int t2;
1690  unsigned int t3;
1691  unsigned int t4;
1692  unsigned int BrakeFlags;
1693  } brake_settings_t;
1694 
1724  typedef struct
1725  {
1726  unsigned int MaxSpeed[10];
1727  unsigned int uMaxSpeed[10];
1728  unsigned int Timeout[9];
1729  unsigned int MaxClickTime;
1730  unsigned int Flags;
1734 
1764  typedef struct
1765  {
1766  float MaxSpeed[10];
1767  unsigned int Timeout[9];
1768  unsigned int MaxClickTime;
1769  unsigned int Flags;
1772 
1801  typedef struct
1802  {
1803  unsigned int JoyLowEnd;
1804  unsigned int JoyCenter;
1805  unsigned int JoyHighEnd;
1806  unsigned int ExpFactor;
1807  unsigned int DeadZone;
1808  unsigned int JoyFlags;
1810 
1844  typedef struct
1845  {
1846  unsigned int CTPMinError;
1847  unsigned int CTPFlags;
1848  } ctp_settings_t;
1849 
1863  typedef struct
1864  {
1865  unsigned int Speed;
1866  unsigned int UARTSetupFlags;
1867  } uart_settings_t;
1868 
1882  typedef struct
1883  {
1884  float CSS1_A;
1885  float CSS1_B;
1886  float CSS2_A;
1887  float CSS2_B;
1891 
1901  typedef struct
1902  {
1903  char ControllerName[17];
1904  unsigned int CtrlFlags;
1906 
1916  typedef struct
1917  {
1918  unsigned int UserData[7];
1920 
1942  typedef struct
1943  {
1944  float L;
1945  float R;
1946  float Km;
1947  unsigned int BackEMFFlags;
1948  } emf_settings_t;
1949 
1964  typedef struct
1965  {
1966  unsigned int stepcloseloop_Kw;
1967  unsigned int stepcloseloop_Kp_low;
1968  unsigned int stepcloseloop_Kp_high;
1970 
1985  typedef struct
1986  {
1987  unsigned int Param1;
1989 
2004  typedef struct
2005  {
2006  int Position;
2008  long_t EncPosition;
2009  } get_position_t;
2010 
2024  typedef struct
2025  {
2026  float Position;
2027  long_t EncPosition;
2029 
2044  typedef struct
2045  {
2046  int Position;
2048  long_t EncPosition;
2049  unsigned int PosFlags;
2050  } set_position_t;
2051 
2066  typedef struct
2067  {
2068  float Position;
2069  long_t EncPosition;
2070  unsigned int PosFlags;
2072 
2084  typedef struct
2085  {
2086  unsigned int MoveSts;
2087  unsigned int MvCmdSts;
2088  unsigned int PWRSts;
2089  unsigned int EncSts;
2090  unsigned int WindSts;
2093  long_t EncPosition;
2094  int CurSpeed;
2096  int Ipwr;
2097  int Upwr;
2098  int Iusb;
2099  int Uusb;
2100  int CurT;
2101  unsigned int Flags;
2102  unsigned int GPIOFlags;
2103  unsigned int CmdBufFreeSpace;
2104  } status_t;
2105 
2117  typedef struct
2118  {
2119  unsigned int MoveSts;
2120  unsigned int MvCmdSts;
2121  unsigned int PWRSts;
2122  unsigned int EncSts;
2123  unsigned int WindSts;
2124  float CurPosition;
2125  long_t EncPosition;
2126  float CurSpeed;
2127  int Ipwr;
2128  int Upwr;
2129  int Iusb;
2130  int Uusb;
2131  int CurT;
2132  unsigned int Flags;
2133  unsigned int GPIOFlags;
2134  unsigned int CmdBufFreeSpace;
2135  } status_calb_t;
2136 
2147  typedef struct
2148  {
2149  int Speed[25];
2150  int Error[25];
2151  unsigned int Length;
2152  } measurements_t;
2153 
2166  typedef struct
2167  {
2174  unsigned int Pot;
2175  unsigned int Joy;
2177  } chart_data_t;
2178 
2195  typedef struct
2196  {
2197  char Manufacturer[5];
2198  char ManufacturerId[3];
2199  char ProductDescription[9];
2200  unsigned int Major;
2201  unsigned int Minor;
2202  unsigned int Release;
2204 
2220  typedef struct
2221  {
2222  unsigned int SN;
2223  uint8_t Key[32];
2224  unsigned int Major;
2225  unsigned int Minor;
2226  unsigned int Release;
2227  } serial_number_t;
2228 
2243  typedef struct
2244  {
2245  unsigned int A1Voltage_ADC;
2246  unsigned int A2Voltage_ADC;
2247  unsigned int B1Voltage_ADC;
2248  unsigned int B2Voltage_ADC;
2249  unsigned int SupVoltage_ADC;
2250  unsigned int ACurrent_ADC;
2251  unsigned int BCurrent_ADC;
2252  unsigned int FullCurrent_ADC;
2253  unsigned int Temp_ADC;
2254  unsigned int Joy_ADC;
2255  unsigned int Pot_ADC;
2256  unsigned int L5_ADC;
2257  unsigned int H5_ADC;
2263  int ACurrent;
2264  int BCurrent;
2266  int Temp;
2267  int Joy;
2268  int Pot;
2269  int L5;
2270  int H5;
2271  unsigned int deprecated;
2272  int R;
2273  int L;
2274  } analog_data_t;
2275 
2287  typedef struct
2288  {
2289  uint8_t DebugData[128];
2290  } debug_read_t;
2291 
2303  typedef struct
2304  {
2305  uint8_t DebugData[128];
2306  } debug_write_t;
2307 
2317  typedef struct
2318  {
2319  char PositionerName[17];
2320  } stage_name_t;
2321 
2333  typedef struct
2334  {
2335  char Manufacturer[17];
2336  char PartNumber[25];
2338 
2350  typedef struct
2351  {
2353  char Units[9];
2354  float MaxSpeed;
2355  float TravelRange;
2361  } stage_settings_t;
2362 
2374  typedef struct
2375  {
2376  char Manufacturer[17];
2377  char PartNumber[25];
2379 
2391  typedef struct
2392  {
2393  unsigned int MotorType;
2394  unsigned int ReservedField;
2395  unsigned int Poles;
2396  unsigned int Phases;
2405  float StallTorque;
2411  float MaxSpeed;
2412  float MaxCurrent;
2415  float NoLoadSpeed;
2416  } motor_settings_t;
2417 
2429  typedef struct
2430  {
2431  char Manufacturer[17];
2432  char PartNumber[25];
2434 
2446  typedef struct
2447  {
2452  unsigned int PPR;
2453  unsigned int EncoderSettings;
2455 
2467  typedef struct
2468  {
2469  char Manufacturer[17];
2470  char PartNumber[25];
2472 
2484  typedef struct
2485  {
2490  unsigned int PPR;
2492 
2504  typedef struct
2505  {
2506  char Manufacturer[17];
2507  char PartNumber[25];
2509 
2521  typedef struct
2522  {
2523  float ReductionIn;
2529  float Efficiency;
2530  } gear_settings_t;
2531 
2543  typedef struct
2544  {
2545  char MagneticBrakeInfo[25];
2548  float MBTorque;
2549  unsigned int MBSettings;
2550  char TemperatureSensorInfo[25];
2551  float TSMin;
2552  float TSMax;
2553  float TSGrad;
2554  unsigned int TSSettings;
2555  unsigned int LimitSwitchesSettings;
2557 
2569  typedef struct
2570  {
2571  uint8_t key[16];
2572  } init_random_t;
2573 
2583  typedef struct
2584  {
2585  unsigned int UniqueID0;
2586  unsigned int UniqueID1;
2587  unsigned int UniqueID2;
2588  unsigned int UniqueID3;
2590 
2591 /*
2592  --------------------------------------------
2593  BEGIN OF GENERATED function declarations
2594  --------------------------------------------
2595 */
2596 
2609 
2628  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2629 
2648  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2649 
2666  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2667 
2686  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2687 
2704  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2705 
2724  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2725 
2738  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2739 
2754  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2755 
2768  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2769 
2784  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2785 
2807  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2808 
2832  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2833 
2853  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2854 
2876  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2877 
2890  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2891 
2904  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
2905 
2919  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
2920 
2935  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
2936 
2950  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
2951 
2965  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
2966 
2981  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
2982 
3007  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3008 
3023  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
3024 
3049  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3050 
3074  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
3075 
3096  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
3097 
3115  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
3116 
3136  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);
3137 
3155  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
3156 
3176  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);
3177 
3195  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
3196 
3216  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);
3217 
3232  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
3233 
3253  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);
3254 
3273  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
3274 
3290  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
3291 
3304  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
3305 
3318  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
3319 
3348  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
3349 
3380  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3381 
3410  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
3411 
3442  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3443 
3479  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
3480 
3516  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
3517 
3552  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
3553 
3588  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3589 
3606  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3607 
3624  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3625 
3642  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3643 
3660  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3661 
3674  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3675 
3688  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3689 
3702  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3703 
3716  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3717 
3736  result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t* emf_settings);
3737 
3754  result_t XIMC_API get_emf_settings (device_t id, emf_settings_t* emf_settings);
3755 
3770  result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t* engine_advansed_setup);
3771 
3786  result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t* engine_advansed_setup);
3787 
3802  result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t* extended_settings);
3803 
3818  result_t XIMC_API get_extended_settings (device_t id, extended_settings_t* extended_settings);
3819 
3820 
3822 
3835 
3855  result_t XIMC_API command_stop (device_t id);
3856 
3875  result_t XIMC_API command_power_off (device_t id);
3876 
3896  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
3897 
3925  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
3926 
3950  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
3951 
3983  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
3984 
4024  result_t XIMC_API command_home (device_t id);
4025 
4036  result_t XIMC_API command_left (device_t id);
4037 
4048  result_t XIMC_API command_right (device_t id);
4049 
4062  result_t XIMC_API command_loft (device_t id);
4063 
4074  result_t XIMC_API command_sstp (device_t id);
4075 
4090  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
4091 
4116  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
4117 
4134  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
4135 
4153  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
4154 
4177  result_t XIMC_API command_zero (device_t id);
4178 
4179 
4181 
4194 
4205  result_t XIMC_API command_save_settings (device_t id);
4206 
4217  result_t XIMC_API command_read_settings (device_t id);
4218 
4229  result_t XIMC_API command_save_robust_settings (device_t id);
4230 
4241  result_t XIMC_API command_read_robust_settings (device_t id);
4242 
4255  result_t XIMC_API command_eesave_settings (device_t id);
4256 
4268  result_t XIMC_API command_eeread_settings (device_t id);
4269 
4280  result_t XIMC_API command_start_measurements (device_t id);
4281 
4300  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
4301 
4318  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
4319 
4332  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
4333 
4350  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4351 
4362  result_t XIMC_API service_command_updf (device_t id);
4363 
4364 
4366 
4379 
4398  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
4399 
4414  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
4415 
4430  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
4431 
4444  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
4445 
4446 
4448 
4461 
4474  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
4475 
4488  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
4489 
4504  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
4505 
4518  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
4519 
4534  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
4535 
4548  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
4549 
4564  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
4565 
4578  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
4579 
4594  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
4595 
4608  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
4609 
4624  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
4625 
4638  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
4639 
4654  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
4655 
4668  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
4669 
4684  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
4685 
4698  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
4699 
4714  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
4715 
4728  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
4729 
4744  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
4745 
4758  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
4759 
4774  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4775 
4788  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4789 
4804  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4805 
4818  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4819 
4836  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4837 
4850  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4851 
4868  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4869 
4870 
4871 /*
4872  -------------------------
4873  END OF GENERATED CODE
4874  -------------------------
4875 */
4876 
4877 /* hand-crafted functions begin */
4878 
4891  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
4892 
4905  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
4906 
4922  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
4923 
4938  result_t XIMC_API write_key (const char* uri, uint8_t* key);
4939 
4952  result_t XIMC_API command_reset(device_t id);
4953 
4966  result_t XIMC_API command_clear_fram(device_t id);
4967 
4969 
4970  // ------------------------------------
4971 
4983 
5010  device_t XIMC_API open_device (const char* uri);
5011 
5026  result_t XIMC_API close_device (device_t* id);
5027 
5083  result_t XIMC_API load_correction_table(device_t* id, const char* namefile);
5084 
5134  result_t XIMC_API set_correction_table(device_t id, const char* namefile);
5135 
5148  result_t XIMC_API probe_device (const char* uri);
5149 
5162  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5163 
5190  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5191 
5202  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5203 
5214  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5215 
5224  typedef char* pchar;
5225 
5240  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5241 
5242 
5259  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5260 
5277  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5278 
5295  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5296 
5313  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5314 
5331  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5332 
5342  result_t XIMC_API reset_locks ();
5343 
5359  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5360 
5361 
5371  void XIMC_API msec_sleep (unsigned int msec);
5372 
5382  void XIMC_API ximc_version (char* version);
5383 
5384 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5385 
5397  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5398 
5410  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5411 
5423  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5424 
5437  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5438 
5439 #endif
5440 
5464  result_t XIMC_API get_status (device_t id, status_t* status);
5465 
5491  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5492 
5518  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5519 
5538  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5539 
5552  result_t XIMC_API command_homezero(device_t id);
5554 
5555 #if defined(__cplusplus)
5556 };
5557 #endif
5558 
5559 #endif
5560 
5561 // vim: ts=4 shiftwidth=4
5562