libximc  2.14.27
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.27
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 
1767  typedef struct
1768  {
1769  unsigned int JoyLowEnd;
1770  unsigned int JoyCenter;
1771  unsigned int JoyHighEnd;
1772  unsigned int ExpFactor;
1773  unsigned int DeadZone;
1774  unsigned int JoyFlags;
1776 
1795  typedef struct
1796  {
1797  unsigned int CTPMinError;
1798  unsigned int CTPFlags;
1799  } ctp_settings_t;
1800 
1815  typedef struct
1816  {
1817  unsigned int Speed;
1818  unsigned int UARTSetupFlags;
1819  } uart_settings_t;
1820 
1834  typedef struct
1835  {
1836  unsigned int DHCPEnabled;
1837  unsigned int IPv4Address[4];
1838  unsigned int SubnetMask[4];
1839  unsigned int DefaultGateway[4];
1841 
1855  typedef struct
1856  {
1857  char UserPassword[21];
1859 
1874  typedef struct
1875  {
1876  float CSS1_A;
1877  float CSS1_B;
1878  float CSS2_A;
1879  float CSS2_B;
1883 
1893  typedef struct
1894  {
1895  char ControllerName[17];
1896  unsigned int CtrlFlags;
1898 
1908  typedef struct
1909  {
1910  unsigned int UserData[7];
1912 
1931  typedef struct
1932  {
1933  float L;
1934  float R;
1935  float Km;
1936  unsigned int BackEMFFlags;
1937  } emf_settings_t;
1938 
1954  typedef struct
1955  {
1956  unsigned int stepcloseloop_Kw;
1957  unsigned int stepcloseloop_Kp_low;
1958  unsigned int stepcloseloop_Kp_high;
1960 
1976  typedef struct
1977  {
1978  unsigned int Param1;
1980 
1995  typedef struct
1996  {
1997  int Position;
1999  long_t EncPosition;
2000  } get_position_t;
2001 
2015  typedef struct
2016  {
2017  float Position;
2018  long_t EncPosition;
2020 
2033  typedef struct
2034  {
2035  int Position;
2037  long_t EncPosition;
2038  unsigned int PosFlags;
2039  } set_position_t;
2040 
2053  typedef struct
2054  {
2055  float Position;
2056  long_t EncPosition;
2057  unsigned int PosFlags;
2059 
2072  typedef struct
2073  {
2074  unsigned int MoveSts;
2075  unsigned int MvCmdSts;
2076  unsigned int PWRSts;
2077  unsigned int EncSts;
2078  unsigned int WindSts;
2081  long_t EncPosition;
2082  int CurSpeed;
2084  int Ipwr;
2085  int Upwr;
2086  int Iusb;
2087  int Uusb;
2088  int CurT;
2089  unsigned int Flags;
2090  unsigned int GPIOFlags;
2091  unsigned int CmdBufFreeSpace;
2092  } status_t;
2093 
2106  typedef struct
2107  {
2108  unsigned int MoveSts;
2109  unsigned int MvCmdSts;
2110  unsigned int PWRSts;
2111  unsigned int EncSts;
2112  unsigned int WindSts;
2113  float CurPosition;
2114  long_t EncPosition;
2115  float CurSpeed;
2116  int Ipwr;
2117  int Upwr;
2118  int Iusb;
2119  int Uusb;
2120  int CurT;
2121  unsigned int Flags;
2122  unsigned int GPIOFlags;
2123  unsigned int CmdBufFreeSpace;
2124  } status_calb_t;
2125 
2136  typedef struct
2137  {
2138  int Speed[25];
2139  int Error[25];
2140  unsigned int Length;
2141  } measurements_t;
2142 
2156  typedef struct
2157  {
2164  unsigned int Pot;
2165  unsigned int Joy;
2167  } chart_data_t;
2168 
2179  typedef struct
2180  {
2181  char Manufacturer[5];
2182  char ManufacturerId[3];
2183  char ProductDescription[9];
2184  unsigned int Major;
2185  unsigned int Minor;
2186  unsigned int Release;
2188 
2199  typedef struct
2200  {
2201  unsigned int SN;
2202  uint8_t Key[32];
2203  unsigned int Major;
2204  unsigned int Minor;
2205  unsigned int Release;
2206  } serial_number_t;
2207 
2221  typedef struct
2222  {
2223  unsigned int A1Voltage_ADC;
2224  unsigned int A2Voltage_ADC;
2225  unsigned int B1Voltage_ADC;
2226  unsigned int B2Voltage_ADC;
2227  unsigned int SupVoltage_ADC;
2228  unsigned int ACurrent_ADC;
2229  unsigned int BCurrent_ADC;
2230  unsigned int FullCurrent_ADC;
2231  unsigned int Temp_ADC;
2232  unsigned int Joy_ADC;
2233  unsigned int Pot_ADC;
2234  unsigned int L5_ADC;
2235  unsigned int H5_ADC;
2241  int ACurrent;
2242  int BCurrent;
2244  int Temp;
2245  int Joy;
2246  int Pot;
2247  int L5;
2248  int H5;
2249  unsigned int deprecated;
2250  int R;
2251  int L;
2252  } analog_data_t;
2253 
2265  typedef struct
2266  {
2267  uint8_t DebugData[128];
2268  } debug_read_t;
2269 
2281  typedef struct
2282  {
2283  uint8_t DebugData[128];
2284  } debug_write_t;
2285 
2295  typedef struct
2296  {
2297  char PositionerName[17];
2298  } stage_name_t;
2299 
2311  typedef struct
2312  {
2313  char Manufacturer[17];
2314  char PartNumber[25];
2316 
2328  typedef struct
2329  {
2331  char Units[9];
2332  float MaxSpeed;
2333  float TravelRange;
2339  } stage_settings_t;
2340 
2352  typedef struct
2353  {
2354  char Manufacturer[17];
2355  char PartNumber[25];
2357 
2369  typedef struct
2370  {
2371  unsigned int MotorType;
2372  unsigned int ReservedField;
2373  unsigned int Poles;
2374  unsigned int Phases;
2383  float StallTorque;
2389  float MaxSpeed;
2390  float MaxCurrent;
2393  float NoLoadSpeed;
2394  } motor_settings_t;
2395 
2407  typedef struct
2408  {
2409  char Manufacturer[17];
2410  char PartNumber[25];
2412 
2424  typedef struct
2425  {
2430  unsigned int PPR;
2431  unsigned int EncoderSettings;
2433 
2445  typedef struct
2446  {
2447  char Manufacturer[17];
2448  char PartNumber[25];
2450 
2462  typedef struct
2463  {
2468  unsigned int PPR;
2470 
2482  typedef struct
2483  {
2484  char Manufacturer[17];
2485  char PartNumber[25];
2487 
2499  typedef struct
2500  {
2501  float ReductionIn;
2507  float Efficiency;
2508  } gear_settings_t;
2509 
2521  typedef struct
2522  {
2523  char MagneticBrakeInfo[25];
2526  float MBTorque;
2527  unsigned int MBSettings;
2528  char TemperatureSensorInfo[25];
2529  float TSMin;
2530  float TSMax;
2531  float TSGrad;
2532  unsigned int TSSettings;
2533  unsigned int LimitSwitchesSettings;
2535 
2548  typedef struct
2549  {
2550  uint8_t key[16];
2551  } init_random_t;
2552 
2562  typedef struct
2563  {
2564  unsigned int UniqueID0;
2565  unsigned int UniqueID1;
2566  unsigned int UniqueID2;
2567  unsigned int UniqueID3;
2569 
2570 /*
2571  --------------------------------------------
2572  BEGIN OF GENERATED function declarations
2573  --------------------------------------------
2574 */
2575 
2588 
2607  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2608 
2627  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2628 
2645  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2646 
2665  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2666 
2683  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2684 
2703  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2704 
2717  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2718 
2733  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2734 
2747  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2748 
2763  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2764 
2783  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2784 
2805  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2806 
2825  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2826 
2847  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2848 
2861  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2862 
2875  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
2876 
2890  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
2891 
2906  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
2907 
2921  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
2922 
2936  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
2937 
2952  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
2953 
2978  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
2979 
2994  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
2995 
3020  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3021 
3040  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
3041 
3059  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
3060 
3077  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
3078 
3097  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);
3098 
3115  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
3116 
3135  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);
3136 
3153  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
3154 
3173  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);
3174 
3189  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
3190 
3209  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);
3210 
3228  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
3229 
3245  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
3246 
3259  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
3260 
3273  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
3274 
3299  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
3300 
3327  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3328 
3353  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
3354 
3381  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3382 
3409  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
3410 
3437  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
3438 
3458  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
3459 
3477  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3478 
3495  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3496 
3513  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3514 
3534  result_t XIMC_API set_network_settings (device_t id, const network_settings_t* network_settings);
3535 
3555  result_t XIMC_API get_network_settings (device_t id, network_settings_t* network_settings);
3556 
3570  result_t XIMC_API set_password_settings (device_t id, const password_settings_t* password_settings);
3571 
3585  result_t XIMC_API get_password_settings (device_t id, password_settings_t* password_settings);
3586 
3603  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3604 
3621  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3622 
3635  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3636 
3649  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3650 
3663  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3664 
3677  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3678 
3696  result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t* emf_settings);
3697 
3714  result_t XIMC_API get_emf_settings (device_t id, emf_settings_t* emf_settings);
3715 
3730  result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t* engine_advansed_setup);
3731 
3746  result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t* engine_advansed_setup);
3747 
3762  result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t* extended_settings);
3763 
3778  result_t XIMC_API get_extended_settings (device_t id, extended_settings_t* extended_settings);
3779 
3780 
3782 
3795 
3813  result_t XIMC_API command_stop (device_t id);
3814 
3829  result_t XIMC_API command_power_off (device_t id);
3830 
3849  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
3850 
3877  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
3878 
3895  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
3896 
3921  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
3922 
3958  result_t XIMC_API command_home (device_t id);
3959 
3970  result_t XIMC_API command_left (device_t id);
3971 
3982  result_t XIMC_API command_right (device_t id);
3983 
3995  result_t XIMC_API command_loft (device_t id);
3996 
4007  result_t XIMC_API command_sstp (device_t id);
4008 
4022  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
4023 
4046  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
4047 
4062  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
4063 
4078  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
4079 
4090  result_t XIMC_API command_zero (device_t id);
4091 
4092 
4094 
4107 
4118  result_t XIMC_API command_save_settings (device_t id);
4119 
4130  result_t XIMC_API command_read_settings (device_t id);
4131 
4142  result_t XIMC_API command_save_robust_settings (device_t id);
4143 
4154  result_t XIMC_API command_read_robust_settings (device_t id);
4155 
4168  result_t XIMC_API command_eesave_settings (device_t id);
4169 
4180  result_t XIMC_API command_eeread_settings (device_t id);
4181 
4192  result_t XIMC_API command_start_measurements (device_t id);
4193 
4212  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
4213 
4230  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
4231 
4244  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
4245 
4262  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4263 
4274  result_t XIMC_API service_command_updf (device_t id);
4275 
4276 
4278 
4291 
4310  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
4311 
4324  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
4325 
4340  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
4341 
4354  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
4355 
4356 
4358 
4371 
4384  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
4385 
4398  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
4399 
4414  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
4415 
4428  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
4429 
4444  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
4445 
4458  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
4459 
4474  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
4475 
4488  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
4489 
4504  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
4505 
4518  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
4519 
4534  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
4535 
4548  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
4549 
4564  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
4565 
4578  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
4579 
4594  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
4595 
4608  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
4609 
4624  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
4625 
4638  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
4639 
4654  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
4655 
4668  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
4669 
4684  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4685 
4698  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4699 
4714  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4715 
4728  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4729 
4746  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4747 
4760  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4761 
4777  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4778 
4779 
4780 /*
4781  -------------------------
4782  END OF GENERATED CODE
4783  -------------------------
4784 */
4785 
4786 /* hand-crafted functions begin */
4787 
4800  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
4801 
4814  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
4815 
4831  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
4832 
4847  result_t XIMC_API write_key (const char* uri, uint8_t* key);
4848 
4861  result_t XIMC_API command_reset(device_t id);
4862 
4875  result_t XIMC_API command_clear_fram(device_t id);
4876 
4878 
4879  // ------------------------------------
4880 
4892 
4920  device_t XIMC_API open_device (const char* uri);
4921 
4936  result_t XIMC_API close_device (device_t* id);
4937 
4993  result_t XIMC_API load_correction_table(device_t* id, const char* namefile);
4994 
5039  result_t XIMC_API set_correction_table(device_t id, const char* namefile);
5040 
5053  result_t XIMC_API probe_device (const char* uri);
5054 
5064  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5065 
5092  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5093 
5104  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5105 
5116  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5117 
5126  typedef char* pchar;
5127 
5142  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5143 
5144 
5161  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5162 
5179  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5180 
5197  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5198 
5215  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5216 
5233  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5234 
5242  result_t XIMC_API reset_locks ();
5243 
5259  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5260 
5261 
5271  void XIMC_API msec_sleep (unsigned int msec);
5272 
5282  void XIMC_API ximc_version (char* version);
5283 
5284 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5285 
5297  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5298 
5310  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5311 
5323  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5324 
5337  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5338 
5339 #endif
5340 
5364  result_t XIMC_API get_status (device_t id, status_t* status);
5365 
5391  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5392 
5418  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5419 
5438  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5439 
5452  result_t XIMC_API command_homezero(device_t id);
5454 
5455 #if defined(__cplusplus)
5456 };
5457 #endif
5458 
5459 #endif
5460 
5461 // vim: ts=4 shiftwidth=4
5462