libximc  2.13.3
ximc.h
См. документацию.
1 #ifndef INC_XIMC_H
2 #define INC_XIMC_H
3 
19 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
20  #define XIMC_API __stdcall
21 #else
22  #ifdef LIBXIMC_EXPORTS
23  #define XIMC_API __attribute__((visibility("default")))
24  #else
25  #define XIMC_API
26  #endif
27 #endif
28 
33 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
34  #define XIMC_CALLCONV __stdcall
35 #else
36  #define XIMC_CALLCONV
37 #endif
38 
43 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
44 #define XIMC_RETTYPE unsigned int
45 #else
46 #define XIMC_RETTYPE void*
47 #endif
48 
49 
50 #if !defined(XIMC_NO_STDINT)
51 
52 #if ( (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)) && !defined(MATLAB_IMPORT)
53 // msvc types burden
54 typedef __int8 int8_t;
55 typedef __int16 int16_t;
56 typedef __int32 int32_t;
57 typedef __int64 int64_t;
58 typedef unsigned __int8 uint8_t;
59 typedef unsigned __int16 uint16_t;
60 typedef unsigned __int32 uint32_t;
61 typedef unsigned __int64 uint64_t;
62 #else
63 #include <stdint.h>
64 #endif
65 
66 /* labview doesn't speak C99 */
67 #if defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)
68 typedef unsigned __int64 ulong_t;
69 typedef __int64 long_t;
70 #else
71 typedef unsigned long long ulong_t;
72 typedef long long long_t;
73 #endif
74 
75 #endif
76 
77 #include <time.h>
78 
79 #if defined(__cplusplus)
80 extern "C"
81 {
82 #endif
83 
84 
93  typedef int device_t;
94 
103  typedef int result_t;
104 
113  #if defined(_WIN64) || defined(__LP64__) || defined(LABVIEW64_IMPORT)
114  typedef uint64_t device_enumeration_t;
115  #else
116  typedef uint32_t device_enumeration_t;
117  #endif
118  //typedef device_enumeration_t* pdevice_enumeration_t;
119 
128 #define device_undefined -1
129 
138 
147 #define result_ok 0
148 
157 #define result_error -1
158 
167 #define result_not_implemented -2
168 
177 #define result_value_error -3
178 
187 #define result_nodevice -4
188 
190 
199 
208 #define LOGLEVEL_ERROR 0x01
209 
217 #define LOGLEVEL_WARNING 0x02
218 
226 #define LOGLEVEL_INFO 0x03
227 
235 #define LOGLEVEL_DEBUG 0x04
236 
237 
238 
246  typedef struct calibration_t
247  {
248  double A;
249  unsigned int MicrostepMode;
250  } calibration_t;
251 
260  {
261  uint32_t ipv4;
262  char nodename[16];
263  uint32_t axis_state;
264  char locker_username[16];
265  char locker_nodename[16];
266  time_t locked_time;
268 
269 
270 
272 #define LIBXIMC_VERSION 2.13.3
273 
277 #define LIBXIMC_PROTOCOL_VERSION 20.5
278 
281 /*
282  ------------------------------------------
283  BEGIN OF GENERATED struct declarations
284  ------------------------------------------
285 */
286 
298 #define ENUMERATE_PROBE 0x01
299 #define ENUMERATE_ALL_COM 0x02
300 #define ENUMERATE_NETWORK 0x04
302 
303 
320 #define MOVE_STATE_MOVING 0x01
321 #define MOVE_STATE_TARGET_SPEED 0x02
322 #define MOVE_STATE_ANTIPLAY 0x04
324 
325 
341 #define EEPROM_PRECEDENCE 0x01
343 
344 
361 #define PWR_STATE_UNKNOWN 0x00
362 #define PWR_STATE_OFF 0x01
363 #define PWR_STATE_NORM 0x03
364 #define PWR_STATE_REDUCT 0x04
365 #define PWR_STATE_MAX 0x05
367 
368 
387 #define STATE_CONTR 0x000003F
388 #define STATE_ERRC 0x0000001
389 #define STATE_ERRD 0x0000002
390 #define STATE_ERRV 0x0000004
391 #define STATE_EEPROM_CONNECTED 0x0000010
392 #define STATE_IS_HOMED 0x0000020
393 #define STATE_SECUR 0x1B3FFC0
394 #define STATE_ALARM 0x0000040
395 #define STATE_CTP_ERROR 0x0000080
396 #define STATE_POWER_OVERHEAT 0x0000100
397 #define STATE_CONTROLLER_OVERHEAT 0x0000200
398 #define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400
399 #define STATE_OVERLOAD_POWER_CURRENT 0x0000800
400 #define STATE_OVERLOAD_USB_VOLTAGE 0x0001000
401 #define STATE_LOW_USB_VOLTAGE 0x0002000
402 #define STATE_OVERLOAD_USB_CURRENT 0x0004000
403 #define STATE_BORDERS_SWAP_MISSET 0x0008000
404 #define STATE_LOW_POWER_VOLTAGE 0x0010000
405 #define STATE_H_BRIDGE_FAULT 0x0020000
406 #define STATE_WINDING_RES_MISMATCH 0x0100000
407 #define STATE_ENCODER_FAULT 0x0200000
408 #define STATE_ENGINE_RESPONSE_ERROR 0x0800000
409 #define STATE_EXTIO_ALARM 0x1000000
411 
412 
431 #define STATE_DIG_SIGNAL 0xFFFF
432 #define STATE_RIGHT_EDGE 0x0001
433 #define STATE_LEFT_EDGE 0x0002
434 #define STATE_BUTTON_RIGHT 0x0004
435 #define STATE_BUTTON_LEFT 0x0008
436 #define STATE_GPIO_PINOUT 0x0010
437 #define STATE_GPIO_LEVEL 0x0020
438 #define STATE_BRAKE 0x0200
439 #define STATE_REV_SENSOR 0x0400
440 #define STATE_SYNC_INPUT 0x0800
441 #define STATE_SYNC_OUTPUT 0x1000
442 #define STATE_ENC_A 0x2000
443 #define STATE_ENC_B 0x4000
445 
446 
463 #define ENC_STATE_ABSENT 0x00
464 #define ENC_STATE_UNKNOWN 0x01
465 #define ENC_STATE_MALFUNC 0x02
466 #define ENC_STATE_REVERS 0x03
467 #define ENC_STATE_OK 0x04
469 
470 
487 #define WIND_A_STATE_ABSENT 0x00
488 #define WIND_A_STATE_UNKNOWN 0x01
489 #define WIND_A_STATE_MALFUNC 0x02
490 #define WIND_A_STATE_OK 0x03
491 #define WIND_B_STATE_ABSENT 0x00
492 #define WIND_B_STATE_UNKNOWN 0x10
493 #define WIND_B_STATE_MALFUNC 0x20
494 #define WIND_B_STATE_OK 0x30
496 
497 
516 #define MVCMD_NAME_BITS 0x3F
517 #define MVCMD_UKNWN 0x00
518 #define MVCMD_MOVE 0x01
519 #define MVCMD_MOVR 0x02
520 #define MVCMD_LEFT 0x03
521 #define MVCMD_RIGHT 0x04
522 #define MVCMD_STOP 0x05
523 #define MVCMD_HOME 0x06
524 #define MVCMD_LOFT 0x07
525 #define MVCMD_SSTP 0x08
526 #define MVCMD_ERROR 0x40
527 #define MVCMD_RUNNING 0x80
529 
530 
550 #define RPM_DIV_1000 0x01
552 
553 
573 #define ENGINE_REVERSE 0x01
574 #define ENGINE_CURRENT_AS_RMS 0x02
575 #define ENGINE_MAX_SPEED 0x04
576 #define ENGINE_ANTIPLAY 0x08
577 #define ENGINE_ACCEL_ON 0x10
578 #define ENGINE_LIMIT_VOLT 0x20
579 #define ENGINE_LIMIT_CURR 0x40
580 #define ENGINE_LIMIT_RPM 0x80
582 
583 
604 #define MICROSTEP_MODE_FULL 0x01
605 #define MICROSTEP_MODE_FRAC_2 0x02
606 #define MICROSTEP_MODE_FRAC_4 0x03
607 #define MICROSTEP_MODE_FRAC_8 0x04
608 #define MICROSTEP_MODE_FRAC_16 0x05
609 #define MICROSTEP_MODE_FRAC_32 0x06
610 #define MICROSTEP_MODE_FRAC_64 0x07
611 #define MICROSTEP_MODE_FRAC_128 0x08
612 #define MICROSTEP_MODE_FRAC_256 0x09
614 
615 
636 #define ENGINE_TYPE_NONE 0x00
637 #define ENGINE_TYPE_DC 0x01
638 #define ENGINE_TYPE_2DC 0x02
639 #define ENGINE_TYPE_STEP 0x03
640 #define ENGINE_TYPE_TEST 0x04
641 #define ENGINE_TYPE_BRUSHLESS 0x05
643 
644 
665 #define DRIVER_TYPE_DISCRETE_FET 0x01
666 #define DRIVER_TYPE_INTEGRATE 0x02
667 #define DRIVER_TYPE_EXTERNAL 0x03
669 
670 
689 #define POWER_REDUCT_ENABLED 0x01
690 #define POWER_OFF_ENABLED 0x02
691 #define POWER_SMOOTH_CURRENT 0x04
693 
694 
713 #define ALARM_ON_DRIVER_OVERHEATING 0x01
714 #define LOW_UPWR_PROTECTION 0x02
715 #define H_BRIDGE_ALERT 0x04
716 #define ALARM_ON_BORDERS_SWAP_MISSET 0x08
717 #define ALARM_FLAGS_STICKING 0x10
718 #define USB_BREAK_RECONNECT 0x20
719 #define ALARM_WINDING_MISMATCH 0x40
720 #define ALARM_ENGINE_RESPONSE 0x80
722 
723 
741 #define SETPOS_IGNORE_POSITION 0x01
742 #define SETPOS_IGNORE_ENCODER 0x02
744 
745 
761 #define FEEDBACK_ENCODER 0x01
762 #define FEEDBACK_EMF 0x04
763 #define FEEDBACK_NONE 0x05
764 #define FEEDBACK_ENCODER_MEDIATED 0x06
766 
767 
783 #define FEEDBACK_ENC_REVERSE 0x01
784 #define FEEDBACK_ENC_TYPE_BITS 0xC0
785 #define FEEDBACK_ENC_TYPE_AUTO 0x00
786 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
787 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
789 
790 
804 #define SYNCIN_ENABLED 0x01
805 #define SYNCIN_INVERT 0x02
806 #define SYNCIN_GOTOPOSITION 0x04
808 
809 
823 #define SYNCOUT_ENABLED 0x01
824 #define SYNCOUT_STATE 0x02
825 #define SYNCOUT_INVERT 0x04
826 #define SYNCOUT_IN_STEPS 0x08
827 #define SYNCOUT_ONSTART 0x10
828 #define SYNCOUT_ONSTOP 0x20
829 #define SYNCOUT_ONPERIOD 0x40
831 
832 
848 #define EXTIO_SETUP_OUTPUT 0x01
849 #define EXTIO_SETUP_INVERT 0x02
851 
852 
869 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
870 #define EXTIO_SETUP_MODE_IN_NOP 0x00
871 #define EXTIO_SETUP_MODE_IN_STOP 0x01
872 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
873 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
874 #define EXTIO_SETUP_MODE_IN_HOME 0x04
875 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
876 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
877 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
878 #define EXTIO_SETUP_MODE_OUT_ON 0x10
879 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
880 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
881 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
883 
884 
904 #define BORDER_IS_ENCODER 0x01
905 #define BORDER_STOP_LEFT 0x02
906 #define BORDER_STOP_RIGHT 0x04
907 #define BORDERS_SWAP_MISSET_DETECTION 0x08
909 
910 
930 #define ENDER_SWAP 0x01
931 #define ENDER_SW1_ACTIVE_LOW 0x02
932 #define ENDER_SW2_ACTIVE_LOW 0x04
934 
935 
955 #define BRAKE_ENABLED 0x01
956 #define BRAKE_ENG_PWROFF 0x02
958 
959 
979 #define CONTROL_MODE_BITS 0x03
980 #define CONTROL_MODE_OFF 0x00
981 #define CONTROL_MODE_JOY 0x01
982 #define CONTROL_MODE_LR 0x02
983 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
984 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
986 
987 
1005 #define JOY_REVERSE 0x01
1007 
1008 
1028 #define CTP_ENABLED 0x01
1029 #define CTP_BASE 0x02
1030 #define CTP_ALARM_ON_ERROR 0x04
1031 #define REV_SENS_INV 0x08
1032 #define CTP_ERROR_CORRECTION 0x10
1034 
1035 
1056 #define HOME_DIR_FIRST 0x001
1057 #define HOME_DIR_SECOND 0x002
1058 #define HOME_MV_SEC_EN 0x004
1059 #define HOME_HALF_MV 0x008
1060 #define HOME_STOP_FIRST_BITS 0x030
1061 #define HOME_STOP_FIRST_REV 0x010
1062 #define HOME_STOP_FIRST_SYN 0x020
1063 #define HOME_STOP_FIRST_LIM 0x030
1064 #define HOME_STOP_SECOND_BITS 0x0C0
1065 #define HOME_STOP_SECOND_REV 0x040
1066 #define HOME_STOP_SECOND_SYN 0x080
1067 #define HOME_STOP_SECOND_LIM 0x0C0
1068 #define HOME_USE_FAST 0x100
1070 
1071 
1085 #define UART_PARITY_BITS 0x03
1086 #define UART_PARITY_BIT_EVEN 0x00
1087 #define UART_PARITY_BIT_ODD 0x01
1088 #define UART_PARITY_BIT_SPACE 0x02
1089 #define UART_PARITY_BIT_MARK 0x03
1090 #define UART_PARITY_BIT_USE 0x04
1091 #define UART_STOP_BIT 0x08
1093 
1094 
1108 #define MOTOR_TYPE_UNKNOWN 0x00
1109 #define MOTOR_TYPE_STEP 0x01
1110 #define MOTOR_TYPE_DC 0x02
1111 #define MOTOR_TYPE_BLDC 0x03
1113 
1114 
1128 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1129 #define ENCSET_PUSHPULL_OUTPUT 0x004
1130 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1131 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1132 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1134 
1135 
1149 #define MB_AVAILABLE 0x01
1150 #define MB_POWERED_HOLD 0x02
1152 
1153 
1167 #define TS_TYPE_BITS 0x07
1168 #define TS_TYPE_UNKNOWN 0x00
1169 #define TS_TYPE_THERMOCOUPLE 0x01
1170 #define TS_TYPE_SEMICONDUCTOR 0x02
1171 #define TS_AVAILABLE 0x08
1173 
1174 
1188 #define LS_ON_SW1_AVAILABLE 0x01
1189 #define LS_ON_SW2_AVAILABLE 0x02
1190 #define LS_SW1_ACTIVE_LOW 0x04
1191 #define LS_SW2_ACTIVE_LOW 0x08
1192 #define LS_SHORTED 0x10
1194 
1195 
1211 #define BACK_EMF_INDUCTANCE_AUTO 0x01
1212 #define BACK_EMF_RESISTANCE_AUTO 0x02
1213 #define BACK_EMF_KM_AUTO 0x04
1215 
1216 
1228  typedef struct
1229  {
1230  unsigned int IPS;
1231  unsigned int FeedbackType;
1232  unsigned int FeedbackFlags;
1233  unsigned int CountsPerTurn;
1235 
1251  typedef struct
1252  {
1253  unsigned int FastHome;
1254  unsigned int uFastHome;
1255  unsigned int SlowHome;
1256  unsigned int uSlowHome;
1259  unsigned int HomeFlags;
1260  } home_settings_t;
1261 
1277  typedef struct
1278  {
1279  float FastHome;
1280  float SlowHome;
1281  float HomeDelta;
1282  unsigned int HomeFlags;
1284 
1296  typedef struct
1297  {
1298  unsigned int Speed;
1299  unsigned int uSpeed;
1300  unsigned int Accel;
1301  unsigned int Decel;
1302  unsigned int AntiplaySpeed;
1303  unsigned int uAntiplaySpeed;
1304  unsigned int MoveFlags;
1305  } move_settings_t;
1306 
1318  typedef struct
1319  {
1320  float Speed;
1321  float Accel;
1322  float Decel;
1324  unsigned int MoveFlags;
1326 
1347  typedef struct
1348  {
1349  unsigned int NomVoltage;
1350  unsigned int NomCurrent;
1351  unsigned int NomSpeed;
1352  unsigned int uNomSpeed;
1353  unsigned int EngineFlags;
1354  int Antiplay;
1355  unsigned int MicrostepMode;
1356  unsigned int StepsPerRev;
1358 
1379  typedef struct
1380  {
1381  unsigned int NomVoltage;
1382  unsigned int NomCurrent;
1383  float NomSpeed;
1384  unsigned int EngineFlags;
1385  float Antiplay;
1386  unsigned int MicrostepMode;
1387  unsigned int StepsPerRev;
1389 
1406  typedef struct
1407  {
1408  unsigned int EngineType;
1409  unsigned int DriverType;
1411 
1423  typedef struct
1424  {
1425  unsigned int HoldCurrent;
1426  unsigned int CurrReductDelay;
1427  unsigned int PowerOffDelay;
1428  unsigned int CurrentSetTime;
1429  unsigned int PowerFlags;
1430  } power_settings_t;
1431 
1445  typedef struct
1446  {
1447  unsigned int LowUpwrOff;
1448  unsigned int CriticalIpwr;
1449  unsigned int CriticalUpwr;
1450  unsigned int CriticalT;
1451  unsigned int CriticalIusb;
1452  unsigned int CriticalUusb;
1453  unsigned int MinimumUusb;
1454  unsigned int Flags;
1456 
1474  typedef struct
1475  {
1476  unsigned int BorderFlags;
1477  unsigned int EnderFlags;
1482  } edges_settings_t;
1483 
1501  typedef struct
1502  {
1503  unsigned int BorderFlags;
1504  unsigned int EnderFlags;
1505  float LeftBorder;
1506  float RightBorder;
1508 
1532  typedef struct
1533  {
1534  unsigned int KpU;
1535  unsigned int KiU;
1536  unsigned int KdU;
1537  float Kpf;
1538  float Kif;
1539  float Kdf;
1540  } pid_settings_t;
1541 
1557  typedef struct
1558  {
1559  unsigned int SyncInFlags;
1560  unsigned int ClutterTime;
1561  int Position;
1563  unsigned int Speed;
1564  unsigned int uSpeed;
1566 
1582  typedef struct
1583  {
1584  unsigned int SyncInFlags;
1585  unsigned int ClutterTime;
1586  float Position;
1587  float Speed;
1589 
1605  typedef struct
1606  {
1607  unsigned int SyncOutFlags;
1608  unsigned int SyncOutPulseSteps;
1609  unsigned int SyncOutPeriod;
1610  unsigned int Accuracy;
1611  unsigned int uAccuracy;
1613 
1629  typedef struct
1630  {
1631  unsigned int SyncOutFlags;
1632  unsigned int SyncOutPulseSteps;
1633  unsigned int SyncOutPeriod;
1634  float Accuracy;
1636 
1653  typedef struct
1654  {
1655  unsigned int EXTIOSetupFlags;
1656  unsigned int EXTIOModeFlags;
1657  } extio_settings_t;
1658 
1672  typedef struct
1673  {
1674  unsigned int t1;
1675  unsigned int t2;
1676  unsigned int t3;
1677  unsigned int t4;
1678  unsigned int BrakeFlags;
1679  } brake_settings_t;
1680 
1710  typedef struct
1711  {
1712  unsigned int MaxSpeed[10];
1713  unsigned int uMaxSpeed[10];
1714  unsigned int Timeout[9];
1715  unsigned int MaxClickTime;
1716  unsigned int Flags;
1720 
1750  typedef struct
1751  {
1752  float MaxSpeed[10];
1753  unsigned int Timeout[9];
1754  unsigned int MaxClickTime;
1755  unsigned int Flags;
1758 
1787  typedef struct
1788  {
1789  unsigned int JoyLowEnd;
1790  unsigned int JoyCenter;
1791  unsigned int JoyHighEnd;
1792  unsigned int ExpFactor;
1793  unsigned int DeadZone;
1794  unsigned int JoyFlags;
1796 
1830  typedef struct
1831  {
1832  unsigned int CTPMinError;
1833  unsigned int CTPFlags;
1834  } ctp_settings_t;
1835 
1849  typedef struct
1850  {
1851  unsigned int Speed;
1852  unsigned int UARTSetupFlags;
1853  } uart_settings_t;
1854 
1868  typedef struct
1869  {
1870  float CSS1_A;
1871  float CSS1_B;
1872  float CSS2_A;
1873  float CSS2_B;
1877 
1887  typedef struct
1888  {
1889  char ControllerName[17];
1890  unsigned int CtrlFlags;
1892 
1902  typedef struct
1903  {
1904  unsigned int UserData[7];
1906 
1928  typedef struct
1929  {
1930  float L;
1931  float R;
1932  float Km;
1933  unsigned int BackEMFFlags;
1934  } emf_settings_t;
1935 
1950  typedef struct
1951  {
1952  unsigned int stepcloseloop_Kw;
1953  unsigned int stepcloseloop_Kp_low;
1954  unsigned int stepcloseloop_Kp_high;
1956 
1971  typedef struct
1972  {
1973  unsigned int Param1;
1975 
1990  typedef struct
1991  {
1992  int Position;
1994  long_t EncPosition;
1995  } get_position_t;
1996 
2010  typedef struct
2011  {
2012  float Position;
2013  long_t EncPosition;
2015 
2030  typedef struct
2031  {
2032  int Position;
2034  long_t EncPosition;
2035  unsigned int PosFlags;
2036  } set_position_t;
2037 
2052  typedef struct
2053  {
2054  float Position;
2055  long_t EncPosition;
2056  unsigned int PosFlags;
2058 
2070  typedef struct
2071  {
2072  unsigned int MoveSts;
2073  unsigned int MvCmdSts;
2074  unsigned int PWRSts;
2075  unsigned int EncSts;
2076  unsigned int WindSts;
2079  long_t EncPosition;
2080  int CurSpeed;
2082  int Ipwr;
2083  int Upwr;
2084  int Iusb;
2085  int Uusb;
2086  int CurT;
2087  unsigned int Flags;
2088  unsigned int GPIOFlags;
2089  unsigned int CmdBufFreeSpace;
2090  } status_t;
2091 
2103  typedef struct
2104  {
2105  unsigned int MoveSts;
2106  unsigned int MvCmdSts;
2107  unsigned int PWRSts;
2108  unsigned int EncSts;
2109  unsigned int WindSts;
2110  float CurPosition;
2111  long_t EncPosition;
2112  float CurSpeed;
2113  int Ipwr;
2114  int Upwr;
2115  int Iusb;
2116  int Uusb;
2117  int CurT;
2118  unsigned int Flags;
2119  unsigned int GPIOFlags;
2120  unsigned int CmdBufFreeSpace;
2121  } status_calb_t;
2122 
2133  typedef struct
2134  {
2135  int Speed[25];
2136  int Error[25];
2137  unsigned int Length;
2138  } measurements_t;
2139 
2152  typedef struct
2153  {
2160  unsigned int Pot;
2161  unsigned int Joy;
2163  } chart_data_t;
2164 
2181  typedef struct
2182  {
2183  char Manufacturer[5];
2184  char ManufacturerId[3];
2185  char ProductDescription[9];
2186  unsigned int Major;
2187  unsigned int Minor;
2188  unsigned int Release;
2190 
2206  typedef struct
2207  {
2208  unsigned int SN;
2209  uint8_t Key[32];
2210  unsigned int Major;
2211  unsigned int Minor;
2212  unsigned int Release;
2213  } serial_number_t;
2214 
2229  typedef struct
2230  {
2231  unsigned int A1Voltage_ADC;
2232  unsigned int A2Voltage_ADC;
2233  unsigned int B1Voltage_ADC;
2234  unsigned int B2Voltage_ADC;
2235  unsigned int SupVoltage_ADC;
2236  unsigned int ACurrent_ADC;
2237  unsigned int BCurrent_ADC;
2238  unsigned int FullCurrent_ADC;
2239  unsigned int Temp_ADC;
2240  unsigned int Joy_ADC;
2241  unsigned int Pot_ADC;
2242  unsigned int L5_ADC;
2243  unsigned int H5_ADC;
2249  int ACurrent;
2250  int BCurrent;
2252  int Temp;
2253  int Joy;
2254  int Pot;
2255  int L5;
2256  int H5;
2257  unsigned int deprecated;
2258  int R;
2259  int L;
2260  } analog_data_t;
2261 
2273  typedef struct
2274  {
2275  uint8_t DebugData[128];
2276  } debug_read_t;
2277 
2289  typedef struct
2290  {
2291  uint8_t DebugData[128];
2292  } debug_write_t;
2293 
2303  typedef struct
2304  {
2305  char PositionerName[17];
2306  } stage_name_t;
2307 
2319  typedef struct
2320  {
2321  char Manufacturer[17];
2322  char PartNumber[25];
2324 
2336  typedef struct
2337  {
2339  char Units[9];
2340  float MaxSpeed;
2341  float TravelRange;
2347  } stage_settings_t;
2348 
2360  typedef struct
2361  {
2362  char Manufacturer[17];
2363  char PartNumber[25];
2365 
2377  typedef struct
2378  {
2379  unsigned int MotorType;
2380  unsigned int ReservedField;
2381  unsigned int Poles;
2382  unsigned int Phases;
2391  float StallTorque;
2397  float MaxSpeed;
2398  float MaxCurrent;
2401  float NoLoadSpeed;
2402  } motor_settings_t;
2403 
2415  typedef struct
2416  {
2417  char Manufacturer[17];
2418  char PartNumber[25];
2420 
2432  typedef struct
2433  {
2438  unsigned int PPR;
2439  unsigned int EncoderSettings;
2441 
2453  typedef struct
2454  {
2455  char Manufacturer[17];
2456  char PartNumber[25];
2458 
2470  typedef struct
2471  {
2476  unsigned int PPR;
2478 
2490  typedef struct
2491  {
2492  char Manufacturer[17];
2493  char PartNumber[25];
2495 
2507  typedef struct
2508  {
2509  float ReductionIn;
2515  float Efficiency;
2516  } gear_settings_t;
2517 
2529  typedef struct
2530  {
2531  char MagneticBrakeInfo[25];
2534  float MBTorque;
2535  unsigned int MBSettings;
2536  char TemperatureSensorInfo[25];
2537  float TSMin;
2538  float TSMax;
2539  float TSGrad;
2540  unsigned int TSSettings;
2541  unsigned int LimitSwitchesSettings;
2543 
2555  typedef struct
2556  {
2557  uint8_t key[16];
2558  } init_random_t;
2559 
2569  typedef struct
2570  {
2571  unsigned int UniqueID0;
2572  unsigned int UniqueID1;
2573  unsigned int UniqueID2;
2574  unsigned int UniqueID3;
2576 
2577 /*
2578  --------------------------------------------
2579  BEGIN OF GENERATED function declarations
2580  --------------------------------------------
2581 */
2582 
2595 
2614  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2615 
2634  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2635 
2652  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2653 
2672  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2673 
2690  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2691 
2710  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2711 
2724  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2725 
2740  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2741 
2754  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2755 
2770  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2771 
2793  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2794 
2818  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2819 
2839  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2840 
2862  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2863 
2876  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2877 
2890  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
2891 
2905  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
2906 
2921  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
2922 
2936  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
2937 
2951  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
2952 
2967  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
2968 
2993  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
2994 
3009  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
3010 
3035  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3036 
3060  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
3061 
3082  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
3083 
3101  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
3102 
3122  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);
3123 
3141  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
3142 
3162  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);
3163 
3181  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
3182 
3202  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);
3203 
3218  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
3219 
3239  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);
3240 
3259  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
3260 
3276  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
3277 
3290  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
3291 
3304  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
3305 
3334  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
3335 
3366  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3367 
3396  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
3397 
3428  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3429 
3465  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
3466 
3502  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
3503 
3538  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
3539 
3574  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3575 
3592  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3593 
3610  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3611 
3628  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3629 
3646  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3647 
3660  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3661 
3674  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3675 
3688  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3689 
3702  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3703 
3722  result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t* emf_settings);
3723 
3740  result_t XIMC_API get_emf_settings (device_t id, emf_settings_t* emf_settings);
3741 
3756  result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t* engine_advansed_setup);
3757 
3772  result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t* engine_advansed_setup);
3773 
3788  result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t* extended_settings);
3789 
3804  result_t XIMC_API get_extended_settings (device_t id, extended_settings_t* extended_settings);
3805 
3806 
3808 
3821 
3839  result_t XIMC_API command_stop (device_t id);
3840 
3859  result_t XIMC_API command_power_off (device_t id);
3860 
3880  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
3881 
3909  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
3910 
3934  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
3935 
3967  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
3968 
4008  result_t XIMC_API command_home (device_t id);
4009 
4020  result_t XIMC_API command_left (device_t id);
4021 
4032  result_t XIMC_API command_right (device_t id);
4033 
4046  result_t XIMC_API command_loft (device_t id);
4047 
4058  result_t XIMC_API command_sstp (device_t id);
4059 
4074  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
4075 
4100  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
4101 
4118  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
4119 
4137  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
4138 
4161  result_t XIMC_API command_zero (device_t id);
4162 
4163 
4165 
4178 
4189  result_t XIMC_API command_save_settings (device_t id);
4190 
4201  result_t XIMC_API command_read_settings (device_t id);
4202 
4213  result_t XIMC_API command_save_robust_settings (device_t id);
4214 
4225  result_t XIMC_API command_read_robust_settings (device_t id);
4226 
4239  result_t XIMC_API command_eesave_settings (device_t id);
4240 
4252  result_t XIMC_API command_eeread_settings (device_t id);
4253 
4264  result_t XIMC_API command_start_measurements (device_t id);
4265 
4284  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
4285 
4302  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
4303 
4316  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
4317 
4334  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4335 
4346  result_t XIMC_API service_command_updf (device_t id);
4347 
4348 
4350 
4363 
4382  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
4383 
4398  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
4399 
4414  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
4415 
4428  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
4429 
4430 
4432 
4445 
4458  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
4459 
4472  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
4473 
4488  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
4489 
4502  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
4503 
4518  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
4519 
4532  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
4533 
4548  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
4549 
4562  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
4563 
4578  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
4579 
4592  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
4593 
4608  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
4609 
4622  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
4623 
4638  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
4639 
4652  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
4653 
4668  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
4669 
4682  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
4683 
4698  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
4699 
4712  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
4713 
4728  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
4729 
4742  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
4743 
4758  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4759 
4772  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4773 
4788  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4789 
4802  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4803 
4820  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4821 
4834  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4835 
4852  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4853 
4854 
4855 /*
4856  -------------------------
4857  END OF GENERATED CODE
4858  -------------------------
4859 */
4860 
4861 /* hand-crafted functions begin */
4862 
4875  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
4876 
4889  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
4890 
4906  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
4907 
4922  result_t XIMC_API write_key (const char* uri, uint8_t* key);
4923 
4936  result_t XIMC_API command_reset(device_t id);
4937 
4950  result_t XIMC_API command_clear_fram(device_t id);
4951 
4953 
4954  // ------------------------------------
4955 
4967 
4994  device_t XIMC_API open_device (const char* uri);
4995 
5010  result_t XIMC_API close_device (device_t* id);
5011 
5067  result_t XIMC_API load_correction_table(device_t* id, const char* namefile);
5068 
5118  result_t XIMC_API set_correction_table(device_t id, const char* namefile);
5119 
5132  result_t XIMC_API probe_device (const char* uri);
5133 
5146  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5147 
5174  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5175 
5186  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5187 
5198  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5199 
5208  typedef char* pchar;
5209 
5224  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5225 
5226 
5243  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5244 
5261  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5262 
5279  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5280 
5297  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5298 
5315  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5316 
5330  result_t XIMC_API reset_locks ();
5331 
5351  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5352 
5353 
5363  void XIMC_API msec_sleep (unsigned int msec);
5364 
5374  void XIMC_API ximc_version (char* version);
5375 
5376 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5377 
5389  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5390 
5402  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5403 
5415  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5416 
5429  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5430 
5431 #endif
5432 
5456  result_t XIMC_API get_status (device_t id, status_t* status);
5457 
5483  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5484 
5510  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5511 
5530  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5531 
5544  result_t XIMC_API command_homezero(device_t id);
5546 
5547 #if defined(__cplusplus)
5548 };
5549 #endif
5550 
5551 #endif
5552 
5553 // vim: ts=4 shiftwidth=4
5554