libximc  2.9.12
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.9.12
273 
277 #define LIBXIMC_PROTOCOL_VERSION 17.4
278 
281 /*
282  ------------------------------------------
283  BEGIN OF GENERATED struct declarations
284  ------------------------------------------
285 */
286 
296 #define ENUMERATE_PROBE 0x01
297 #define ENUMERATE_ALL_COM 0x02
298 #define ENUMERATE_NETWORK 0x04
300 
301 
317 #define MOVE_STATE_MOVING 0x01
318 #define MOVE_STATE_TARGET_SPEED 0x02
319 #define MOVE_STATE_ANTIPLAY 0x04
321 
322 
336 #define EEPROM_PRECEDENCE 0x01
338 
339 
355 #define PWR_STATE_UNKNOWN 0x00
356 #define PWR_STATE_OFF 0x01
357 #define PWR_STATE_NORM 0x03
358 #define PWR_STATE_REDUCT 0x04
359 #define PWR_STATE_MAX 0x05
361 
362 
380 #define STATE_CONTR 0x00003F
381 #define STATE_ERRC 0x000001
382 #define STATE_ERRD 0x000002
383 #define STATE_ERRV 0x000004
384 #define STATE_EEPROM_CONNECTED 0x000010
385 #define STATE_IS_HOMED 0x000020
386 #define STATE_SECUR 0x73FFC0
387 #define STATE_ALARM 0x000040
388 #define STATE_CTP_ERROR 0x000080
389 #define STATE_POWER_OVERHEAT 0x000100
390 #define STATE_CONTROLLER_OVERHEAT 0x000200
391 #define STATE_OVERLOAD_POWER_VOLTAGE 0x000400
392 #define STATE_OVERLOAD_POWER_CURRENT 0x000800
393 #define STATE_OVERLOAD_USB_VOLTAGE 0x001000
394 #define STATE_LOW_USB_VOLTAGE 0x002000
395 #define STATE_OVERLOAD_USB_CURRENT 0x004000
396 #define STATE_BORDERS_SWAP_MISSET 0x008000
397 #define STATE_LOW_POWER_VOLTAGE 0x010000
398 #define STATE_H_BRIDGE_FAULT 0x020000
399 #define STATE_CURRENT_MOTOR_BITS 0x0C0000
400 #define STATE_CURRENT_MOTOR0 0x000000
401 #define STATE_CURRENT_MOTOR1 0x040000
402 #define STATE_CURRENT_MOTOR2 0x080000
403 #define STATE_CURRENT_MOTOR3 0x0C0000
404 #define STATE_WINDING_RES_MISMATCH 0x100000
405 #define STATE_ENCODER_FAULT 0x200000
406 #define STATE_MOTOR_CURRENT_LIMIT 0x400000
408 
409 
427 #define STATE_DIG_SIGNAL 0xFFFF
428 #define STATE_RIGHT_EDGE 0x0001
429 #define STATE_LEFT_EDGE 0x0002
430 #define STATE_BUTTON_RIGHT 0x0004
431 #define STATE_BUTTON_LEFT 0x0008
432 #define STATE_GPIO_PINOUT 0x0010
433 #define STATE_GPIO_LEVEL 0x0020
434 #define STATE_HALL_A 0x0040
435 #define STATE_HALL_B 0x0080
436 #define STATE_HALL_C 0x0100
437 #define STATE_BRAKE 0x0200
438 #define STATE_REV_SENSOR 0x0400
439 #define STATE_SYNC_INPUT 0x0800
440 #define STATE_SYNC_OUTPUT 0x1000
441 #define STATE_ENC_A 0x2000
442 #define STATE_ENC_B 0x4000
444 
445 
461 #define ENC_STATE_ABSENT 0x00
462 #define ENC_STATE_UNKNOWN 0x01
463 #define ENC_STATE_MALFUNC 0x02
464 #define ENC_STATE_REVERS 0x03
465 #define ENC_STATE_OK 0x04
467 
468 
484 #define WIND_A_STATE_ABSENT 0x00
485 #define WIND_A_STATE_UNKNOWN 0x01
486 #define WIND_A_STATE_MALFUNC 0x02
487 #define WIND_A_STATE_OK 0x03
488 #define WIND_B_STATE_ABSENT 0x00
489 #define WIND_B_STATE_UNKNOWN 0x10
490 #define WIND_B_STATE_MALFUNC 0x20
491 #define WIND_B_STATE_OK 0x30
493 
494 
512 #define MVCMD_NAME_BITS 0x3F
513 #define MVCMD_UKNWN 0x00
514 #define MVCMD_MOVE 0x01
515 #define MVCMD_MOVR 0x02
516 #define MVCMD_LEFT 0x03
517 #define MVCMD_RIGHT 0x04
518 #define MVCMD_STOP 0x05
519 #define MVCMD_HOME 0x06
520 #define MVCMD_LOFT 0x07
521 #define MVCMD_SSTP 0x08
522 #define MVCMD_ERROR 0x40
523 #define MVCMD_RUNNING 0x80
525 
526 
545 #define ENGINE_REVERSE 0x01
546 #define ENGINE_CURRENT_AS_RMS 0x02
547 #define ENGINE_MAX_SPEED 0x04
548 #define ENGINE_ANTIPLAY 0x08
549 #define ENGINE_ACCEL_ON 0x10
550 #define ENGINE_LIMIT_VOLT 0x20
551 #define ENGINE_LIMIT_CURR 0x40
552 #define ENGINE_LIMIT_RPM 0x80
554 
555 
574 #define MICROSTEP_MODE_FULL 0x01
575 #define MICROSTEP_MODE_FRAC_2 0x02
576 #define MICROSTEP_MODE_FRAC_4 0x03
577 #define MICROSTEP_MODE_FRAC_8 0x04
578 #define MICROSTEP_MODE_FRAC_16 0x05
579 #define MICROSTEP_MODE_FRAC_32 0x06
580 #define MICROSTEP_MODE_FRAC_64 0x07
581 #define MICROSTEP_MODE_FRAC_128 0x08
582 #define MICROSTEP_MODE_FRAC_256 0x09
584 
585 
604 #define ENGINE_TYPE_NONE 0x00
605 #define ENGINE_TYPE_DC 0x01
606 #define ENGINE_TYPE_2DC 0x02
607 #define ENGINE_TYPE_STEP 0x03
608 #define ENGINE_TYPE_TEST 0x04
609 #define ENGINE_TYPE_BRUSHLESS 0x05
611 
612 
631 #define DRIVER_TYPE_DISCRETE_FET 0x01
632 #define DRIVER_TYPE_INTEGRATE 0x02
633 #define DRIVER_TYPE_EXTERNAL 0x03
635 
636 
653 #define POWER_REDUCT_ENABLED 0x01
654 #define POWER_OFF_ENABLED 0x02
655 #define POWER_SMOOTH_CURRENT 0x04
657 
658 
675 #define ALARM_ON_DRIVER_OVERHEATING 0x01
676 #define LOW_UPWR_PROTECTION 0x02
677 #define H_BRIDGE_ALERT 0x04
678 #define ALARM_ON_BORDERS_SWAP_MISSET 0x08
679 #define ALARM_FLAGS_STICKING 0x10
680 #define USB_BREAK_RECONNECT 0x20
682 
683 
699 #define SETPOS_IGNORE_POSITION 0x01
700 #define SETPOS_IGNORE_ENCODER 0x02
702 
703 
717 #define FEEDBACK_ENCODER 0x01
718 #define FEEDBACK_ENCODERHALL 0x03
719 #define FEEDBACK_EMF 0x04
720 #define FEEDBACK_NONE 0x05
722 
723 
737 #define FEEDBACK_ENC_REVERSE 0x01
738 #define FEEDBACK_HALL_REVERSE 0x02
739 #define FEEDBACK_ENC_TYPE_BITS 0xC0
740 #define FEEDBACK_ENC_TYPE_AUTO 0x00
741 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
742 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
744 
745 
760 #define SYNCIN_ENABLED 0x01
761 #define SYNCIN_INVERT 0x02
762 #define SYNCIN_GOTOPOSITION 0x04
764 
765 
780 #define SYNCOUT_ENABLED 0x01
781 #define SYNCOUT_STATE 0x02
782 #define SYNCOUT_INVERT 0x04
783 #define SYNCOUT_IN_STEPS 0x08
784 #define SYNCOUT_ONSTART 0x10
785 #define SYNCOUT_ONSTOP 0x20
786 #define SYNCOUT_ONPERIOD 0x40
788 
789 
804 #define EXTIO_SETUP_OUTPUT 0x01
805 #define EXTIO_SETUP_INVERT 0x02
807 
808 
823 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
824 #define EXTIO_SETUP_MODE_IN_NOP 0x00
825 #define EXTIO_SETUP_MODE_IN_STOP 0x01
826 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
827 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
828 #define EXTIO_SETUP_MODE_IN_HOME 0x04
829 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
830 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
831 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
832 #define EXTIO_SETUP_MODE_OUT_ON 0x10
833 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
834 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
835 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
836 #define EXTIO_SETUP_MODE_OUT_MOTOR_FOUND 0x50
838 
839 
857 #define BORDER_IS_ENCODER 0x01
858 #define BORDER_STOP_LEFT 0x02
859 #define BORDER_STOP_RIGHT 0x04
860 #define BORDERS_SWAP_MISSET_DETECTION 0x08
862 
863 
881 #define ENDER_SWAP 0x01
882 #define ENDER_SW1_ACTIVE_LOW 0x02
883 #define ENDER_SW2_ACTIVE_LOW 0x04
885 
886 
904 #define BRAKE_ENABLED 0x01
905 #define BRAKE_ENG_PWROFF 0x02
907 
908 
926 #define CONTROL_MODE_BITS 0x03
927 #define CONTROL_MODE_OFF 0x00
928 #define CONTROL_MODE_JOY 0x01
929 #define CONTROL_MODE_LR 0x02
930 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
931 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
933 
934 
950 #define JOY_REVERSE 0x01
952 
953 
971 #define CTP_ENABLED 0x01
972 #define CTP_BASE 0x02
973 #define CTP_ALARM_ON_ERROR 0x04
974 #define REV_SENS_INV 0x08
975 #define CTP_ERROR_CORRECTION 0x10
977 
978 
997 #define HOME_DIR_FIRST 0x001
998 #define HOME_DIR_SECOND 0x002
999 #define HOME_MV_SEC_EN 0x004
1000 #define HOME_HALF_MV 0x008
1001 #define HOME_STOP_FIRST_BITS 0x030
1002 #define HOME_STOP_FIRST_REV 0x010
1003 #define HOME_STOP_FIRST_SYN 0x020
1004 #define HOME_STOP_FIRST_LIM 0x030
1005 #define HOME_STOP_SECOND_BITS 0x0C0
1006 #define HOME_STOP_SECOND_REV 0x040
1007 #define HOME_STOP_SECOND_SYN 0x080
1008 #define HOME_STOP_SECOND_LIM 0x0C0
1009 #define HOME_USE_FAST 0x100
1011 
1012 
1024 #define UART_PARITY_BITS 0x03
1025 #define UART_PARITY_BIT_EVEN 0x00
1026 #define UART_PARITY_BIT_ODD 0x01
1027 #define UART_PARITY_BIT_SPACE 0x02
1028 #define UART_PARITY_BIT_MARK 0x03
1029 #define UART_PARITY_BIT_USE 0x04
1030 #define UART_STOP_BIT 0x08
1032 
1033 
1045 #define MOTOR_TYPE_UNKNOWN 0x00
1046 #define MOTOR_TYPE_STEP 0x01
1047 #define MOTOR_TYPE_DC 0x02
1048 #define MOTOR_TYPE_BLDC 0x03
1050 
1051 
1063 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1064 #define ENCSET_PUSHPULL_OUTPUT 0x004
1065 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1066 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1067 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1069 
1070 
1082 #define MB_AVAILABLE 0x01
1083 #define MB_POWERED_HOLD 0x02
1085 
1086 
1098 #define TS_TYPE_BITS 0x07
1099 #define TS_TYPE_UNKNOWN 0x00
1100 #define TS_TYPE_THERMOCOUPLE 0x01
1101 #define TS_TYPE_SEMICONDUCTOR 0x02
1102 #define TS_AVAILABLE 0x08
1104 
1105 
1117 #define LS_ON_SW1_AVAILABLE 0x01
1118 #define LS_ON_SW2_AVAILABLE 0x02
1119 #define LS_SW1_ACTIVE_LOW 0x04
1120 #define LS_SW2_ACTIVE_LOW 0x08
1121 #define LS_SHORTED 0x10
1123 
1124 
1136  typedef struct
1137  {
1138  unsigned int IPS;
1139  unsigned int FeedbackType;
1140  unsigned int FeedbackFlags;
1141  unsigned int HallSPR;
1144 
1160  typedef struct
1161  {
1162  unsigned int FastHome;
1163  unsigned int uFastHome;
1164  unsigned int SlowHome;
1165  unsigned int uSlowHome;
1168  unsigned int HomeFlags;
1169  } home_settings_t;
1170 
1171  typedef struct
1172  {
1173  float FastHome;
1174  float SlowHome;
1175  float HomeDelta;
1176  unsigned int HomeFlags;
1178 
1190  typedef struct
1191  {
1192  unsigned int Speed;
1193  unsigned int uSpeed;
1194  unsigned int Accel;
1195  unsigned int Decel;
1196  unsigned int AntiplaySpeed;
1197  unsigned int uAntiplaySpeed;
1198  } move_settings_t;
1199 
1200  typedef struct
1201  {
1202  float Speed;
1203  float Accel;
1204  float Decel;
1207 
1228  typedef struct
1229  {
1230  unsigned int NomVoltage;
1231  unsigned int NomCurrent;
1232  unsigned int NomSpeed;
1233  unsigned int uNomSpeed;
1234  unsigned int EngineFlags;
1235  int Antiplay;
1236  unsigned int MicrostepMode;
1237  unsigned int StepsPerRev;
1239 
1240  typedef struct
1241  {
1242  unsigned int NomVoltage;
1243  unsigned int NomCurrent;
1244  float NomSpeed;
1245  unsigned int EngineFlags;
1246  float Antiplay;
1247  unsigned int MicrostepMode;
1248  unsigned int StepsPerRev;
1250 
1267  typedef struct
1268  {
1269  unsigned int EngineType;
1270  unsigned int DriverType;
1272 
1284  typedef struct
1285  {
1286  unsigned int HoldCurrent;
1287  unsigned int CurrReductDelay;
1288  unsigned int PowerOffDelay;
1289  unsigned int CurrentSetTime;
1290  unsigned int PowerFlags;
1291  } power_settings_t;
1292 
1306  typedef struct
1307  {
1308  unsigned int LowUpwrOff;
1309  unsigned int CriticalIpwr;
1310  unsigned int CriticalUpwr;
1311  unsigned int CriticalT;
1312  unsigned int CriticalIusb;
1313  unsigned int CriticalUusb;
1314  unsigned int MinimumUusb;
1315  unsigned int Flags;
1317 
1335  typedef struct
1336  {
1337  unsigned int BorderFlags;
1338  unsigned int EnderFlags;
1343  } edges_settings_t;
1344 
1345  typedef struct
1346  {
1347  unsigned int BorderFlags;
1348  unsigned int EnderFlags;
1349  float LeftBorder;
1350  float RightBorder;
1352 
1376  typedef struct
1377  {
1378  unsigned int KpU;
1379  unsigned int KiU;
1380  unsigned int KdU;
1381  float Kpf;
1382  float Kif;
1383  float Kdf;
1384  } pid_settings_t;
1385 
1401  typedef struct
1402  {
1403  unsigned int SyncInFlags;
1404  unsigned int ClutterTime;
1405  int Position;
1407  unsigned int Speed;
1408  unsigned int uSpeed;
1410 
1411  typedef struct
1412  {
1413  unsigned int SyncInFlags;
1414  unsigned int ClutterTime;
1415  float Position;
1416  float Speed;
1418 
1434  typedef struct
1435  {
1436  unsigned int SyncOutFlags;
1437  unsigned int SyncOutPulseSteps;
1438  unsigned int SyncOutPeriod;
1439  unsigned int Accuracy;
1440  unsigned int uAccuracy;
1442 
1443  typedef struct
1444  {
1445  unsigned int SyncOutFlags;
1446  unsigned int SyncOutPulseSteps;
1447  unsigned int SyncOutPeriod;
1448  float Accuracy;
1450 
1467  typedef struct
1468  {
1469  unsigned int EXTIOSetupFlags;
1470  unsigned int EXTIOModeFlags;
1471  } extio_settings_t;
1472 
1486  typedef struct
1487  {
1488  unsigned int t1;
1489  unsigned int t2;
1490  unsigned int t3;
1491  unsigned int t4;
1492  unsigned int BrakeFlags;
1493  } brake_settings_t;
1494 
1524  typedef struct
1525  {
1526  unsigned int MaxSpeed[10];
1527  unsigned int uMaxSpeed[10];
1528  unsigned int Timeout[9];
1529  unsigned int MaxClickTime;
1530  unsigned int Flags;
1534 
1535  typedef struct
1536  {
1537  float MaxSpeed[10];
1538  unsigned int Timeout[9];
1539  unsigned int MaxClickTime;
1540  unsigned int Flags;
1543 
1572  typedef struct
1573  {
1574  unsigned int JoyLowEnd;
1575  unsigned int JoyCenter;
1576  unsigned int JoyHighEnd;
1577  unsigned int ExpFactor;
1578  unsigned int DeadZone;
1579  unsigned int JoyFlags;
1581 
1615  typedef struct
1616  {
1617  unsigned int CTPMinError;
1618  unsigned int CTPFlags;
1619  } ctp_settings_t;
1620 
1634  typedef struct
1635  {
1636  unsigned int Speed;
1637  unsigned int UARTSetupFlags;
1638  } uart_settings_t;
1639 
1653  typedef struct
1654  {
1655  float CSS1_A;
1656  float CSS1_B;
1657  float CSS2_A;
1658  float CSS2_B;
1662 
1672  typedef struct
1673  {
1674  char ControllerName[17];
1675  unsigned int CtrlFlags;
1677 
1687  typedef struct
1688  {
1689  unsigned int UserData[7];
1691 
1701  typedef struct
1702  {
1703  int Position;
1705  unsigned int Time;
1707 
1708  typedef struct
1709  {
1710  float Position;
1711  unsigned int Time;
1713 
1728  typedef struct
1729  {
1730  int Position;
1732  long_t EncPosition;
1733  } get_position_t;
1734 
1735  typedef struct
1736  {
1737  float Position;
1738  long_t EncPosition;
1740 
1755  typedef struct
1756  {
1757  int Position;
1759  long_t EncPosition;
1760  unsigned int PosFlags;
1761  } set_position_t;
1762 
1763  typedef struct
1764  {
1765  float Position;
1766  long_t EncPosition;
1767  unsigned int PosFlags;
1769 
1781  typedef struct
1782  {
1783  unsigned int MoveSts;
1784  unsigned int MvCmdSts;
1785  unsigned int PWRSts;
1786  unsigned int EncSts;
1787  unsigned int WindSts;
1790  long_t EncPosition;
1791  int CurSpeed;
1793  int Ipwr;
1794  int Upwr;
1795  int Iusb;
1796  int Uusb;
1797  int CurT;
1798  unsigned int Flags;
1799  unsigned int GPIOFlags;
1800  unsigned int CmdBufFreeSpace;
1801  } status_t;
1802 
1803  typedef struct
1804  {
1805  unsigned int MoveSts;
1806  unsigned int MvCmdSts;
1807  unsigned int PWRSts;
1808  unsigned int EncSts;
1809  unsigned int WindSts;
1810  float CurPosition;
1811  long_t EncPosition;
1812  float CurSpeed;
1813  int Ipwr;
1814  int Upwr;
1815  int Iusb;
1816  int Uusb;
1817  int CurT;
1818  unsigned int Flags;
1819  unsigned int GPIOFlags;
1820  unsigned int CmdBufFreeSpace;
1821  } status_calb_t;
1822 
1833  typedef struct
1834  {
1835  int Speed[25];
1836  int Error[25];
1837  unsigned int Length;
1838  } measurements_t;
1839 
1852  typedef struct
1853  {
1860  unsigned int Pot;
1861  unsigned int Joy;
1863  } chart_data_t;
1864 
1881  typedef struct
1882  {
1883  char Manufacturer[5];
1884  char ManufacturerId[3];
1885  char ProductDescription[9];
1886  unsigned int Major;
1887  unsigned int Minor;
1888  unsigned int Release;
1890 
1906  typedef struct
1907  {
1908  unsigned int SN;
1909  uint8_t Key[32];
1910  unsigned int Major;
1911  unsigned int Minor;
1912  unsigned int Release;
1913  } serial_number_t;
1914 
1929  typedef struct
1930  {
1931  unsigned int A1Voltage_ADC;
1932  unsigned int A2Voltage_ADC;
1933  unsigned int B1Voltage_ADC;
1934  unsigned int B2Voltage_ADC;
1935  unsigned int SupVoltage_ADC;
1936  unsigned int ACurrent_ADC;
1937  unsigned int BCurrent_ADC;
1938  unsigned int FullCurrent_ADC;
1939  unsigned int Temp_ADC;
1940  unsigned int Joy_ADC;
1941  unsigned int Pot_ADC;
1942  unsigned int L5_ADC;
1943  unsigned int H5_ADC;
1949  int ACurrent;
1950  int BCurrent;
1952  int Temp;
1953  int Joy;
1954  int Pot;
1955  int L5;
1956  int H5;
1957  unsigned int deprecated;
1958  int R;
1959  int L;
1960  } analog_data_t;
1961 
1973  typedef struct
1974  {
1975  uint8_t DebugData[128];
1976  } debug_read_t;
1977 
1989  typedef struct
1990  {
1991  uint8_t DebugData[128];
1992  } debug_write_t;
1993 
2003  typedef struct
2004  {
2005  char PositionerName[17];
2006  } stage_name_t;
2007 
2019  typedef struct
2020  {
2021  char Manufacturer[17];
2022  char PartNumber[25];
2024 
2036  typedef struct
2037  {
2039  char Units[9];
2040  float MaxSpeed;
2041  float TravelRange;
2047  } stage_settings_t;
2048 
2060  typedef struct
2061  {
2062  char Manufacturer[17];
2063  char PartNumber[25];
2065 
2077  typedef struct
2078  {
2079  unsigned int MotorType;
2080  unsigned int ReservedField;
2081  unsigned int Poles;
2082  unsigned int Phases;
2091  float StallTorque;
2097  float MaxSpeed;
2098  float MaxCurrent;
2101  float NoLoadSpeed;
2102  } motor_settings_t;
2103 
2115  typedef struct
2116  {
2117  char Manufacturer[17];
2118  char PartNumber[25];
2120 
2132  typedef struct
2133  {
2138  unsigned int PPR;
2139  unsigned int EncoderSettings;
2141 
2153  typedef struct
2154  {
2155  char Manufacturer[17];
2156  char PartNumber[25];
2158 
2170  typedef struct
2171  {
2176  unsigned int PPR;
2178 
2190  typedef struct
2191  {
2192  char Manufacturer[17];
2193  char PartNumber[25];
2195 
2207  typedef struct
2208  {
2209  float ReductionIn;
2215  float Efficiency;
2216  } gear_settings_t;
2217 
2229  typedef struct
2230  {
2231  char MagneticBrakeInfo[25];
2234  float MBTorque;
2235  unsigned int MBSettings;
2236  char TemperatureSensorInfo[25];
2237  float TSMin;
2238  float TSMax;
2239  float TSGrad;
2240  unsigned int TSSettings;
2241  unsigned int LimitSwitchesSettings;
2243 
2255  typedef struct
2256  {
2257  uint8_t key[16];
2258  } init_random_t;
2259 
2269  typedef struct
2270  {
2271  unsigned int UniqueID0;
2272  unsigned int UniqueID1;
2273  unsigned int UniqueID2;
2274  unsigned int UniqueID3;
2276 
2286  typedef struct
2287  {
2288  unsigned int Motor;
2290 
2291 /*
2292  --------------------------------------------
2293  BEGIN OF GENERATED function declarations
2294  --------------------------------------------
2295 */
2296 
2309 
2328  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2329 
2348  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2349 
2366  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2367 
2368  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2369 
2386  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2387 
2388  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2389 
2402  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2403 
2404  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2405 
2418  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2419 
2420  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2421 
2443  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2444 
2445  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2446 
2466  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2467 
2468  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2469 
2484  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2485 
2500  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
2501 
2515  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
2516 
2531  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
2532 
2546  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
2547 
2561  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
2562 
2577  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
2578 
2579  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
2580 
2595  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
2596 
2597  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
2598 
2622  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
2623 
2644  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
2645 
2663  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
2664 
2665  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);
2666 
2684  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
2685 
2686  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);
2687 
2705  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
2706 
2707  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);
2708 
2723  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
2724 
2725  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);
2726 
2745  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
2746 
2762  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
2763 
2776  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
2777 
2790  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
2791 
2820  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
2821 
2822  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
2823 
2852  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
2853 
2854  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
2855 
2891  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
2892 
2928  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
2929 
2964  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
2965 
3000  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3001 
3018  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3019 
3036  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3037 
3054  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3055 
3072  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3073 
3086  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3087 
3100  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3101 
3114  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3115 
3128  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3129 
3130 
3132 
3145 
3163  result_t XIMC_API command_stop (device_t id);
3164 
3184  result_t XIMC_API command_add_sync_in_action (device_t id, const command_add_sync_in_action_t* the_command_add_sync_in_action);
3185 
3186  result_t XIMC_API command_add_sync_in_action_calb (device_t id, const command_add_sync_in_action_calb_t* the_command_add_sync_in_action_calb, const calibration_t* calibration);
3187 
3206  result_t XIMC_API command_power_off (device_t id);
3207 
3227  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
3228 
3229  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
3230 
3252  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
3253 
3254  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
3255 
3295  result_t XIMC_API command_home (device_t id);
3296 
3307  result_t XIMC_API command_left (device_t id);
3308 
3319  result_t XIMC_API command_right (device_t id);
3320 
3333  result_t XIMC_API command_loft (device_t id);
3334 
3345  result_t XIMC_API command_sstp (device_t id);
3346 
3361  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
3362 
3363  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
3364 
3381  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
3382 
3383  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
3384 
3407  result_t XIMC_API command_zero (device_t id);
3408 
3409 
3411 
3424 
3435  result_t XIMC_API command_save_settings (device_t id);
3436 
3447  result_t XIMC_API command_read_settings (device_t id);
3448 
3459  result_t XIMC_API command_save_robust_settings (device_t id);
3460 
3471  result_t XIMC_API command_read_robust_settings (device_t id);
3472 
3485  result_t XIMC_API command_eesave_settings (device_t id);
3486 
3498  result_t XIMC_API command_eeread_settings (device_t id);
3499 
3510  result_t XIMC_API command_start_measurements (device_t id);
3511 
3530  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
3531 
3548  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
3549 
3562  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
3563 
3580  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
3581 
3592  result_t XIMC_API service_command_updf (device_t id);
3593 
3594 
3596 
3609 
3628  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
3629 
3644  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
3645 
3660  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
3661 
3674  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
3675 
3676 
3678 
3691 
3704  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
3705 
3718  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
3719 
3734  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
3735 
3748  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
3749 
3764  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
3765 
3778  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
3779 
3794  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
3795 
3808  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
3809 
3824  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
3825 
3838  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
3839 
3854  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
3855 
3868  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
3869 
3884  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
3885 
3898  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
3899 
3914  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
3915 
3928  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
3929 
3944  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
3945 
3958  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
3959 
3974  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
3975 
3988  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
3989 
4004  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4005 
4018  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4019 
4034  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4035 
4048  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4049 
4066  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4067 
4080  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4081 
4098  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4099 
4110  result_t XIMC_API command_change_motor (device_t id, const command_change_motor_t* the_command_change_motor);
4111 
4112 
4113 /*
4114  -------------------------
4115  END OF GENERATED CODE
4116  -------------------------
4117 */
4118 
4119 /* hand-crafted functions begin */
4120 
4133  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
4134 
4147  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
4148 
4164  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
4165 
4180  result_t XIMC_API write_key (const char* uri, uint8_t* key);
4181 
4194  result_t XIMC_API command_reset(device_t id);
4195 
4208  result_t XIMC_API command_clear_fram(device_t id);
4209 
4211 
4212  // ------------------------------------
4213 
4225 
4252  device_t XIMC_API open_device (const char* uri);
4253 
4264  result_t XIMC_API close_device (device_t* id);
4265 
4278  result_t XIMC_API probe_device (const char* uri);
4279 
4294  result_t XIMC_API set_bindy_key(const char* keyfilepath);
4295 
4316  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
4317 
4328  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
4329 
4340  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
4341 
4350  typedef char* pchar;
4351 
4366  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
4367 
4368 
4385  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
4386 
4403  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
4404 
4421  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
4422 
4439  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
4440 
4457  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
4458 
4466  result_t XIMC_API reset_locks ();
4467 
4487  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
4488 
4489 
4499  void XIMC_API msec_sleep (unsigned int msec);
4500 
4510  void XIMC_API ximc_version (char* version);
4511 
4512 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
4513 
4525  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
4526 
4538  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
4539 
4551  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
4552 
4565  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
4566 
4567 #endif
4568 
4592  result_t XIMC_API get_status (device_t id, status_t* status);
4593 
4605  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
4606 
4632  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
4633 
4652  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
4653 
4666  result_t XIMC_API command_homezero(device_t id);
4668 
4669 #if defined(__cplusplus)
4670 };
4671 #endif
4672 
4673 #endif
4674 
4675 // vim: ts=4 shiftwidth=4
4676