libximc  2.14.30
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 
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.30
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_ADAPTIVE_HOLDING 0x02
863 #define FEEDBACK_ENC_TYPE_BITS 0xC0
864 #define FEEDBACK_ENC_TYPE_AUTO 0x00
865 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
866 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
868 
869 
883 #define SYNCIN_ENABLED 0x01
884 #define SYNCIN_INVERT 0x02
885 #define SYNCIN_GOTOPOSITION 0x04
887 
888 
902 #define SYNCOUT_ENABLED 0x01
903 #define SYNCOUT_STATE 0x02
904 #define SYNCOUT_INVERT 0x04
905 #define SYNCOUT_IN_STEPS 0x08
906 #define SYNCOUT_ONSTART 0x10
907 #define SYNCOUT_ONSTOP 0x20
908 #define SYNCOUT_ONPERIOD 0x40
910 
911 
927 #define EXTIO_SETUP_OUTPUT 0x01
928 #define EXTIO_SETUP_INVERT 0x02
930 
931 
948 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
949 #define EXTIO_SETUP_MODE_IN_NOP 0x00
950 #define EXTIO_SETUP_MODE_IN_STOP 0x01
951 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
952 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
953 #define EXTIO_SETUP_MODE_IN_HOME 0x04
954 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
955 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
956 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
957 #define EXTIO_SETUP_MODE_OUT_ON 0x10
958 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
959 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
960 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
962 
963 
983 #define BORDER_IS_ENCODER 0x01
984 #define BORDER_STOP_LEFT 0x02
985 #define BORDER_STOP_RIGHT 0x04
986 #define BORDERS_SWAP_MISSET_DETECTION 0x08
988 
989 
1009 #define ENDER_SWAP 0x01
1010 #define ENDER_SW1_ACTIVE_LOW 0x02
1011 #define ENDER_SW2_ACTIVE_LOW 0x04
1013 
1014 
1034 #define BRAKE_ENABLED 0x01
1035 #define BRAKE_ENG_PWROFF 0x02
1037 
1038 
1058 #define CONTROL_MODE_BITS 0x03
1059 #define CONTROL_MODE_OFF 0x00
1060 #define CONTROL_MODE_JOY 0x01
1061 #define CONTROL_MODE_LR 0x02
1062 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
1063 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
1065 
1066 
1084 #define JOY_REVERSE 0x01
1086 
1087 
1107 #define CTP_ENABLED 0x01
1108 #define CTP_BASE 0x02
1109 #define CTP_ALARM_ON_ERROR 0x04
1110 #define REV_SENS_INV 0x08
1111 #define CTP_ERROR_CORRECTION 0x10
1113 
1114 
1135 #define HOME_DIR_FIRST 0x001
1136 #define HOME_DIR_SECOND 0x002
1137 #define HOME_MV_SEC_EN 0x004
1138 #define HOME_HALF_MV 0x008
1139 #define HOME_STOP_FIRST_BITS 0x030
1140 #define HOME_STOP_FIRST_REV 0x010
1141 #define HOME_STOP_FIRST_SYN 0x020
1142 #define HOME_STOP_FIRST_LIM 0x030
1143 #define HOME_STOP_SECOND_BITS 0x0C0
1144 #define HOME_STOP_SECOND_REV 0x040
1145 #define HOME_STOP_SECOND_SYN 0x080
1146 #define HOME_STOP_SECOND_LIM 0x0C0
1147 #define HOME_USE_FAST 0x100
1149 
1150 
1164 #define UART_PARITY_BITS 0x03
1165 #define UART_PARITY_BIT_EVEN 0x00
1166 #define UART_PARITY_BIT_ODD 0x01
1167 #define UART_PARITY_BIT_SPACE 0x02
1168 #define UART_PARITY_BIT_MARK 0x03
1169 #define UART_PARITY_BIT_USE 0x04
1170 #define UART_STOP_BIT 0x08
1172 
1173 
1187 #define MOTOR_TYPE_UNKNOWN 0x00
1188 #define MOTOR_TYPE_STEP 0x01
1189 #define MOTOR_TYPE_DC 0x02
1190 #define MOTOR_TYPE_BLDC 0x03
1192 
1193 
1207 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1208 #define ENCSET_PUSHPULL_OUTPUT 0x004
1209 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1210 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1211 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1213 
1214 
1228 #define MB_AVAILABLE 0x01
1229 #define MB_POWERED_HOLD 0x02
1231 
1232 
1246 #define TS_TYPE_BITS 0x07
1247 #define TS_TYPE_UNKNOWN 0x00
1248 #define TS_TYPE_THERMOCOUPLE 0x01
1249 #define TS_TYPE_SEMICONDUCTOR 0x02
1250 #define TS_AVAILABLE 0x08
1252 
1253 
1267 #define LS_ON_SW1_AVAILABLE 0x01
1268 #define LS_ON_SW2_AVAILABLE 0x02
1269 #define LS_SW1_ACTIVE_LOW 0x04
1270 #define LS_SW2_ACTIVE_LOW 0x08
1271 #define LS_SHORTED 0x10
1273 
1274 
1290 #define BACK_EMF_INDUCTANCE_AUTO 0x01
1291 #define BACK_EMF_RESISTANCE_AUTO 0x02
1292 #define BACK_EMF_KM_AUTO 0x04
1294 
1295 
1307  typedef struct
1308  {
1309  unsigned int IPS;
1310  unsigned int FeedbackType;
1311  unsigned int FeedbackFlags;
1312  unsigned int CountsPerTurn;
1314 
1329  typedef struct
1330  {
1331  unsigned int FastHome;
1332  unsigned int uFastHome;
1333  unsigned int SlowHome;
1334  unsigned int uSlowHome;
1337  unsigned int HomeFlags;
1338  } home_settings_t;
1339 
1355  typedef struct
1356  {
1357  float FastHome;
1358  float SlowHome;
1359  float HomeDelta;
1360  unsigned int HomeFlags;
1362 
1374  typedef struct
1375  {
1376  unsigned int Speed;
1377  unsigned int uSpeed;
1378  unsigned int Accel;
1379  unsigned int Decel;
1380  unsigned int AntiplaySpeed;
1381  unsigned int uAntiplaySpeed;
1382  unsigned int MoveFlags;
1383  } move_settings_t;
1384 
1396  typedef struct
1397  {
1398  float Speed;
1410  float Accel;
1422  float Decel;
1434  float AntiplaySpeed;
1446  unsigned int MoveFlags;
1448 
1465  typedef struct
1466  {
1467  unsigned int NomVoltage;
1468  unsigned int NomCurrent;
1469  unsigned int NomSpeed;
1470  unsigned int uNomSpeed;
1471  unsigned int EngineFlags;
1472  int Antiplay;
1473  unsigned int MicrostepMode;
1474  unsigned int StepsPerRev;
1476 
1494  typedef struct
1495  {
1496  unsigned int NomVoltage;
1497  unsigned int NomCurrent;
1498  float NomSpeed;
1499  unsigned int EngineFlags;
1500  float Antiplay;
1501  unsigned int MicrostepMode;
1502  unsigned int StepsPerRev;
1504 
1521  typedef struct
1522  {
1523  unsigned int EngineType;
1524  unsigned int DriverType;
1526 
1538  typedef struct
1539  {
1540  unsigned int HoldCurrent;
1541  unsigned int CurrReductDelay;
1542  unsigned int PowerOffDelay;
1543  unsigned int CurrentSetTime;
1544  unsigned int PowerFlags;
1545  } power_settings_t;
1546 
1560  typedef struct
1561  {
1562  unsigned int LowUpwrOff;
1563  unsigned int CriticalIpwr;
1564  unsigned int CriticalUpwr;
1565  unsigned int CriticalT;
1566  unsigned int CriticalIusb;
1567  unsigned int CriticalUusb;
1568  unsigned int MinimumUusb;
1569  unsigned int Flags;
1571 
1587  typedef struct
1588  {
1589  unsigned int BorderFlags;
1590  unsigned int EnderFlags;
1595  } edges_settings_t;
1596 
1612  typedef struct
1613  {
1614  unsigned int BorderFlags;
1615  unsigned int EnderFlags;
1616  float LeftBorder;
1617  float RightBorder;
1619 
1637  typedef struct
1638  {
1639  unsigned int KpU;
1640  unsigned int KiU;
1641  unsigned int KdU;
1642  float Kpf;
1643  float Kif;
1644  float Kdf;
1645  } pid_settings_t;
1646 
1661  typedef struct
1662  {
1663  unsigned int SyncInFlags;
1664  unsigned int ClutterTime;
1665  int Position;
1667  unsigned int Speed;
1668  unsigned int uSpeed;
1670 
1684  typedef struct
1685  {
1686  unsigned int SyncInFlags;
1687  unsigned int ClutterTime;
1688  float Position;
1689  float Speed;
1691 
1705  typedef struct
1706  {
1707  unsigned int SyncOutFlags;
1708  unsigned int SyncOutPulseSteps;
1709  unsigned int SyncOutPeriod;
1710  unsigned int Accuracy;
1711  unsigned int uAccuracy;
1713 
1728  typedef struct
1729  {
1730  unsigned int SyncOutFlags;
1731  unsigned int SyncOutPulseSteps;
1732  unsigned int SyncOutPeriod;
1733  float Accuracy;
1735 
1752  typedef struct
1753  {
1754  unsigned int EXTIOSetupFlags;
1755  unsigned int EXTIOModeFlags;
1756  } extio_settings_t;
1757 
1772  typedef struct
1773  {
1774  unsigned int t1;
1775  unsigned int t2;
1776  unsigned int t3;
1777  unsigned int t4;
1778  unsigned int BrakeFlags;
1779  } brake_settings_t;
1780 
1806  typedef struct
1807  {
1808  unsigned int MaxSpeed[10];
1809  unsigned int uMaxSpeed[10];
1810  unsigned int Timeout[9];
1811  unsigned int MaxClickTime;
1812  unsigned int Flags;
1816 
1842  typedef struct
1843  {
1844  float MaxSpeed[10];
1845  unsigned int Timeout[9];
1846  unsigned int MaxClickTime;
1847  unsigned int Flags;
1850 
1883  typedef struct
1884  {
1885  unsigned int JoyLowEnd;
1886  unsigned int JoyCenter;
1887  unsigned int JoyHighEnd;
1888  unsigned int ExpFactor;
1889  unsigned int DeadZone;
1890  unsigned int JoyFlags;
1892 
1911  typedef struct
1912  {
1913  unsigned int CTPMinError;
1914  unsigned int CTPFlags;
1915  } ctp_settings_t;
1916 
1931  typedef struct
1932  {
1933  unsigned int Speed;
1934  unsigned int UARTSetupFlags;
1935  } uart_settings_t;
1936 
1950  typedef struct
1951  {
1952  unsigned int DHCPEnabled;
1953  unsigned int IPv4Address[4];
1954  unsigned int SubnetMask[4];
1955  unsigned int DefaultGateway[4];
1957 
1971  typedef struct
1972  {
1973  char UserPassword[21];
1975 
1990  typedef struct
1991  {
1992  float CSS1_A;
1993  float CSS1_B;
1994  float CSS2_A;
1995  float CSS2_B;
1999 
2009  typedef struct
2010  {
2011  char ControllerName[17];
2012  unsigned int CtrlFlags;
2014 
2024  typedef struct
2025  {
2026  unsigned int UserData[7];
2028 
2047  typedef struct
2048  {
2049  float L;
2050  float R;
2051  float Km;
2052  unsigned int BackEMFFlags;
2053  } emf_settings_t;
2054 
2070  typedef struct
2071  {
2072  unsigned int stepcloseloop_Kw;
2073  unsigned int stepcloseloop_Kp_low;
2074  unsigned int stepcloseloop_Kp_high;
2076 
2092  typedef struct
2093  {
2094  unsigned int Param1;
2096 
2111  typedef struct
2112  {
2113  int Position;
2115  long_t EncPosition;
2116  } get_position_t;
2117 
2131  typedef struct
2132  {
2133  float Position;
2134  long_t EncPosition;
2136 
2149  typedef struct
2150  {
2151  int Position;
2153  long_t EncPosition;
2154  unsigned int PosFlags;
2155  } set_position_t;
2156 
2169  typedef struct
2170  {
2171  float Position;
2172  long_t EncPosition;
2173  unsigned int PosFlags;
2175 
2188  typedef struct
2189  {
2190  unsigned int MoveSts;
2191  unsigned int MvCmdSts;
2192  unsigned int PWRSts;
2193  unsigned int EncSts;
2194  unsigned int WindSts;
2197  long_t EncPosition;
2198  int CurSpeed;
2200  int Ipwr;
2201  int Upwr;
2202  int Iusb;
2203  int Uusb;
2204  int CurT;
2205  unsigned int Flags;
2206  unsigned int GPIOFlags;
2207  unsigned int CmdBufFreeSpace;
2208  } status_t;
2209 
2222  typedef struct
2223  {
2224  unsigned int MoveSts;
2225  unsigned int MvCmdSts;
2226  unsigned int PWRSts;
2227  unsigned int EncSts;
2228  unsigned int WindSts;
2229  float CurPosition;
2230  long_t EncPosition;
2231  float CurSpeed;
2232  int Ipwr;
2233  int Upwr;
2234  int Iusb;
2235  int Uusb;
2236  int CurT;
2237  unsigned int Flags;
2238  unsigned int GPIOFlags;
2239  unsigned int CmdBufFreeSpace;
2240  } status_calb_t;
2241 
2252  typedef struct
2253  {
2254  int Speed[25];
2255  int Error[25];
2256  unsigned int Length;
2257  } measurements_t;
2258 
2272  typedef struct
2273  {
2280  unsigned int Pot;
2281  unsigned int Joy;
2283  } chart_data_t;
2284 
2295  typedef struct
2296  {
2297  char Manufacturer[5];
2298  char ManufacturerId[3];
2299  char ProductDescription[9];
2300  unsigned int Major;
2301  unsigned int Minor;
2302  unsigned int Release;
2304 
2315  typedef struct
2316  {
2317  unsigned int SN;
2318  uint8_t Key[32];
2319  unsigned int Major;
2320  unsigned int Minor;
2321  unsigned int Release;
2322  } serial_number_t;
2323 
2337  typedef struct
2338  {
2339  unsigned int A1Voltage_ADC;
2340  unsigned int A2Voltage_ADC;
2341  unsigned int B1Voltage_ADC;
2342  unsigned int B2Voltage_ADC;
2343  unsigned int SupVoltage_ADC;
2344  unsigned int ACurrent_ADC;
2345  unsigned int BCurrent_ADC;
2346  unsigned int FullCurrent_ADC;
2347  unsigned int Temp_ADC;
2348  unsigned int Joy_ADC;
2349  unsigned int Pot_ADC;
2350  unsigned int Enc_Check_ADC;
2351  unsigned int deprecated0;
2357  int ACurrent;
2358  int BCurrent;
2360  int Temp;
2361  int Joy;
2362  int Pot;
2364  unsigned int deprecated1[2];
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 
5182  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5183 
5294  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5295 
5306  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5307 
5318  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5319 
5328  typedef char* pchar;
5329 
5344  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5345 
5346 
5363  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5364 
5381  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5382 
5399  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5400 
5417  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5418 
5435  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5436 
5444  result_t XIMC_API reset_locks ();
5445 
5461  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5462 
5463 
5473  void XIMC_API msec_sleep (unsigned int msec);
5474 
5484  void XIMC_API ximc_version (char* version);
5485 
5486 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5487 
5499  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5500 
5512  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5513 
5525  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5526 
5539  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5540 
5541 #endif
5542 
5566  result_t XIMC_API get_status (device_t id, status_t* status);
5567 
5593  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5594 
5620  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5621 
5640  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5641 
5654  result_t XIMC_API command_homezero(device_t id);
5656 
5657 #if defined(__cplusplus)
5658 };
5659 #endif
5660 
5661 #endif
5662 
5663 // vim: ts=4 shiftwidth=4
5664