Sys Tec Electronic USB-CANmodul Скачать руководство пользователя страница 53

Software

                                                                                                                                                

                                                                                                                                                

 SYS TEC electronic GmbH 2001     L-487e_6

51

3.2.3

 

Error Codes of the Functions

The functions of the USBCAN32.DLL return an error code with the
type of a BYTE.  Each return value represents an error.  The only
exception is the function UcanReadCanMsg () which can also return
warnings.  The warning USBCAN_WARN_NODATA indicates that no
CAN messages are in the buffer.  Other warnings show the calling
function that an event has occurred but a valid CAN message is
transferred.

All possible return codes for the functions of the USBCAN32.DLL
are listed below:

USBCAN_SUCCESSFUL

Value: 0x00

Description:
This message returns if the function is executed successfully.

USBCAN_ERR_RESOURCE

Value: 0x01

Description:
This error message returns if one resource could not be
generated. In this case the term resource means memory and
handles provided by Windows.

Содержание USB-CANmodul

Страница 1: ...A Product of PHYTEC Technologie Holding AG USB CANmodul Systems Manual Edition March 2001 ...

Страница 2: ...bH offers no guarantee nor accepts any liability for damages arising from the improper usage or improper installation of the hardware or software SYS TEC electronic GmbH further reserves the right to alter the layout and or design of the hardware without prior notification and accepts no liability for doing so Copyright 2001 SYS TEC electronic GmbH D 07973 Greiz Thueringen Rights including those o...

Страница 3: ...ection to a CAN Network 13 2 1 6 Starting PCANView USBCAN 14 2 2 Status LEDs on the USB CANmodul 17 2 3 CAN Supply Voltage 17 3 Software Support 21 3 1 Tools for the USB CANmodul 21 3 1 1 UCAN Config for Windows 21 3 1 2 PCANView USBCAN for Windows 24 3 2 Dynamic Linked Library 29 3 2 1 The Attributes of the USBCAN32 DLL 29 3 2 2 Functions of the USBCAN32 DLL 32 3 2 3 Error Codes of the Functions ...

Страница 4: ...er Configuration 15 Figure 6 PCANView USBCAN Main Window 16 Figure 7 Location and Numbering of the Jumpers 18 Figure 8 UCAN Config Utility 22 Figure 9 Dialog Box with Hardware Configuration 24 Figure 10 Dialog Box Message Filter Configuration 25 Figure 11 PCANView USBCAN with Messages 26 Figure 12 Software State Diagram 30 Table 1 States of the LEDs on the USB CANmodul 17 Table 2 Pinout of the DB ...

Страница 5: ...C products are designed for installation in electrical appliances or as dedicated Evaluation Boards i e for use as a test and prototype platform for hardware software development in laboratory environments Note PHYTEC products lacking protective enclosures are subject to dam age by Electro Static Discharge ESD and hence may only be unpacked handled or operated in environments in which sufficient p...

Страница 6: ...stablishment of conformity to and certification of Electro Magnetic Directives Only after doing so the devices are allowed to be put into circulation PHYTEC s microcontroller modules allow engineers to shorten devel opment horizons reduce design costs and speed project concepts from design to market Please contact PHYTEC for additional information EUROPE NORTH AMERICA Address SYS TEC electronic Gm...

Страница 7: ...portal from a host PC to a CAN network Connecting the USB CANmodul to the host PC is simple The included USB cable supports the two types of USB connectors type A and type B The type A plug connects to the host computer or an upstream hub Type B plug connects downstream to the USB CANmodul The USB interface enables data transfer with a rate of up to 12 MBit s With a uniform connector for all devic...

Страница 8: ...ion tool for Windows enables connectivity and management of more than one device on the USB bus This USB network is configured using device numbers which are assigned by the user and are stored in an EEPROM The functions for data exchange with the USB CAN application are available through a DLL Dynamic Linked Library The enclosed demo program shows the easy handling of the DLL functions A host PC ...

Страница 9: ...USB bus 100mA in operating mode Transmission type Bulk 12MBit s Power and Status LED Case size 120 x 60 x 30 L x W x H in mm Operating temperature 0 C 55 C Conforms to CE standard Software Support Kernel Mode driver for Windows 98 2000 USBCANLD SYS for easy firmware download to the USB CANmodul USBCAN SYS supports the various functions of the USB CANmodul User Mode driver for Windows 98 2000 USBCA...

Страница 10: ...USB CANmodul 8 SYS TEC electronic GmbH 2001 L 487e_6 ...

Страница 11: ... discs Systems Manual printed or as electronic version on the installation discs USB cable 2 1 1 Software Installation Note Install the software before connecting the USB CANmodul to the host PC Installation and operation of the USB CANmodul requires a host PC with a USB port that is running Microsoft Windows 98 or Windows 2000 The USB CANmodul will not work under Windows NT because there is no US...

Страница 12: ...ple Start the host PC Connect the USB CANmodul to your computer using the included USB cable Windows automatically detects the USB CANmodul A window with the message Unknown device appears Then the operating system automatically searches for the appropriate driver The firmware will now be downloaded to the USB CANmodul The red status LED blinks with a frequency of 10 hertz to indicate this procedu...

Страница 13: ... on the desktop and click the right mouse key A pop up menu appears Click on Properties The dialog box System Properties appears Choose the tab Device Manager at the top Click on the pull down menu Universal Serial Bus Controller If the device Systec USB CANmodul usbcan sys is shown in the list the new USB device has been detected properly This is shown in the figure below Figure 1 Device Manager ...

Страница 14: ...identifies the individual USB CANmodul Start the configuration utility using the Windows Start button and browse to Programs USB CANmodul Utilities UCAN Config This utility lists the USB CANmodul s by serial number and device number The device number is set to zero by the manufacturer It is not necessary to change this value if only using one USB CANmodul We recommend to accept the default value f...

Страница 15: ...pin 7 is required to ensure proper signal transmission The default setting of the USB CANmodul at time of delivery configures the CAN transceiver to operate optically isolated For this reason the power for the CAN transceiver has to be supplied via the CAN bus This requires that the CAN cable consists of a power line with a supply voltage in the range between 7 and 13V Compare the pinout of the DB...

Страница 16: ...mmended that you drag the PCANView USBCAN icon onto the desktop of your PC This enables easy start of this utility program by double clicking on the icon The USB CANmodul window will appear Figure 4 Dialog Box with Hardware Configuration Select the baudrate of your CAN network in the Baudrate box and the Device Number The entry any selects the USB CANmodul that is found first by Windows Click on t...

Страница 17: ... Figure 5 Dialog Box Message Filter Configuration In this message box you can select Standard 11 bit or Extended 29 bit CAN identifier and message filters if desired Click on the OK button to enable these settings The PCANView USBCAN main window will appear ...

Страница 18: ...n is divided into two sections Receive and Transmit Receive monitors CAN signals that are received from a node Transmit monitors CAN signals sent from the host PC to the CAN network via the USB CANmodul Refer to section 3 1 2 for complete and detailed description of the PCANView USBCAN utility program ...

Страница 19: ...es on off CAN is initialized no error yes on Blinking at 2 Hz An error occurred on the USB CANmodul Table 1 States of the LEDs on the USB CANmodul 2 3 CAN Supply Voltage The default setting for the CAN supply voltage is optically isolated The voltage for the CAN transceiver and the opto coupler must be supplied via the CAN cable A voltage in the range between 7V and 13V is recommended The pin assi...

Страница 20: ...nge between CAN power supply via USB or via the CAN bus two insertable jumpers are available on the USB CANmodul Remove the four screws on the bottom of the module and remove the upper part of the case carefully to configure the required jumpers Figure 7 shows the position and the numbering of both jumpers Table 3 describes the two configuration options Note Only open the device when the USB CANmo...

Страница 21: ...Started SYS TEC electronic GmbH 2001 L 487e_6 19 JP1 JP2 CAN Power Supply 1 2 1 2 Via CAN bus pin 3 and 9 2 3 2 3 Via USB bus Other settings are not allowed Table 3 Configuration of the CAN Power Supply Jumpers ...

Страница 22: ...USB CANmodul 20 SYS TEC electronic GmbH 2001 L 487e_6 ...

Страница 23: ... the serial number and device number Identification Module number Number of the USB CANmodul This is the number Windows assigns and uses to configure the module Serial number Barcode number sticker on the module Device number Number of the USB CANmodul identifies the modules for application purposes This number is stored in the EEPROM of the device and is transferred before the initialization with...

Страница 24: ...o the USB CANmodul Invalid values will be recognized by the program and not be accepted A Warning message box will appear if more than one module has an identical device number This is not an error however the application always uses the first module with the device number This means if two modules with the same device number are present the one connected first or registered first through Windows ...

Страница 25: ...2001 L 487e_6 23 While this utility is running you can add more USB CANmoduls The program will recognize the USB CANmodul and you can update the module list by pressing the refresh button To exit the UCAN Config utility click on Close ...

Страница 26: ...SBCAN It is recommended that you drag the PCANView USBCAN icon onto the desktop of your PC This enables easy start of this utility program by double clicking on the icon The USB CANmodul window will appear Figure 9 Dialog Box with Hardware Configuration Select the baudrate of your CAN network in the Baudrate box and the Device Number The entry any selects the USB CANmodul that is found first by Wi...

Страница 27: ...ure 10 Dialog Box Message Filter Configuration In this message box you can select Standard 11 bit or Extended 29 bit CAN identifier and message filters if desired Click on the OK button to enable these settings The PCANView USBCAN main window will appear ...

Страница 28: ...ion provides the following information Message identifier of the CAN message hexadecimal format ranging from 0 to 7FFh for 11 bit identifiers and from 0 to 1FFFFFFFh for 29 bit identifiers Length data length code of the message ranges from 0 to 8 Data values of the messages data bytes up to 8 or the text Remote request if a remote frame has been received Period period of time between the reception...

Страница 29: ...n the last two message sent Note If at creation of the message the period was set to 0 the text Wait is shown In this case the message can only be transmitted manually using the Space bar Or the message is sent automatically after a matching remote frame has been received Count number of messages sent with this identifier no remote frames since last user reset Trigger reason for the last transmiss...

Страница 30: ...bH 2001 L 487e_6 the transmit list Transmit Edit Edit the currently selected message Transmit Clear all Delete the entire transmit list Program Reset Reset the message counters and reset the connected USB CANmodul Deletes the receive list ...

Страница 31: ...ect load the DLL manually with the Windows function LoadLibrary and add the library functions with the function GetProcAdress The STDCALL calling convention of the DLL functions provides a standardized interface to the user This standard interface ensures that users of other programming languages than C C Pascal etc are able to use these functions The file DEMO API contains an example program writ...

Страница 32: ...N messages in this state If the application software calls the library function UcanInitCan the state changes into CAN_INIT In this state it is possible to transmit or to receive CAN messages Return with the library function UcanDeinitCan into the state HW_INIT and with the library function UcanDeinitHardware into the state DLL_INIT It is possible to close the application program only after this s...

Страница 33: ...onsidered for each USB CANmodul that is used If the first USB CANmodul is in the state CAN_INIT the second one can still be in the DLL_INIT state State Functions DLL_INIT UcanGetVersion UcanInitHwConnectControl UcanInitHardware UcanDeinitHwConnectControl HW_INIT UcanGetVersion UcanGetHardwareInfo UcanGetStatus UcanInitCan UcanDeinitHardware CAN_INIT UcanGetVersion UcanGetHardwareInfo UcanGetStatus...

Страница 34: ... the parameters of each function the possible error codes are shown UcanGetVersion Syntax DWORD STDCALL UcanGetVersion void Usability DLL_INIT HW_INIT CAN_INIT Description Returns the software version number of the USBCAN32 DLL Parameter Return value Software version number as DWORD with the following format Bit 0 to 3 least significant digits of the version number in binary format Bit 4 to 7 most...

Страница 35: ...ability DLL_INIT Parameter fpConnectControlFkt_p Address to the callback function that has to be called if a new USB CANmodul is connected or disconnected This address may not be zero Return value Error code of the function USBCAN_SUCCESSFUL USBCAN_ERR_RESOURCE Description Initializes the supervision for recently connected USB CANmoduls If a new module is connected to the PC the callback function ...

Страница 36: ...void Usability DLL_INIT Return value Error code of the function USBCAN_SUCCESSFUL Description This function finishes the supervision of the recently connected or disconnected USB CANmoduls This function must be called after the function UcanInitHwConnectControl was called within an application and before closing this application ...

Страница 37: ...Y_MODULE 255 makes sure that the first allocated USB CANmodul is used fpCallbackFkt_p Address to the callback function of this USB CANmodul This value can be ZERO The callback function will not be called if corresponding events appear This address can also be same as one that is already used from other USB CANmoduls because the callback function contains the associated USB CAN Handle Return value ...

Страница 38: ...ctions as they are defined in Table 4 can be called If the function was executed successfully the function transfers a USB CAN handle to the variable pUcabHandle_p Other functions have to be called with this handle Example BYTE bRet tUcanHandle UcanHandle initializes a USB CANmodul without callback function bRet UcanInitHardware UcanHandle USBCAN_ANY_MODULE NULL ...

Страница 39: ...e function USBCAN_SUCCESSFUL USBCAN_ERR_MAXINSTANCES USBCAN_ERR_ILLHANDLE Description Shuts down an initialized USB CANmodul The software returns to the state DLL_INIT After the function call the USB CAN handle is not valid That means execution of the valid functions see Table 4 for HW_INIT is no longer possible Note This function has to be called before closing the application otherwise other app...

Страница 40: ...d rate register 1 refer to SJA1000 data sheet dwAMR_p Acceptance Mask Register dwACR_p Acceptance Code Register Return values Error code of the function USBCAN_SUCCESSFUL USBCAN_ERR_MAXINSTANCES USBCAN_ERR_ILLHANDLE USBCAN_ERR_RESOURCE USBCAN_ERR_BUSY USBCAN_ERR_IOFAILED USBCAN_ERRCMD_NOTEQU USBCAN_ERRCMD_REGTST USBCAN_ERRCMD_ILLCMD Description Initializes the CAN interface of a USB CANmodul The s...

Страница 41: ...with the function UcanInitHardware Return value Error code of the function USBCAN_SUCCESSFUL USBCAN_ERR_MAXINSTANCES USBCAN_ERR_ILLHANDLE USBCAN_ERR_CANNOTINIT USBCAN_ERR_BUSY USBCAN_ERR_IOFAILED USBCAN_ERRCMD_NOTEQU USBCAN_ERRCMD_ILLCMD Description Resets the CAN controller in the USB CANmodul and erases the CAN message buffer This function needs to be called if a BUSOFF event occurred ...

Страница 42: ...alue Error code of the function USBCAN_SUCCESSFUL USBCAN_ERR_MAXINSTANCES USBCAN_ERR_ILLHANDLE USBCAN_ERR_CANNOTINIT USBCAN_ERR_BUSY USBCAN_ERR_IOFAILED USBCAN_ERRCMD_NOTEQU USBCAN_ERRCMD_ILLCMD Description Shuts down the CAN interface of a USB CANmodul This function sets the operating voltage of the CAN controller to 0 V After calling this function all CAN messages transferred on the CAN bus are ...

Страница 43: ...Address to the hardware information structure typedef struct BYTE m_bDeviceNr Device number TUcanHandle m_UcanHandle USB CAN handle DWORD m_dwReserved reserved BYTE m_bBTR0 Baud Rate Register 0 BYTE m_bBTR1 Baud Rate Register 1 BYTE m_bOCR Output Control Register DWORD m_dwAMR Acceptance Mask Register DWORD m_dwACR Acceptance Code Register tUcanHardwareInfo Return value Error code of the function ...

Страница 44: ...Afterwards the hardware information contains the device number of the initialized USB CANmodul Example BYTE bRet tUcanHandle UcanHandle tUcanHardwareInfo HwInfo char szDeviceNr 24 initialize USB CANmodul bRet UcanInitHardware UcanHandle USBCAN_ANY_MODULE NULL no error if bRet get hardware information UcanGetHardwareInfo UcanHandle HwInfo change the device number into a string wsprintf szDeviceNr d...

Страница 45: ...atus of the USB CANmodul typedef struct WORD m_wCanStatus present CAN status WORD m_wUsbStatus present USB status tStatusStruct Return values Error code of the function USBCAN_SUCCESSFUL USBCAN_ERR_MAXINSTANCES USBCAN_ERR_ILLHANDLE USBCAN_ERR_ILLPARAM The WORD m wCanStatus found in the tStatusStruct structure returns the following values USBCAN_CANERR_OK 0x0000 No error USBCAN_CANERR_XMTFULL 0x000...

Страница 46: ...troller not found hardware error This WORD is bit oriented it can register multiple errors simultaneously WORD m wUsbStatus is becoming obsolete and is retained only for compatability purposes It retains the value 0 Description Returns the error status from the USB CANmodul If an error occurred on the USB CANmodul the red status LED starts blinking and a status information is returned to the PC If...

Страница 47: ...AN_CANERR_BUSOFF 0x0010 Bus error CAN controller is in bus off state USBCAN_CANERR_QRCVEMPTY 0x0020 RcvQueue is empty USBCAN_CANERR_QOVERRUN 0x0040 RcvQueue overflow USBCAN_CANERR_QXMTFULL 0x0080 Transmit queue is full USBCAN_CANERR_REGTEST 0x0100 CAN controller register test failed USBCAN_CANERR_MEMTEST 0x0200 Memory test failed USB error states Name Value Description USBCAN_USBERR_OK 0x0000 No e...

Страница 48: ...ndle_p USB CAN handle received with the function UcanInitHardware bBTR0_p Baud rate register 0 bBTR1_p Baud rate register 1 Return value Error code of the function USBCAN_SUCCESSFUL USBCAN_ERR_MAXINSTANCES USBCAN_ERR_ILLHANDLE USBCAN_ERR_CANNOTINIT USBCAN_ERR_BUSY USBCAN_ERR_IOFAILED USBCAN_ERRCMD_NOTEQU USBCAN_ERRCMD_ILLCMD Description Changes the baud rate configuration of the USB CANmodul ...

Страница 49: ..._p USB CAN handle received with the function UcanInitHardware dwAMR_p Acceptance Mask Register dwACR_p Acceptance Code Register Return value Error code of the function USBCAN_SUCCESSFUL USBCAN_ERR_MAXINSTANCES USBCAN_ERR_ILLHANDLE USBCAN_ERR_CANNOTINIT USBCAN_ERR_BUSY USBCAN_ERR_IOFAILED USBCAN_ERRCMD_NOTEQU USBCAN_ERRCMD_ILLCMD Description Changes the acceptance Mask Register of the USB CANmodul ...

Страница 50: ...p Usability CAN_INIT Parameter UcanHandle_p USB CAN handle received with the function UcanInitHardware pCanMsg_p Address to a CAN message structure This address must not be ZERO typedef struct DWORD m_dwID CAN identifier BYTE m_bFF CAN frame format BYTE m_bDLC CAN data length code BYTE m_bData 8 CAN data DWORD m_dwTime Receipt time in ms tCanMsgStruct ...

Страница 51: ... the buffer contains no CAN messages this function returns a warning If a buffer overrun occurred this function returns a valid CAN message and a warning Example tUcanHandle UcanHandle tCabMsgStruct CanMsg BYTE bRet read CAN messages bRet UcanReadCanMsg UcanHandle CanMsg no errors print CAN message if bRet PrintCanMsg CanMsg else no warning print error if bRet USBCAN_WARNING PrintError bRet else v...

Страница 52: ... to a CAN message structure This address must not be ZERO typedef struct DWORD m_dwID CAN identifier BYTE m_bFF CAN frame format BYTE m_bDLC CAN data length code BYTE m_bData 8 CAN data DWORD m_dwTime has no meaning in this function tCanMsgStruct Return value Error code of the function USBCAN_SUCCESSFUL USBCAN_ERR_MAXINSTANCES USBCAN_ERR_ILLHANDLE USBCAN_ERR_CANNOTINIT USBCAN_ERR_ILLPARAM USBCAN_E...

Страница 53: ...cates that no CAN messages are in the buffer Other warnings show the calling function that an event has occurred but a valid CAN message is transferred All possible return codes for the functions of the USBCAN32 DLL are listed below USBCAN_SUCCESSFUL Value 0x00 Description This message returns if the function is executed successfully USBCAN_ERR_RESOURCE Value 0x01 Description This error message re...

Страница 54: ... 5 modules application 2 has opened 5 modules and application 3 wants to open a module Application 3 receives this error message USBCAN_ERR_HWINUSE Value 0x03 Description An application tries to initialize a USB CANmodul with the device number x If this module has already been initialized by its own or by another application this error message is returned USBCAN_ERR_ILLVERSION Value 0x04 Descripti...

Страница 55: ...d to the PC or all connected modules are already in use USBCAN_ERR_ILLHANDLE Value 0x06 Description This error message returns if a function received an incorrect USB CAN handle The function first checks which USB CANmodul is initialized to this handle This error occurs if no module has been initialized to this handle USBCAN_ERR_ILLPARAM Value 0x07 Description This error message returns if a wrong...

Страница 56: ...d again USBCAN_ERR_TIMEOUT Value 0x09 Description This error message occurs if the function transmits a command to the USB CANmodul but no answer is returned To solve this problem close the application disconnect the USB CANmodul and connect it again USBCAN_ERR_IOFAILED Value 0x0a Description This error message occurs if the communication to the USB CAN driver was interrupted This happens for exam...

Страница 57: ... Description In this software version a maximum amount of 10 applications are able to have access to the USBCAN32 DLL If more applications attempt access to the DLL this error message will occur In this case it is not possible to initialize a USB CANmodul USBCAN_ERR_CANNOTINIT55 Value 0x0d Description If a USB CANmodul is initialized with the function UcanInitHardware the software changes into the...

Страница 58: ...nswer does not correspond to the command USBCAN_ERRCMD_REGTST Value 0x41 Description The software tests the CAN controller on the USB CANmodul when the CAN interface is initialized Several registers of the CAN controller are checked This error message returns if an error appears during this register test USBCAN_ERRCMD_ILLCMD Value 0x42 Description This error message returns if the USB CANmodul rec...

Страница 59: ...urned USBCAN_WARN_NODATA Value 0x80 Description If the function UcanReadCanMsg returns with this warning it is an indication that the receive buffer contains no CAN messages USBCAN_WARN_SYS_RXOVERRUN Value 0x81 Description If an overrun in the receive buffer on the USB CAN system driver occurred the USBCAN32 DLL is informed about this event The function UcanReadCanMsg returns this warning and a va...

Страница 60: ...OVERRUN Value 0x82 Description The USBCAN32 DLL automatically requests CAN messages from the USB CANmodul and stores the messages into a buffer of the DLL If more CAN messages are received than the DLL buffer size allows this error message returns and CAN messages are lost ...

Страница 61: ...Bit s USBCAN_BAUD_125kBit 0x031c CAN baud rate 125 kBit s USBCAN_BAUD_250kBit 0x011c CAN baud rate 250 kBit s USBCAN_BAUD_500kBit 0x001c CAN baud rate 500 kBit s USBCAN_BAUD_800kBit 0x0016 CAN baud rate 800 kBit s USBCAN_BAUD_1MBit 0x0014 CAN baud rate 1 MBit s Example TUcanHandle UcanHandle BYTE bRet initializes the hardware bRet UcanInitHardware UcanHandle 0 NULL initializes the CAN interface bR...

Страница 62: ...erred to the function UcanInitCan as parameter dwAMR_p and dwACR_p It is also possible to change these values later after calling the function UcanInitCan with the function UcanSetAcceptance The following mechanism is used for filtration AMR Bit ACR Bit Bit of the CAN ID 0 0 0 0 1 1 1 0 x 1 1 x 0 The corresponding bit of the CAN identifier has to be 0 1 The corresponding bit of the CAN identifier ...

Страница 63: ...frame 29 bit identifier dwACR_p 31 30 3 2 1 0 dwAMR_p 31 30 3 2 1 0 CAN Identifier 28 27 0 R T R free The macros USBCAN_SET_AMR extended can_id rtr and USBCAN_SET_AMR extended can_id rtr can be used to calculate the filter values The parameter extended indicates if it is a 29 bit message TRUE or a 11 bit message FALSE The parameter can_id shows the filter value as CAN identifier The parameter rtr ...

Страница 64: ... RTR unimportant bRet UcanInitCan UcanHandle HIBYTE USBCAN_BAUD_1MBit LOBYTE USBCAN_BAUD_1MBit USBCAN_SET_AMR FALSE 0x0ff 1 USBCAN_SET_ACR FALSE 0x300 0 Error print error if bRet PrintError bRet CAN messages with a 29 bit identifier are filtered with the same configuration In this case AMR and ACR are interpreted in a different way In this configuration CAN messages with the 29 bit identifiers fro...

Страница 65: ...wParam_p Additional parameter If bEvent p 8 then the parameter is returned from the USB CAN Handle of the disconnected module No messages are received from this module and no messages can be sent The corresponding USB CAN Handle is invalid in other instances the parameter is 0 Description This callback function informs the application program if a new USB CANmodul is connected to the PC or a conne...

Страница 66: ...andle of the USB CANmodul where the event occurred This handle is returned with the function UcanInitHardware bEvent_p Event which occurred USBCAN_EVENT_INITHW 0 USBCAN_EVENT_INITCAN 1 USBCAN_EVENT_RECEIVE 2 USBCAN_EVENT_STATUS 3 USBCAN_EVENT_DEINITCAN 4 USBCAN_EVENT_DEINITHW 5 ...

Страница 67: ...CAN_EVENT_INITCAN 0x01 The CAN interface is initialized successfully USBCAN_EVENT_RECEIVE 0x02 A CAN message is received USBCAN_EVENT_STATUS 0x03 The error status at the USB CANmodul has changed USBCAN_EVENT_DEINITCAN 0x04 The CAN interface is shut down USBCAN_EVENT_DEINITHW 0x05 The USB CANmodul is shut down USBCAN_EVENT_CONNECT 0x06 A new USB CANmodul is connected USBCAN_EVENT_DISCONNECT 0x07 A ...

Страница 68: ...USB CANmodul 66 SYS TEC electronic GmbH 2001 L 487e_6 parameter dwParam p contains the USB CAN Handle of the disconnected module The Handle can no longer be used ...

Страница 69: ..._p new USB CANmodul connected case USBCAN_EVENT_CONNECT open USB CANmodul with USBCAN_ANY_MODULE and initialize second callback function bRet UcanInitHardware UcanHandle_g USBCAN_ANY_MODULE UcanCallbackFkt break USB CANmodul disconnected case USBCAN_EVENT_DISCONNECT break void STDCALL UcanCallbackFkt tUcanHandle UcanHandle_p BYTE bEvent_p what event appeared Switch bEvent_p receives CAN message ca...

Страница 70: ...USB CANmodul 68 SYS TEC electronic GmbH 2001 L 487e_6 ...

Страница 71: ...Can 40 UcanDeinitHardware 37 UcanDeinitHwConnectControl 34 UcanGetHardwarInfo 41 UcanGetStatus 43 UcanGetVersion 32 UcanInitCan 38 UcanInitHardware 35 UcanInitHwConnectControl 33 UcanReadCanMsg 48 UcanResetCan 39 UcanSetAcceptance 47 UcanSetBaudrate 46 UcanWriteCanMsg 50 USB 5 USB Connectors 5 USBCAN_ERR_BUSY 54 USBCAN_ERR_CANNOTINIT1 55 USBCAN_ERR_DLL_TXFULL 55 USBCAN_ERR_HWINUSE 52 USBCAN_ERR_IL...

Страница 72: ...USB CANmodul 70 SYS TEC electronic GmbH 2001 L 487e_6 USBCAN_WARN_DLL_RXOV ERRUN 58 USBCAN_WARN_NODATA 57 USBCAN_WARN_SYS_RXOVE RRUN 57 ...

Страница 73: ... USB CANmodul Document number L 487e_6 March 2001 How would you improve this manual Did you find any mistakes in this manual page Submitted by Customer number Name Company Address Return to SYS TEC electronic GmbH August Bebel Str 29 D 07973 Greiz Germany Fax 49 0 3661 63248 ...

Страница 74: ...Published by SYS TEC electronic 2001 Ordering No L 487e_6 Printed in Germany ...

Отзывы: