libximc  2.14.28
ximc.h
См. документацию.
1 #ifndef INC_XIMC_H
2 #define INC_XIMC_H
3 
25 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
26  #define XIMC_API __stdcall
27 #else
28  #ifdef LIBXIMC_EXPORTS
29  #define XIMC_API __attribute__((visibility("default")))
30  #else
31  #define XIMC_API
32  #endif
33 #endif
34 
43 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
44  #define XIMC_CALLCONV __stdcall
45 #else
46  #define XIMC_CALLCONV
47 #endif
48 
57 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
58 #define XIMC_RETTYPE unsigned int
59 #else
60 #define XIMC_RETTYPE void*
61 #endif
62 
63 
64 #if !defined(XIMC_NO_STDINT)
65 
66 #if ( (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)) && !defined(MATLAB_IMPORT)
67 // msvc types burden
68 typedef __int8 int8_t;
69 typedef __int16 int16_t;
70 typedef __int32 int32_t;
71 typedef __int64 int64_t;
72 typedef unsigned __int8 uint8_t;
73 typedef unsigned __int16 uint16_t;
74 typedef unsigned __int32 uint32_t;
75 typedef unsigned __int64 uint64_t;
76 #else
77 #include <stdint.h>
78 #endif
79 
80 /* labview doesn't speak C99 */
81 #if defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)
82 typedef unsigned __int64 ulong_t;
83 typedef __int64 long_t;
84 #else
85 typedef unsigned long long ulong_t;
86 typedef long long long_t;
87 #endif
88 
89 #endif
90 
91 #include <time.h>
92 
93 #if defined(__cplusplus)
94 extern "C"
95 {
96 #endif
97 
98 
107  typedef int device_t;
108 
117  typedef int result_t;
118 
127  #if defined(_WIN64) || defined(__LP64__) || defined(LABVIEW64_IMPORT)
128  typedef uint64_t device_enumeration_t;
129  #else
130  typedef uint32_t device_enumeration_t;
131  #endif
132  //typedef device_enumeration_t* pdevice_enumeration_t;
133 
142 #define device_undefined -1
143 
152 
161 #define result_ok 0
162 
171 #define result_error -1
172 
181 #define result_not_implemented -2
182 
191 #define result_value_error -3
192 
201 #define result_nodevice -4
202 
204 
213 
222 #define LOGLEVEL_ERROR 0x01
223 
231 #define LOGLEVEL_WARNING 0x02
232 
240 #define LOGLEVEL_INFO 0x03
241 
249 #define LOGLEVEL_DEBUG 0x04
250 
251 
252 
260  typedef struct calibration_t
261  {
262  double A;
263  unsigned int MicrostepMode;
264  } calibration_t;
265 
274  {
275  uint32_t ipv4;
276  char nodename[16];
278  uint32_t axis_state;
279  char locker_username[16];
280  char locker_nodename[16];
281  time_t locked_time;
283 
284 
285 
287 #define LIBXIMC_VERSION 2.14.28
288 
292 #define LIBXIMC_PROTOCOL_VERSION 20.9
293 
296 /*
297  ------------------------------------------
298  BEGIN OF GENERATED struct declarations
299  ------------------------------------------
300 */
301 
313 #define ENUMERATE_PROBE 0x01
314 #define ENUMERATE_ALL_COM 0x02
315 #define ENUMERATE_NETWORK 0x04
317 
318 
335 #define MOVE_STATE_MOVING 0x01
336 #define MOVE_STATE_TARGET_SPEED 0x02
337 #define MOVE_STATE_ANTIPLAY 0x04
339 
340 
356 #define EEPROM_PRECEDENCE 0x01
358 
359 
376 #define PWR_STATE_UNKNOWN 0x00
377 #define PWR_STATE_OFF 0x01
378 #define PWR_STATE_NORM 0x03
379 #define PWR_STATE_REDUCT 0x04
380 #define PWR_STATE_MAX 0x05
382 
383 
402 #define STATE_CONTR 0x000003F
403 #define STATE_ERRC 0x0000001
404 #define STATE_ERRD 0x0000002
405 #define STATE_ERRV 0x0000004
406 #define STATE_EEPROM_CONNECTED 0x0000010
407 #define STATE_IS_HOMED 0x0000020
408 #define STATE_SECUR 0x1B3FFC0
409 #define STATE_ALARM 0x0000040
410 #define STATE_CTP_ERROR 0x0000080
411 #define STATE_POWER_OVERHEAT 0x0000100
412 #define STATE_CONTROLLER_OVERHEAT 0x0000200
413 #define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400
414 #define STATE_OVERLOAD_POWER_CURRENT 0x0000800
415 #define STATE_OVERLOAD_USB_VOLTAGE 0x0001000
416 #define STATE_LOW_USB_VOLTAGE 0x0002000
417 #define STATE_OVERLOAD_USB_CURRENT 0x0004000
418 #define STATE_BORDERS_SWAP_MISSET 0x0008000
419 #define STATE_LOW_POWER_VOLTAGE 0x0010000
420 #define STATE_H_BRIDGE_FAULT 0x0020000
421 #define STATE_WINDING_RES_MISMATCH 0x0100000
422 #define STATE_ENCODER_FAULT 0x0200000
423 #define STATE_ENGINE_RESPONSE_ERROR 0x0800000
424 #define STATE_EXTIO_ALARM 0x1000000
426 
427 
446 #define STATE_DIG_SIGNAL 0xFFFF
447 #define STATE_RIGHT_EDGE 0x0001
448 #define STATE_LEFT_EDGE 0x0002
449 #define STATE_BUTTON_RIGHT 0x0004
450 #define STATE_BUTTON_LEFT 0x0008
451 #define STATE_GPIO_PINOUT 0x0010
452 #define STATE_GPIO_LEVEL 0x0020
453 #define STATE_BRAKE 0x0200
454 #define STATE_REV_SENSOR 0x0400
455 #define STATE_SYNC_INPUT 0x0800
456 #define STATE_SYNC_OUTPUT 0x1000
457 #define STATE_ENC_A 0x2000
458 #define STATE_ENC_B 0x4000
460 
461 
478 #define ENC_STATE_ABSENT 0x00
479 #define ENC_STATE_UNKNOWN 0x01
480 #define ENC_STATE_MALFUNC 0x02
481 #define ENC_STATE_REVERS 0x03
482 #define ENC_STATE_OK 0x04
484 
485 
502 #define WIND_A_STATE_ABSENT 0x00
503 #define WIND_A_STATE_UNKNOWN 0x01
504 #define WIND_A_STATE_MALFUNC 0x02
505 #define WIND_A_STATE_OK 0x03
506 #define WIND_B_STATE_ABSENT 0x00
507 #define WIND_B_STATE_UNKNOWN 0x10
508 #define WIND_B_STATE_MALFUNC 0x20
509 #define WIND_B_STATE_OK 0x30
511 
512 
531 #define MVCMD_NAME_BITS 0x3F
532 #define MVCMD_UKNWN 0x00
533 #define MVCMD_MOVE 0x01
534 #define MVCMD_MOVR 0x02
535 #define MVCMD_LEFT 0x03
536 #define MVCMD_RIGHT 0x04
537 #define MVCMD_STOP 0x05
538 #define MVCMD_HOME 0x06
539 #define MVCMD_LOFT 0x07
540 #define MVCMD_SSTP 0x08
541 #define MVCMD_ERROR 0x40
542 #define MVCMD_RUNNING 0x80
544 
545 
565 #define RPM_DIV_1000 0x01
567 
568 
588 #define ENGINE_REVERSE 0x01
589 #define ENGINE_CURRENT_AS_RMS 0x02
590 #define ENGINE_MAX_SPEED 0x04
591 #define ENGINE_ANTIPLAY 0x08
592 #define ENGINE_ACCEL_ON 0x10
593 #define ENGINE_LIMIT_VOLT 0x20
594 #define ENGINE_LIMIT_CURR 0x40
595 #define ENGINE_LIMIT_RPM 0x80
597 
598 
619 #define MICROSTEP_MODE_FULL 0x01
620 #define MICROSTEP_MODE_FRAC_2 0x02
621 #define MICROSTEP_MODE_FRAC_4 0x03
622 #define MICROSTEP_MODE_FRAC_8 0x04
623 #define MICROSTEP_MODE_FRAC_16 0x05
624 #define MICROSTEP_MODE_FRAC_32 0x06
625 #define MICROSTEP_MODE_FRAC_64 0x07
626 #define MICROSTEP_MODE_FRAC_128 0x08
627 #define MICROSTEP_MODE_FRAC_256 0x09
629 
630 
651 #define ENGINE_TYPE_NONE 0x00
652 #define ENGINE_TYPE_DC 0x01
653 #define ENGINE_TYPE_2DC 0x02
654 #define ENGINE_TYPE_STEP 0x03
655 #define ENGINE_TYPE_TEST 0x04
656 #define ENGINE_TYPE_BRUSHLESS 0x05
658 
659 
680 #define DRIVER_TYPE_DISCRETE_FET 0x01
681 #define DRIVER_TYPE_INTEGRATE 0x02
682 #define DRIVER_TYPE_EXTERNAL 0x03
684 
685 
704 #define POWER_REDUCT_ENABLED 0x01
705 #define POWER_OFF_ENABLED 0x02
706 #define POWER_SMOOTH_CURRENT 0x04
708 
709 
728 #define ALARM_ON_DRIVER_OVERHEATING 0x01
729 #define LOW_UPWR_PROTECTION 0x02
730 #define H_BRIDGE_ALERT 0x04
731 #define ALARM_ON_BORDERS_SWAP_MISSET 0x08
732 #define ALARM_FLAGS_STICKING 0x10
733 #define USB_BREAK_RECONNECT 0x20
734 #define ALARM_WINDING_MISMATCH 0x40
735 #define ALARM_ENGINE_RESPONSE 0x80
737 
738 
756 #define SETPOS_IGNORE_POSITION 0x01
757 #define SETPOS_IGNORE_ENCODER 0x02
759 
760 
776 #define FEEDBACK_ENCODER 0x01
777 #define FEEDBACK_EMF 0x04
778 #define FEEDBACK_NONE 0x05
779 #define FEEDBACK_ENCODER_MEDIATED 0x06
781 
782 
798 #define FEEDBACK_ENC_REVERSE 0x01
799 #define FEEDBACK_ENC_TYPE_BITS 0xC0
800 #define FEEDBACK_ENC_TYPE_AUTO 0x00
801 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
802 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
804 
805 
819 #define SYNCIN_ENABLED 0x01
820 #define SYNCIN_INVERT 0x02
821 #define SYNCIN_GOTOPOSITION 0x04
823 
824 
838 #define SYNCOUT_ENABLED 0x01
839 #define SYNCOUT_STATE 0x02
840 #define SYNCOUT_INVERT 0x04
841 #define SYNCOUT_IN_STEPS 0x08
842 #define SYNCOUT_ONSTART 0x10
843 #define SYNCOUT_ONSTOP 0x20
844 #define SYNCOUT_ONPERIOD 0x40
846 
847 
863 #define EXTIO_SETUP_OUTPUT 0x01
864 #define EXTIO_SETUP_INVERT 0x02
866 
867 
884 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
885 #define EXTIO_SETUP_MODE_IN_NOP 0x00
886 #define EXTIO_SETUP_MODE_IN_STOP 0x01
887 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
888 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
889 #define EXTIO_SETUP_MODE_IN_HOME 0x04
890 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
891 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
892 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
893 #define EXTIO_SETUP_MODE_OUT_ON 0x10
894 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
895 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
896 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
898 
899 
919 #define BORDER_IS_ENCODER 0x01
920 #define BORDER_STOP_LEFT 0x02
921 #define BORDER_STOP_RIGHT 0x04
922 #define BORDERS_SWAP_MISSET_DETECTION 0x08
924 
925 
945 #define ENDER_SWAP 0x01
946 #define ENDER_SW1_ACTIVE_LOW 0x02
947 #define ENDER_SW2_ACTIVE_LOW 0x04
949 
950 
970 #define BRAKE_ENABLED 0x01
971 #define BRAKE_ENG_PWROFF 0x02
973 
974 
994 #define CONTROL_MODE_BITS 0x03
995 #define CONTROL_MODE_OFF 0x00
996 #define CONTROL_MODE_JOY 0x01
997 #define CONTROL_MODE_LR 0x02
998 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
999 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
1001 
1002 
1020 #define JOY_REVERSE 0x01
1022 
1023 
1043 #define CTP_ENABLED 0x01
1044 #define CTP_BASE 0x02
1045 #define CTP_ALARM_ON_ERROR 0x04
1046 #define REV_SENS_INV 0x08
1047 #define CTP_ERROR_CORRECTION 0x10
1049 
1050 
1071 #define HOME_DIR_FIRST 0x001
1072 #define HOME_DIR_SECOND 0x002
1073 #define HOME_MV_SEC_EN 0x004
1074 #define HOME_HALF_MV 0x008
1075 #define HOME_STOP_FIRST_BITS 0x030
1076 #define HOME_STOP_FIRST_REV 0x010
1077 #define HOME_STOP_FIRST_SYN 0x020
1078 #define HOME_STOP_FIRST_LIM 0x030
1079 #define HOME_STOP_SECOND_BITS 0x0C0
1080 #define HOME_STOP_SECOND_REV 0x040
1081 #define HOME_STOP_SECOND_SYN 0x080
1082 #define HOME_STOP_SECOND_LIM 0x0C0
1083 #define HOME_USE_FAST 0x100
1085 
1086 
1100 #define UART_PARITY_BITS 0x03
1101 #define UART_PARITY_BIT_EVEN 0x00
1102 #define UART_PARITY_BIT_ODD 0x01
1103 #define UART_PARITY_BIT_SPACE 0x02
1104 #define UART_PARITY_BIT_MARK 0x03
1105 #define UART_PARITY_BIT_USE 0x04
1106 #define UART_STOP_BIT 0x08
1108 
1109 
1123 #define MOTOR_TYPE_UNKNOWN 0x00
1124 #define MOTOR_TYPE_STEP 0x01
1125 #define MOTOR_TYPE_DC 0x02
1126 #define MOTOR_TYPE_BLDC 0x03
1128 
1129 
1143 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1144 #define ENCSET_PUSHPULL_OUTPUT 0x004
1145 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1146 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1147 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1149 
1150 
1164 #define MB_AVAILABLE 0x01
1165 #define MB_POWERED_HOLD 0x02
1167 
1168 
1182 #define TS_TYPE_BITS 0x07
1183 #define TS_TYPE_UNKNOWN 0x00
1184 #define TS_TYPE_THERMOCOUPLE 0x01
1185 #define TS_TYPE_SEMICONDUCTOR 0x02
1186 #define TS_AVAILABLE 0x08
1188 
1189 
1203 #define LS_ON_SW1_AVAILABLE 0x01
1204 #define LS_ON_SW2_AVAILABLE 0x02
1205 #define LS_SW1_ACTIVE_LOW 0x04
1206 #define LS_SW2_ACTIVE_LOW 0x08
1207 #define LS_SHORTED 0x10
1209 
1210 
1226 #define BACK_EMF_INDUCTANCE_AUTO 0x01
1227 #define BACK_EMF_RESISTANCE_AUTO 0x02
1228 #define BACK_EMF_KM_AUTO 0x04
1230 
1231 
1243  typedef struct
1244  {
1245  unsigned int IPS;
1246  unsigned int FeedbackType;
1247  unsigned int FeedbackFlags;
1248  unsigned int CountsPerTurn;
1250 
1265  typedef struct
1266  {
1267  unsigned int FastHome;
1268  unsigned int uFastHome;
1269  unsigned int SlowHome;
1270  unsigned int uSlowHome;
1273  unsigned int HomeFlags;
1274  } home_settings_t;
1275 
1291  typedef struct
1292  {
1293  float FastHome;
1294  float SlowHome;
1295  float HomeDelta;
1296  unsigned int HomeFlags;
1298 
1310  typedef struct
1311  {
1312  unsigned int Speed;
1313  unsigned int uSpeed;
1314  unsigned int Accel;
1315  unsigned int Decel;
1316  unsigned int AntiplaySpeed;
1317  unsigned int uAntiplaySpeed;
1318  unsigned int MoveFlags;
1319  } move_settings_t;
1320 
1332  typedef struct
1333  {
1334  float Speed;
1335  float Accel;
1336  float Decel;
1338  unsigned int MoveFlags;
1340 
1357  typedef struct
1358  {
1359  unsigned int NomVoltage;
1360  unsigned int NomCurrent;
1361  unsigned int NomSpeed;
1362  unsigned int uNomSpeed;
1363  unsigned int EngineFlags;
1364  int Antiplay;
1365  unsigned int MicrostepMode;
1366  unsigned int StepsPerRev;
1368 
1386  typedef struct
1387  {
1388  unsigned int NomVoltage;
1389  unsigned int NomCurrent;
1390  float NomSpeed;
1391  unsigned int EngineFlags;
1392  float Antiplay;
1393  unsigned int MicrostepMode;
1394  unsigned int StepsPerRev;
1396 
1413  typedef struct
1414  {
1415  unsigned int EngineType;
1416  unsigned int DriverType;
1418 
1430  typedef struct
1431  {
1432  unsigned int HoldCurrent;
1433  unsigned int CurrReductDelay;
1434  unsigned int PowerOffDelay;
1435  unsigned int CurrentSetTime;
1436  unsigned int PowerFlags;
1437  } power_settings_t;
1438 
1452  typedef struct
1453  {
1454  unsigned int LowUpwrOff;
1455  unsigned int CriticalIpwr;
1456  unsigned int CriticalUpwr;
1457  unsigned int CriticalT;
1458  unsigned int CriticalIusb;
1459  unsigned int CriticalUusb;
1460  unsigned int MinimumUusb;
1461  unsigned int Flags;
1463 
1479  typedef struct
1480  {
1481  unsigned int BorderFlags;
1482  unsigned int EnderFlags;
1487  } edges_settings_t;
1488 
1504  typedef struct
1505  {
1506  unsigned int BorderFlags;
1507  unsigned int EnderFlags;
1508  float LeftBorder;
1509  float RightBorder;
1511 
1529  typedef struct
1530  {
1531  unsigned int KpU;
1532  unsigned int KiU;
1533  unsigned int KdU;
1534  float Kpf;
1535  float Kif;
1536  float Kdf;
1537  } pid_settings_t;
1538 
1553  typedef struct
1554  {
1555  unsigned int SyncInFlags;
1556  unsigned int ClutterTime;
1557  int Position;
1559  unsigned int Speed;
1560  unsigned int uSpeed;
1562 
1576  typedef struct
1577  {
1578  unsigned int SyncInFlags;
1579  unsigned int ClutterTime;
1580  float Position;
1581  float Speed;
1583 
1597  typedef struct
1598  {
1599  unsigned int SyncOutFlags;
1600  unsigned int SyncOutPulseSteps;
1601  unsigned int SyncOutPeriod;
1602  unsigned int Accuracy;
1603  unsigned int uAccuracy;
1605 
1620  typedef struct
1621  {
1622  unsigned int SyncOutFlags;
1623  unsigned int SyncOutPulseSteps;
1624  unsigned int SyncOutPeriod;
1625  float Accuracy;
1627 
1644  typedef struct
1645  {
1646  unsigned int EXTIOSetupFlags;
1647  unsigned int EXTIOModeFlags;
1648  } extio_settings_t;
1649 
1664  typedef struct
1665  {
1666  unsigned int t1;
1667  unsigned int t2;
1668  unsigned int t3;
1669  unsigned int t4;
1670  unsigned int BrakeFlags;
1671  } brake_settings_t;
1672 
1698  typedef struct
1699  {
1700  unsigned int MaxSpeed[10];
1701  unsigned int uMaxSpeed[10];
1702  unsigned int Timeout[9];
1703  unsigned int MaxClickTime;
1704  unsigned int Flags;
1708 
1734  typedef struct
1735  {
1736  float MaxSpeed[10];
1737  unsigned int Timeout[9];
1738  unsigned int MaxClickTime;
1739  unsigned int Flags;
1742 
1775  typedef struct
1776  {
1777  unsigned int JoyLowEnd;
1778  unsigned int JoyCenter;
1779  unsigned int JoyHighEnd;
1780  unsigned int ExpFactor;
1781  unsigned int DeadZone;
1782  unsigned int JoyFlags;
1784 
1803  typedef struct
1804  {
1805  unsigned int CTPMinError;
1806  unsigned int CTPFlags;
1807  } ctp_settings_t;
1808 
1823  typedef struct
1824  {
1825  unsigned int Speed;
1826  unsigned int UARTSetupFlags;
1827  } uart_settings_t;
1828 
1842  typedef struct
1843  {
1844  unsigned int DHCPEnabled;
1845  unsigned int IPv4Address[4];
1846  unsigned int SubnetMask[4];
1847  unsigned int DefaultGateway[4];
1849 
1863  typedef struct
1864  {
1865  char UserPassword[21];
1867 
1882  typedef struct
1883  {
1884  float CSS1_A;
1885  float CSS1_B;
1886  float CSS2_A;
1887  float CSS2_B;
1891 
1901  typedef struct
1902  {
1903  char ControllerName[17];
1904  unsigned int CtrlFlags;
1906 
1916  typedef struct
1917  {
1918  unsigned int UserData[7];
1920 
1939  typedef struct
1940  {
1941  float L;
1942  float R;
1943  float Km;
1944  unsigned int BackEMFFlags;
1945  } emf_settings_t;
1946 
1962  typedef struct
1963  {
1964  unsigned int stepcloseloop_Kw;
1965  unsigned int stepcloseloop_Kp_low;
1966  unsigned int stepcloseloop_Kp_high;
1968 
1984  typedef struct
1985  {
1986  unsigned int Param1;
1988 
2003  typedef struct
2004  {
2005  int Position;
2007  long_t EncPosition;
2008  } get_position_t;
2009 
2023  typedef struct
2024  {
2025  float Position;
2026  long_t EncPosition;
2028 
2041  typedef struct
2042  {
2043  int Position;
2045  long_t EncPosition;
2046  unsigned int PosFlags;
2047  } set_position_t;
2048 
2061  typedef struct
2062  {
2063  float Position;
2064  long_t EncPosition;
2065  unsigned int PosFlags;
2067 
2080  typedef struct
2081  {
2082  unsigned int MoveSts;
2083  unsigned int MvCmdSts;
2084  unsigned int PWRSts;
2085  unsigned int EncSts;
2086  unsigned int WindSts;
2089  long_t EncPosition;
2090  int CurSpeed;
2092  int Ipwr;
2093  int Upwr;
2094  int Iusb;
2095  int Uusb;
2096  int CurT;
2097  unsigned int Flags;
2098  unsigned int GPIOFlags;
2099  unsigned int CmdBufFreeSpace;
2100  } status_t;
2101 
2114  typedef struct
2115  {
2116  unsigned int MoveSts;
2117  unsigned int MvCmdSts;
2118  unsigned int PWRSts;
2119  unsigned int EncSts;
2120  unsigned int WindSts;
2121  float CurPosition;
2122  long_t EncPosition;
2123  float CurSpeed;
2124  int Ipwr;
2125  int Upwr;
2126  int Iusb;
2127  int Uusb;
2128  int CurT;
2129  unsigned int Flags;
2130  unsigned int GPIOFlags;
2131  unsigned int CmdBufFreeSpace;
2132  } status_calb_t;
2133 
2144  typedef struct
2145  {
2146  int Speed[25];
2147  int Error[25];
2148  unsigned int Length;
2149  } measurements_t;
2150 
2164  typedef struct
2165  {
2172  unsigned int Pot;
2173  unsigned int Joy;
2175  } chart_data_t;
2176 
2187  typedef struct
2188  {
2189  char Manufacturer[5];
2190  char ManufacturerId[3];
2191  char ProductDescription[9];
2192  unsigned int Major;
2193  unsigned int Minor;
2194  unsigned int Release;
2196 
2207  typedef struct
2208  {
2209  unsigned int SN;
2210  uint8_t Key[32];
2211  unsigned int Major;
2212  unsigned int Minor;
2213  unsigned int Release;
2214  } serial_number_t;
2215 
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 
2556  typedef struct
2557  {
2558  uint8_t key[16];
2559  } init_random_t;
2560 
2570  typedef struct
2571  {
2572  unsigned int UniqueID0;
2573  unsigned int UniqueID1;
2574  unsigned int UniqueID2;
2575  unsigned int UniqueID3;
2577 
2578 /*
2579  --------------------------------------------
2580  BEGIN OF GENERATED function declarations
2581  --------------------------------------------
2582 */
2583 
2596 
2615  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2616 
2635  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2636 
2653  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2654 
2673  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2674 
2691  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2692 
2711  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2712 
2725  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2726 
2741  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2742 
2755  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2756 
2771  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2772 
2791  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2792 
2813  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2814 
2833  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2834 
2855  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2856 
2869  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2870 
2883  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
2884 
2898  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
2899 
2914  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
2915 
2929  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
2930 
2944  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
2945 
2960  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
2961 
2986  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
2987 
3002  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
3003 
3028  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3029 
3048  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
3049 
3067  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
3068 
3085  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
3086 
3105  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);
3106 
3123  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
3124 
3143  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);
3144 
3161  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
3162 
3181  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);
3182 
3197  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
3198 
3217  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);
3218 
3236  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
3237 
3253  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
3254 
3267  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
3268 
3281  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
3282 
3307  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
3308 
3335  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3336 
3361  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
3362 
3389  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3390 
3419  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
3420 
3449  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
3450 
3470  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
3471 
3489  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3490 
3507  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3508 
3525  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3526 
3546  result_t XIMC_API set_network_settings (device_t id, const network_settings_t* network_settings);
3547 
3567  result_t XIMC_API get_network_settings (device_t id, network_settings_t* network_settings);
3568 
3582  result_t XIMC_API set_password_settings (device_t id, const password_settings_t* password_settings);
3583 
3597  result_t XIMC_API get_password_settings (device_t id, password_settings_t* password_settings);
3598 
3615  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3616 
3633  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3634 
3647  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3648 
3661  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3662 
3675  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3676 
3689  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3690 
3708  result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t* emf_settings);
3709 
3726  result_t XIMC_API get_emf_settings (device_t id, emf_settings_t* emf_settings);
3727 
3742  result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t* engine_advansed_setup);
3743 
3758  result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t* engine_advansed_setup);
3759 
3774  result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t* extended_settings);
3775 
3790  result_t XIMC_API get_extended_settings (device_t id, extended_settings_t* extended_settings);
3791 
3792 
3794 
3807 
3825  result_t XIMC_API command_stop (device_t id);
3826 
3841  result_t XIMC_API command_power_off (device_t id);
3842 
3861  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
3862 
3889  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
3890 
3907  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
3908 
3933  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
3934 
3970  result_t XIMC_API command_home (device_t id);
3971 
3982  result_t XIMC_API command_left (device_t id);
3983 
3994  result_t XIMC_API command_right (device_t id);
3995 
4007  result_t XIMC_API command_loft (device_t id);
4008 
4019  result_t XIMC_API command_sstp (device_t id);
4020 
4034  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
4035 
4058  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
4059 
4074  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
4075 
4090  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
4091 
4102  result_t XIMC_API command_zero (device_t id);
4103 
4104 
4106 
4119 
4130  result_t XIMC_API command_save_settings (device_t id);
4131 
4142  result_t XIMC_API command_read_settings (device_t id);
4143 
4154  result_t XIMC_API command_save_robust_settings (device_t id);
4155 
4166  result_t XIMC_API command_read_robust_settings (device_t id);
4167 
4180  result_t XIMC_API command_eesave_settings (device_t id);
4181 
4192  result_t XIMC_API command_eeread_settings (device_t id);
4193 
4204  result_t XIMC_API command_start_measurements (device_t id);
4205 
4224  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
4225 
4242  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
4243 
4256  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
4257 
4274  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4275 
4286  result_t XIMC_API service_command_updf (device_t id);
4287 
4288 
4290 
4303 
4322  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
4323 
4336  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
4337 
4352  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
4353 
4366  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
4367 
4368 
4370 
4383 
4396  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
4397 
4410  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
4411 
4426  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
4427 
4440  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
4441 
4456  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
4457 
4470  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
4471 
4486  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
4487 
4500  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
4501 
4516  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
4517 
4530  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
4531 
4546  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
4547 
4560  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
4561 
4576  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
4577 
4590  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
4591 
4606  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
4607 
4620  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
4621 
4636  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
4637 
4650  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
4651 
4666  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
4667 
4680  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
4681 
4696  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4697 
4710  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4711 
4726  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4727 
4740  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4741 
4758  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4759 
4772  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4773 
4789  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4790 
4791 
4792 /*
4793  -------------------------
4794  END OF GENERATED CODE
4795  -------------------------
4796 */
4797 
4798 /* hand-crafted functions begin */
4799 
4812  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
4813 
4826  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
4827 
4843  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
4844 
4859  result_t XIMC_API write_key (const char* uri, uint8_t* key);
4860 
4873  result_t XIMC_API command_reset(device_t id);
4874 
4887  result_t XIMC_API command_clear_fram(device_t id);
4888 
4890 
4891  // ------------------------------------
4892 
4904 
4932  device_t XIMC_API open_device (const char* uri);
4933 
4948  result_t XIMC_API close_device (device_t* id);
4949 
5005  result_t XIMC_API load_correction_table(device_t* id, const char* namefile);
5006 
5051  result_t XIMC_API set_correction_table(device_t id, const char* namefile);
5052 
5065  result_t XIMC_API probe_device (const char* uri);
5066 
5076  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5077 
5104  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5105 
5116  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5117 
5128  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5129 
5138  typedef char* pchar;
5139 
5154  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5155 
5156 
5173  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5174 
5191  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5192 
5209  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5210 
5227  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5228 
5245  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5246 
5254  result_t XIMC_API reset_locks ();
5255 
5271  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5272 
5273 
5283  void XIMC_API msec_sleep (unsigned int msec);
5284 
5294  void XIMC_API ximc_version (char* version);
5295 
5296 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5297 
5309  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5310 
5322  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5323 
5335  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5336 
5349  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5350 
5351 #endif
5352 
5376  result_t XIMC_API get_status (device_t id, status_t* status);
5377 
5403  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5404 
5430  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5431 
5450  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5451 
5464  result_t XIMC_API command_homezero(device_t id);
5466 
5467 #if defined(__cplusplus)
5468 };
5469 #endif
5470 
5471 #endif
5472 
5473 // vim: ts=4 shiftwidth=4
5474