Home

DIP065 RS232 to CAN Network Adapter Instruction Manual

image

Contents

1. Plug Polarity x S CANH and CANL ONLY 7 O an RS232 N z AAA O O ol ees XMIT XMIT NAAA O DeviceNet O Stotus Q Node D f 06S ae oe ie BUS and BUS ONLY DeviceNet Power Supply N 4 D AA e AN IN E ADAN my f j K Zz AC DC Adaptor 9V DC 200mA Hardware Installation Instructions DIP065 No external Supply T Ii COM1 9 PIN MALE Use QS5 a DB25 F to DB9 M COM2 25 PIN MALE adapter if your mouse or another serial device is using COM1 RECV cv Plug Polarity O o ote S a O an RS232 N Dae ay N A Y O O mes E XMIT XMIT O DeviceNet O Stotus O Node DIPO65 Serial CAN Adapte DLP Inc Moreno Valley CA If DeviceNet Node consumes less than 150mA the DIPO65 can be used to power such node SN 4 D NY e EN TN a my 6 0 K VA AC DC Adaptor 9V DC 200mA
2. 0 cceceeeeeeeeeeeeeeeeeeeaeeeeeeeeaes 4 1 Acknowledgement Packets ceseeeeeeeeeeeee teen tees eeeeeneneas 4 2 Error Codes iii 4 2 DRV052 Functions Chapter 5 Chapter Overview 0cccccteeeeceee tees eee eeeee eee ea eaeeaeeeeaeaeeas 5 1 DIN FUNCIONS 32s h2sccce2 cadet ad aederedades aa aap eed 5 1 GAN FUNCUONS seisine a ias 5 8 MAD Functions ii Seti Ae ee le ae 5 10 Utility FUNCIONS boicot pantera 5 12 Error Codes it ceed oa dave tis va lcd can 5 12 Visual Basic Function Prototypes ooocococconcccncnconcnncnincncnnononos 5 13 Obtaining Help Chapter 6 Chapter Overview oooococcccoccncccncoconcononnnconconcanncnanconcnncnnnnnnnns 6 1 Sources for Hel pi ostia pais 6 1 DIP065 User s Manual e 13006502 1 0 1 Chapter Overview Introduction Chapter 1 Introduction This chapter serves as an introduction to the DIP065 For information on See Page Introduction 1 1 The following serial protocol has been developed to support the DIP RS232 to CAN network adapter This protocol will be considered proprietary to DIP The protocol will be supported on the DIPO65 CAN based microcontroller hardware adapter CAN Serial Interface Module using a full duplex serial RS232 electrical interface The CAN protocol specifications are specifically not defined It is the intent of the DIP065 module to allow various CAN protocols to be processed using software supplied on the controlling RS232 device HOST system The
3. 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 DIP065 User s Manual e 13006502 1 0 1 5 6 DRV052 Functions DIP065 User s Manual e 13006502 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 attr 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
4. DIP065 will pass messages through with no interpretation of the data Data transferred on the CAN network consist of variable length packets The maximum packet length is 8 data bytes 2 control bytes Since the DIPO065 module is to pass data through with no attempt to interpret the CAN message protocol the serial protocol will simply prepend a suitable STX character and append a checksum ETX character to the CAN packets The DIPO65 module is not intended to be a control interface but to instead provide a method to monitor and configure a CAN network or individual CAN device DIP065 User s Manual e 13006502 1 0 1 Chapter 2 Hardware Requirements Chapter Overview This chapter will address the DIPO65 Hardware Requirements For information on See Page DeviceNet Terminal Block Connector 2 1 Power Connections 2 1 DeviceNet Terminal The DIP065 serial adapter connects to DeviceNet using the following pin Block Connector description Notice that Pin 1 and Pin 5 are OUTPUT pins B gt Pin 1 is the leftmost pin on the unit Description Common Out Bus CAN Low Shield CAN High 15 VDC Out Bus Power Connections The DIPO65 may be powered either from a local power source 9 12 VDC 500mA or from a 9 volt battery The unit is able to supply 15 VDC at 100 mA using a rechargeable NiCd 150mAh for approximately one hour DIP065 User s Manual e 13006502 1 0 1 Chapter Overview RS232 Serial Channel Data Rates Data Buff
5. 0 1 5 8 DRV052 Functions CAN functions DIP065 User s Manual e 13006502 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 5 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 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 respo
6. 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 5 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 O 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 return value Dim clss As Integer Dim inst as Integer Dim attr as Integer Dim int as Integer Dim buf 150 as byte DIP065 User s Manual e 13006502 1
7. 13006502 1 0 1 Due to the typically much higher data rate for the CAN network there is little need to provide RS232 to CAN data buffering The only time the RS232 channel can operate faster than the CAN network is when the network itself is heavily loaded or a fault condition has occurred In both cases it is considered reasonable that the HOST software will want to take corrective actions so message buffering in fact would prove a hindrance Information flowing between the DIPO65 and the HOST are considered to be either DATA packets transferred to or from the CAN channel and CONFIGURATION packets information used to control the operation of the DIP065 module Packets of information sent from the HOST to the CAN network will be received and buffered in an internal transmit buffer Upon verification of message checksums and data format ETX the data will be transferred to the CAN transmit buffer and then the appropriate transmit control signals will be generated At this point the transmit buffer will be considered empty and another transmit request can be accepted Following successful completion of the CAN transmission an ACKNOWLEDGE packet will be returned to the HOST If errors occur an error packet will be returned to the HOST Packets of information received on the CAN network which are accepted by the controller will be transferred to a receive FIFO A background handler will automatically transfer data from the receive FIFO to the R
8. S232 serial channel encapsulated with STX and CHECKSUM ETX bytes When the HOST responds with an acknowledge the DIP065 will either retransmit the packet error condition or proceed with the next available packet if one is available If the HOST does not respond the receive FIFO will eventually overflow The DIP065 may be configured to either discard subsequent CAN packets or to throw away the oldest packets Configuration packets must also be acknowledged by the receiver before the transmitter is free to send further packets If the HOST sends a request to write configuration information the DIP065 will process the request and then return either an acceptance or failure acknowledgement If the HOST sends a request to read configuration information the DIP065 will process the request and return either a failure acknowledgement or the requested information No response is expected from the HOST The DIP065 module will never send an unsolicited configuration packet Flow Control Configuration Control Functional Requirements 3 3 Packets are defined as either DATA packets to from the CAN interface or CONFIGURATION packets which transfer status and control information Packet flow is controlled by the receiver generating an ACKNOWLEDGE after receiving each packet The transmitter will not initiate another transmission of the same type until an acknowledge has been received In cases where the receive FIFO is not empty DIP065 send
9. Table of Contents Introduction Chapter 1 Chapter Overview oooococcococcncccncoconcononnnconconcnnncnanconinnnnnnnnnnns 1 1 o O en aeta 1 1 Hardware Requirements Chapter 2 Chapter OvervieW oooococccococcncncncnconcononcnconconnnnconancnnnnncnnnnnnnns 2 1 DeviceNet Terminal Block CONNECtOF oocoococcccccccnccncnconinccnnnns 2 1 Power Connections 0cococccccccncnccnoncnnnnnnnnconcnncnnconinccnconinancines 2 1 Functional Requirements Chapter 3 Chapter Overview 0ccccceeeeeceee tence eee eeeeeeeeeeaeaeeaeeeeaeaeeas 3 1 RS232 Serial Channel 02 cceeeeeeeeeeeeeeeeeeeeeee este ea een ee eee 3 1 Data Rates a AAAS E Sedan ead eee eee 3 1 Data Buffering ccccceeee ee eeee eee e eee eens nese ees E RARATON 3 1 Data FlOW EEEE TE RO ape 3 2 Data Pack mitad a ltd heehee 3 2 Configuration Packets oocoococcoccccncccncoccnnnnnnnnconconenaninincnnnnnnns 3 2 Plow Control ii eke eE a Aa bas tease sae DAN 3 3 Configuration Control cccceeeeee cece cece e eee esse eeeeeeeeaeaeeaeeeed 3 3 Error Management 2 e eeeeececeeeeeeeeeeeeceeeceeeneeeseseeeeeeeees 3 3 Synchronization ee 3 4 Protocol Formats Chapter 4 Chapter Overview 0ccccceeeeeceee ee eee eee eeeeeeeeeeaeaeeaeeeeeeaeeas 4 1 STX Start of Packet ooooocococcccocccocinccconconcnnnconcnnonenonaninncnnons 4 1 ETX End of Packet wisconsin eet beset Mee i area 4 1 CHECKSUM uien tuning iii cicic 4 1 Data Configuration Packets
10. b drv052 dll parl As Integer xbuf As Any As Long DIP065 User s Manual e 13006502 1 0 1 5 14 DRV052 Functions 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 DIP065 User s Manual e 13006502 1 0 1 Chapter 6 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 6 1 Sources for obtaining help are listed below B gt 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 E gt Reach us by telephone at 909 686 4211 Fax us at 909 686 4122 gt Send us Postal Mail at DIP Inc 1860 Chicago Ave Suite I 5 Riverside CA 92507 USA DIP065 User s Manual e 13006502 1 0 1 Hardware Installation Instructions DIP065 External Pwr Supply T Ii COM1 9 PIN MALE Use QS5 a DB25 F to DB9 M COM2 25 PIN MALE adapter if your mouse or another serial device is using COM1
11. e 0 DATA and CONFIGURATION packets are identical in format STX OBJ 02H Object identifier bits 11 3 for data packets Reserved field 0 for configuration packets RTRLEN Object identifier bits 2 0 RTR Length 0 8 for data packets see CAN Specifications Command type code 9 15 for configuration packets DIP065 User s Manual e 13006502 1 0 1 4 2 Protocol Formats Variable length data For data packets the length is encoded in the RTRLEN field For configuration information the length is implicit in the configuration command byte Two s complement of OBJ RTRLEN DATA Acknowledgement packets are used to verify transmission of previous packets and report failures DATA CHKSUM ETX 03H ACKNOWLEDGEMENT PACKETS STX STX STATUS CHKSUM ETX ERROR CODES DIP065 User s Manual e 13006502 1 0 1 STATUS CHKSUM ETX 02H Error code see Errors Two s complement of STATUS 03H The following error codes are defined ERROR E_OK E_FULL E_PARAM E_CHKSUM CODE DESCRIPTION 0 No Error The last transmitted packet was accepted an fully processed This is the ACK packet The RS232 to CAN receive buffer is in use due to a previous attempt to transmit This error is generated upon receiving a transmit request before a previous transmit packet has been transferred to the CAN transmit buffer An invalid configuration parameter was received in acommand packet The packet is ignored A recei
12. e rest of the packet if an Error code is received buf 2 3 Receive Id from node DIP065 User s Manual e 13006502 1 0 1 5 4 DRV052 Functions DIP065 User s Manual e 13006502 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 0 if no data is 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 5 5 Visual Basic Declaration Dim rts As Long return value Dim clss As Integer Dim inst as Integer Dim rlen as Integer Dim buf 150 as byte rts DNReset node clss inst rlen buf 0 Return Data buf returns the following data buf
13. ering Chapter 3 Functional Requirements This chapter will address the DIPO65 Functional Requirements For information on See Page RS232 Serial Channel 3 1 Data Rates 3 1 Data Buffering 3 1 Data Flow 3 2 Data Packets 3 2 Configuration Packets 3 2 Flow Control 3 3 Configuration Control 3 3 Error Management 3 5 Synchronization 3 5 The purpose of the DIP063 Serial protocol is to allow an RS232 serial channel to gain access to a CAN based control network The RS232 channel will typically be but in no way limited to an IBM PC compatible personal computer HOST system Electrical power for the RS232 transceivers will be derived from the DSR DTR signal pair Description RX Receive TX Transmit DTR Data Ready GND Ground RTS Ready to Send B gt These are the minimum required signals needed to operate the serial interface The RS232 serial interface will operate at 9600 baud 1 stop bit no parity The CAN network operating rate will be determined by the configuration registers as set by the HOST software CAN data rates vary from very low less than 9600 baud to very high 1 megabaud The DIP065 module will allow for 176 data bytes to be buffered in a receive FIFO structure for data packets received from the CAN network pending transmission to the RS232 channel DIP 065 User s Manual e 13006502 1 0 1 3 2 Functional Requirements Data Flow Data Packets Configuration Packets DIP065 User s Manual e
14. ing transactions to HOST the HOST may force a pause by not responding to a transmission During the pause the DIPO65 will continue to process configuration packets sent by the HOST Two levels of configuration control are required The CAN control subsystem has specific control registers to determine transmission rates and address filtering In addition configuration control is provided to determine the RS232 packet management The CAN packet header uses 4 bits to define the packet length allowing for potentially 16 different message lengths 0 15 Only packet lengths of 0 8 are acceptable leaving 7 undefined lengths which can be used to transfer configuration information The following configuration transfers will be supported Code 9 allows the RS232 channel to access the CAN interface set up registers OBJ 0 RESERVED RTRLEN 0x09 Write configuration DATA ACCEPTANCE code DATA 1 MASK code DATA 2 TIMO code DATA 3 TIM1 code OBJ 00 RESERVED RTRLEN 0x19 Write configuration DATA ACCEPTANCE code DATA 1 MASK code DATA 2 TIMO code DATA 3 TIM1 code Code 10 allows the RS232 channel to access the CAN interface control status registers OBJ RESERVED RTRLEN 0x0A Write configuration or DATA CAN_CONTROL OBJ 0 RTRLEN 0x1A Read configuration DATA CAN_STATUS DIP065 User s Manual e 13006502 1 0 1 3 4 F
15. ions 5 13 The following section describes the declaration under Visual Basic Function Prototypes and Declaration Declare Function DNAllocate Lib drv052 d1l ByVal node As Integer ByVal conn As Integer rbuf As Any As Long Declare Function DNFree Lib drv052 dIl ByVal node As Integer ByVal conn As Integer rbuf As Any As Long Declare Function DNReset Lib drv052 dIl 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 d1l radd As Integer rlen As Integer rbuf As Any As Long Declare Function CANXmit Lib drv052 dll ByVal radd As Integer ByVal rlen As Integer rbuf As Any As Long Declare Function LoadVXD Lib drv052 d11 ByVal port As Integer ByVal Irq As Integer config As Any As Long Declare Function UnloadVXD Lib drv052 d11 As Long Declare Function Byte2Int Lib drv052 dll xbuf As Any As Integer Declare Function Byte2Long Lib drv052 d11 xbuf As Any As Long Declare Function Byte2Float Lib drv052 dll xbuf As Any As Single Declare Function Int2Byte Li
16. ipt of 10 ETX characters Note that this character burst may cause at least 1 NACK transaction to occur within the DIP065 module DIP065 User s Manual e 13006502 1 0 1 Chapter Overview STX Start of Packet ETX End of Packet CHECKSUM DATA AND CONFIGURATION PACKETS Chapter 4 Protocol Formats This chapter will address the DIPO65 Protocol Formats For information on See Page STX Start of Packet 4 1 ETX End of Packet 4 1 CHECKSUM 4 1 Data Configuration Packets 4 1 Acknowledgement P ackets 4 2 Error Codes 4 2 The transfer formats for data configuration and acknowledgment packets share a common format consisting of a start of packet flag byte the packet information a checksum and an end of packet flag byte All packets sent between the HOST and the DIP065 will start with an STX character The STX character is the standard ASCII character 02H The DIPO65 module will ignore all RS232 data until the receipt of the STX character and will continue to buffer data until the receipt of the ETX character up to a maximum of 11 characters 2 header 8 data checksum All packets sent between the HOST and the DIP063 will end with an ETX character The ETX character is the standard ASCII character 03H The ETX character may be used to force synchronization All packets will include a 2 s complement checksum of all packet information except the STX and ETX characters The modulus 256 sum of all data the checksum will b
17. nse 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 DIP065 User s Manual e 13006502 1 0 1 5 10 DRV052 Functions VXD functions DIP065 User s Manual e 13006502 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 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 DIP065 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 Configuring DIP065 ee oA DRV052 Functions 5 11 The 4 byte configuration array consists of the following UNSIGNED CHAR fields Config 4 accept_code Config 5 mask_code Config 6 Bus Time 0 accept_c
18. ode 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_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 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 x32 specific register information Config 7 Bus Time 1 Bus Time 1 Data bit sampling control Refer to x32 specific register information To set up the data rate to 125kb use Bus Time 0 Bus Time 1 DEF_SPD125_0 0x03 DEF_SPD125_1 Oxic To set up the data rate to 250kb use Bus Time 0 Bus Time 1 DEF _SPD250_0 0x01 DEF _SPD250_1 Oxic To set up the data rate to 500kb use Bus Time 0 Bus Time 1 DEF_SPD500_0 0x00 DEF_SPD500_1 Oxic To set up the data rate to 1000kb use Bus Time 0 Bus Time 1 DEF_SPD1000_0 0x00 DEF_SPD1000_1 0x14 DIP065 User s Manual e 13006502 1 0 1 5 12 DRV052 Functions Utility functions Error Codes DIP065 User s Manual e 13006502 1 0 1 Port 0x2f8 0x3f8 for DIPO65 IRQ IGNORED Config As described above UnloadVXD This function unloads the
19. proper driver for the DIPO52 and DIP065 The DRV052 DLL can be used on Windows 95 and NT operating system Function Prototype long UnloadVXDO 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 Param1 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 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 DIPOS2 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 Visual Basic Function Prototypes DRV052 Funct
20. teger Dim conn As Integer Dim buf 150 as Byte rts DNAllocate 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 5 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 Dim buf 150 as byte rts DNFree node conn buf 0 Return Data buf returns the following data buf 0 1 Error code 0 for successful response Ignore th
21. the parameter byte 0x1 it indicates that the last data byte was received incorrectly and should be retransmitted Error Management Synchronization Functional Requirements 3 5 NOTE ONLY DATA packets are expected to be acknowledged by the HOST NOTE The WRITE_STATUS does not generate an explicit response If the parameter byte is O then the implicit response occurs when the next CAN packet is received and transfered If the parameter byte is 1 the implicit response occurs immediately by the retransmission of the previous packet If the parameter byte gt 1 then the function returns an E_ PARAMETER message The StatusByte may be read It has the following bit interpretations lt aa if set HOLD buffer waiting for an ACK 2 3 if set HOLD buffer waits for ACK NAK 2 8 if set discard new message if XHOLD is full OBJ 0 RTRLEN 0x0F Write configuration or DATA StatusByte OBJ 0 RTRLEN 0x1F Read configuration DATA Status Byte All packets sent by either the HOST or the DIP065 must be acknowledged Configuration READ requests are acknowledged with either the requested data or an error packet All other transactions are specifically acknowledged by a an error packet or an ACK packet To a large degree the error management is controlled by the HOST The HOST and DIP063 must maintain synchronization since the data bytes are transmitted in binary format The units will re synchronize upon rece
22. unctional Requirements DIP065 User s Manual e 13006502 1 0 1 Code 11 allows the RS232 channel to set the XHold mode and the DiscardMode registers and to reset the device The first byte contains the mode byte shown below The second byte must be 0 OBJ 0 RTRLEN 0x0B Write configuration or DATA mode byte DATA 1 0 7237 00 do nothing 01 flush XHOLD buffer disable ACK requirement enable ACK requirement l sgena rE 0x do nothing 10 iscard oldest packet on overflow q 11 discard newest packet on overflow ei aaa Master Reset no acknowledge When read the AccessMode function returns 2 bytes The first byte is the ModeControl status shown below The second byte is the number of bytes in the HOLD buffer OBJ 0 RTRLEN 0x1B Read configuration DATA Mode Control DATA 1 Number of bytes in Hold Buffer i eses if set HOLD buffer waiting for an ACK S 353 if set HOLD buffer waits for ACK NAK 2 22 if set discard new message if XHOLD is full Code 12 14 Reserved Code 15 AccessStatus allows the RS232 channel to access the last STATUS information or clear the XHOLD function to send the next packet The DIP065 sends two types of unsolicited messages status and DATA from CAN When a WRITE_STATUS is received with the parameter byte 0 it indicates that the last DATA packet has been acknowledged and the XHOLD function is free to send the next packet If
23. ved checksum was incorrect Chapter Overview DN Functions Chapter 5 DRVO052 Functions This chapter addresses the DRV052 functions Windows For information on See Page DN Functions 5 1 CAN Functions 5 8 VXD Functions 5 10 Utility Functions 5 12 Error Codes 5 12 Visual Basic Function Prototypes 5 13 Note drv052 dll was recompiled under the following names Drv052_c dll C calling convention C C Drv052_p dll Pascal calling convention Vbasic These functions allow the user to send DeviceNet commands DNAllocate 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 DIP065 User s Manual e 13006502 1 0 1 Chapter 5 buf Pointer to an array of bytes for a response from DNAllocate The size of the array must be 150 DIP065 User s Manual e 13006502 1 0 1 5 2 DRV052 Functions DIP065 User s Manual e 13006502 1 0 1 C Declaration long rts int 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 In

Download Pdf Manuals

image

Related Search

Related Contents

Feltest Tensio+ User Manual  Service Manual Orion Peripheral Stations Version 2.20  GUÍA DEL USUARIO - produktinfo.conrad.com      026 Caractéristiques techniques _    Maintenance - TSM Control Systems  ESP FLICKER  BD TCBS Agar  

Copyright © All rights reserved.
Failed to retrieve file