Home
DIP052 User Manual - MKS Instruments, Inc.
Contents
1. DOS Device Driver HEADER FILES ERROR CODES Chapter 3 DRVO51 Functions This chapter addresses the DRV051 functions DOS For information on See Page DOS Device Driver 3 1 Header F iles 3 1 DRV051 Error Codes 3 1 Packet Management 3 2 DRV051 Functions 3 2 The DIPO52 uses the Signetics 82C200 Can controller The controller is I O mapped and requires 32 consecutive addresses The base address is defined by the CanPort variable set during initialization Until the port is configured all functions will return an E NOTCONFIG error code A DOS based interrupt handler is provided in Microsoft compatible C SOURCE code to provide an example of using the DIPO52 The driver code provided consists of the following files DRVO051 C Source code for interface routines DRVO051 H Header file DRV051 H defines the function prototypes and various constants It should be included in any module making access to the DRV051 interface All user interface functions will return status information in the form of an unsigned int The following are possible error codes E OK 0x00 No error detected E TIMEOUT Oxffff Timed out due to lack of response E NOTCONFIG Oxfffe DIPO52 has not been configured E BUSY Oxfffd DIPO52 controller not available E EMPTY Oxfffc No messages in receive queue E FULL Oxfffb Transmit queue is full E_PRESENT Oxfffa DIPO52 not present at specified port E LENGTH Oxfff9 length parameter incorrect DIP052 Use
2. 4122 DO Send us Postal Mail at DIP Inc 1860 Chicago Ave Suite I 5 Riverside CA 92507 USA DIP052 User s Manual e 13005202 1 0 1
3. Dim inst as Integer Dim rlen as Integer Dim buf 150 as byte rts ZDNReset node clss inst rlen buf 0 Return Data buf returns the following data buf 0 1 Error code 0 for successful response Ignore the rest of the packet if an Error code is received buf 2 3 Receive Id from node buf 4 5 Size of message buf 6 Message from node Comments The function returns a non zero value for Error See Error Codes for details The function waits 100ms for a response If callback is implemented then the response is made available to the user as soon it is received DNGetAttribute This function supports DeviceNet Service GET SINGLE Function Prototype long DNGetAttribute unsigned short int node unsigned short int clss unsigned short int inst unsigned short int attr unsigned char buf Parameters node DeviceNet node that the user wants to reset The value ranges from 0 to 63 clss Class to be accessed inst Instance to be accessed DIP052 User s Manual e 13005202 1 0 1 4 6 DRV052 Functions DIP052 User s Manual e 13005202 1 0 1 attr Attribute to be accessed buf On exit buf has data response from DNGetAttribute The size of the array must be 150 C Declaration long rts int clss int inst int attr unsigned char buf 150 rts DNGetAttribute node clss inst attr amp buf Visual Basic Declaration Dim rts As Long return value Dim clss As Integer Dim inst as Integer Dim at
4. 0 data sheet for the possible control values The routine will return E NOTCONFIG if the DIPO52 port has not been configured If the interrupt is due to a Transmit Complete the function checks if additional messages are available from the transmit queue If so the oldest message is copied from the buffer to the 80C200 transmission registers An ERROR or OVERRUN condition is cleared Chapter Overview DN Functions Chapter 4 DRVO52 Functions This chapter addresses the DRV052 functions Windows For information on See Page DN Functions 4 1 CAN Functions 4 8 VXD Functions 4 10 Utility Functions 4 13 Error Codes 4 13 Visual Basic Function Prototypes 4 14 These functions allow the user to send DeviceNet commands DNAlIlocate DNFree DNReset DNGetAttribute DNSetAttribute DNAllocate This function allows the user to create a M S connection with a node within the DeviceNet network Function Prototype long DNAllocate unsigned short int node unsigned short int conn unsigned char buf Parameters node DeviceNet node that the user wants to allocate The value ranges from 0 to 63 conn Connection to be established with the node Explicit 1 Poll 2 Strobe 4 etc buf Pointer to an array of bytes for a response from DNAllocate The size of the array must be 150 DIP052 User s Manual e 13005202 1 0 1 4 2 DRV052 Functions DIP052 User s Manual e 13005202 1 0 1 C Declaration long rts int
5. 5 The DRV052 DLL can be used on Windows 95 and NT operating system Function Prototype long Unload VXD DIP052 User s Manual e 13005202 1 0 1 Utility functions Error Codes DRVO052 Functions 4 13 RegisterCB This function registers a callback function within the DLL This allows the user to be notified when a CAN transaction has occurred Function Prototype long RegisterCB unsigned short int mode mode 1 A CAN transaction has been sent 2 A CAN transaction has been received Oxffff Notified everything These functions allow the user to make some simple conversion between data types The first set of functions converts bytes into integers longs or floats by pointing to an element of the array unsigned short int Byte2Int unsigned char bData long Byte2Long unsigned char bData float Byte2Float unsigned char bData The second set of functions converts integers longs or floats into bytes These functions return 0 long Int2Byte unsigned short int Param1 unsigned char bData long Long2Byte unsigned long Paraml unsigned char bData long Float2Byte float Param1 unsigned char bData All user interface functions will return status information in the form of an unsigned long The following are possible error codes E OK 0x00 No error detected E TIMEOUT Oxffff Timed out due to lack of response E NOTCONFIG Oxfffe DIP052 has not been configured E BUSY Oxfffd DIPOS2 cont
6. IDENTIFIER and the accept code Setting a bit within the mask code informs the controller to ignore the corresponding bit in the accept code A mask code of OxFF will allow the controller to receive all packets Bus Time 0 Baud rate multiplier and jitter correction control bits Refer to 80C200 specific register information DIP052 User s Manual e 13005202 1 0 1 4 12 DRV052 Functions Config 7 Bus Time 1 Bus Time 1 Data bit sampling control Refer to 80C200 specific register information To set up the data rate to 125kb use Bus Time0 DEF SPDI125 0 0x03 Bus Time 1 DEF SPDI25 1 Oxlc To set up the data rate to 250kb use Bus Time 0 DEF SPD250 0 0x01 Bus Time 1 DEF SPD250_1 Oxlc To set up the data rate to 500kb use Bus Time 0 DEF SPD500 0 0x00 Bus Time 1 DEF SPD500 1 Oxic To set up the data rate to 1000kb use Bus Time 0 DEF SPD1000 0 0x00 Bus Time 1 DEF SPD1000 1 0x14 Config 8 Output cfg Output cfg The control register used to determine drive levels for the 80C200 output drivers Refer to the 80C200 specific register information For standard hardware configurations use a value of DEF NORMAL CFG Oxfa Config 9 Counter reg Counter reg Ox4e Port 0x200 0x280 0x300 0x380 for DIPO52 IRQ 5 7 9 10 11 12 14 15 Ignored for DIP052 Config As described above Note On NT Port and IRQ are ignored Config is processed Unload VXD This function unloads the proper driver for the DIPO52 and DIP06
7. Integer Dim buf 150 as byte rts CANRcv radd rlen buf 0 Return Data buf returns the following data buf 0 1 Error code 0 for successful response Ignore the rest of the packet if an Error code is received buf 2 3 Receive Id from node buf 4 5 Size of message buf 6 Message from node Comment The function returns a non zero value for Error See Error Codes for details CANXmit This function will write a message to the VXD Function Prototype long CANXmit unsigned short int xadd unsigned short int xlen unsigned char buf Parameters radd 11 bit identifier xlen Number of characters received This value must be less or equal to 8 DIP052 User s Manual e 13005202 1 0 1 4 10 DRVO052 Functions VXD functions DIP052 User s Manual e 13005202 1 0 1 buf On entry data to be sent to the node C Declaration long rts int xadd int xlen unsigned char buf 150 rts CANXmit xadd xlen amp buf Visual Basic Declaration Dim rts As Long return value Dim xadd As Integer Dim xlen as Integer Dim buf 150 as byte rts CANXmit xadd xlen buf 0 Return Value NONE LoadVXD This function loads the proper driver for the DIPO52 and DIPO065 The DRV052 DLL can be used on Windows 95 and NT operating system Function Prototype long LoadVXD unsigned short int Port unsigned short int IRQ unsigned char Config The port address must not conflict with other I O devices The r
8. Q function will read all 32 registers from the 80C200 into the user supplied buffer When accessing the internal registers of the 80C200 it is necessary to reset the device Any pending messages will be lost Refer to the 80C200 data sheet for the register map Register 31 is not used by the 80C200 and instead contains the DIPO52 status word which reflects the 2 user assigned status bits the current interrupt status bit and the cable present status bit CanStatus sts CanStatus void unsigned int sts The CanStatus function will return the status word of the 80C200 If the DIPO52 port has not been configured the routine returns an E NOTCONFIG Note that the status value will be in the range 0 Oxff The error codes will be in the range Oxff00 Oxffff Refer to the 80C200 data sheet for status register bit assignments DIP052 User s Manual e 13005202 1 0 1 3 6 DRV051 Functions DIP052 User s Manual e 13005202 1 0 1 CanCommand sts CanCommand Cmd unsigned int sts unsigned int Cmd The CanCommand function will write the user specified Cmd byte to the 80C200 command register Refer to the 80C200 data sheet for the possible command values The routine will return E NOTCONFIG if the DIPO52 port has not been configured CanControl sts CanControl Cntr unsigned int sts unsigned int Cntr The CanControl function will write the user specified Cntr byte to the 80C200 control register Refer to the 80C20
9. Table of Contents Introduction Chapter 1 Chapter Overview cccceeecec eee ee eect eeeeeeeeeeeaeeaeeeeeeaeeaeaes 1 1 suigofo Weise 1 1 Installing the DIPO52 Chapter 2 Chapter OVervieW sioe seat boe He se htt E pe eee cx e di proe Eu clgd 2 1 DIPO52 Specifications ssa iiare enn aa aon eane hiaan as 2 1 Port Addresses zias ean dnan a a a e a aa aaa 2 1 Interrupt LevelS oki c eR cag RR RD eee e Bex SERO MBA ATAS 2 2 DIPO52 Connector Pin Out sssss es 2 2 Network Adapter Jumpers 0 0 cece ee eee nent eee eee e een ee eens een en ead 2 2 JUMPER PT aa oerte nra Ut rU RR RAPUIT eh bese 2 3 Jumper P2 5 5 coc aa EE ie Ea RREA ASIERA 2 3 Fully Isolated Interface esssHR 2 3 Non Isolated Interface ccc cece eee eeenee eee a eens een ease eaeeeeneneaes 2 4 DRV051 Functions Chapter 3 Chapter Overview sss nemen nennen 3 1 DOS Device Driver saeir reari cece eee ISAT a mee 3 1 Header Files 5 ott orate PR Rd RES 3 1 DRVO051 Error Codes ssssssssssssm mee 3 1 Packet Management siorse anii Aerer Arara R a 3 2 DRVO51 FUNCHONS He uice RE ra Ren RR RR PATa 3 2 DRV052 Functions Chapter 4 Chapter Overview 2 1 dde cade dedere epe oo e oed ed Voter ege ia 4 1 DN FEURCEIODS u iiie dfe bed enel tice 4 1 CAN FUnclions 5 3 reet eae eerte roe b om RR vere sanete E d e daa 4 8 MAD FUNCIONS orasini ternis Ego etel Eie oet ee eo eden eed un 4 10 Utility FUNCIONS variisik ina
10. ani tnmen Been Es 4 13 Emor CodeS EE 4 13 Visual Basic Function Prototypes cceeeeeeeeeee ee eeee eee enes 4 14 Obtaining Help Chapter 5 Chapter OVenview ice ary e REP ded eld beni Nen eis Sous 5 1 Sources for Hel piss 2 oe qr ROO ede dee eden 5 1 DIP052 User s Manual e 13005202 1 0 1 Chapter Overview Introduction Chapter 1 Introduction This chapter serves as an introduction to the DIPO52 For information on See Page Introduction 11 The DIP052 provides a general purpose CAN bas interface for IBM PC AT ISA bus compatible systems The unit relies on the Signetics 82C200 CAN interface component to provide access to the CAN network The hardware interface includes optical isolation for the CAN signals reverse polarity protection for the CAN bus power and signal lines and a circuit to detect when the CAN bus power is removed The software interfaces to the DIPO52 through an interrupt driven device driver Commands are available to configure both the PC specific interface and the CAN network parameters DIP052 User s Manual e 13005202 1 0 1 Chapter Overview DIP052 Specifications Port Addresses Chapter 2 Installing the DI P052 This chapter addresses the DIPO52 Installation Requirements For information on See Page DIP052 Specifications 2 1 Port Addresses 2 1 Interrupt Levels 2 2 DIP052 Connector Pin Out 2 2 Network Adapter J umpers 2 2 Jumper P1 2 3 Jumper P2 2 3 Fully Isolated Interfac
11. between the CAN network and the PC the transceiver circuit requires a separate power source This is typically provided by a network wide power supply carried on the BUS and BUS GND signals The following jumper options should be used when the BUS and BUS GND signals are to be used to power the transceiver Isolated P2 Internal Function DB 9 Pin Function Xcvr Gnd 0 0 3 Bus Unreg Pwr o of 1 N C PC 12 o o 8 N C Xcvr GND o o 4 N C PC GND o o 5 N C Xcvr GND o o 6 Bus Unreg Pwr o oj 9 Bus Xcvr CAN H o o 7 Can H Xcvr CAN L o o 2 Can L 120 Ohm Resistor o oj 120 Ohm Terminating Resistor DIP052 User s Manual e 13005202 1 0 1 2 4 Installing the DIPO52 Non Isolated Interface DIP052 User s Manual e 13005202 1 0 1 The following jumper options should be used when the PC 12 power is to be used to power the transceiver Note that this configuration does not provide galvanic isolation between the CAN network and the PC Installing the jumpers marked will connect the PC 12 volt and GND supply to the DB9 connector CARE SHOULD BE EXERCISED Non Isolated P2 Internal Function Xcvr GND Unreg Pwr PC 12 Xcvr GND PC GND Xcvr GND Unreg Pwr Xcvr CAN H Xcvr CAN L 120 Ohm Resistor DB 9 a o ga o o o o o o o oOoooooooooo Pin Function O o 2 CI rNONODUB OF W 120 Ohm Terminating Resistor Chapter Overview
12. d the length variable will be set to the actual number of bytes received in the packet 0x00 0x08 The Bptr points to an unsigned char array to receive the packet data The CAN specification limits the packet data length to 8 bytes and it is recommended that all receive buffers be at least 8 bytes since it is not possible to pre determine the length of incoming packets CanXmit sts CanXmit Id Len Bptr unsigned int sts unsigned int Id int Len unsigned char Bptr The CanXmit function will transmit a packet on the CAN network If the DIPO52 has not been configured the routine will return an E NOTCONFIG error If no space is available in the message queue the routine will return an E FULL error If an invalid Len parameter is specified the routine returns an E LENGTH error status The Id must contain the packet identifier 11 bits DRV051 Functions 3 5 The Len integer contains the number of message bytes to be transmitted If the packet is a Remote Frame RTR bit set high then the length variable must be set to 0x10 and no message bytes will be transferred If the RTR bit is be cleared the length variable must be set to the actual number of bytes to be transmitted the packet 0x00 0x08 The Bptr points to an unsigned char array which contains the packet data The CAN specification limits the packet data length to 8 bytes CanDump sts CanDump Bptr unsigned int sts unsigned char Bptr The CanDump
13. dll ByVal radd As Integer ByVal rlen As Integer rbuf As Any As Long Declare Function LoadVXD Lib drv052 dll ByVal port As Integer ByVal Irq As Integer config As Any As Long Declare Function UnloadV XD Lib drv052 dll As Long Declare Function RegisterCB Lib drv052 dll ByVal mode As Integer As Long Declare Function Byte2Int Lib drv052 dll xbuf As Any As Integer Declare Function Byte2Long Lib drv052 dll xbuf As Any As Long Declare Function Byte2Float Lib drv052 dll xbuf As Any As Single DRVO052 Functions 4 15 Declare Function Int2Byte Lib drv052 dll parl As Integer xbuf As Any As Long Declare Function Long2Byte Lib drv052 dll parl As Long xbuf As Any As Long Declare Function Float2Byte Lib drv052 dll parl As Single xbuf As Any As Long DIP052 User s Manual e 13005202 1 0 1 Chapter 5 Chapter Overview Sources for Help Obtaining Help This chapter will focus on obtaining help with the product For information on See Page Sources for Help 5 1 Sources for obtaining help are listed below D Visit the DIP Web Site at http www dipinc com The newest updates and revisions to the software as well as the documentation will be posted there b gt Send a request for information through e mail to info dipinc com If the question is related to sales or marketing send your e mail to Sales dipinc com Reach us by telephone at 909 686 4211 DO Fax us at 909 686
14. e 2 3 Non Isolated Interface 2 4 The DIP052 PC to CAN adapter may be installed in an ISA compatible Personal Computer The module occupies 32 consecutive locations within the processor I O space Prior to installation the user must set both the base address and the interrupt level to be used by the adapter 8 X4 5 ISA Bus Compatible 5 Volt 100mA 12 Volt 80mA bus power Bus Interface Optical Isolation ISO DIS 11898 Bus Speed Up to 1 Mbit sec 120 nodes Interrupt Levels 3 4 5 7 10 11 12 15 user selectable T O Addresses 200 21F 280 29F 300 31F 380 39F The DIP052 may be configured to one of 4 separate base addresses using switch positions S9 and S10 Note that when setting the switch the down position is ON and the up position is OFF SWITCH ADDRESS te NNNM DIP052 User s Manual e 13005202 1 0 1 2 2 Installing the DIPO52 Interrupt Levels DIP052 Connector Pin Out Network Adapter Jumpers DIP052 User s Manual e 13005202 1 0 1 The DIP052 may be used in either POLLED or INTERRUPT mode depending on the support software used POLLED mode provides lower performance DIP supplies INTERRUPT driven drivers The DIPO52 supports 8 different interrupts through switch positions S1 through S8 Only 1 of these switches should be in the ON Down position Interrupts are a very scarce resource on heavily populated personal computers The following table shows the standard use of interrupts for AT and 386 486 mach
15. ecommended value is 0x300H The port address is set by using the DIPswitch on the DIPO52 SWITCH _ ADDRESS S10 S9 OFF OFF 200H OFF ON 280H ON OFF 300H ON ON 380H DRVO052 Functions 4 11 The interrupt_level specifies what hardware interrupt level to use The interrupt driver does not allow sharing interrupts between devices A recommended level is 5 printer LPT2 The interrupt level is set by using the DIPswitch on the DIPO52 Switch On Interrupt Hex Common Usage Sl IRQI5 OF General I O S2 IRQI2 0C General I O S3 IRQI1 OB General I O S4 IRQIO 0A General I O S5 IRQ7 07 LPT1 S6 IRQ5 05 LPT2 Sound CD card S7 IRQ4 04 Com1 and Com3 S8 IRQ3 03 Com2 and Com4 The 10 byte configuration array consists of the following UNSIGNED CHAR fields Config 0 Config 1 Config 2 Config 3 LL ee G ean Config 4 accept code Config 5 mask code Config 6 Bus Time 0 Do not use Internal use Do not use Internal use Do not use Internal use Do not use Internal use accept code Message IDENTIFIER s to be recognized by this node Defines which message packets received by the controller will be accepted subject to mask code operation Basically node address of DIPO52 mask code MASK value which will be applied to accept code and Message IDENTIFIER when qualifying message acceptance The mask code value is AND ed with both the incoming message
16. eturn value Dim clss As Integer Dim inst as Integer Dim attr as Integer Dim int as Integer Dim buf 150 as byte DIP052 User s Manual e 13005202 1 0 1 4 8 DRV052 Functions CAN functions DIP052 User s Manual e 13005202 1 0 1 rts DNSetAttribute node clss inst attr rlen buf 0 Return Data buf returns the following data buf 0 1 Error code 0 for successful response Ignore the rest of the packet if an Error code is received buf 2 3 Receive Id from node buf 4 5 Size of message buf 6 Message from node Comments The function returns a non zero value for Error See Error Codes for details The function waits 100ms for a response If callback is implemented then the response is made available to the user as soon it is received These functions allow the user to receive and transmit generic CAN messages CANRcv This function will read a message from the VXD If no messages are available an Error code is generated Function Prototype long CANRcv unsigned short int radd unsigned short int rlen unsigned char buf Parameters radd 11 bit identifier rlen Number of characters received buf On exit data response from CANRcv The size of the array must be 150 C Declaration long rts int radd DRV052 Functions 4 9 int rlen unsigned char buf 150 rts CANRcv radd rlen amp buf Visual Basic Declaration Dim rts As Long return value Dim radd As Integer Dim rlen as
17. ines The hexadecimal values in parenthesis are the corresponding interrupt level to be coded in the MONITOR initialization files DOS version The DIP052 pin out for the DB9 connector is as follows Number 5 PC GND do not connect to this pin in isolated systems 6 ShieldGround 0 O 8 NC donotconnecttothispin p 9 e cese es The DIPO52 is provided with an optically coupled CAN transceiver To support applications requiring alternate drivers two sets of dual row 10 position jumpers are provided Jumper group P1 carries signals from the CAN controller to the CAN transceiver circuit Jumper group P2 carries signals from the transceiver to the DB9 connector Jumper P2 10 provides a convenient 120Q network termination resistor Jumper P1 Jumper P2 Fully Isolated Interface Installing the DIPO52 2 3 Unless a custom network driver is installed the jumper locations on P1 containing white silk screened lines should be installed CONNECTOR P1 5 RX1 RXO TX1 TXO CLKOUT OPT1 OPT2 OPT3 GND To opto isolated transceiver circuits 0 o 0 o 0 o 0 o 0 Qooooooooo Jumper group P2 connects the CAN transceiver circuit to the DB9 connector Unless a custom network driver is installed the jumper locations on P2 containing white silk screened lines should be installed Additional jumpers will be required to select the power option for the transceiver To provide full isolation
18. m buf 150 as byte rts ZDNFree node conn buf 0 Return Data buf returns the following data buf 0 1 Error code 0 for successful response Ignore the rest of the packet if an Error code is received buf 2 3 Receive Id from node DIP 052 User s Manual e 13005202 1 0 1 4 4 DRV052 Functions DIP052 User s Manual e 13005202 1 0 1 buf 4 5 Size of CAN message buf 6 Message from node Comments The function returns a non zero value for Error See Error Codes for details The function waits 100ms for a response If callback is implemented then the response is made available to the user as soon it is received DNReset This function allows the user to reset the node Function Prototype long DNReset unsigned short int node unsigned short int clss unsigned short int inst unsigned short int rlen unsigned char buf Parameters node DeviceNet node that the user wants to reset The value ranges from 0 to 63 clss Class to be accessed inst Instance to be accessed rlen Number of characters send in buf Set to O if no data 1s to be sent buf On entry buf has data to be sent to the node On exit buf has data response from DNReset The size of the array must be 150 C Declaration long rts int clss int inst int rlen unsigned char buf 150 rts DNReset node clss inst rlen amp buf DRV052 Functions 4 5 Visual Basic Declaration Dim rts As Long return value Dim clss As Integer
19. nflict with other I O devices The recommended value is 0x300 The intlevel specifies what hardware interrupt level to use The interrupt driver does not allow sharing interrupts between devices A recommended level is 5 printer LPT2 The 6 byte configuration array consists of the following UNSIGNED CHAR fields accept_code mask_code Bus Time 0 Bus Time 1 Output cfg Clock control DRV051 Functions 3 3 Message IDENTIFIER s to be recognized by this node Defines which message packets received by the controller will be accepted subject to mask_code operation MASK value which will be applied to accept_code and Message IDENTIFIER when qualifying message acceptance The mask code value is AND ed with both the incoming message IDENTIFIER and the accept code Setting a bit within the mask code informs the controller to ignore the corresponding bit in the accept code A mask code of OxFF will allow the controller to receive all packets Baud rate multiplier and jitter correction control bits Refer to 80C200 specific register information Data bit sampling control Refer to 80C200 specific register information The control register used to determine drive levels for the 80C200 output drivers Refer to the 80C200 specific register information For standard hardware configurations use a value of DEF NORMAL CFG The 80C200 generates a separate auxiliary clock output which may be used in specialized hardware configu
20. node int conn unsigned char buf 150 rts DNAllocate node conn amp buf Visual Basic Declaration Dim rts As Long return value Dim node As Integer Dim conn As Integer Dim buf 150 as Byte rts ZDNAllocate node conn buf 0 Return Data buf returns the following data buf 0 1 Error code 0 for successful response Ignore the rest of the packet if an Error code is received buf 2 3 Receive Id from node buf 4 5 Size of CAN message buf 6 Message from node Comments This function returns a non zero value for Error See Error Codes for details The function waits 100ms for a response If callback is implemented then the response is made available to the user as soon as it is received DRV052 Functions 4 3 DNFree This function allows the user to free M S connection with a node within the DeviceNet network Function Prototype long DNFree unsigned short int node unsigned short int conn unsigned char buf Parameters node DeviceNet node that the user wants to free The value ranges from 0 to 63 conn Connection to be established with the node Explicit 1 Poll 2 Strobe 4 buf Pointer to an array of bytes for function DNFree The size of the array must be 150 C Declaration long rts int node int conn unsigned char buf 150 rts DNFree node conn amp buf Visual Basic Declaration Dim rts As Long return value Dim node As Integer Dim conn As Integer Di
21. r s Manual e 13005202 1 0 1 3 2 DRV051 Functions PACKET MANAGEMENT DRV051 FUNCTIONS DIP052 User s Manual e 13005202 1 0 1 CAN bus traffic is buffered in memory queues The receive queue is 128 bytes in length The transmit queue is 32 bytes Packets received are transferred to the receive queue by the internal interrupt routine and the user Receive function transfers the packet information from the queue to user buffers Messages to be transmitted are transferred directly to the DIPO52 CAN adapter if possible If the CAN controller is busy the user message s will be queued in the transmit buffer Auxiliary functions allow retrieving the entire DIPO52 register set as well as reading the DIPO52 status register and setting the control and command registers The following functions are available to application DOS programs CanConfig configure CAN network interface CanRecv accept incoming CAN messages CanXmit send CAN messages CanStatus return status register 80C200 CanControl send control byte to 80C200 CanCommand send command byte to 80C200 CanDump return all 80C200 registers GetAll return all registers and FIFO content CanConfig sts CanConfig port address interrupt level config unsigned int sts int port address int interrupt level unsigned char config 6 The DRVOSI interface must be advised to the port interrupt and internal controller conditions to be used The port address must not co
22. rations For standard hardware use a value of 0 The Bus Time 0 and Bus Time 1 parameters are specific to the 80C200 controller and defines both the transmission speed and bit jittering adjustment capability The drv051 h file includes predefined parameters for 125 250 500 and 1000 kbit second networks DEF SPD125 0 0x03 DEF SPD125 1 Oxlc DEF_SPD250_0 0x01 DEF_SPD250_1 Oxlc DEF_SPD500_0 0x00 DEF SPD500 1 Oxlc DEF_SPD1000_0 0x00 DEF_SPD1000_1 0x14 The routine will return E_OK 0 if a controller is found It will return E_TIMEOUT if the DIP052 fails to respond in 1 second and E PRESENT if the controller is not found at the specified address DIP052 User s Manual e 13005202 1 0 1 3 4 DRV051 Functions DIP052 User s Manual e 13005202 1 0 1 CanRecv sts CanRecv Iptr Lptr Bptr unsigned int sts unsigned int Iptr int Lptr unsigned char Bptr The CanRecv function is used to receive messages from the CAN network If the DIPO52 has not been configured the routine will return an E NOTCONFIG error If no message is available the routine will return an E EMPTY error The Iptr must be a pointer to an integer which will contain the packet identifier of the received message The Lptr points to an integer which will contain the number of message bytes received If the packet is a Remote Frame RTR bit set high then the length variable is set to 0x10 and no message bytes will be transferred If the RTR bit is cleare
23. roller not available E EMPTY Oxfffc No messages in receive queue E FULL Oxfffb Transmit queue is full E PRESENT Oxfffa DIPO52 not present at specified port E LENGTH Oxfff9 length parameter incorrect E_PRESENT Oxfff8 Unable to determine OS E_LENGTH Oxfff7 Generic error E LENGTH Oxfff5 COM port is in used by another device DIP052 User s Manual e 13005202 1 0 1 4 14 DRV052 Functions Visual Basic Function Prototypes DIP052 User s Manual e 13005202 1 0 1 The following section describes the declaration under Visual Basic Function Prototypes and Declaration Declare Function DNAllocate Lib drv052 dll ByVal node As Integer ByVal conn As Integer rbuf As Any As Long Declare Function DNFree Lib drv052 dll ByVal node As Integer ByVal conn As Integer rbuf As Any As Long Declare Function DNReset Lib drv052 dll ByVal node As Integer ByVal cls As Integer ByVal inst As Integer ByVal rlen As Integer rbuf As Any As Long Declare Function DNGetAttribute Lib drv052 dll ByVal node As Integer ByVal cls As Integer ByVal inst As Integer ByVal attr As Integer rbuf As Any As Long Declare Function DNSetAttribute Lib drv052 dll ByVal node As Integer ByVal cls As Integer ByVal inst As Integer ByVal attr As Integer ByVal rlen As Integer rbuf As Any As Long Declare Function CANRcv Lib drv052 dll radd As Integer rlen As Integer rbuf As Any As Long Declare Function CANXmit Lib drv052
24. tr as Integer Dim buf 150 as byte rts DNGetAttribute node clss inst attr buf 0 Return Data buf returns the following data buf 0 1 Error code 0 for successful response Ignore the rest of the packet if an Error code is received buf 2 3 Receive Id from node buf 4 5 Size of message buf 6 Message from node Comments The function returns a non zero value for Error See Error Codes for details The function waits 100ms for a response If callback is implemented then the response is made available to the user as soon it is received DRV052 Functions 4 7 DNSetAttribute This function supports DeviceNet Service SET_SINGLE Function Prototype long DNSetAttribute unsigned short int node unsigned short int clss unsigned short int inst unsigned short int attr unsigned short int rlen unsigned char buf Parameters node DeviceNet node that the user wants to reset The value ranges from 0 to 63 clss Class to be accessed inst Instance to be accessed attr Attribute to be accessed rlen Number of characters send in buf Set to 0 if no data is to be sent buf On entry buf has the data to be sent to the node On exit buf has data response from DNSetAttribute The size of the array must be 150 C Declaration long rts int clss int inst int attr int rlen unsigned char buf 150 rts DNSetAttribute node clss inst attr amp buf Visual Basic Declaration Dim rts As Long r
Download Pdf Manuals
Related Search
Related Contents
SECTION 1 : CATEGORIE « EQUIPE D`ETABLISSEMENT » Cables Direct CDL-022BG USB cable Service Manual Compte rendu - Assemblée nationale Manitowoc Ice K00119 User's Manual 平成 17 年度 ファイル基準総括表 1 9 1 9 2 11 2 11 3 11 3 12 Queen`s ROMEO e-System 2015 OCCUPANT RESTRAINT SYSTEM INFORMATION – RAM C/V Philips 8060X Electric Shaver User Manual Modulo di sicurezza MSR41, Manuale dell`utente Copyright © All rights reserved.
Failed to retrieve file