canlib.h
Go to the documentation of this file.
1 /*
2  * Copyright 1994-2017 by KVASER AB, SWEDEN
3  *
4  * WWW: http://www.kvaser.com
5  *
6  * This software is furnished under a license and may be used and copied
7  * only in accordance with the terms of such license.
8  *
9  * \note MATLAB users on Windows: if you define WIN32_LEAN_AND_MEAN before
10  * including this file, you will see a lot less warnings.
11  *
12  */
13 
106 #ifndef _CANLIB_H_
107 #define _CANLIB_H_
108 
109 #include <stdlib.h>
110 
111 #include <windows.h>
112 #include "predef.h"
113 #include "canevt.h"
114 
115 #include "canstat.h"
116 
118 typedef int canHandle;
119 
120 #define canINVALID_HANDLE (-1)
121 
122 
123 #define CanHandle int
124 
126 #define WM__CANLIB (WM_USER+16354)
127 
150 #define canOPEN_EXCLUSIVE 0x0008
151 
163 #define canOPEN_REQUIRE_EXTENDED 0x0010
164 
172 #define canOPEN_ACCEPT_VIRTUAL 0x0020
173 
182 #define canOPEN_OVERRIDE_EXCLUSIVE 0x0040
183 
200 #define canOPEN_REQUIRE_INIT_ACCESS 0x0080
201 
213 #define canOPEN_NO_INIT_ACCESS 0x0100
214 
226 #define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8
227 
234 #define canOPEN_CAN_FD 0x0400
235 
249 #define canOPEN_CAN_FD_NONISO 0x0800
250 
251 
255 #define canOPEN_INTERNAL_L 0x1000
256 
268 #define canFILTER_ACCEPT 1
269 #define canFILTER_REJECT 2
270 
271 #define canFILTER_SET_CODE_STD 3
272 
273 #define canFILTER_SET_MASK_STD 4
274 
275 #define canFILTER_SET_CODE_EXT 5
276 
277 #define canFILTER_SET_MASK_EXT 6
278 
279 #define canFILTER_NULL_MASK 0L
280 
296 #define canDRIVER_NORMAL 4
297 
304 #define canDRIVER_SILENT 1
305 
309 #define canDRIVER_SELFRECEPTION 8
310 
314 #define canDRIVER_OFF 0
315 
338 #define canBITRATE_1M (-1)
339 
340 #define canBITRATE_500K (-2)
341 
342 #define canBITRATE_250K (-3)
343 
344 #define canBITRATE_125K (-4)
345 
346 #define canBITRATE_100K (-5)
347 
348 #define canBITRATE_62K (-6)
349 
350 #define canBITRATE_50K (-7)
351 
352 #define canBITRATE_83K (-8)
353 
354 #define canBITRATE_10K (-9)
355 
356 // CAN FD Bit Rates
360 #define canFD_BITRATE_500K_80P (-1000)
361 
364 #define canFD_BITRATE_1M_80P (-1001)
365 
368 #define canFD_BITRATE_2M_80P (-1002)
369 
372 #define canFD_BITRATE_2M_60P (-1007)
373 
376 #define canFD_BITRATE_4M_80P (-1003)
377 
380 #define canFD_BITRATE_8M_60P (-1004)
381 
384 #define canFD_BITRATE_8M_80P (-1005)
385 
388 #define canFD_BITRATE_8M_70P (-1006)
389 
391 #define BAUD_1M (-1)
392 
393 #define BAUD_500K (-2)
394 
395 #define BAUD_250K (-3)
396 
397 #define BAUD_125K (-4)
398 
399 #define BAUD_100K (-5)
400 
401 #define BAUD_62K (-6)
402 
403 #define BAUD_50K (-7)
404 
405 #define BAUD_83K (-8)
406 
409 //
410 // Define CANLIBAPI unless it's done already.
411 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
412 // and DLLEXPORT before including this file.)
413 //
414 #ifndef CANLIBAPI
415 # define CANLIBAPI __stdcall
416 # define DLLIMPORT __declspec(dllimport)
417 # define DLLEXPORT __declspec(dllexport)
418 #endif /* CANLIBAPI */
419 
420 
421 #ifdef __cplusplus
422 extern "C" {
423 #endif /* __cplusplus */
424 
446 void CANLIBAPI canInitializeLibrary(void);
447 
469 canStatus CANLIBAPI canEnumHardwareEx(int *channelCount);
470 
495 canStatus CANLIBAPI canClose(const CanHandle hnd);
496 
521 canStatus CANLIBAPI canBusOn(const CanHandle hnd);
522 
543 canStatus CANLIBAPI canBusOff(const CanHandle hnd);
544 
594 canStatus CANLIBAPI canSetBusParams(const CanHandle hnd,
595  long freq,
596  unsigned int tseg1,
597  unsigned int tseg2,
598  unsigned int sjw,
599  unsigned int noSamp,
600  unsigned int syncmode);
601 
631 typedef struct kvBusParamsTq {
632  int tq;
633  int phase1;
634  int phase2;
635  int sjw;
636  int prop;
637  int prescaler;
638 } kvBusParamsTq;
639 
665  canStatus CANLIBAPI canSetBusParamsTq(const CanHandle hnd,
666  const kvBusParamsTq nominal);
667 
701 canStatus CANLIBAPI canSetBusParamsFd(const CanHandle hnd,
702  long freq_brs,
703  unsigned int tseg1_brs,
704  unsigned int tseg2_brs,
705  unsigned int sjw_brs);
706 
733 canStatus CANLIBAPI canSetBusParamsFdTq(const CanHandle hnd,
734  const kvBusParamsTq arbitration,
735  const kvBusParamsTq data);
736 
737 
769 canStatus CANLIBAPI canGetBusParams(const CanHandle hnd,
770  long *freq,
771  unsigned int *tseg1,
772  unsigned int *tseg2,
773  unsigned int *sjw,
774  unsigned int *noSamp,
775  unsigned int *syncmode);
776 
796 canStatus CANLIBAPI canGetBusParamsTq(const CanHandle hnd,
797  kvBusParamsTq *nominal);
798 
821 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
822  long *freq_brs,
823  unsigned int *tseg1_brs,
824  unsigned int *tseg2_brs,
825  unsigned int *sjw_brs);
826 
847 canStatus CANLIBAPI canGetBusParamsFdTq(const CanHandle hnd,
848  kvBusParamsTq *nominal,
849  kvBusParamsTq *data);
850 
875 canStatus CANLIBAPI canSetBusOutputControl(const CanHandle hnd,
876  const unsigned int drivertype);
877 
912 canStatus CANLIBAPI canGetBusOutputControl(const CanHandle hnd,
913  unsigned int *drivertype);
914 
957 canStatus CANLIBAPI canAccept(const CanHandle hnd,
958  const long envelope,
959  const unsigned int flag);
960 
984 canStatus CANLIBAPI canReadStatus(const CanHandle hnd,
985  unsigned long *const flags);
986 
1023 canStatus CANLIBAPI canReadErrorCounters(const CanHandle hnd,
1024  unsigned int *txErr,
1025  unsigned int *rxErr,
1026  unsigned int *ovErr);
1027 
1069 canStatus CANLIBAPI canWrite(const CanHandle hnd,
1070  long id,
1071  void *msg,
1072  unsigned int dlc,
1073  unsigned int flag);
1074 
1102 canStatus CANLIBAPI canWriteSync(const CanHandle hnd, unsigned long timeout);
1103 
1157 canStatus CANLIBAPI canRead(const CanHandle hnd,
1158  long *id,
1159  void *msg,
1160  unsigned int *dlc,
1161  unsigned int *flag,
1162  unsigned long *time);
1215 canStatus CANLIBAPI canReadWait(const CanHandle hnd,
1216  long *id,
1217  void *msg,
1218  unsigned int *dlc,
1219  unsigned int *flag,
1220  unsigned long *time,
1221  unsigned long timeout);
1222 
1274 canStatus CANLIBAPI canReadSpecific(const CanHandle hnd, long id, void *msg,
1275  unsigned int *dlc, unsigned int *flag,
1276  unsigned long *time);
1277 
1308 canStatus CANLIBAPI canReadSync(const CanHandle hnd, unsigned long timeout);
1309 
1341 canStatus CANLIBAPI canReadSyncSpecific(const CanHandle hnd,
1342  long id,
1343  unsigned long timeout);
1344 
1390 canStatus CANLIBAPI canReadSpecificSkip(const CanHandle hnd,
1391  long id,
1392  void *msg,
1393  unsigned int *dlc,
1394  unsigned int *flag,
1395  unsigned long *time);
1396 
1397 
1436 canStatus CANLIBAPI canSetNotify(const CanHandle hnd,
1437  HWND aHWnd,
1438  unsigned int aNotifyFlags);
1439 
1440 
1475 canStatus CANLIBAPI canTranslateBaud(long *const freq,
1476  unsigned int *const tseg1,
1477  unsigned int *const tseg2,
1478  unsigned int *const sjw,
1479  unsigned int *const nosamp,
1480  unsigned int *const syncMode);
1481 
1504 canStatus CANLIBAPI kvBitrateToBusParamsTq(const canHandle hnd,
1505  int freq,
1506  kvBusParamsTq *nominal);
1507 
1533 canStatus CANLIBAPI kvBitrateToBusParamsFdTq(const canHandle hnd,
1534  int freqA,
1535  int freqD,
1536  kvBusParamsTq *arbitration,
1537  kvBusParamsTq *data);
1538 
1561 canStatus CANLIBAPI canGetErrorText(canStatus err, char *buf, unsigned int bufsiz);
1562 
1593 unsigned short CANLIBAPI canGetVersion(void);
1594 
1623 canStatus CANLIBAPI canIoCtl(const CanHandle hnd,
1624  unsigned int func,
1625  void *buf,
1626  unsigned int buflen);
1627 
1628 
1637 unsigned long CANLIBAPI canReadTimer(const CanHandle hnd);
1638 
1689 CanHandle CANLIBAPI canOpenChannel(int channel, int flags);
1690 
1711 canStatus CANLIBAPI canGetNumberOfChannels(int *channelCount);
1712 
1713 
1721 #define kvREMOTE_TYPE_NOT_REMOTE 0
1722 #define kvREMOTE_TYPE_WLAN 1
1723 #define kvREMOTE_TYPE_LAN 2
1724 
1733 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1734 #define kvLOGGER_TYPE_V1 1
1735 #define kvLOGGER_TYPE_V2 2
1736 
1769 canStatus CANLIBAPI canGetChannelData(int channel,
1770  int item,
1771  void *buffer,
1772  size_t bufsize);
1773 
1792 #define canCHANNELDATA_CHANNEL_CAP 1
1793 
1803 #define canCHANNELDATA_TRANS_CAP 2
1804 
1813 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1814 
1823 #define canCHANNELDATA_CARD_TYPE 4
1824 
1834 #define canCHANNELDATA_CARD_NUMBER 5
1835 
1843 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1844 
1854 #define canCHANNELDATA_CARD_SERIAL_NO 7
1855 
1865 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1866 
1877 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1878 
1889 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1890 
1900 #define canCHANNELDATA_CARD_UPC_NO 11
1901 
1912 #define canCHANNELDATA_TRANS_UPC_NO 12
1913 
1931 #define canCHANNELDATA_CHANNEL_NAME 13
1932 
1948 #define canCHANNELDATA_DLL_FILE_VERSION 14
1949 
1965 #define canCHANNELDATA_DLL_PRODUCT_VERSION 15
1966 
1982 #define canCHANNELDATA_DLL_FILETYPE 16
1983 
1992 #define canCHANNELDATA_TRANS_TYPE 17
1993 
2017 #define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
2018 
2031 #define canCHANNELDATA_UI_NUMBER 19
2032 
2056 #define canCHANNELDATA_TIMESYNC_ENABLED 20
2057 
2072 #define canCHANNELDATA_DRIVER_FILE_VERSION 21
2073 
2088 #define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
2089 
2098 #define canCHANNELDATA_MFGNAME_UNICODE 23
2099 
2107 #define canCHANNELDATA_MFGNAME_ASCII 24
2108 
2117 #define canCHANNELDATA_DEVDESCR_UNICODE 25
2118 
2126 #define canCHANNELDATA_DEVDESCR_ASCII 26
2127 
2138 #define canCHANNELDATA_DRIVER_NAME 27
2139 
2152 #define canCHANNELDATA_CHANNEL_QUALITY 28
2153 
2162 #define canCHANNELDATA_ROUNDTRIP_TIME 29
2163 
2172 #define canCHANNELDATA_BUS_TYPE 30
2173 
2186 #define canCHANNELDATA_DEVNAME_ASCII 31
2187 
2198 #define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2199 
2209 #define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2210 
2219 #define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2220 
2229 #define canCHANNELDATA_REMOTE_HOST_NAME 35
2230 
2239 #define canCHANNELDATA_REMOTE_MAC 36
2240 
2249 #define canCHANNELDATA_MAX_BITRATE 37
2250 
2261 #define canCHANNELDATA_CHANNEL_CAP_MASK 38
2262 
2274 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2275 
2285 #define canCHANNELDATA_IS_REMOTE 40
2286 
2295 #define canCHANNELDATA_REMOTE_TYPE 41
2296 
2305 #define canCHANNELDATA_LOGGER_TYPE 42
2306 
2316 #define canCHANNELDATA_HW_STATUS 43
2317 
2327 #define canCHANNELDATA_FEATURE_EAN 44
2328 
2335 #define canCHANNELDATA_BUS_PARAM_LIMITS 45
2336 
2343 #define canCHANNELDATA_CLOCK_INFO 46
2344 
2365 #define canCHANNELDATA_CHANNEL_CAP_EX 47
2366 
2379 typedef struct kvClockInfo {
2380  int version;
2385 }kvClockInfo;
2386 
2401 typedef struct kvBusParamLimits {
2402  int version;
2408 
2419 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2420 
2422 #define canCHANNEL_IS_OPEN 0x0002
2423 
2426 #define canCHANNEL_IS_CANFD 0x0004
2427 
2428 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2429 
2432 #define canCHANNEL_IS_LIN 0x0010
2433 
2436 #define canCHANNEL_IS_LIN_MASTER 0x0020
2437 
2440 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2441 
2442 
2461 #define canHWTYPE_NONE 0
2462 #define canHWTYPE_VIRTUAL 1
2463 #define canHWTYPE_LAPCAN 2
2464 #define canHWTYPE_CANPARI 3
2465 #define canHWTYPE_PCCAN 8
2466 #define canHWTYPE_PCICAN 9
2467 #define canHWTYPE_USBCAN 11
2468 #define canHWTYPE_PCICAN_II 40
2469 #define canHWTYPE_USBCAN_II 42
2470 #define canHWTYPE_SIMULATED 44
2471 #define canHWTYPE_ACQUISITOR 46
2472 #define canHWTYPE_LEAF 48
2473 #define canHWTYPE_PC104_PLUS 50
2474 #define canHWTYPE_PCICANX_II 52
2475 #define canHWTYPE_MEMORATOR_II 54
2476 #define canHWTYPE_MEMORATOR_PRO 54
2477 #define canHWTYPE_USBCAN_PRO 56
2478 #define canHWTYPE_IRIS 58
2479 #define canHWTYPE_BLACKBIRD 58
2480 #define canHWTYPE_MEMORATOR_LIGHT 60
2481 #define canHWTYPE_MINIHYDRA 62
2482 #define canHWTYPE_EAGLE 62
2483 #define canHWTYPE_BAGEL 64
2484 #define canHWTYPE_BLACKBIRD_V2 64
2485 #define canHWTYPE_MINIPCIE 66
2486 #define canHWTYPE_USBCAN_KLINE 68
2487 #define canHWTYPE_ETHERCAN 70
2488 #define canHWTYPE_USBCAN_LIGHT 72
2489 #define canHWTYPE_USBCAN_PRO2 74
2490 #define canHWTYPE_PCIE_V2 76
2491 #define canHWTYPE_MEMORATOR_PRO2 78
2492 #define canHWTYPE_LEAF2 80
2493 #define canHWTYPE_MEMORATOR_V2 82
2494 #define canHWTYPE_CANLINHYBRID 84
2495 #define canHWTYPE_DINRAIL 86
2496 #define canHWTYPE_U100 88
2497 #define canHWTYPE_LEAF3 90
2498 
2499 
2507 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2508 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2509 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2510 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2511 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2512 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2513 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2514 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2515 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2516 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2517 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2518 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2519 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2520 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2521 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2522 #define canCHANNEL_CAP_LOGGER 0x00800000L
2523 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2524 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2525 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2526 #define canCHANNEL_CAP_IO_API 0x08000000L
2527 #define canCHANNEL_CAP_CANTEGRITY 0x10000000L
2528 
2529 
2535 #define canCHANNEL_CAP_EX_BUSPARAMS_TQ 0x0000000000000001L
2536 
2537 
2549 #define canCHANNEL_OPMODE_NONE 1
2550 
2554 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2555 
2559 #define canCHANNEL_OPMODE_RESERVED 3
2560 
2564 #define canCHANNEL_OPMODE_ADHOC 4
2565 
2575 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2576 
2602 #define canIOCTL_PREFER_EXT 1
2603 
2616 #define canIOCTL_PREFER_STD 2
2617 
2634 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2635 
2649 #define canIOCTL_SET_TIMER_SCALE 6
2650 
2670 #define canIOCTL_SET_TXACK 7
2671 
2684 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2685 
2698 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2699 
2709 #define canIOCTL_FLUSH_RX_BUFFER 10
2710 
2720 #define canIOCTL_FLUSH_TX_BUFFER 11
2721 
2730 #define canIOCTL_GET_TIMER_SCALE 12
2731 
2747 #define canIOCTL_SET_TXRQ 13
2748 
2776 #define canIOCTL_GET_EVENTHANDLE 14
2777 
2784 #define canIOCTL_SET_BYPASS_MODE 15
2785 
2791 #define canIOCTL_SET_WAKEUP 16
2792 
2802 #define canIOCTL_GET_DRIVERHANDLE 17
2803 
2809 #define canIOCTL_MAP_RXQUEUE 18
2810 
2816 #define canIOCTL_GET_WAKEUP 19
2817 
2829 #define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2830 
2838 #define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2839 
2849 #define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2850 
2860 #define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2861 
2871 #define canIOCTL_SET_USER_IOPORT 24
2872 
2883 #define canIOCTL_GET_USER_IOPORT 25
2884 
2890 #define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2891 
2908 #define canIOCTL_SET_RX_QUEUE_SIZE 27
2909 
2915 #define canIOCTL_SET_USB_THROTTLE 28
2916 
2922 #define canIOCTL_GET_USB_THROTTLE 29
2923 
2938 #define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2939 
2951 #define canIOCTL_GET_TXACK 31
2952 
2967 #define canIOCTL_SET_LOCAL_TXECHO 32
2968 
2984 #define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
2985 
2999 #define canIOCTL_GET_CHANNEL_QUALITY 34
3000 
3012 #define canIOCTL_GET_ROUNDTRIP_TIME 35
3013 
3022 #define canIOCTL_GET_BUS_TYPE 36
3023 
3036 #define canIOCTL_GET_DEVNAME_ASCII 37
3037 
3049 #define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
3050 
3064 #define canIOCTL_GET_TREF_LIST 39
3065 
3087 #define canIOCTL_TX_INTERVAL 40
3088 
3100 #define canIOCTL_SET_BRLIMIT 43
3101 
3107 #define canIOCTL_SET_USB_THROTTLE_SCALED 41
3108 
3123 #define canIOCTL_SET_THROTTLE_SCALED 41
3124 
3130 #define canIOCTL_GET_USB_THROTTLE_SCALED 42
3131 
3146 #define canIOCTL_GET_THROTTLE_SCALED 42
3147 
3155 #define canIOCTL_RESET_OVERRUN_COUNT 44
3156 
3165 #define canIOCTL_LIN_MODE 45
3166 
3167 
3185 #define canIOCTL_SET_LOCAL_TXACK 46
3186 
3189 typedef struct {
3190  unsigned int portNo;
3191  unsigned int portValue;
3193 
3223 canStatus CANLIBAPI canWaitForEvent(const CanHandle hnd, DWORD timeout);
3224 
3265 canStatus CANLIBAPI canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1);
3266 
3267 
3268 
3304 canStatus CANLIBAPI canSetDriverMode(const CanHandle hnd, int lineMode, int resNet);
3305 
3342 canStatus CANLIBAPI canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet);
3343 
3363 #define canVERSION_CANLIB32_VERSION 0
3364 
3375 #define canVERSION_CANLIB32_PRODVER 1
3376 
3388 #define canVERSION_CANLIB32_PRODVER32 2
3389 
3400 #define canVERSION_CANLIB32_BETA 3
3401 
3402 
3423 unsigned int CANLIBAPI canGetVersionEx(unsigned int itemCode);
3424 
3425 
3443 canStatus CANLIBAPI canParamGetCount(void);
3444 
3468 canStatus CANLIBAPI canParamCommitChanges(void);
3469 
3494 canStatus CANLIBAPI canParamDeleteEntry(int index);
3495 
3518 canStatus CANLIBAPI canParamCreateNewEntry(void);
3519 
3547 canStatus CANLIBAPI canParamSwapEntries(int index1, int index2);
3548 
3577 canStatus CANLIBAPI canParamGetName(int index, char *buffer, int maxlen);
3578 
3599 canStatus CANLIBAPI canParamGetChannelNumber(int index);
3600 
3629 canStatus CANLIBAPI canParamGetBusParams(int index,
3630  long *bitrate,
3631  unsigned int *tseg1,
3632  unsigned int *tseg2,
3633  unsigned int *sjw,
3634  unsigned int *noSamp);
3635 
3658 canStatus CANLIBAPI canParamSetName(int index, const char *buffer);
3659 
3681 canStatus CANLIBAPI canParamSetChannelNumber(int index, int channel);
3682 
3715 canStatus CANLIBAPI canParamSetBusParams(int index,
3716  long bitrate,
3717  unsigned int tseg1,
3718  unsigned int tseg2,
3719  unsigned int sjw,
3720  unsigned int noSamp);
3721 
3741 canStatus CANLIBAPI canParamFindByName(const char *name);
3761 canStatus CANLIBAPI canObjBufFreeAll(const CanHandle hnd);
3762 
3783 canStatus CANLIBAPI canObjBufAllocate(const CanHandle hnd, int type);
3784 
3793 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3794 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3795 
3817 canStatus CANLIBAPI canObjBufFree(const CanHandle hnd, int idx);
3818 
3819 // Writes CAN data to the object buffer with the specified index.
3820 
3846 canStatus CANLIBAPI canObjBufWrite(const CanHandle hnd,
3847  int idx,
3848  int id,
3849  void *msg,
3850  unsigned int dlc,
3851  unsigned int flags);
3852 
3878 canStatus CANLIBAPI canObjBufSetFilter(const CanHandle hnd,
3879  int idx,
3880  unsigned int code,
3881  unsigned int mask);
3882 
3903 canStatus CANLIBAPI canObjBufSetFlags(const CanHandle hnd,
3904  int idx,
3905  unsigned int flags);
3906 
3924 #define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3925 
3947 canStatus CANLIBAPI canObjBufSetPeriod(const CanHandle hnd,
3948  int idx,
3949  unsigned int period);
3950 
3971 canStatus CANLIBAPI canObjBufSetMsgCount(const CanHandle hnd,
3972  int idx,
3973  unsigned int count);
3974 
3994 canStatus CANLIBAPI canObjBufEnable(const CanHandle hnd, int idx);
3995 
4015 canStatus CANLIBAPI canObjBufDisable(const CanHandle hnd, int idx);
4016 
4040 canStatus CANLIBAPI canObjBufSendBurst(const CanHandle hnd,
4041  int idx,
4042  unsigned int burstlen);
4043 
4060 #define canVERSION_DONT_ACCEPT_LATER 0x01
4061 
4068 #define canVERSION_DONT_ACCEPT_BETAS 0x02
4069 
4107 BOOL CANLIBAPI canProbeVersion (const CanHandle hnd,
4108  int major,
4109  int minor,
4110  int oem_id,
4111  unsigned int flags);
4112 
4135 canStatus CANLIBAPI canResetBus(const CanHandle hnd);
4136 
4177 canStatus CANLIBAPI canWriteWait(const CanHandle hnd,
4178  long id,
4179  void *msg,
4180  unsigned int dlc,
4181  unsigned int flag,
4182  unsigned long timeout);
4183 
4184 
4214 canStatus CANLIBAPI canUnloadLibrary(void);
4215 
4277 canStatus CANLIBAPI canSetAcceptanceFilter(const CanHandle hnd,
4278  unsigned int code,
4279  unsigned int mask,
4280  int is_extended);
4304 canStatus CANLIBAPI canFlushReceiveQueue(const CanHandle hnd);
4305 
4330 canStatus CANLIBAPI canFlushTransmitQueue(const CanHandle hnd);
4331 
4351 canStatus CANLIBAPI kvGetApplicationMapping(int busType,
4352  char *appName,
4353  int appChannel,
4354  int *resultingChannel);
4355 
4377 canStatus CANLIBAPI kvBeep(const CanHandle hnd,
4378  int freq,
4379  unsigned int duration);
4380 
4400 canStatus CANLIBAPI kvSelfTest(const CanHandle hnd, unsigned long *presults);
4401 
4410 #define kvLED_ACTION_ALL_LEDS_ON 0
4411 #define kvLED_ACTION_ALL_LEDS_OFF 1
4412 #define kvLED_ACTION_LED_0_ON 2
4413 #define kvLED_ACTION_LED_0_OFF 3
4414 #define kvLED_ACTION_LED_1_ON 4
4415 #define kvLED_ACTION_LED_1_OFF 5
4416 #define kvLED_ACTION_LED_2_ON 6
4417 #define kvLED_ACTION_LED_2_OFF 7
4418 #define kvLED_ACTION_LED_3_ON 8
4419 #define kvLED_ACTION_LED_3_OFF 9
4420 #define kvLED_ACTION_LED_4_ON 10
4421 #define kvLED_ACTION_LED_4_OFF 11
4422 #define kvLED_ACTION_LED_5_ON 12
4423 #define kvLED_ACTION_LED_5_OFF 13
4424 #define kvLED_ACTION_LED_6_ON 14
4425 #define kvLED_ACTION_LED_6_OFF 15
4426 #define kvLED_ACTION_LED_7_ON 16
4427 #define kvLED_ACTION_LED_7_OFF 17
4428 #define kvLED_ACTION_LED_8_ON 18
4429 #define kvLED_ACTION_LED_8_OFF 19
4430 #define kvLED_ACTION_LED_9_ON 20
4431 #define kvLED_ACTION_LED_9_OFF 21
4432 #define kvLED_ACTION_LED_10_ON 22
4433 #define kvLED_ACTION_LED_10_OFF 23
4434 #define kvLED_ACTION_LED_11_ON 24
4435 #define kvLED_ACTION_LED_11_OFF 25
4436 
4437 
4460 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
4461 
4488 canStatus CANLIBAPI canRequestChipStatus(const CanHandle hnd);
4489 
4516 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
4517 
4523 typedef struct canBusStatistics_s {
4524  unsigned long stdData;
4525  unsigned long stdRemote;
4526  unsigned long extData;
4527  unsigned long extRemote;
4528  unsigned long errFrame;
4529 
4534  unsigned long busLoad;
4535  unsigned long overruns;
4537 
4560 canStatus CANLIBAPI canGetBusStatistics(const CanHandle hnd,
4561  canBusStatistics *stat,
4562  size_t bufsiz);
4563 
4584 canStatus CANLIBAPI canSetBitrate(const CanHandle hnd, int bitrate);
4585 
4603 canStatus CANLIBAPI kvAnnounceIdentity(const CanHandle hnd,
4604  void *buf,
4605  size_t bufsiz);
4606 
4627 canStatus CANLIBAPI kvAnnounceIdentityEx(const CanHandle hnd,
4628  int type,
4629  void *buf,
4630  size_t bufsiz);
4631 
4653 canStatus CANLIBAPI canGetHandleData(const CanHandle hnd,
4654  int item,
4655  void *buffer,
4656  size_t bufsize);
4657 
4659 typedef void *kvTimeDomain;
4660 
4663 
4668 typedef struct kvTimeDomainData_s {
4674 
4703 kvStatus CANLIBAPI kvTimeDomainCreate(kvTimeDomain *domain);
4704 
4727 kvStatus CANLIBAPI kvTimeDomainDelete(kvTimeDomain domain);
4728 
4754 kvStatus CANLIBAPI kvTimeDomainResetTime(kvTimeDomain domain);
4755 
4780 kvStatus CANLIBAPI kvTimeDomainGetData(kvTimeDomain domain,
4781  kvTimeDomainData *data,
4782  size_t bufsiz);
4783 
4806 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
4807  const CanHandle hnd);
4808 
4830 kvStatus CANLIBAPI kvTimeDomainRemoveHandle(kvTimeDomain domain,
4831  const CanHandle hnd);
4832 
4850 typedef void(__stdcall *kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent);
4884 kvStatus CANLIBAPI kvSetNotifyCallback(const CanHandle hnd,
4885  kvCallback_t callback,
4886  void *context,
4887  unsigned int notifyFlags);
4888 
4902 #define kvBUSTYPE_NONE 0
4903 
4908 #define kvBUSTYPE_PCI 1
4909 
4914 #define kvBUSTYPE_PCMCIA 2
4915 
4920 #define kvBUSTYPE_USB 3
4921 
4926 #define kvBUSTYPE_WLAN 4
4927 
4932 #define kvBUSTYPE_PCI_EXPRESS 5
4933 
4938 #define kvBUSTYPE_ISA 6
4939 
4944 #define kvBUSTYPE_VIRTUAL 7
4945 
4950 #define kvBUSTYPE_PC104_PLUS 8
4951 
4956 #define kvBUSTYPE_LAN 9
4957 
4973 #define kvBUSTYPE_GROUP_VIRTUAL 1
4974 
4979 #define kvBUSTYPE_GROUP_LOCAL 2
4980 
4985 #define kvBUSTYPE_GROUP_REMOTE 3
4986 
4990 #define kvBUSTYPE_GROUP_INTERNAL 4
4991 
5045 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo(int index,
5046  char *hwName,
5047  size_t nameLen,
5048  int *hwType,
5049  int *hwBusType);
5050 
5075 kvStatus CANLIBAPI kvReadDeviceCustomerData(const CanHandle hnd,
5076  int userNumber,
5077  int itemNumber,
5078  void *data,
5079  size_t bufsiz);
5080 
5094 #define kvENVVAR_TYPE_INT 1
5095 
5101 #define kvENVVAR_TYPE_FLOAT 2
5102 
5108 #define kvENVVAR_TYPE_STRING 3
5109 
5125 #define kvEVENT_TYPE_KEY 1
5126 
5134 typedef __int64 kvEnvHandle;
5135 
5155 kvStatus CANLIBAPI kvScriptStart(const CanHandle hnd, int slotNo);
5156 
5163 #define kvSCRIPT_STOP_NORMAL 0
5164 #define kvSCRIPT_STOP_FORCED -9
5188 kvStatus CANLIBAPI kvScriptStop(const CanHandle hnd, int slotNo, int mode);
5189 
5209 kvStatus CANLIBAPI kvScriptUnload(const CanHandle hnd, int slotNo);
5210 
5235 kvStatus CANLIBAPI kvScriptSendEvent(const CanHandle hnd,
5236  int slotNo,
5237  int eventType,
5238  int eventNo,
5239  unsigned int data);
5240 
5265 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen(const CanHandle hnd,
5266  const char *envvarName,
5267  int *envvarType,
5268  int *envvarSize); // returns scriptHandle
5269 
5287 kvStatus CANLIBAPI kvScriptEnvvarClose(kvEnvHandle eHnd);
5288 
5309 kvStatus CANLIBAPI kvScriptEnvvarSetInt(kvEnvHandle eHnd, int val);
5310 
5332 kvStatus CANLIBAPI kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val);
5333 
5356 kvStatus CANLIBAPI kvScriptEnvvarSetFloat(kvEnvHandle eHnd, float val);
5357 
5381 kvStatus CANLIBAPI kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val);
5382 
5409 kvStatus CANLIBAPI kvScriptEnvvarSetData(kvEnvHandle eHnd,
5410  const void *buf,
5411  int start_index,
5412  int data_len);
5413 
5439 kvStatus CANLIBAPI kvScriptEnvvarGetData(kvEnvHandle eHnd,
5440  void *buf,
5441  int start_index,
5442  int data_len);
5443 
5467 kvStatus CANLIBAPI kvScriptLoadFileOnDevice(const CanHandle hnd,
5468  int slotNo,
5469  char *localFile);
5470 
5499 kvStatus CANLIBAPI kvScriptLoadFile(const CanHandle hnd,
5500  int slotNo,
5501  char *filePathOnPC);
5502 
5503 
5517 #define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1
5518 
5522 #define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2
5523 
5527 #define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255
5528 
5552 kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd,
5553  unsigned int slot,
5554  unsigned int request);
5555 
5556 
5557 
5580 kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd,
5581  int *slot,
5582  unsigned long *time,
5583  unsigned int *flags,
5584  char *buf,
5585  size_t bufsize);
5586 
5593 #define kvSCRIPT_STATUS_LOADED 1
5594 #define kvSCRIPT_STATUS_RUNNING 2
5615 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
5616  int slot,
5617  unsigned int *status);
5618 
5619 
5638 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
5639 
5670 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
5671  int item,
5672  void *buffer,
5673  unsigned int *bufsize);
5674 
5700 #define canTXEDATA_FILE_VERSION 1
5701 
5717 #define canTXEDATA_COMPILER_VERSION 2
5718 
5737 #define canTXEDATA_DATE 3
5738 
5749 #define canTXEDATA_DESCRIPTION 4
5750 
5764 #define canTXEDATA_SOURCE 5
5765 
5775 #define canTXEDATA_SIZE_OF_CODE 6
5776 
5786 #define canTXEDATA_IS_ENCRYPTED 7
5787 
5788 
5815 kvStatus CANLIBAPI kvFileCopyToDevice(const CanHandle hnd,
5816  char *hostFileName,
5817  char *deviceFileName);
5818 
5841 kvStatus CANLIBAPI kvFileCopyFromDevice(const CanHandle hnd,
5842  char *deviceFileName,
5843  char *hostFileName);
5844 
5866 kvStatus CANLIBAPI kvFileDelete(const CanHandle hnd, char *deviceFileName);
5867 
5890 kvStatus CANLIBAPI kvFileGetName(const CanHandle hnd,
5891  int fileNo,
5892  char *name,
5893  int namelen);
5894 
5914 kvStatus CANLIBAPI kvFileGetCount(const CanHandle hnd, int *count);
5915 
5938 kvStatus CANLIBAPI kvFileGetSystemData(const CanHandle hnd,
5939  int itemCode,
5940  int *result);
5941 
5960 kvStatus CANLIBAPI kvFileDiskFormat(const CanHandle hnd);
5961 
5979 #define kvDEVICE_MODE_INTERFACE 0x00
5980 
5985 #define kvDEVICE_MODE_LOGGER 0x01
5986 
6011 kvStatus CANLIBAPI kvDeviceSetMode(const CanHandle hnd, int mode);
6012 
6035 kvStatus CANLIBAPI kvDeviceGetMode(const CanHandle hnd, int *result);
6036 
6037 
6055 kvStatus CANLIBAPI kvPingRequest(const CanHandle hnd,
6056  unsigned int *requestTime);
6057 
6075 kvStatus CANLIBAPI kvPingGetLatest(const CanHandle hnd,
6076  unsigned int *requestTime,
6077  unsigned int *pingTime);
6078 
6080 
6089 //
6090 //
6091 //
6092 #if defined(_CANEVT_H_)
6093 canStatus CANLIBAPI canReadEvent(const CanHandle hnd, CanEvent *event);
6094 #endif /* _CANEVT_H_ */
6095 
6097 void CANLIBAPI canSetDebug(int d);
6099 canStatus CANLIBAPI canSetNotifyEx(const CanHandle hnd,
6100  HANDLE event,
6101  unsigned int flags);
6103 canStatus CANLIBAPI canSetTimer(const CanHandle hnd,
6104  DWORD interval,
6105  DWORD flags);
6107 #define canTIMER_CYCLIC 0x01
6108 
6109 #define canTIMER_EXPENSIVE 0x02
6110 
6111 int CANLIBAPI canSplitHandle(CanHandle hnd, int channel);
6113 int CANLIBAPI canOpenMultiple(DWORD bitmask, int flags);
6115 
6145 kvStatus CANLIBAPI kvReadTimer(const CanHandle hnd, unsigned int *time);
6146 
6175 kvStatus CANLIBAPI kvReadTimer64(const CanHandle hnd, KVINT64 *time);
6176 
6193 #define kvIO_INFO_GET_MODULE_TYPE 1
6194 
6200 #define kvIO_INFO_GET_DIRECTION 2
6201 
6207 #define kvIO_INFO_GET_PIN_TYPE 4
6208 
6214 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
6215 
6223 #define kvIO_INFO_GET_RANGE_MIN 6
6224 
6232 #define kvIO_INFO_GET_RANGE_MAX 7
6233 
6241 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
6242 
6250 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
6251 
6259 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
6260 
6269 #define kvIO_INFO_GET_AI_HYSTERESIS 11
6270 
6276 #define kvIO_INFO_GET_MODULE_NUMBER 14
6277 
6283 #define kvIO_INFO_GET_SERIAL_NUMBER 15
6284 
6292 #define kvIO_INFO_GET_FW_VERSION 16
6293 
6314 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
6315 
6323 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
6324 
6332 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
6333 
6342 #define kvIO_INFO_SET_AI_HYSTERESIS 11
6343 
6360 #define kvIO_MODULE_TYPE_DIGITAL 1
6361 
6365 #define kvIO_MODULE_TYPE_ANALOG 2
6366 
6370 #define kvIO_MODULE_TYPE_RELAY 3
6371 
6375 #define kvIO_MODULE_TYPE_INTERNAL 4
6376 
6391 #define kvIO_PIN_TYPE_DIGITAL 1
6392 
6396 #define kvIO_PIN_TYPE_ANALOG 2
6397 
6401 #define kvIO_PIN_TYPE_RELAY 3
6402 
6417 #define kvIO_PIN_DIRECTION_IN 4
6418 
6422 #define kvIO_PIN_DIRECTION_OUT 8
6423 
6445 canStatus CANLIBAPI kvIoGetNumberOfPins(const CanHandle hnd, unsigned int *pinCount);
6446 
6463 canStatus CANLIBAPI kvIoConfirmConfig(const CanHandle hnd);
6464 
6484 canStatus CANLIBAPI kvIoPinGetInfo(const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
6485 
6505 canStatus CANLIBAPI kvIoPinSetInfo(const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
6506 
6524 canStatus CANLIBAPI kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value);
6525 
6545 canStatus CANLIBAPI kvIoPinGetDigital(const CanHandle hnd, unsigned int pin, unsigned int *value);
6546 
6568 canStatus CANLIBAPI kvIoPinGetOutputDigital(const CanHandle hnd, unsigned int pin, unsigned int *value);
6569 
6587 canStatus CANLIBAPI kvIoPinSetRelay(const CanHandle hnd, unsigned int pin, unsigned int value);
6588 
6608 canStatus CANLIBAPI kvIoPinGetOutputRelay(const CanHandle hnd, unsigned int pin, unsigned int *value);
6609 
6627 canStatus CANLIBAPI kvIoPinSetAnalog(const CanHandle hnd, unsigned int pin, float value);
6628 
6646 canStatus CANLIBAPI kvIoPinGetAnalog(const CanHandle hnd, unsigned int pin, float *value);
6647 
6667 canStatus CANLIBAPI kvIoPinGetOutputAnalog(const CanHandle hnd, unsigned int pin, float *value);
6668 
6674 typedef struct {
6675  int type;
6676  unsigned char DO1 : 1;
6677  unsigned char DO2 : 1;
6678  unsigned char DO3 : 1;
6679  unsigned char DO4 : 1;
6680  unsigned char DO5 : 1;
6681  unsigned char DO6 : 1;
6682  unsigned char DO7 : 1;
6683  unsigned char DO8 : 1;
6684  unsigned char DO9 : 1;
6685  unsigned char DO10: 1;
6686  unsigned char DO11: 1;
6687  unsigned char DO12: 1;
6688  unsigned char DO13: 1;
6689  unsigned char DO14: 1;
6690  unsigned char DO15: 1;
6691  unsigned char DO16: 1;
6692  unsigned char DI1 : 1;
6693  unsigned char DI2 : 1;
6694  unsigned char DI3 : 1;
6695  unsigned char DI4 : 1;
6696  unsigned char DI5 : 1;
6697  unsigned char DI6 : 1;
6698  unsigned char DI7 : 1;
6699  unsigned char DI8 : 1;
6700  unsigned char DI9 : 1;
6701  unsigned char DI10: 1;
6702  unsigned char DI11: 1;
6703  unsigned char DI12: 1;
6704  unsigned char DI13: 1;
6705  unsigned char DI14: 1;
6706  unsigned char DI15: 1;
6707  unsigned char DI16: 1;
6709 
6710 
6716 typedef struct {
6717  int type;
6718  unsigned char DO: 1;
6719  unsigned char DI: 1;
6721 
6722 
6729 typedef struct {
6730  int type;
6731  unsigned char RO1 : 1;
6732  unsigned char RO2 : 1;
6733  unsigned char RO3 : 1;
6734  unsigned char RO4 : 1;
6735  unsigned char RO5 : 1;
6736  unsigned char RO6 : 1;
6737  unsigned char RO7 : 1;
6738  unsigned char RO8 : 1;
6739  unsigned char DI1 : 1;
6740  unsigned char DI2 : 1;
6741  unsigned char DI3 : 1;
6742  unsigned char DI4 : 1;
6743  unsigned char DI5 : 1;
6744  unsigned char DI6 : 1;
6745  unsigned char DI7 : 1;
6746  unsigned char DI8 : 1;
6747 } kvIoModuleRelay;
6748 
6755 typedef struct {
6756  int type;
6757  float AO1;
6758  float AO2;
6759  float AO3;
6760  float AO4;
6761  float AI1;
6762  float AI2;
6763  float AI3;
6764  float AI4;
6766 
6767 
6790 canStatus CANLIBAPI kvIoGetModulePins(const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize);
6791 
6792 
6816 canStatus CANLIBAPI kvIoSetModulePins(const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize);
6817 
6818 
6819 #ifdef __cplusplus
6820 }
6821 #endif /* __cplusplus */
6822 
6823 #include "obsolete.h"
6824 
6825 #endif /* _CANLIB_H_ */
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const int hnd)
unsigned long stdData
Number of received standard (11-bit identifiers) data frames.
Definition: canlib.h:4524
canStatus canSetBusParamsFdTq(const int hnd, const kvBusParamsTq arbitration, const kvBusParamsTq data)
kvStatus kvScriptEnvvarGetData(kvEnvHandle eHnd, void *buf, int start_index, int data_len)
canStatus canParamGetChannelNumber(int index)
kvBusParamsTq arbitration_max
Definition: canlib.h:2404
canStatus canBusOn(const int hnd)
unsigned char DO
Definition: canlib.h:6718
canStatus kvBeep(const int hnd, int freq, unsigned int duration)
canStatus canSetDriverMode(const int hnd, int lineMode, int resNet)
kvStatus kvScriptSendEvent(const int hnd, int slotNo, int eventType, int eventNo, unsigned int data)
unsigned char RO6
Definition: canlib.h:6736
kvBusParamsTq data_min
Definition: canlib.h:2405
int version
Definition: canlib.h:2380
canStatus canClose(const int hnd)
kvBusParamsTq arbitration_min
Definition: canlib.h:2403
canStatus kvBitrateToBusParamsFdTq(const canHandle hnd, int freqA, int freqD, kvBusParamsTq *arbitration, kvBusParamsTq *data)
kvStatus kvFileGetName(const int hnd, int fileNo, char *name, int namelen)
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:4671
kvStatus kvPingRequest(const int hnd, unsigned int *requestTime)
kvStatus kvReadTimer64(const int hnd, int64_t *time)
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:4527
struct canBusStatistics_s canBusStatistics
unsigned char DO3
Definition: canlib.h:6678
canStatus canFlushReceiveQueue(const int hnd)
canStatus canBusOff(const int hnd)
int tq
Definition: canlib.h:632
canStatus canEnumHardwareEx(int *channelCount)
canStatus canGetBusParams(const int hnd, long *freq, unsigned int *tseg1, unsigned int *tseg2, unsigned int *sjw, unsigned int *noSamp, unsigned int *syncmode)
canStatus kvGetApplicationMapping(int busType, char *appName, int appChannel, int *resultingChannel)
int sjw
Definition: canlib.h:635
unsigned char DO11
Definition: canlib.h:6686
canStatus canObjBufFreeAll(const int hnd)
canStatus canGetNumberOfChannels(int *channelCount)
unsigned char DI10
Definition: canlib.h:6701
canStatus canParamFindByName(const char *name)
int nMagiSyncedMembers
number of MagiSync™ members
Definition: canlib.h:4670
int phase2
Definition: canlib.h:634
canStatus kvIoPinSetInfo(const int hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize)
kvStatus kvFileGetCount(const int hnd, int *count)
canStatus canSetAcceptanceFilter(const int hnd, unsigned int code, unsigned int mask, int is_extended)
kvStatus kvScriptEnvvarClose(kvEnvHandle eHnd)
kvStatus kvScriptEnvvarSetInt(kvEnvHandle eHnd, int val)
kvStatus kvDeviceGetMode(const int hnd, int *result)
unsigned int canGetVersionEx(unsigned int itemCode)
canStatus kvStatus
Definition: canlib.h:4662
Definitions which are retained for compatibility.
canStatus canObjBufAllocate(const int hnd, int type)
unsigned long extData
Number of received extended (29-bit identifiers) data frames.
Definition: canlib.h:4526
unsigned char DO5
Definition: canlib.h:6680
canStatus kvIoPinGetOutputAnalog(const int hnd, unsigned int pin, float *value)
canStatus canTranslateBaud(long *const freq, unsigned int *const tseg1, unsigned int *const tseg2, unsigned int *const sjw, unsigned int *const nosamp, unsigned int *const syncMode)
canStatus canWriteWait(const int hnd, long id, void *msg, unsigned int dlc, unsigned int flag, unsigned long timeout)
canStatus
Definition: canstat.h:34
unsigned char DO12
Definition: canlib.h:6687
kvStatus kvFileDelete(const int hnd, char *deviceFileName)
unsigned char DI13
Definition: canlib.h:6704
kvStatus kvTimeDomainDelete(kvTimeDomain domain)
unsigned char RO5
Definition: canlib.h:6735
unsigned char RO7
Definition: canlib.h:6737
canStatus canReadErrorCounters(const int hnd, unsigned int *txErr, unsigned int *rxErr, unsigned int *ovErr)
kvStatus kvPingGetLatest(const int hnd, unsigned int *requestTime, unsigned int *pingTime)
kvEnvHandle kvScriptEnvvarOpen(const int hnd, const char *envvarName, int *envvarType, int *envvarSize)
canStatus canParamSwapEntries(int index1, int index2)
canStatus canSetNotify(const int hnd, HWND aHWnd, unsigned int aNotifyFlags)
canStatus canResetBus(const int hnd)
void(__stdcall * kvCallback_t)(int hnd, void *context, unsigned int notifyEvent)
Definition: canlib.h:4850
canStatus kvIoPinGetOutputDigital(const int hnd, unsigned int pin, unsigned int *value)
canStatus canObjBufSetMsgCount(const int hnd, int idx, unsigned int count)
#define CanHandle
Definition: canlib.h:123
unsigned char DI11
Definition: canlib.h:6702
unsigned char DI
Definition: canlib.h:6719
canStatus canRead(const int hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
canStatus canSetBitrate(const int hnd, int bitrate)
canStatus canGetHandleData(const int hnd, int item, void *buffer, size_t bufsize)
canStatus canReadSpecific(const int hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
unsigned char RO4
Definition: canlib.h:6734
canStatus canWriteSync(const int hnd, unsigned long timeout)
unsigned char DI15
Definition: canlib.h:6706
Definition: canlib.h:4523
float AI1
Definition: canlib.h:6761
BOOL canProbeVersion(const int hnd, int major, int minor, int oem_id, unsigned int flags)
kvStatus kvScriptEnvvarSetData(kvEnvHandle eHnd, const void *buf, int start_index, int data_len)
canStatus canSetBusParams(const int hnd, long freq, unsigned int tseg1, unsigned int tseg2, unsigned int sjw, unsigned int noSamp, unsigned int syncmode)
unsigned char DI8
Definition: canlib.h:6699
unsigned char DO2
Definition: canlib.h:6677
canStatus canAccept(const int hnd, const long envelope, const unsigned int flag)
canStatus canIoCtl(const int hnd, unsigned int func, void *buf, unsigned int buflen)
unsigned short canGetVersion(void)
unsigned char RO3
Definition: canlib.h:6733
kvStatus kvReadTimer(const int hnd, unsigned int *time)
unsigned char DO9
Definition: canlib.h:6684
kvStatus kvScriptLoadFile(const int hnd, int slotNo, char *filePathOnPC)
canStatus canGetBusParamsFdTq(const int hnd, kvBusParamsTq *nominal, kvBusParamsTq *data)
kvStatus kvTimeDomainGetData(kvTimeDomain domain, kvTimeDomainData *data, size_t bufsiz)
kvStatus kvTimeDomainCreate(kvTimeDomain *domain)
unsigned int portValue
Port value used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3191
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:4669
Definition: canlib.h:2401
canStatus canReadStatus(const int hnd, unsigned long *const flags)
int accuracy_ppm
Definition: canlib.h:2384
unsigned char DI14
Definition: canlib.h:6705
canStatus canGetBusParamsTq(const int hnd, kvBusParamsTq *nominal)
float AI3
Definition: canlib.h:6763
canStatus canRequestChipStatus(const int hnd)
canStatus kvIoConfirmConfig(const int hnd)
unsigned char RO1
Definition: canlib.h:6731
Definition: canlib.h:6729
kvStatus kvReadDeviceCustomerData(const int hnd, int userNumber, int itemNumber, void *data, size_t bufsiz)
canStatus kvIoPinSetRelay(const int hnd, unsigned int pin, unsigned int value)
__int64 kvEnvHandle
Definition: canlib.h:5134
kvStatus kvScriptTxeGetData(const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize)
unsigned char DI7
Definition: canlib.h:6698
canStatus canParamGetBusParams(int index, long *bitrate, unsigned int *tseg1, unsigned int *tseg2, unsigned int *sjw, unsigned int *noSamp)
struct kvTimeDomainData_s kvTimeDomainData
int prescaler
Definition: canlib.h:637
unsigned char DO4
Definition: canlib.h:6679
canStatus kvIoGetNumberOfPins(const int hnd, unsigned int *pinCount)
float AO2
Definition: canlib.h:6758
kvStatus kvFileCopyFromDevice(const int hnd, char *deviceFileName, char *hostFileName)
kvStatus kvFileCopyToDevice(const int hnd, char *hostFileName, char *deviceFileName)
float AI2
Definition: canlib.h:6762
kvStatus kvGetSupportedInterfaceInfo(int index, char *hwName, size_t nameLen, int *hwType, int *hwBusType)
canStatus canReadSpecificSkip(const int hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
canStatus canGetBusParamsFd(const int hnd, long *freq_brs, unsigned int *tseg1_brs, unsigned int *tseg2_brs, unsigned int *sjw_brs)
int denominator
Definition: canlib.h:2382
kvStatus kvFileDiskFormat(const int hnd)
canStatus kvIoPinSetDigital(const int hnd, unsigned int pin, unsigned int value)
Definition: canlib.h:3189
unsigned long errFrame
Number of error frames.
Definition: canlib.h:4528
kvStatus kvDeviceSetMode(const int hnd, int mode)
int type
Definition: canlib.h:6675
canStatus canReadWait(const int hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time, unsigned long timeout)
int power_of_ten
Definition: canlib.h:2383
unsigned long busLoad
Definition: canlib.h:4534
Definition: canlib.h:6755
int phase1
Definition: canlib.h:633
kvStatus kvScriptUnload(const int hnd, int slotNo)
canStatus canParamCommitChanges(void)
float AO4
Definition: canlib.h:6760
canStatus kvIoPinGetInfo(const int hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize)
struct kvBusParamLimits kvBusParamLimits
canStatus canObjBufSendBurst(const int hnd, int idx, unsigned int burstlen)
unsigned char DO1
Definition: canlib.h:6676
canStatus canRequestBusStatistics(const int hnd)
kvStatus kvSetNotifyCallback(const int hnd, kvCallback_t callback, void *context, unsigned int notifyFlags)
struct kvClockInfo kvClockInfo
canStatus canGetDriverMode(const int hnd, int *lineMode, int *resNet)
kvStatus kvScriptGetText(const int hnd, int *slot, unsigned long *time, unsigned int *flags, char *buf, size_t bufsize)
float AO1
Definition: canlib.h:6757
canStatus canReadSync(const int hnd, unsigned long timeout)
struct kvBusParamsTq kvBusParamsTq
kvStatus kvTimeDomainRemoveHandle(kvTimeDomain domain, const int hnd)
canStatus canFlushTransmitQueue(const int hnd)
canStatus canParamGetCount(void)
unsigned char DI4
Definition: canlib.h:6695
canStatus canReadSyncSpecific(const int hnd, long id, unsigned long timeout)
int nNonMagiSyncedMembers
number of non MagiSync™ members
Definition: canlib.h:4672
canStatus kvIoSetModulePins(const int hnd, unsigned int module, const void *buffer, const unsigned int bufsize)
unsigned char RO8
Definition: canlib.h:6738
unsigned char DI2
Definition: canlib.h:6693
canStatus canUnloadLibrary(void)
Definitions for the CANLIB API.
canStatus kvSelfTest(const int hnd, unsigned long *presults)
canStatus canSetBusParamsC200(const int hnd, unsigned char btr0, unsigned char btr1)
canStatus canParamSetName(int index, const char *buffer)
canStatus canWaitForEvent(const int hnd, DWORD timeout)
canStatus canParamSetBusParams(int index, long bitrate, unsigned int tseg1, unsigned int tseg2, unsigned int sjw, unsigned int noSamp)
unsigned char DO7
Definition: canlib.h:6682
unsigned char DO13
Definition: canlib.h:6688
float AI4
Definition: canlib.h:6764
canStatus kvIoPinGetOutputRelay(const int hnd, unsigned int pin, unsigned int *value)
unsigned char DI3
Definition: canlib.h:6694
canStatus canObjBufSetFlags(const int hnd, int idx, unsigned int flags)
int prop
Definition: canlib.h:636
canStatus canSetBusOutputControl(const int hnd, const unsigned int drivertype)
unsigned char RO2
Definition: canlib.h:6732
Definition: canlib.h:6716
canStatus canObjBufEnable(const int hnd, int idx)
Definition: canlib.h:4668
canStatus kvFlashLeds(const int hnd, int action, int timeout)
Definition: canlib.h:2379
canStatus kvAnnounceIdentity(const int hnd, void *buf, size_t bufsiz)
Definition: canlib.h:631
canStatus kvIoGetModulePins(const int hnd, unsigned int module, void *buffer, const unsigned int bufsize)
unsigned char DO10
Definition: canlib.h:6685
unsigned char DI16
Definition: canlib.h:6707
unsigned char DO14
Definition: canlib.h:6689
unsigned char DI12
Definition: canlib.h:6703
canStatus canWrite(const int hnd, long id, void *msg, unsigned int dlc, unsigned int flag)
canStatus canParamGetName(int index, char *buffer, int maxlen)
void canInitializeLibrary(void)
canStatus canGetBusStatistics(const int hnd, canBusStatistics *stat, size_t bufsiz)
unsigned long canReadTimer(const int hnd)
canStatus kvBitrateToBusParamsTq(const canHandle hnd, int freq, kvBusParamsTq *nominal)
unsigned long overruns
The number of overruns detected by the hardware, firmware or driver.
Definition: canlib.h:4535
kvStatus kvFileGetSystemData(const int hnd, int itemCode, int *result)
kvBusParamsTq data_max
Definition: canlib.h:2406
kvStatus kvScriptLoadFileOnDevice(const int hnd, int slotNo, char *localFile)
canStatus canSetBusParamsFd(const int hnd, long freq_brs, unsigned int tseg1_brs, unsigned int tseg2_brs, unsigned int sjw_brs)
canStatus kvIoPinSetAnalog(const int hnd, unsigned int pin, float value)
canStatus kvAnnounceIdentityEx(const int hnd, int type, void *buf, size_t bufsiz)
kvStatus kvScriptStart(const int hnd, int slotNo)
kvStatus kvTimeDomainResetTime(kvTimeDomain domain)
canStatus kvIoPinGetDigital(const int hnd, unsigned int pin, unsigned int *value)
canStatus canParamSetChannelNumber(int index, int channel)
int canOpenChannel(int channel, int flags)
canStatus kvIoPinGetAnalog(const int hnd, unsigned int pin, float *value)
unsigned char DI1
Definition: canlib.h:6692
unsigned char DO15
Definition: canlib.h:6690
canStatus canObjBufSetPeriod(const int hnd, int idx, unsigned int period)
unsigned char DO6
Definition: canlib.h:6681
Definition: canlib.h:6674
canStatus canGetBusOutputControl(const int hnd, unsigned int *drivertype)
float AO3
Definition: canlib.h:6759
unsigned long stdRemote
Number of received standard (11-bit identifiers) remote frames.
Definition: canlib.h:4525
unsigned char DI9
Definition: canlib.h:6700
kvStatus kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize)
kvStatus kvScriptRequestText(const int hnd, unsigned int slot, unsigned int request)
unsigned char DO8
Definition: canlib.h:6683
unsigned char DO16
Definition: canlib.h:6691
unsigned char DI6
Definition: canlib.h:6697
kvStatus kvScriptEnvvarSetFloat(kvEnvHandle eHnd, float val)
canStatus canGetErrorText(canStatus err, char *buf, unsigned int bufsiz)
canStatus canParamDeleteEntry(int index)
void * kvTimeDomain
Definition: canlib.h:4659
int numerator
Definition: canlib.h:2381
unsigned int portNo
Port number used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3190
unsigned char DI5
Definition: canlib.h:6696
int canHandle
Definition: canlib.h:118
canStatus canObjBufDisable(const int hnd, int idx)
canStatus canObjBufWrite(const int hnd, int idx, int id, void *msg, unsigned int dlc, unsigned int flags)
canStatus canParamCreateNewEntry(void)
kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val)
canStatus canSetBusParamsTq(const int hnd, const kvBusParamsTq nominal)
canStatus canObjBufSetFilter(const int hnd, int idx, unsigned int code, unsigned int mask)
kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val)