libximc  2.14.31
ximc.h
Go to the documentation of this file.
1 #ifndef INC_XIMC_H
2 #define INC_XIMC_H
3 
25 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
26  #define XIMC_API __stdcall
27 #else
28  #ifdef LIBXIMC_EXPORTS
29  #define XIMC_API __attribute__((visibility("default")))
30  #else
31  #define XIMC_API
32  #endif
33 #endif
34 
43 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
44  #define XIMC_CALLCONV __stdcall
45 #else
46  #define XIMC_CALLCONV
47 #endif
48 
57 #if defined(_WIN32) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT) || defined(MATLAB_IMPORT)
58 #define XIMC_RETTYPE unsigned int
59 #else
60 #define XIMC_RETTYPE void*
61 #endif
62 
63 
64 #if !defined(XIMC_NO_STDINT)
65 
66 #if ( (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)) && !defined(MATLAB_IMPORT)
67 // msvc types burden
68 typedef __int8 int8_t;
69 typedef __int16 int16_t;
70 typedef __int32 int32_t;
71 typedef __int64 int64_t;
72 typedef unsigned __int8 uint8_t;
73 typedef unsigned __int16 uint16_t;
74 typedef unsigned __int32 uint32_t;
75 typedef unsigned __int64 uint64_t;
76 #else
77 #include <stdint.h>
78 #endif
79 
80 /* labview doesn't speak C99 */
81 #if defined(LABVIEW64_IMPORT) || defined(LABVIEW32_IMPORT)
82 typedef unsigned __int64 ulong_t;
83 typedef __int64 long_t;
84 #else
85 typedef unsigned long long ulong_t;
86 typedef long long long_t;
87 #endif
88 
89 #endif
90 
91 #include <time.h>
92 
93 #if defined(__cplusplus)
94 extern "C"
95 {
96 #endif
97 
98 
107  typedef int device_t;
108 
117  typedef int result_t;
118 
127  #if defined(_WIN64) || defined(__LP64__) || defined(LABVIEW64_IMPORT)
128  typedef uint64_t device_enumeration_t;
129  #else
130  typedef uint32_t device_enumeration_t;
131  #endif
132  //typedef device_enumeration_t* pdevice_enumeration_t;
133 
142 #define device_undefined -1
143 
152 
161 #define result_ok 0
162 
171 #define result_error -1
172 
181 #define result_not_implemented -2
182 
191 #define result_value_error -3
192 
201 #define result_nodevice -4
202 
204 
213 
222 #define LOGLEVEL_ERROR 0x01
223 
231 #define LOGLEVEL_WARNING 0x02
232 
240 #define LOGLEVEL_INFO 0x03
241 
249 #define LOGLEVEL_DEBUG 0x04
250 
251 
252 
296  typedef struct calibration_t
297  {
298  double A;
326  unsigned int MicrostepMode;
327  } calibration_t;
328 
337  {
338  uint32_t ipv4;
339  char nodename[16];
341  uint32_t axis_state;
342  char locker_username[16];
343  char locker_nodename[16];
344  time_t locked_time;
346 
347 
348 
350 #define LIBXIMC_VERSION 2.14.31
351 
355 #define LIBXIMC_PROTOCOL_VERSION 20.10
356 
359 /*
360  ------------------------------------------
361  BEGIN OF GENERATED struct declarations
362  ------------------------------------------
363 */
364 
376 #define ENUMERATE_PROBE 0x01
377 #define ENUMERATE_ALL_COM 0x02
378 #define ENUMERATE_NETWORK 0x04
380 
381 
398 #define MOVE_STATE_MOVING 0x01
399 #define MOVE_STATE_TARGET_SPEED 0x02
400 #define MOVE_STATE_ANTIPLAY 0x04
402 
403 
419 #define EEPROM_PRECEDENCE 0x01
421 
422 
439 #define PWR_STATE_UNKNOWN 0x00
440 #define PWR_STATE_OFF 0x01
441 #define PWR_STATE_NORM 0x03
442 #define PWR_STATE_REDUCT 0x04
443 #define PWR_STATE_MAX 0x05
445 
446 
465 #define STATE_CONTR 0x000003F
466 #define STATE_ERRC 0x0000001
467 #define STATE_ERRD 0x0000002
468 #define STATE_ERRV 0x0000004
469 #define STATE_EEPROM_CONNECTED 0x0000010
470 #define STATE_IS_HOMED 0x0000020
471 #define STATE_SECUR 0x1B3FFC0
472 #define STATE_ALARM 0x0000040
473 #define STATE_CTP_ERROR 0x0000080
474 #define STATE_POWER_OVERHEAT 0x0000100
475 #define STATE_CONTROLLER_OVERHEAT 0x0000200
476 #define STATE_OVERLOAD_POWER_VOLTAGE 0x0000400
477 #define STATE_OVERLOAD_POWER_CURRENT 0x0000800
478 #define STATE_OVERLOAD_USB_VOLTAGE 0x0001000
479 #define STATE_LOW_USB_VOLTAGE 0x0002000
480 #define STATE_OVERLOAD_USB_CURRENT 0x0004000
481 #define STATE_BORDERS_SWAP_MISSET 0x0008000
482 #define STATE_LOW_POWER_VOLTAGE 0x0010000
483 #define STATE_H_BRIDGE_FAULT 0x0020000
484 #define STATE_WINDING_RES_MISMATCH 0x0100000
485 #define STATE_ENCODER_FAULT 0x0200000
486 #define STATE_ENGINE_RESPONSE_ERROR 0x0800000
487 #define STATE_EXTIO_ALARM 0x1000000
489 
490 
509 #define STATE_DIG_SIGNAL 0xFFFF
510 #define STATE_RIGHT_EDGE 0x0001
511 #define STATE_LEFT_EDGE 0x0002
512 #define STATE_BUTTON_RIGHT 0x0004
513 #define STATE_BUTTON_LEFT 0x0008
514 #define STATE_GPIO_PINOUT 0x0010
515 #define STATE_GPIO_LEVEL 0x0020
516 #define STATE_BRAKE 0x0200
517 #define STATE_REV_SENSOR 0x0400
518 #define STATE_SYNC_INPUT 0x0800
519 #define STATE_SYNC_OUTPUT 0x1000
520 #define STATE_ENC_A 0x2000
521 #define STATE_ENC_B 0x4000
523 
524 
553 #define ENC_STATE_ABSENT 0x00
554 #define ENC_STATE_UNKNOWN 0x01
555 #define ENC_STATE_MALFUNC 0x02
556 #define ENC_STATE_REVERS 0x03
557 #define ENC_STATE_OK 0x04
559 
560 
577 #define WIND_A_STATE_ABSENT 0x00
578 #define WIND_A_STATE_UNKNOWN 0x01
579 #define WIND_A_STATE_MALFUNC 0x02
580 #define WIND_A_STATE_OK 0x03
581 #define WIND_B_STATE_ABSENT 0x00
582 #define WIND_B_STATE_UNKNOWN 0x10
583 #define WIND_B_STATE_MALFUNC 0x20
584 #define WIND_B_STATE_OK 0x30
586 
587 
606 #define MVCMD_NAME_BITS 0x3F
607 #define MVCMD_UKNWN 0x00
608 #define MVCMD_MOVE 0x01
609 #define MVCMD_MOVR 0x02
610 #define MVCMD_LEFT 0x03
611 #define MVCMD_RIGHT 0x04
612 #define MVCMD_STOP 0x05
613 #define MVCMD_HOME 0x06
614 #define MVCMD_LOFT 0x07
615 #define MVCMD_SSTP 0x08
616 #define MVCMD_ERROR 0x40
617 #define MVCMD_RUNNING 0x80
619 
620 
640 #define RPM_DIV_1000 0x01
642 
643 
663 #define ENGINE_REVERSE 0x01
664 #define ENGINE_CURRENT_AS_RMS 0x02
665 #define ENGINE_MAX_SPEED 0x04
666 #define ENGINE_ANTIPLAY 0x08
667 #define ENGINE_ACCEL_ON 0x10
668 #define ENGINE_LIMIT_VOLT 0x20
669 #define ENGINE_LIMIT_CURR 0x40
670 #define ENGINE_LIMIT_RPM 0x80
672 
673 
694 #define MICROSTEP_MODE_FULL 0x01
695 #define MICROSTEP_MODE_FRAC_2 0x02
696 #define MICROSTEP_MODE_FRAC_4 0x03
697 #define MICROSTEP_MODE_FRAC_8 0x04
698 #define MICROSTEP_MODE_FRAC_16 0x05
699 #define MICROSTEP_MODE_FRAC_32 0x06
700 #define MICROSTEP_MODE_FRAC_64 0x07
701 #define MICROSTEP_MODE_FRAC_128 0x08
702 #define MICROSTEP_MODE_FRAC_256 0x09
704 
705 
726 #define ENGINE_TYPE_NONE 0x00
727 #define ENGINE_TYPE_DC 0x01
728 #define ENGINE_TYPE_2DC 0x02
729 #define ENGINE_TYPE_STEP 0x03
730 #define ENGINE_TYPE_TEST 0x04
731 #define ENGINE_TYPE_BRUSHLESS 0x05
733 
734 
755 #define DRIVER_TYPE_DISCRETE_FET 0x01
756 #define DRIVER_TYPE_INTEGRATE 0x02
757 #define DRIVER_TYPE_EXTERNAL 0x03
759 
760 
779 #define POWER_REDUCT_ENABLED 0x01
780 #define POWER_OFF_ENABLED 0x02
781 #define POWER_SMOOTH_CURRENT 0x04
783 
784 
803 #define ALARM_ON_DRIVER_OVERHEATING 0x01
804 #define LOW_UPWR_PROTECTION 0x02
805 #define H_BRIDGE_ALERT 0x04
806 #define ALARM_ON_BORDERS_SWAP_MISSET 0x08
807 #define ALARM_FLAGS_STICKING 0x10
808 #define BRAKING_OVERVOLTAGE_PROTECTION 0x20
809 #define ALARM_WINDING_MISMATCH 0x40
810 #define ALARM_ENGINE_RESPONSE 0x80
812 
813 
831 #define SETPOS_IGNORE_POSITION 0x01
832 #define SETPOS_IGNORE_ENCODER 0x02
834 
835 
851 #define FEEDBACK_ENCODER 0x01
852 #define FEEDBACK_EMF 0x04
853 #define FEEDBACK_NONE 0x05
854 #define FEEDBACK_ENCODER_MEDIATED 0x06
856 
857 
873 #define FEEDBACK_ENC_REVERSE 0x01
874 #define FEEDBACK_ENC_ADAPTIVE_HOLDING 0x02
875 #define FEEDBACK_ENC_TYPE_BITS 0xC0
876 #define FEEDBACK_ENC_TYPE_AUTO 0x00
877 #define FEEDBACK_ENC_TYPE_SINGLE_ENDED 0x40
878 #define FEEDBACK_ENC_TYPE_DIFFERENTIAL 0x80
880 
881 
895 #define SYNCIN_ENABLED 0x01
896 #define SYNCIN_INVERT 0x02
897 #define SYNCIN_GOTOPOSITION 0x04
899 
900 
914 #define SYNCOUT_ENABLED 0x01
915 #define SYNCOUT_STATE 0x02
916 #define SYNCOUT_INVERT 0x04
917 #define SYNCOUT_IN_STEPS 0x08
918 #define SYNCOUT_ONSTART 0x10
919 #define SYNCOUT_ONSTOP 0x20
920 #define SYNCOUT_ONPERIOD 0x40
922 
923 
939 #define EXTIO_SETUP_OUTPUT 0x01
940 #define EXTIO_SETUP_INVERT 0x02
942 
943 
960 #define EXTIO_SETUP_MODE_IN_BITS 0x0F
961 #define EXTIO_SETUP_MODE_IN_NOP 0x00
962 #define EXTIO_SETUP_MODE_IN_STOP 0x01
963 #define EXTIO_SETUP_MODE_IN_PWOF 0x02
964 #define EXTIO_SETUP_MODE_IN_MOVR 0x03
965 #define EXTIO_SETUP_MODE_IN_HOME 0x04
966 #define EXTIO_SETUP_MODE_IN_ALARM 0x05
967 #define EXTIO_SETUP_MODE_OUT_BITS 0xF0
968 #define EXTIO_SETUP_MODE_OUT_OFF 0x00
969 #define EXTIO_SETUP_MODE_OUT_ON 0x10
970 #define EXTIO_SETUP_MODE_OUT_MOVING 0x20
971 #define EXTIO_SETUP_MODE_OUT_ALARM 0x30
972 #define EXTIO_SETUP_MODE_OUT_MOTOR_ON 0x40
974 
975 
995 #define BORDER_IS_ENCODER 0x01
996 #define BORDER_STOP_LEFT 0x02
997 #define BORDER_STOP_RIGHT 0x04
998 #define BORDERS_SWAP_MISSET_DETECTION 0x08
1000 
1001 
1021 #define ENDER_SWAP 0x01
1022 #define ENDER_SW1_ACTIVE_LOW 0x02
1023 #define ENDER_SW2_ACTIVE_LOW 0x04
1025 
1026 
1046 #define BRAKE_ENABLED 0x01
1047 #define BRAKE_ENG_PWROFF 0x02
1049 
1050 
1070 #define CONTROL_MODE_BITS 0x03
1071 #define CONTROL_MODE_OFF 0x00
1072 #define CONTROL_MODE_JOY 0x01
1073 #define CONTROL_MODE_LR 0x02
1074 #define CONTROL_BTN_LEFT_PUSHED_OPEN 0x04
1075 #define CONTROL_BTN_RIGHT_PUSHED_OPEN 0x08
1077 
1078 
1096 #define JOY_REVERSE 0x01
1098 
1099 
1119 #define CTP_ENABLED 0x01
1120 #define CTP_BASE 0x02
1121 #define CTP_ALARM_ON_ERROR 0x04
1122 #define REV_SENS_INV 0x08
1123 #define CTP_ERROR_CORRECTION 0x10
1125 
1126 
1147 #define HOME_DIR_FIRST 0x001
1148 #define HOME_DIR_SECOND 0x002
1149 #define HOME_MV_SEC_EN 0x004
1150 #define HOME_HALF_MV 0x008
1151 #define HOME_STOP_FIRST_BITS 0x030
1152 #define HOME_STOP_FIRST_REV 0x010
1153 #define HOME_STOP_FIRST_SYN 0x020
1154 #define HOME_STOP_FIRST_LIM 0x030
1155 #define HOME_STOP_SECOND_BITS 0x0C0
1156 #define HOME_STOP_SECOND_REV 0x040
1157 #define HOME_STOP_SECOND_SYN 0x080
1158 #define HOME_STOP_SECOND_LIM 0x0C0
1159 #define HOME_USE_FAST 0x100
1161 
1162 
1176 #define UART_PARITY_BITS 0x03
1177 #define UART_PARITY_BIT_EVEN 0x00
1178 #define UART_PARITY_BIT_ODD 0x01
1179 #define UART_PARITY_BIT_SPACE 0x02
1180 #define UART_PARITY_BIT_MARK 0x03
1181 #define UART_PARITY_BIT_USE 0x04
1182 #define UART_STOP_BIT 0x08
1184 
1185 
1199 #define MOTOR_TYPE_UNKNOWN 0x00
1200 #define MOTOR_TYPE_STEP 0x01
1201 #define MOTOR_TYPE_DC 0x02
1202 #define MOTOR_TYPE_BLDC 0x03
1204 
1205 
1219 #define ENCSET_DIFFERENTIAL_OUTPUT 0x001
1220 #define ENCSET_PUSHPULL_OUTPUT 0x004
1221 #define ENCSET_INDEXCHANNEL_PRESENT 0x010
1222 #define ENCSET_REVOLUTIONSENSOR_PRESENT 0x040
1223 #define ENCSET_REVOLUTIONSENSOR_ACTIVE_HIGH 0x100
1225 
1226 
1240 #define MB_AVAILABLE 0x01
1241 #define MB_POWERED_HOLD 0x02
1243 
1244 
1258 #define TS_TYPE_BITS 0x07
1259 #define TS_TYPE_UNKNOWN 0x00
1260 #define TS_TYPE_THERMOCOUPLE 0x01
1261 #define TS_TYPE_SEMICONDUCTOR 0x02
1262 #define TS_AVAILABLE 0x08
1264 
1265 
1279 #define LS_ON_SW1_AVAILABLE 0x01
1280 #define LS_ON_SW2_AVAILABLE 0x02
1281 #define LS_SW1_ACTIVE_LOW 0x04
1282 #define LS_SW2_ACTIVE_LOW 0x08
1283 #define LS_SHORTED 0x10
1285 
1286 
1302 #define BACK_EMF_INDUCTANCE_AUTO 0x01
1303 #define BACK_EMF_RESISTANCE_AUTO 0x02
1304 #define BACK_EMF_KM_AUTO 0x04
1306 
1307 
1319  typedef struct
1320  {
1321  unsigned int IPS;
1322  unsigned int FeedbackType;
1323  unsigned int FeedbackFlags;
1324  unsigned int CountsPerTurn;
1326 
1341  typedef struct
1342  {
1343  unsigned int FastHome;
1344  unsigned int uFastHome;
1345  unsigned int SlowHome;
1346  unsigned int uSlowHome;
1349  unsigned int HomeFlags;
1350  } home_settings_t;
1351 
1367  typedef struct
1368  {
1369  float FastHome;
1370  float SlowHome;
1371  float HomeDelta;
1372  unsigned int HomeFlags;
1374 
1386  typedef struct
1387  {
1388  unsigned int Speed;
1389  unsigned int uSpeed;
1390  unsigned int Accel;
1391  unsigned int Decel;
1392  unsigned int AntiplaySpeed;
1393  unsigned int uAntiplaySpeed;
1394  unsigned int MoveFlags;
1395  } move_settings_t;
1396 
1408  typedef struct
1409  {
1410  float Speed;
1422  float Accel;
1434  float Decel;
1446  float AntiplaySpeed;
1458  unsigned int MoveFlags;
1460 
1477  typedef struct
1478  {
1479  unsigned int NomVoltage;
1480  unsigned int NomCurrent;
1481  unsigned int NomSpeed;
1482  unsigned int uNomSpeed;
1483  unsigned int EngineFlags;
1484  int Antiplay;
1485  unsigned int MicrostepMode;
1486  unsigned int StepsPerRev;
1488 
1506  typedef struct
1507  {
1508  unsigned int NomVoltage;
1509  unsigned int NomCurrent;
1510  float NomSpeed;
1511  unsigned int EngineFlags;
1512  float Antiplay;
1513  unsigned int MicrostepMode;
1514  unsigned int StepsPerRev;
1516 
1533  typedef struct
1534  {
1535  unsigned int EngineType;
1536  unsigned int DriverType;
1538 
1550  typedef struct
1551  {
1552  unsigned int HoldCurrent;
1553  unsigned int CurrReductDelay;
1554  unsigned int PowerOffDelay;
1555  unsigned int CurrentSetTime;
1556  unsigned int PowerFlags;
1557  } power_settings_t;
1558 
1570  typedef struct
1571  {
1572  unsigned int LowUpwrOff;
1573  unsigned int CriticalIpwr;
1574  unsigned int CriticalUpwr;
1575  unsigned int CriticalT;
1576  unsigned int CriticalIusb;
1577  unsigned int CriticalUusb;
1578  unsigned int MinimumUusb;
1579  unsigned int Flags;
1581 
1597  typedef struct
1598  {
1599  unsigned int BorderFlags;
1600  unsigned int EnderFlags;
1605  } edges_settings_t;
1606 
1622  typedef struct
1623  {
1624  unsigned int BorderFlags;
1625  unsigned int EnderFlags;
1626  float LeftBorder;
1627  float RightBorder;
1629 
1647  typedef struct
1648  {
1649  unsigned int KpU;
1650  unsigned int KiU;
1651  unsigned int KdU;
1652  float Kpf;
1653  float Kif;
1654  float Kdf;
1655  } pid_settings_t;
1656 
1671  typedef struct
1672  {
1673  unsigned int SyncInFlags;
1674  unsigned int ClutterTime;
1675  int Position;
1677  unsigned int Speed;
1678  unsigned int uSpeed;
1680 
1694  typedef struct
1695  {
1696  unsigned int SyncInFlags;
1697  unsigned int ClutterTime;
1698  float Position;
1699  float Speed;
1701 
1715  typedef struct
1716  {
1717  unsigned int SyncOutFlags;
1718  unsigned int SyncOutPulseSteps;
1719  unsigned int SyncOutPeriod;
1720  unsigned int Accuracy;
1721  unsigned int uAccuracy;
1723 
1738  typedef struct
1739  {
1740  unsigned int SyncOutFlags;
1741  unsigned int SyncOutPulseSteps;
1742  unsigned int SyncOutPeriod;
1743  float Accuracy;
1745 
1762  typedef struct
1763  {
1764  unsigned int EXTIOSetupFlags;
1765  unsigned int EXTIOModeFlags;
1766  } extio_settings_t;
1767 
1782  typedef struct
1783  {
1784  unsigned int t1;
1785  unsigned int t2;
1786  unsigned int t3;
1787  unsigned int t4;
1788  unsigned int BrakeFlags;
1789  } brake_settings_t;
1790 
1816  typedef struct
1817  {
1818  unsigned int MaxSpeed[10];
1819  unsigned int uMaxSpeed[10];
1820  unsigned int Timeout[9];
1821  unsigned int MaxClickTime;
1822  unsigned int Flags;
1826 
1852  typedef struct
1853  {
1854  float MaxSpeed[10];
1855  unsigned int Timeout[9];
1856  unsigned int MaxClickTime;
1857  unsigned int Flags;
1860 
1893  typedef struct
1894  {
1895  unsigned int JoyLowEnd;
1896  unsigned int JoyCenter;
1897  unsigned int JoyHighEnd;
1898  unsigned int ExpFactor;
1899  unsigned int DeadZone;
1900  unsigned int JoyFlags;
1902 
1921  typedef struct
1922  {
1923  unsigned int CTPMinError;
1924  unsigned int CTPFlags;
1925  } ctp_settings_t;
1926 
1941  typedef struct
1942  {
1943  unsigned int Speed;
1944  unsigned int UARTSetupFlags;
1945  } uart_settings_t;
1946 
1960  typedef struct
1961  {
1962  unsigned int DHCPEnabled;
1963  unsigned int IPv4Address[4];
1964  unsigned int SubnetMask[4];
1965  unsigned int DefaultGateway[4];
1967 
1981  typedef struct
1982  {
1983  char UserPassword[21];
1985 
2000  typedef struct
2001  {
2002  float CSS1_A;
2003  float CSS1_B;
2004  float CSS2_A;
2005  float CSS2_B;
2009 
2019  typedef struct
2020  {
2021  char ControllerName[17];
2022  unsigned int CtrlFlags;
2024 
2034  typedef struct
2035  {
2036  unsigned int UserData[7];
2038 
2057  typedef struct
2058  {
2059  float L;
2060  float R;
2061  float Km;
2062  unsigned int BackEMFFlags;
2063  } emf_settings_t;
2064 
2080  typedef struct
2081  {
2082  unsigned int stepcloseloop_Kw;
2083  unsigned int stepcloseloop_Kp_low;
2084  unsigned int stepcloseloop_Kp_high;
2086 
2102  typedef struct
2103  {
2104  unsigned int Param1;
2106 
2121  typedef struct
2122  {
2123  int Position;
2125  long_t EncPosition;
2126  } get_position_t;
2127 
2141  typedef struct
2142  {
2143  float Position;
2144  long_t EncPosition;
2146 
2159  typedef struct
2160  {
2161  int Position;
2163  long_t EncPosition;
2164  unsigned int PosFlags;
2165  } set_position_t;
2166 
2179  typedef struct
2180  {
2181  float Position;
2182  long_t EncPosition;
2183  unsigned int PosFlags;
2185 
2198  typedef struct
2199  {
2200  unsigned int MoveSts;
2201  unsigned int MvCmdSts;
2202  unsigned int PWRSts;
2203  unsigned int EncSts;
2204  unsigned int WindSts;
2207  long_t EncPosition;
2208  int CurSpeed;
2210  int Ipwr;
2211  int Upwr;
2212  int Iusb;
2213  int Uusb;
2214  int CurT;
2215  unsigned int Flags;
2216  unsigned int GPIOFlags;
2217  unsigned int CmdBufFreeSpace;
2218  } status_t;
2219 
2232  typedef struct
2233  {
2234  unsigned int MoveSts;
2235  unsigned int MvCmdSts;
2236  unsigned int PWRSts;
2237  unsigned int EncSts;
2238  unsigned int WindSts;
2239  float CurPosition;
2240  long_t EncPosition;
2241  float CurSpeed;
2242  int Ipwr;
2243  int Upwr;
2244  int Iusb;
2245  int Uusb;
2246  int CurT;
2247  unsigned int Flags;
2248  unsigned int GPIOFlags;
2249  unsigned int CmdBufFreeSpace;
2250  } status_calb_t;
2251 
2262  typedef struct
2263  {
2264  int Speed[25];
2265  int Error[25];
2266  unsigned int Length;
2267  } measurements_t;
2268 
2282  typedef struct
2283  {
2290  unsigned int Pot;
2291  unsigned int Joy;
2293  } chart_data_t;
2294 
2305  typedef struct
2306  {
2307  char Manufacturer[5];
2308  char ManufacturerId[3];
2309  char ProductDescription[9];
2310  unsigned int Major;
2311  unsigned int Minor;
2312  unsigned int Release;
2314 
2325  typedef struct
2326  {
2327  unsigned int SN;
2328  uint8_t Key[32];
2329  unsigned int Major;
2330  unsigned int Minor;
2331  unsigned int Release;
2332  } serial_number_t;
2333 
2347  typedef struct
2348  {
2349  unsigned int A1Voltage_ADC;
2350  unsigned int A2Voltage_ADC;
2351  unsigned int B1Voltage_ADC;
2352  unsigned int B2Voltage_ADC;
2353  unsigned int SupVoltage_ADC;
2354  unsigned int ACurrent_ADC;
2355  unsigned int BCurrent_ADC;
2356  unsigned int FullCurrent_ADC;
2357  unsigned int Temp_ADC;
2358  unsigned int Joy_ADC;
2359  unsigned int Pot_ADC;
2360  unsigned int Enc_Check_ADC;
2361  unsigned int deprecated0;
2367  int ACurrent;
2368  int BCurrent;
2370  int Temp;
2371  int Joy;
2372  int Pot;
2374  unsigned int deprecated1[2];
2375  int R;
2376  int L;
2377  } analog_data_t;
2378 
2390  typedef struct
2391  {
2392  uint8_t DebugData[128];
2393  } debug_read_t;
2394 
2406  typedef struct
2407  {
2408  uint8_t DebugData[128];
2409  } debug_write_t;
2410 
2420  typedef struct
2421  {
2422  char PositionerName[17];
2423  } stage_name_t;
2424 
2436  typedef struct
2437  {
2438  char Manufacturer[17];
2439  char PartNumber[25];
2441 
2453  typedef struct
2454  {
2456  char Units[9];
2457  float MaxSpeed;
2458  float TravelRange;
2464  } stage_settings_t;
2465 
2477  typedef struct
2478  {
2479  char Manufacturer[17];
2480  char PartNumber[25];
2482 
2494  typedef struct
2495  {
2496  unsigned int MotorType;
2497  unsigned int ReservedField;
2498  unsigned int Poles;
2499  unsigned int Phases;
2508  float StallTorque;
2514  float MaxSpeed;
2515  float MaxCurrent;
2518  float NoLoadSpeed;
2519  } motor_settings_t;
2520 
2532  typedef struct
2533  {
2534  char Manufacturer[17];
2535  char PartNumber[25];
2537 
2549  typedef struct
2550  {
2555  unsigned int PPR;
2556  unsigned int EncoderSettings;
2558 
2570  typedef struct
2571  {
2572  char Manufacturer[17];
2573  char PartNumber[25];
2575 
2587  typedef struct
2588  {
2593  unsigned int PPR;
2595 
2607  typedef struct
2608  {
2609  char Manufacturer[17];
2610  char PartNumber[25];
2612 
2624  typedef struct
2625  {
2626  float ReductionIn;
2632  float Efficiency;
2633  } gear_settings_t;
2634 
2646  typedef struct
2647  {
2648  char MagneticBrakeInfo[25];
2651  float MBTorque;
2652  unsigned int MBSettings;
2653  char TemperatureSensorInfo[25];
2654  float TSMin;
2655  float TSMax;
2656  float TSGrad;
2657  unsigned int TSSettings;
2658  unsigned int LimitSwitchesSettings;
2660 
2673  typedef struct
2674  {
2675  uint8_t key[16];
2676  } init_random_t;
2677 
2687  typedef struct
2688  {
2689  unsigned int UniqueID0;
2690  unsigned int UniqueID1;
2691  unsigned int UniqueID2;
2692  unsigned int UniqueID3;
2694 
2695 /*
2696  --------------------------------------------
2697  BEGIN OF GENERATED function declarations
2698  --------------------------------------------
2699 */
2700 
2713 
2732  result_t XIMC_API set_feedback_settings (device_t id, const feedback_settings_t* feedback_settings);
2733 
2752  result_t XIMC_API get_feedback_settings (device_t id, feedback_settings_t* feedback_settings);
2753 
2770  result_t XIMC_API set_home_settings (device_t id, const home_settings_t* home_settings);
2771 
2790  result_t XIMC_API set_home_settings_calb (device_t id, const home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2791 
2808  result_t XIMC_API get_home_settings (device_t id, home_settings_t* home_settings);
2809 
2828  result_t XIMC_API get_home_settings_calb (device_t id, home_settings_calb_t* home_settings_calb, const calibration_t* calibration);
2829 
2842  result_t XIMC_API set_move_settings (device_t id, const move_settings_t* move_settings);
2843 
2858  result_t XIMC_API set_move_settings_calb (device_t id, const move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2859 
2872  result_t XIMC_API get_move_settings (device_t id, move_settings_t* move_settings);
2873 
2888  result_t XIMC_API get_move_settings_calb (device_t id, move_settings_calb_t* move_settings_calb, const calibration_t* calibration);
2889 
2908  result_t XIMC_API set_engine_settings (device_t id, const engine_settings_t* engine_settings);
2909 
2930  result_t XIMC_API set_engine_settings_calb (device_t id, const engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2931 
2950  result_t XIMC_API get_engine_settings (device_t id, engine_settings_t* engine_settings);
2951 
2972  result_t XIMC_API get_engine_settings_calb (device_t id, engine_settings_calb_t* engine_settings_calb, const calibration_t* calibration);
2973 
2986  result_t XIMC_API set_entype_settings (device_t id, const entype_settings_t* entype_settings);
2987 
3000  result_t XIMC_API get_entype_settings (device_t id, entype_settings_t* entype_settings);
3001 
3015  result_t XIMC_API set_power_settings (device_t id, const power_settings_t* power_settings);
3016 
3031  result_t XIMC_API get_power_settings (device_t id, power_settings_t* power_settings);
3032 
3046  result_t XIMC_API set_secure_settings (device_t id, const secure_settings_t* secure_settings);
3047 
3061  result_t XIMC_API get_secure_settings (device_t id, secure_settings_t* secure_settings);
3062 
3077  result_t XIMC_API set_edges_settings (device_t id, const edges_settings_t* edges_settings);
3078 
3103  result_t XIMC_API set_edges_settings_calb (device_t id, const edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3104 
3119  result_t XIMC_API get_edges_settings (device_t id, edges_settings_t* edges_settings);
3120 
3145  result_t XIMC_API get_edges_settings_calb (device_t id, edges_settings_calb_t* edges_settings_calb, const calibration_t* calibration);
3146 
3165  result_t XIMC_API set_pid_settings (device_t id, const pid_settings_t* pid_settings);
3166 
3184  result_t XIMC_API get_pid_settings (device_t id, pid_settings_t* pid_settings);
3185 
3202  result_t XIMC_API set_sync_in_settings (device_t id, const sync_in_settings_t* sync_in_settings);
3203 
3222  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);
3223 
3240  result_t XIMC_API get_sync_in_settings (device_t id, sync_in_settings_t* sync_in_settings);
3241 
3260  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);
3261 
3278  result_t XIMC_API set_sync_out_settings (device_t id, const sync_out_settings_t* sync_out_settings);
3279 
3298  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);
3299 
3314  result_t XIMC_API get_sync_out_settings (device_t id, sync_out_settings_t* sync_out_settings);
3315 
3334  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);
3335 
3353  result_t XIMC_API set_extio_settings (device_t id, const extio_settings_t* extio_settings);
3354 
3370  result_t XIMC_API get_extio_settings (device_t id, extio_settings_t* extio_settings);
3371 
3384  result_t XIMC_API set_brake_settings (device_t id, const brake_settings_t* brake_settings);
3385 
3398  result_t XIMC_API get_brake_settings (device_t id, brake_settings_t* brake_settings);
3399 
3424  result_t XIMC_API set_control_settings (device_t id, const control_settings_t* control_settings);
3425 
3452  result_t XIMC_API set_control_settings_calb (device_t id, const control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3453 
3478  result_t XIMC_API get_control_settings (device_t id, control_settings_t* control_settings);
3479 
3506  result_t XIMC_API get_control_settings_calb (device_t id, control_settings_calb_t* control_settings_calb, const calibration_t* calibration);
3507 
3536  result_t XIMC_API set_joystick_settings (device_t id, const joystick_settings_t* joystick_settings);
3537 
3566  result_t XIMC_API get_joystick_settings (device_t id, joystick_settings_t* joystick_settings);
3567 
3587  result_t XIMC_API set_ctp_settings (device_t id, const ctp_settings_t* ctp_settings);
3588 
3606  result_t XIMC_API get_ctp_settings (device_t id, ctp_settings_t* ctp_settings);
3607 
3624  result_t XIMC_API set_uart_settings (device_t id, const uart_settings_t* uart_settings);
3625 
3642  result_t XIMC_API get_uart_settings (device_t id, uart_settings_t* uart_settings);
3643 
3663  result_t XIMC_API set_network_settings (device_t id, const network_settings_t* network_settings);
3664 
3684  result_t XIMC_API get_network_settings (device_t id, network_settings_t* network_settings);
3685 
3699  result_t XIMC_API set_password_settings (device_t id, const password_settings_t* password_settings);
3700 
3714  result_t XIMC_API get_password_settings (device_t id, password_settings_t* password_settings);
3715 
3732  result_t XIMC_API set_calibration_settings (device_t id, const calibration_settings_t* calibration_settings);
3733 
3750  result_t XIMC_API get_calibration_settings (device_t id, calibration_settings_t* calibration_settings);
3751 
3764  result_t XIMC_API set_controller_name (device_t id, const controller_name_t* controller_name);
3765 
3778  result_t XIMC_API get_controller_name (device_t id, controller_name_t* controller_name);
3779 
3792  result_t XIMC_API set_nonvolatile_memory (device_t id, const nonvolatile_memory_t* nonvolatile_memory);
3793 
3806  result_t XIMC_API get_nonvolatile_memory (device_t id, nonvolatile_memory_t* nonvolatile_memory);
3807 
3825  result_t XIMC_API set_emf_settings (device_t id, const emf_settings_t* emf_settings);
3826 
3843  result_t XIMC_API get_emf_settings (device_t id, emf_settings_t* emf_settings);
3844 
3859  result_t XIMC_API set_engine_advansed_setup (device_t id, const engine_advansed_setup_t* engine_advansed_setup);
3860 
3875  result_t XIMC_API get_engine_advansed_setup (device_t id, engine_advansed_setup_t* engine_advansed_setup);
3876 
3891  result_t XIMC_API set_extended_settings (device_t id, const extended_settings_t* extended_settings);
3892 
3907  result_t XIMC_API get_extended_settings (device_t id, extended_settings_t* extended_settings);
3908 
3909 
3911 
3924 
3942  result_t XIMC_API command_stop (device_t id);
3943 
3958  result_t XIMC_API command_power_off (device_t id);
3959 
3978  result_t XIMC_API command_move (device_t id, int Position, int uPosition);
3979 
4006  result_t XIMC_API command_move_calb (device_t id, float Position, const calibration_t* calibration);
4007 
4024  result_t XIMC_API command_movr (device_t id, int DeltaPosition, int uDeltaPosition);
4025 
4050  result_t XIMC_API command_movr_calb (device_t id, float DeltaPosition, const calibration_t* calibration);
4051 
4087  result_t XIMC_API command_home (device_t id);
4088 
4099  result_t XIMC_API command_left (device_t id);
4100 
4111  result_t XIMC_API command_right (device_t id);
4112 
4124  result_t XIMC_API command_loft (device_t id);
4125 
4136  result_t XIMC_API command_sstp (device_t id);
4137 
4151  result_t XIMC_API get_position (device_t id, get_position_t* the_get_position);
4152 
4175  result_t XIMC_API get_position_calb (device_t id, get_position_calb_t* the_get_position_calb, const calibration_t* calibration);
4176 
4191  result_t XIMC_API set_position (device_t id, const set_position_t* the_set_position);
4192 
4207  result_t XIMC_API set_position_calb (device_t id, const set_position_calb_t* the_set_position_calb, const calibration_t* calibration);
4208 
4219  result_t XIMC_API command_zero (device_t id);
4220 
4221 
4223 
4236 
4247  result_t XIMC_API command_save_settings (device_t id);
4248 
4259  result_t XIMC_API command_read_settings (device_t id);
4260 
4271  result_t XIMC_API command_save_robust_settings (device_t id);
4272 
4283  result_t XIMC_API command_read_robust_settings (device_t id);
4284 
4297  result_t XIMC_API command_eesave_settings (device_t id);
4298 
4309  result_t XIMC_API command_eeread_settings (device_t id);
4310 
4321  result_t XIMC_API command_start_measurements (device_t id);
4322 
4341  result_t XIMC_API get_measurements (device_t id, measurements_t* measurements);
4342 
4359  result_t XIMC_API get_chart_data (device_t id, chart_data_t* chart_data);
4360 
4373  result_t XIMC_API get_serial_number (device_t id, unsigned int* SerialNumber);
4374 
4391  result_t XIMC_API get_firmware_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4392 
4403  result_t XIMC_API service_command_updf (device_t id);
4404 
4405 
4407 
4420 
4439  result_t XIMC_API set_serial_number (device_t id, const serial_number_t* serial_number);
4440 
4453  result_t XIMC_API get_analog_data (device_t id, analog_data_t* analog_data);
4454 
4469  result_t XIMC_API get_debug_read (device_t id, debug_read_t* debug_read);
4470 
4483  result_t XIMC_API set_debug_write (device_t id, const debug_write_t* debug_write);
4484 
4485 
4487 
4500 
4513  result_t XIMC_API set_stage_name (device_t id, const stage_name_t* stage_name);
4514 
4527  result_t XIMC_API get_stage_name (device_t id, stage_name_t* stage_name);
4528 
4543  result_t XIMC_API set_stage_information (device_t id, const stage_information_t* stage_information);
4544 
4557  result_t XIMC_API get_stage_information (device_t id, stage_information_t* stage_information);
4558 
4573  result_t XIMC_API set_stage_settings (device_t id, const stage_settings_t* stage_settings);
4574 
4587  result_t XIMC_API get_stage_settings (device_t id, stage_settings_t* stage_settings);
4588 
4603  result_t XIMC_API set_motor_information (device_t id, const motor_information_t* motor_information);
4604 
4617  result_t XIMC_API get_motor_information (device_t id, motor_information_t* motor_information);
4618 
4633  result_t XIMC_API set_motor_settings (device_t id, const motor_settings_t* motor_settings);
4634 
4647  result_t XIMC_API get_motor_settings (device_t id, motor_settings_t* motor_settings);
4648 
4663  result_t XIMC_API set_encoder_information (device_t id, const encoder_information_t* encoder_information);
4664 
4677  result_t XIMC_API get_encoder_information (device_t id, encoder_information_t* encoder_information);
4678 
4693  result_t XIMC_API set_encoder_settings (device_t id, const encoder_settings_t* encoder_settings);
4694 
4707  result_t XIMC_API get_encoder_settings (device_t id, encoder_settings_t* encoder_settings);
4708 
4723  result_t XIMC_API set_hallsensor_information (device_t id, const hallsensor_information_t* hallsensor_information);
4724 
4737  result_t XIMC_API get_hallsensor_information (device_t id, hallsensor_information_t* hallsensor_information);
4738 
4753  result_t XIMC_API set_hallsensor_settings (device_t id, const hallsensor_settings_t* hallsensor_settings);
4754 
4767  result_t XIMC_API get_hallsensor_settings (device_t id, hallsensor_settings_t* hallsensor_settings);
4768 
4783  result_t XIMC_API set_gear_information (device_t id, const gear_information_t* gear_information);
4784 
4797  result_t XIMC_API get_gear_information (device_t id, gear_information_t* gear_information);
4798 
4813  result_t XIMC_API set_gear_settings (device_t id, const gear_settings_t* gear_settings);
4814 
4827  result_t XIMC_API get_gear_settings (device_t id, gear_settings_t* gear_settings);
4828 
4843  result_t XIMC_API set_accessories_settings (device_t id, const accessories_settings_t* accessories_settings);
4844 
4857  result_t XIMC_API get_accessories_settings (device_t id, accessories_settings_t* accessories_settings);
4858 
4875  result_t XIMC_API get_bootloader_version (device_t id, unsigned int* Major, unsigned int* Minor, unsigned int* Release);
4876 
4889  result_t XIMC_API get_init_random (device_t id, init_random_t* init_random);
4890 
4906  result_t XIMC_API get_globally_unique_identifier (device_t id, globally_unique_identifier_t* globally_unique_identifier);
4907 
4908 
4909 /*
4910  -------------------------
4911  END OF GENERATED CODE
4912  -------------------------
4913 */
4914 
4915 /* hand-crafted functions begin */
4916 
4929  result_t XIMC_API goto_firmware(device_t id, uint8_t* ret);
4930 
4943  result_t XIMC_API has_firmware(const char* uri, uint8_t* ret);
4944 
4960  result_t XIMC_API command_update_firmware(const char* uri, const uint8_t* data, uint32_t data_size);
4961 
4976  result_t XIMC_API write_key (const char* uri, uint8_t* key);
4977 
4990  result_t XIMC_API command_reset(device_t id);
4991 
5004  result_t XIMC_API command_clear_fram(device_t id);
5005 
5007 
5008  // ------------------------------------
5009 
5021 
5049  device_t XIMC_API open_device (const char* uri);
5050 
5065  result_t XIMC_API close_device (device_t* id);
5066 
5122  result_t XIMC_API load_correction_table(device_t* id, const char* namefile);
5123 
5168  result_t XIMC_API set_correction_table(device_t id, const char* namefile);
5169 
5182  result_t XIMC_API probe_device (const char* uri);
5183 
5192  result_t XIMC_API set_bindy_key(const char* keyfilepath);
5193 
5304  device_enumeration_t XIMC_API enumerate_devices(int enumerate_flags, const char *hints);
5305 
5316  result_t XIMC_API free_enumerate_devices(device_enumeration_t device_enumeration);
5317 
5328  int XIMC_API get_device_count(device_enumeration_t device_enumeration);
5329 
5338  typedef char* pchar;
5339 
5354  pchar XIMC_API get_device_name(device_enumeration_t device_enumeration, int device_index);
5355 
5356 
5373  result_t XIMC_API get_enumerate_device_serial(device_enumeration_t device_enumeration, int device_index, uint32_t* serial);
5374 
5391  result_t XIMC_API get_enumerate_device_information(device_enumeration_t device_enumeration, int device_index, device_information_t* device_information);
5392 
5409  result_t XIMC_API get_enumerate_device_controller_name(device_enumeration_t device_enumeration, int device_index, controller_name_t* controller_name);
5410 
5427  result_t XIMC_API get_enumerate_device_stage_name(device_enumeration_t device_enumeration, int device_index, stage_name_t* stage_name);
5428 
5445  result_t XIMC_API get_enumerate_device_network_information(device_enumeration_t device_enumeration, int device_index, device_network_information_t* device_network_information);
5446 
5454  result_t XIMC_API reset_locks ();
5455 
5471  result_t XIMC_API ximc_fix_usbser_sys(const char* device_uri);
5472 
5473 
5483  void XIMC_API msec_sleep (unsigned int msec);
5484 
5494  void XIMC_API ximc_version (char* version);
5495 
5496 #if !defined(MATLAB_IMPORT) && !defined(LABVIEW64_IMPORT) && !defined(LABVIEW32_IMPORT)
5497 
5509  typedef void (XIMC_CALLCONV *logging_callback_t)(int loglevel, const wchar_t* message, void* user_data);
5510 
5522  void XIMC_API logging_callback_stderr_wide(int loglevel, const wchar_t* message, void* user_data);
5523 
5535  void XIMC_API logging_callback_stderr_narrow(int loglevel, const wchar_t* message, void* user_data);
5536 
5549  void XIMC_API set_logging_callback(logging_callback_t logging_callback, void* user_data);
5550 
5551 #endif
5552 
5576  result_t XIMC_API get_status (device_t id, status_t* status);
5577 
5603  result_t XIMC_API get_status_calb (device_t id, status_calb_t* status, const calibration_t* calibration);
5604 
5630  result_t XIMC_API get_device_information (device_t id, device_information_t* device_information);
5631 
5650  result_t XIMC_API command_wait_for_stop(device_t id, uint32_t refresh_interval_ms);
5651 
5664  result_t XIMC_API command_homezero(device_t id);
5666 
5667 #if defined(__cplusplus)
5668 };
5669 #endif
5670 
5671 #endif
5672 
5673 // vim: ts=4 shiftwidth=4
5674