Home

PAM CAN Bus Interface User's Manual

image

Contents

1. 2 2 2 3 1 User Connections 2 3 2 3 2 Interface Controller 2 4 2 3 3 Physical Interface 2 4 2 3 4 Node Address Selector 2 4 2 3 5 CAN Bus Interface Specifications 2 4 3 INTERFACE SOFTWARE 3 1 3 1 Introduction 3 1 3 2 Installation 3 1 3 3 3 1 3 3 1 Channel Declaration 3 2 3 3 2 FUNCtONS 3 5 3 4 Channel 65
2. low high a i Address Selectors gt Nc control lt a In Out CAN Connectors ro gf Interface a Controller 6 Physical a Interface I Firmware Reset Button pac004_a dsf 11 10 96 Figure 3 Interface board 2 3 1 USER CONNECTIONS User connections are made via two nine pin D SUB connectors one male and one female mounted on the front side of the board One connector is for bus input the other connector is for bus output Equivalent pins on both connectors are jumpered together via the board Connector pin assignments are listed in Table 1 SIGNAL REMARK no connection Reserved by CiA CAN In Automation Users and Manufacturers Group CAN_L CAN_L bus line dominant low Reserved by CiA Optional ground internally connected to Pin 3 CAN_H bus line dominant high Reserved by CiA error line Positive DC voltage normally supplied to all nodes on the network by an external power supply Table 1 CAN Bus Interface Connector Pin Assignments The CAN Bus connector is standardized by ISO Standard 11898 Doc No 006 8029 B Rev 4 June 1997 Page 2 3 Interface Description PAM CAN Bus Interface User s Manual Suitable mating connectors are available from a number of connector manufacturers or they may be ordered from Atlas Copco Controls Atlas Copco part numbers are listed in Table 2 ATLAS COPCO ORDERING NUMBER DESCRIPTION 505 3003 9 pin D SUB connecto
3. R Chann lt AR HIS_Axisl 0x402 H El L D el output variable OUTPUT_VAR AxislPosition EL CAN MyDevNetChannel ITY 6 LRO AxislPosition el output variable not event driven _ OUTPUT_VAR HOV_AxislSpeed EL CAN MyDevNetChannel Doc No 006 8029 B Rev 4 June 1997 Example Programs PAM CAN Bus Interface User s Manual EVENT DRIVEN NO 7 VAR LRO_AxislSpeed Host references to output variable CHANNEL REFERENCE HRF_OutAxl1PosToHost0O CHANNEL VAR HOV AxislPosition COMM_ID 0x0003 CHANNEL_REFERENCE HRF_OAx1SpeTHostO EL VAR HOV_AxislSpeed CO ID 0x0004 CHANNEL REFERENCE HRF_OutAx1PosToHostl EL VAR HOV AxislPosition CO ID 0x0403 CHANNEL _ REFERENCE HRF_OAx1SpeTHostl EL VAR HOV_AxislSpeed CO ID 0x0404 Channel Output direct access message HANNEL_ OUTPUT_SET HOS_Axisl CHANNEL CAN MyDevNetChannel VARS LFO_AxislInError 31 LWO_AxisiStatus 0 30 ND Host reference to Output direct access message CHANNEL REFERENCE HRF_OutAx1lMsgToHost0O HANNEL_ VAR HOS_Axisl OMM_ID 0x05 CHANNEL _ REFERENCE HRF_OutAx1lMsgToHostl EL_VAR HOS_Axisl CO ID 0x405
4. Doc No 006 8029 B Rev 4 June 1997 Page 4 7 Example Programs PAM CAN Bus Interface User s Manual Page 4 8 Use in application LRO_AxislPosition lt 12 33 LRO_AxislSpeed lt 12 33 HOV_AxislSpeed lt send LFO_AxislInError lt set LWO_AxislStatus lt 12 HOS_Axisl lt send Hosto A Event if value changed No event generated to DP Manually send var Manually send var CAN CHANNEL HRF_IFIg1FHO gt HIV_InFlagi HRF_IMAx1FHO HRF_OAx1STHO HRF_OAx1PTHO HRF_OMAx1THO HIS_ Axis to DP HOV_Axis1Speed HOV_Axis1Position to DP PAM Application Variables LFI_Flagi gt AxisiStart gt AxisiStop L LWI_Axis1Cmd LRO_AxisiSpeed LRO_Axis1Position 5 HOS _Axis1 Host1 HRF_IFIg1FH1 Pee ae HRF_IMAx1FH1 NAN NS HRF_OAx1STH1 gt HRF_OAx1PTH1 HRF_OMAx1TH1 A LFO_Axis1InError A Figure 10 Linkages for Example Program DeviceNet LWO_AxisStatus pac011_a dsf 26 05 97 Doc No 006 8029 B Rev 4 June 1997 Appendix A CAL Specification PAM CAN Bus Interface User s Manual Appendix A CAL SPECIFICATION CIA DS201 DS207 1 The CAL master must be at least class 2 to have node
5. CHA R Host reference to output variable CHANNEL_REFERENCE HRF_OAx1STH 7 Output Axisl Status To Hosts CHANNEL _ VAR HOS_AxisiStatus END EXAMPLE 2 DEVICENET External CAN_CHANNEL Application CAN Network HRF_InFlag1FromHost0 gt HIV_INFlagt LFI_Flag1 HRF_OutAxe1 StatusToHostO LFO_Axis1Stopped HOS_Axis1Status rT HRF_InFlag1FromHost1 LWO_Axis1Status HRF_OutAxe1 StatusToHost1 pac006_b dsf 02 06 97 Figure 6 Multiple Linkages with DeviceNet Doc No 006 8029 B Page 3 18 Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual Channel declaration CAN_CHANNEL CAN_MyChannel BAUDRATE 200000 GENERATE _VARID YES application variables FLAG VAR LFI_Flagl FLAG VAR LFO_AxislStopped WORD_VAR LWO_AxislStatus Channel input variable ANNEL_INPUT_VAR HIV_InFlagl CHANNEL CAN_MyChannel VAR LFI_Flagl reference to input variable CHANNEL REFERENCE HRF_InFlaglFromHostO CHANNEL VAR HIV_InFlagl CO ID 0x0001 CHANNEL _ REFERENCE HRF_InFlaglFromHostl CHANNEL VAR HIV_InFlagl CO ID 0x0401 mi 7 END Channel output variable CHA
6. 6 I ANNEL_OUTPUT_VAR HOV_AxislSpeed CHANNEL CAN MyChannel EVENT _DRIVEN NO VAR LRO _AxislSpeed m ND Host reference to output variable HANNEL_REFERENCE HRF_OAx1STH CHANNEL_VAR HOV_Axis1Speed DS m ND vent driven Output Axisl Speed To Hosts Channel Output direct access messag en I D Z zZ EL_OUTPUT_SET HOS_Axisl CHANNEL CAN_MyChannel EVENT DRIVEN NO VARS LFO_AxislInError 31 LWNO_AxisiStatus 0 30 END CHANNEL _ REFERENCE CHANNEL _ VAR HRF_OAx1MTH HOS_Axisl m ND Use in application 4 RO_AxislPosition lt Axisl position not vent driven Host reference to Output direct access message Output Axisl Message To Hosts Event if value changed gt message send sent LRO_AxislSpeed lt 120 No HOV_AxislSpeed lt send LFO_AxislInError lt LWO_AxislStatus lt HOS_Axisl lt send set 12 Page 4 2 vent generated to DP gt no msg Manually send var to DP Manually send var to DP Doc No 006 8029 B Rev 4 June 1997 Example Programs 4 2 FOR A CAL WITHOUT DBT MASTER PAM CAN Bus Interface User s Manual The declarations in this example program establish the communications linkages illustrated in Figure 9 during application executi
7. 3 7 3 4 1 Channel Input Variable 3 7 3 4 2 Channel Input Set 3 8 3 4 3 Channel Output Variable 3 9 3 4 4 Channel Output Set 3 11 3 4 5 Function 3 13 3 5 Channel References 3 14 3 5 1 Multiple Linkages 3 17 Doc No 006 8029 B Rev 4 June 1997 Page I Table of Contents PAM CAN Bus Interface User s Manual 3 6 Standard 095 3 19 3 6 1 Standard Declaration for CAL with DBT Master 3 20 3 6 2 Standard Declaration for CAL without DBT Master 3 20 3 6 3 Standard Declaration for DeviceNet 3 20
8. EXAMPLE IF CAN_MyChannel node_error_port 0x0001 THEN RESET_NODE_ERROR_PORT MASK DeviceNet only This function resets the selected bit s of the current node error port of the channel The syntax of the statement is as follows lt ChannelName gt lt reset_node_error_port mask EXAMPLE CAN_MyChannel lt reset_nod rror_port 0x0001 Doc No 006 8029 B Page 3 6 Rev 4 June 1997 Interface Software 3 4 3 4 1 PAM CAN Bus Interface User s Manual CHANNEL VARIABLES Channel Variable declarations create a class of intermediate variables Channel Variables and define how data is mapped between Channel Variables and PAM Internal Variables internal variables declared by the application program CHANNEL_REFERENCE declarations see paragraph 3 5 define the mapping of CAN Bus message data content to Channel Variables In the Channel Variable descriptions input means received by PAM and output means sent by PAM CHANNEL INPUT VARIABLE The Channel Input Variable declaration creates a Channel Input Variable and maps it to a specified PAM Internal Variable DECLARATION SYNTAX CHANNEL_INPUT_VAR lt identifier gt NUMBER lt Number gt NODES_GROUP lt Group identifier gt CHANNEL lt ChannelName gt PRIORITY lt Priority level gt VAR lt VariableName gt END lt Identifier gt Specifies the Channel Variable name lt Number gt NA number for i vari
9. 335 CHANNEL_REF ERENCE CHANNEL COMM_ID END Doc No 006 8029 B Rev 4 June 1997 VAR 881 HRF_InAx1MsgFromHost2 HIS_Axisl LA LA Page 4 3 Example Programs PAM CAN Bus Interface User s Manual CHANNEL _ REFERENCE HRF_InAx1lMsgFromHost3 CHANNEL VAR HIS Axisl COMM_ID 882 END Channel output variable CHANNEL O UTPUT_ VAR HOV AxislPosition CHANNEL CAN MyChannel PRIORITY 6 VAR LRO _AxislPosition CHANNEL OUTPUT_VAR HOV_AxislSpeed CHANNEL CAN MyChannel EVENT DRIVEN NO VAR LRO _AxislSpeed Host reference to output variable HANNEL_ REFERENCE HRF_OutAxlSpeedToHosts CHANNEL _ VAR HOV_AxislSpeed COMM_ID 661 Z EFERENCE HRF_OutAx1PosToHosts EL_VAR HOV_AxislPosition D 1321 Z el Output direct access message OUTPUT_SET HOS_Axisl A EL CAN MyChannel FO_AxislInError 31 LWO_AxisiStatus 0 30 Z Host reference to Output direct access message CHANNEL REFERENCE HRF_OutAx1lMsgToHosts CHANNEL _VAR HOS_Axisl COMM_ID 1543 Fi Z Use in application LRO_AxislPosition lt 12 33 Event if value changed LRO_AxislSpeed lt 12 33 No event generated to DP HOV_Ax
10. lt communications identifier gt END lt Identifier gt Specifies the host variable name In CAL system with a DBT master it is used during initialization phase to define a COMM_ID Then in that case it must be consistent with the FORMAT_NAME and with the name declared in the host The two possible formats name are CAL_FREE xxxxxxxxxxxx 12 characters According to CAL specification CiA DS201 DS207 a is added automatically in the interface board If more than 12 characters are used the name is truncated if less than 12 character are used _ are added at the end e CAL_FIXED pppxxxxxxxnnn where according to CAL specs ppp 3 characters must represent the profile xxxxxxx 7 characters must represent the variable name and nnn 3 digits must represent the Device ID lt Channel var or set gt NA corresponding Channel Variable or set into which the host variable maps lt Format name gt NA format name CAL_FREE or CAL_FIXED CAL The default format name is taken from DEF_FORMAT_NAME in the CHANNEL declaration lt communications identifier gt NA host variable identifier assigned by application when communications identifiers are not assigned by DBT Bus Master Doc No 006 8029 B Page 3 14 Rev 4 June 1997 Interface Software Doc No 006 80 Rev 4 June 1997 PAM CAN Bus Interface User s Manual DeviceNet COMM_ID use In DeviceNet the six most significant bits are used to
11. CH NAL WORD_VA NAL WORD_VA R LWO_VarHigh R LWO_VarLow Channel Output direct access message EL_OUTPUT_S D ET HOS _FatalError ANNEL CAN_MyChannel RS LWO_VarHigh 32 63 LWO_VarLow 0 31 Host reference to Output direct access message EL REFERENC E HRF_FatalErr ANNEL_VAR HOS_FatalError In the following example when a fatal error occurs in PAM the first message is send to inform Host2 that PAM 15 in Fatal Error and a second one is send to give it the fatal error code With dynamic distribution of identifier HOS _PAMVariable Both messages have sam HOS_PAMVariable size and same reference ROR_ROUTINE RTN_MyFatalErrorRoutine Communication channel declaration CAN_CHANNEL CAN_MyChannel GENERATE_VARID NO FATAL _ERROR_VARIABLE1 FATAL _ERROR_VARIABLE2 FATAL_ER END_CHANNE Application linked variables INTERNAL WORD_VAR LWO_VariableID INTERNAL WORD_VAR LWO_VariableValue Channel Output direct access message CHANNEL OUTPUT_SET HOS PAMVariable CHANNEL CAN MyChannel VARS LWO_VariableID 32 39 LWO_VariableValue 0 31 END Host reference to Output direct access message CHANNEL REFERENCE HRF_OPAMVTH2 Output PAM Variable To Host2 Cc END Routines declaratio HANNEL VAR HOS
12. NA in bytes 4 8 Specifies the size of data in the priority FIFOs This size must be not smaller than 4 The default value is 8 MAX_FIFO_DATA SIZE NA in bytes 4 8 Specifies the size of data in the FIFOs This size must be not smaller than 4 The default value is 8 IN_PRIORITY_FIFO_ SIZE NA in blocks Specifies size of the input priority FIFO in number of block This size must not be smaller than 10 The default value is 1 6 of dualport memory IN_FIFO_SIZE NA in blocks Specifies size of the input FIFO in number of block This size must not be smaller than 10 The default value is 1 3 of dualport memory OUT_PRIORITY_FIFO_ SIZE NA in blocks Specifies size of the output priority FIFO in number of block This size must not be smaller than 10 the Default value is 1 6 of dualport memory OUT_FIFO_SIZE NA in blocks Specifies size of the input FIFO in number of block This size must not be smaller than 10 The default value is 1 3 of dualport memory HIGH_PRIORITY_LEVEL NA 0 7 Specifies the highest priority level for the external communication protocol The default value is 0 LOW_PRIORITY_LEVEL NA 0 7 Specifies the lowest priority level for the external communication protocol The default value is 7 LOW_LEVEL_PRIORITY_FIFO NA LOW_PRIORITY_LEVEL HIGH_PRIORITY_LEVEL Specifies the lowest priority level for a variable to be put in the priority FIFO The default value is HIGH_PRIORITY_LEVEL FATAL
13. guarding CiA DS203 1 3 4 2 All variables are Write_only CiA DS202 2 4 3 3 Dynamic identifier distribution is possible Doc No 006 8029 B Rev 4 June 1997 Page A 1
14. linking two Channel References to one single Channel Variable see Example 2 EXAMPLE 1 CAL External CAN_CHANNEL Application CAN Network HRF_IFlgi1FH1 _ __ HIV_INFlagt LFI_Flag1 HRF_OAx1STH lt LFO_Axis1Stopped HOS_ Axis1Status HRF_IFlg1FH2 la LWO_Axis1Status HRF_OAx1STH pac006_a dsf 02 06 97 Figure 5 Multiple Linkages with CAL Channel declaration CAN_CHANNEL CAN_MyChannel ENERATE_VARID NO END_CHANNEL Q Linked application variables INTERNAL FLAG_VAR LFI_Flagl INTERNAL FLAG_VAR LFO AxislStopped INTERNAL WORD_VAR LWO_AxisiStatus Doc No 006 8029 B Rev 4 June 1997 Page 3 17 Interface Software PAM CAN Bus Interface User s Manual Channel input variable CHANNEL_INPUT_VAR HIV_InFlagl CHANNEL CAN_MyChannel VAR LFI_Flagl ig Z Host reference to input variable CHANNEL REFERENCE HRF_IFIg1FH2 Input Flagl From Host2 CHANNEL _ VAR HIV_InFlagl CHANNEL _ REFERENCE HRF_IF1g1FH3 Input Flagl From Host3 CHANNEL VAR HIV_InFlagl Z nnel output variable L_OUTPUT_SET HOS_AxislStatus NNEL CAN MyChannel S LFO_AxislStopped 15 LWO_AxislStatus 0 14
15. put PAM in BOOT state In the Advanced menu select Download Set data type to CAN_FIRMWARE Browse to get the right CAN firmware file Click on OK Gr lt gt D Doc No 006 8029 B p Rev 4 June 1997 Page 3 1 Interface Software PAM CAN Bus Interface User s Manual 3 3 3 3 1 Page 3 2 CHANNEL CHANNEL DECLARATION PURPOSE The Channel Declaration establishes the operating parameters of the CAN Bus Interface during the initialization phase of application program execution For most applications the default values of optional parameters should be used see parameters description DECLARATION SYNTAX CAN CHANNEL lt ChannelName gt SYNCHRO_TIMEOUT lt Synchronization timeout value in ms gt WATCHDOG_TIMEOUT lt Watchdog timeout value in ms gt GENERATE_VARID lt YES NO MAX_PRIORITY_READ lt Nb max priority successive reads gt MAX_PRIORITY_FIFO_DATA_SIZE lt Max data size in byte gt MAX_FIFO_DATA_SIZE lt Max data size in bytes gt IN_PRIORITY_FIFO_SIZE lt In priority FIFO size gt IN_FIFO_SIZE lt ln FIFO size gt OUT_PRIORITY_FIFO_SIZE lt Out priority FIFO size gt OUT_FIFO_SIZE lt Out FIFO size gt HIGH_PRIORITY_LEVEL lt Highest priority level gt LOW_PRIORITY_LEVEL lt Lowest priority level gt LOW_LEVEL_PRIORITY_FIFO lt Lowest priority level for priority FIFO gt FATAL_ERROR_VARIABLE1 lt Fatal error channel variable name for msg 1 g
16. 3 7 Fatal Error 3 3 22 EXAMPLE PROGR ANSE ere 4 1 4 1 For a CAL with DBT 11 25 4 1 4 2 For a CAL without DBT master 4 2 4 3 For 4 6 APPENDIX A CAL SPECIFICATION CIA DS201 DS207 4 1 Doc No 006 8029 B Page Il Rev 4 June 1997 Introduction 1 1 1 2 1 3 PAM CAN Bus Interface User s Manual INTRODUCTION MANUAL SCOPE This manual is intended to serve as a reference for individuals who will be interfacing the PAM Programmable Axis Manager to a CAN Controller Area Network Bus utilizing the optional CAN Bus Interface for PAM This manual provides details on the hardware and software interfacing aspects of the CAN Bus Interface for PAM along with some example programs and applications information The scope of this manual is limited to the optional CAN Bus Interface For a complete listing of all technical publications covering PAM and it s associated peripherals i e ST1 Smart I O VME Bus Master and Simatic S5 refer to the Technical Publications Overview in the PAM User s Manual do
17. 6 8029 B Page 3 22 Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual Fatal Error Occurs y Init FatalError1 Low FatalError1High FatalError2Low FatalError2High Isa Execute FatalErrorRoutine YES P gt FatalErrorRoutine defined T NO M K sa l FatalErrorVariablet gt YES gt Construct and send N defined FatalErrorVariable1 Xe NO y Isa Construct and send FatalErrorVariable2 YES gt gt FatalErrorVariable2 defined Fatal Error End pac001_a dsf 17 10 96 Figure 8 Fatal Error Management EXAMPLES The following example uses the default setting It means that when a fatal error occurs in PAM the first message contains PAMFatalErrorCode and Field1 D1 The second message contains Field D2 and Field3 D3 Communication channel declaration CAN_CHANNEL CAN_MyChannel GENERATE VARID NO With dynamic distribution of identifier FATAL _ERROR_VARIABLE1 HOS_FatalError Both messages have sam FATAL _ERROR_VARIABLE2 HOS_FatalError size and same reference END_CHANNEL Doc No 006 8029 B Rev 4 June 1997 Page 3 23 Interface Software PAM CAN Bus Interface User s Manual Application linked variables INT INT CHANN CHANN END R R CH VA EN
18. NNEL _ OUTPUT_SET HOS_AxislStatus CHANNEL CAN _ MyChannel VARS LFO_AxislStopped 15 LWO_AxislStatus 0 14 END Host reference to output variable CHANNEL REFERENCE HRF_OutAxelStatusToHost0O CHANNEL_VAR HOS_AxislStatus COMM_ID 0x0002 END CHANNEL REFERENCE HRF_OutAxelStatusToHostl CHANNEL VAR HOS_AxisiStatus COMM_ID 0x0402 END Doc No 006 8029 B Rev 4 June 1997 Page 3 19 Interface Software PAM CAN Bus Interface User s Manual 3 6 3 6 1 3 6 2 Page 3 20 STANDARD DECLARATIONS STANDARD DECLARATION FOR CAL WITH DBT MASTER EXAMPLE Communication channel declaration CAN_CHANNEL CAN_MyCALChannel BAUDRATE 200000 GENERATE VARID NO END_CHANNEL Linked application variables INTERNAL WORD_VAR LWO MyLinkedWordVariable channel output variables CHANNEL OUTPUT_VAR HOV_MyChannelOutputVariable CHANNEL CAN MyChannel VAR LWO_MyLinkedWordVariable END channel reference CHANNEL _ REFERENCE HRF_MyChaRef 12 characters according to CAL FREE CHANNEL _ VAR HOV_MyChannelOutputVariable END STANDARD DECLARATION FOR CAL WITHOUT DBT MASTER EXAMPLE Communication channel declaration CAN_CHANNEL CAN_MyCALChannel BAUDRATE 200000 GENERATE VARID YES CHANNEL inked application variables ERNAL WORD_VA
19. PLES IF CAN MyChannel error_code CHNL_NODE_INIT_ERROR THEN EXCEPTION CAN_MyChannel error_code CHNL_NODE_INIT_ERROR SEQUENCE The file CHNLERR SYS contains a listing of the error codes and their definitions It is located in SOCATOOL APPINCS ERROR_CODE NUMERICAL This inquire function returns the current error code of the channel The syntax of the statement is as follows lt ChannelName gt error_code EXAMPLE IF CAN_MyChannel error_code CHNL_WATCHDOG_TIMEOUT THEN RESET_ERROR_CODE MASK This function reset the selected bit s of the current error code of the channel The syntax of the statement is as follows lt ChannelName gt lt reset_error_code mask EXAMPLE CAN_MyChannel lt reset_error_code CHNL_WATCHDOG_TIMEOUT Doc No 006 8029 B Rev 4 June 1997 Page 3 5 Interface Software PAM CAN Bus Interface User s Manual DISCONNECT_NODE CAL Only This function stops the CAN communications The syntax of the statement is as follows lt ChannelName gt lt disconnect_node EXAMPLE CAN_MyChannel lt disconnect_node NODE_ERROR_PORT DeviceNet only This inquire function returns the current node guarding error port status of the interface Return value is a status in which each bit represents a port bitO for portO bit1 for port1 The syntax of the statement is as follows lt ChannelName gt node_error_port
20. R LWO_MyLinkedWordOutputVariable nnel output variables EL_OUTPUT_VAR HOV_MyChannelOutputVariable EL CAN_MyChannel LWO_MyLinkedWordOutputVariable QN HN TN A R N N H D gt Z lal channel referenc Master Only COMM_ID is used HANNEL REFERENCE HRF_MyChannelReference HOV_MyChannelOutputVariable Qn CHANNEL _ VAR COMM _ID 4 tel Z length is not important because without DBT Doc No 006 8029 B Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual 3 6 3 STANDARD DECLARATION FOR DEVICENET EXAMPLE Doc No 006 8029 B Rev 4 June 1997 Communication channel declaration CAN_CHANNEL CAN_DevNetChannel GENERATE _VARID YES BAUDRATE 125000 END_CHANNEL x application linked variables INTERNAL WORD_VAR LWO_MyLinkedWordOutputVariable channel output variables CHANNEL _OUTPUT_VAR HOV_MyChannelOutputVariable CHANNEL CAN_MyChannel VAR LWO_MyLinkedWordOutputVariable END channel reference length is not important because with DeviceNet only COMM_ID is used CHANNEL _ REFERENCE HRF_MyChannelReference CHANNEL_VAR HOV_MyChannelOutputVariable COMM 15 4 ND Page 3 21 Interface Softwa
21. Socapel PAM A Programmable Axes Manager PAM CAN Bus Interface User s Manual Ordering Number 006 8029 B Rev 4 June 1997 This upgraded and improved version replaces all the previous We reserve the right to amend this document without prior notice and decline all responsibilities for eventual errors Doc No 006 8029 B Atlas Copco Controls SA En Montillier 4 June 1997 CH 1303 PENTHAZ by Atlas Copco Controls SA previously SOCAPEL SA Switzerland All rights reserved Table of Contents PAM CAN Bus Interface User s Manual TABLE OF CONTENTS 8 6 SE ae er 1 1 1 1 Manual Scope 1 1 1 2 Manual Organization and Contents 1 1 1 3 Definitions Acronyms and 5 1 1 5 INTERFACE DESCRIPTION eee re ee 2 1 2 1 CAN Summary Description 2 1 2 2 PAM CAN Bus 2 1 2 2 1 DeviceNet Implementation Specification 2 2 2 3 Interface Board
22. _ERROR_VARIABLE1 NA The name of a Channel Variable CHANNEL_OUTPUT_VAR or CHANNEL_OUTPUT_SET to be transmitted when a fatal error occurs in PAM see Fatal Error Management page 3 21 FATAL_ERROR_VARIABLE2 NA The name of a Channel Variable CHANNEL_OUTPUT_VAR or CHANNEL_OUTPUT_SET to be transmitted when a fatal error occurs in PAM see Fatal Error Management page 3 21 FATAL_ERROR_ROUTINE NA The name of a ROUTINE to be executed when a fatal error occurs in PAM see Fatal Error Management page 3 21 Doc No 006 8029 B Rev 4 June 1997 Page 3 3 Interface Software PAM CAN Bus Interface User s Manual Page 3 4 NODE_NAME NA This parameter specifies the PAM node name for connection by name The default name is SocaPam BAUDRATE NA in bits s 100000 or 200000 for CAL 125000 250000 or 500000 for DeviceNet Specifies the communication baudrate The default value is 200000 200 kbits s NODE_GUARDING_TIMEOUT NA in milliseconds For CAL only This parameter give the node guarding time suggested to the NMT Master Default value is none LIFE_TIME_FACTOR NA For CAL only This parameter gives the node life time factor suggested to the NMT Master Default value is none DEF_INHIBIT_TIME NA in milliseconds For CAL only This parameter give the default inhibit time for Channel Output variables when INHIBIT_TIME is not specified in the Channel Output variable declaration Inhibit time specifies minimum delay be
23. _PAMVariable n ROUTINES RGR_MyRoutines ROUTINE RTN_MyFatal ErrorRoutine FatalError2High lt 0x13 7 VariableID PAM fatal error code FatalError2Low lt FatalErrorlLow Pam Fatal Error code FatalErrorlHigh lt OxAA 7 VariableID PAMStatus FatalErrorlLow lt 0x002457FE PAM in Fatal Error END_ROUTINES END_ROUTINES Page 3 24 Doc No 006 8029 B Rev 4 June 1997 Example Programs PAM CAN Bus Interface User s Manual 4 EXAMPLE PROGRAMS 4 1 FOR A CAL WITH DBT MASTER The declarations in this example program establish the communications linkages illustrated in Figure 9 during application execution Communication channel declaration CAN_CHANNEL CAN_MyChannel BAUDRATE 200000 GENERATE VARID NO With dynamic distribution of identifier END_CHANNEL Application variables INTERNAL FLAG VAR LFI_Flagl INTERNAL FLAG VAR LFI AxisiStart INTERNAL FLAG VAR LFI_AxislStop INTERNAL WORD VAR LWI AxisiCmd INTERNAL REAL VAR LRO AxislSpeed INTERNAL REAL VAR LRO AxislPosition INTERNAL FLAG VAR LFO_AxislInError INTERNAL WORD VAR LWO AxisiStatus Channel input variable CHANNEL _ INPUT _ VAR HIV_InFlagl CHANNEL CAN MyChannel PRIORITY 7 VAR LFI_Flagl Host reference to
24. able set CHANNEL _OUTPUT_SET HOS_Msg CHANNEL CAN_MyChannel PRIORITY 5 VARS LFO_Flagl 15 LWO_SubCodel1 0 7 LWO_SubCode2 8 14 LWO_SubCode3 0 14 END How to use it in the application LFO_Flagl lt 1 First set the linked variables LWO_Subcodel lt 7 LWO_Subcode2 lt 11 LWO_Subcode3 lt 24648 HOS_Msg lt send Then send the channel variable to generat the message s FUNCTION The following function is available for Channel Output Variables SEND This function is used to generate the messages to send a not event driven output variable The statement syntax is as follows lt VariableName gt lt send EXAMPLES Once you have modified a linked application variable LWO_MyWordVar lt 245 You can send the channel variable HOV_MyOutWordVar lt send Doc No 006 8029 B Rev 4 June 1997 Page 3 13 Interface Software PAM CAN Bus Interface User s Manual 3 5 CHANNEL REFERENCES Channel Reference declarations define the correlation between external messages and Channel Variables Ina CAN Bus Interface implementation A CHANNEL_REFERENCE declaration cross references the message identifiers of CAN Bus messages to corresponding Channel Variable s assigned to handle the message data content DECLARATION SYNTAX CHANNEL_REFERENCE lt ldentifier gt CHANNEL_VAR lt Channel var or set gt FORMAT_NAME lt Format name gt COMM_ID
25. ables lt Group identifier gt NA group identifier for i variables lt ChannelName gt NA communications channel name from CHANNEL declaration lt Priority level gt NA specifies priority level for the variable Determines whether the variable is placed onto the Input Priority FIFO or the Input FIFO Default Priority level is taken from DEF_PRIORITY in the CHANNEL declaration lt VariableName gt NA name of Internal PAM Variable into which Channel Input Variable maps EXAMPLE This example maps Channel Variable HIV_InFlag1 into the Internal Flag Variable LFI_Flag1 and Channel Variable HIV_Axis1Speed into Internal Real Variable LR1_Axis1Speed Channel declaration CAN_CHANNEL CAN _MyChannel ENERATE_VARID NO END_CHANNEL Q Linked application variables INTERNAL AAG VAR LFI_Flagl INTERNAL REAL VAR LRI AxislSpeed Frj Doc No 006 8029 B Rev 4 June 1997 Page 3 7 Interface Software PAM CAN Bus Interface User s Manual 3 4 2 Channel input variables CHANNEL_INPUT_VAR HIV_InFlagl CHANNEL CAN_MyChannel PRIORITY 2 VAR LFI_Flagl CHANNEL_INPUT_VAR HIV_AxislSpeed CHANNEL CAN_MyChannel VAR LRI_AxislSpeed Channel references see paragraph 3 5 CHANNEL INPUT SET The Channel Input Set declaration maps the content of a specified Channel Variable into mult
26. by another module DBT COB ID Distributor One of the service elements of the application layer in the CAN Reference Model It s the responsibility of the DBT to distribute COB ID s to COB s that are used by the CMS service element MAC Medium Access Control One of the sub layers of the Datalink Layer in the CAN Reference Model that controls who gets access to the medium to send a message NMT Network Management One of the service elements of the application layer in the CAN Reference Model The NMT serves to configure initialize and handle errors in a CAN network APPLICATION LAYER SERVICE ELEMENTS The most important function of the application layer is to determine what an application can do with the communication environment The CAN application layer provides four application layer service elements e CAN based Message Specification CMS e Network Management NMT e Distributor DBT e Layer Management CMS offers an open object oriented environment to design user applications CMS offers Variable Event and Domain objects to design and specify how the functionality of a module can be accessed at its CAN interface The Encoding Rules define how to encode and decode application data into the transfer syntax and vv NMT offers an open object oriented environment to let one module the NMT Master deal with the initialization and possible failures of the other modules NMT Slaves The essential problem in definin
27. c003_a dsf 11 10 96 Figure 2 PAM CAN Bus Interface 2 2 1 DEVICENET IMPLEMENTATION SPECIFICATION With DeviceNet to improve the communication speed the interface acts as Slave class2 This means only point to point communication with only one variable is available Nevertheless in that configuration two addresses are automatically selected to have in the applications point of view two ports available So it is possible to communicate with two masters In addition an internal protocol allows transmission of more than one variable between one master and the PAM This protocol includes the COMM_ID of the variable see 3 5 Channel References page 3 14 in the CAN frame data field To conserve 8 useful data bytes fragmented frames are used Start flag CAN_Identifier Low Byte CAN_Identifier High Byte Start flag CAN Identifier CAN_ Identifier Low Byte High Byte Second and last frame FragmentByte First frame COMM_ID Low byte Page 2 2 COMM_ID 1 Databyte 2 Databyte 3 Databyte 4 Databyte 5 Databyte CRC_Check StopFlag First frame High byte Lowest byte FragmentByte COMM_ID Low byte COMM_ID High byte 6 Databyte 7 Databyte 8 Databyte CRC_Check StopFlag Second frame Highest byte Doc No 006 8029 B Rev 4 June 1997 Interface Description PAM CAN Bus Interface User s Manual 2 3 INTERFACE BOARD CPU Activity LED
28. cument 006 8017 A MANUAL ORGANIZATION AND CONTENTS This manual is organized into four chapters The following is a summary of the manual contents by chapter Chapter 1 Description of manual organization and contents Chapter 2 CAN Bus Interface description and specifications Chapter 3 CAN Bus Interface software including declarations parameters functions and examples Chapter 4 CAN Bus Interface example program DEFINITIONS ACRONYMS AND ABBREVIATIONS CAL CAN Application Layer The application layer for CAN as specified by CiA CAN Controller Area Network A network originally defined for use as a communication network for control applications in automobiles CMS CAN based Message Specification One of the service elements of the application layer in the CAN Reference Model CMS is a language that can describe how the functionality of a module can be accessed at its CAN interface COB Communication Object A unit of transportation ina CAN Network Data must be sent across a CAN Network inside a COB There are 2032 different COB s in a CAN Network A COB can contain at most 8 bytes of data Doc No 006 8029 B Rev 4 June 1997 Page 1 1 Introduction Socapel PAM User s Manual COB ID Each COB is uniquely identified in a CAN Network by a number called the COB Identifier COB ID The COB ID determines the priority of that COB for the MAC sub layer REMOTE COB A COB whose transmission can be requested
29. ess of the MIN or MAX values may cause permanent damage NOMINAL VALUES Ee Cc fm Supply voltage V CAN Bus data rate 10 20 50 100 kBits s 125 250 500 1000 and others Doc No 006 8029 B Rev 4 June 1997 Page 2 5 Interface Description PAM CAN Bus Interface User s Manual Doc No 006 8029 B Page 2 6 Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual 3 INTERFACE SOFTWARE 3 1 INTRODUCTION This chapter describes the process of initializing and interfacing to a CAN Bus from the perspective of the application program Secondly it provides definitions syntax descriptions and examples of routines 3 2 INSTALLATION Depending on which configuration and protocol is used different Boot and Firmware are to be downloaded into PAM CAN Bus interface board CAL with NMT CBAZvvvv CAN CFAZvvvv CAN CAL without NMT CBAZvvvv CAN CFBZvvvv CAN DeviceNet CBAZvvvv CAN CFDZvvvv CAN slave class2 vvvv is the version e g 1000 means version 1 0_00 Firmware files are located in SOCATOOL FIRMWARE and Bootware files in SOCATOOL BOOTWARE You must first download bootware and then firmware DOWNLOAD PROCEDURES To download Bootware 1 Click on to put PAM in BOOT state In the Advanced menu select Download Set data type to CAN_BOOTWARE Browse to get the right CAN bootware file Click on OK moo To download Firmware 1 Click on to
30. g an open CAN environment is the distribution of the COB identifiers A COB Identifier determines the priority for the MAC protocol of that COB Therefore the value of the identifiers may not be fixed by the suppliers of the different CAN modules since the systems integrator wants to have system wide control over the priorities of the COB s The DBT offers a dynamic distribution of the identifiers by one module the DBT Master to the other modules DBT Slaves Doc No 006 8029 B Page 1 2 Rev 4 June 1997 Interface Description 2 1 2 2 PAM CAN Bus Interface User s Manual INTERFACE DESCRIPTION CAN SUMMARY DESCRIPTION The CAN concept was originally developed for use in the automotive industry to fulfill a need for a reliable low cost serial data bus system for networking sensors actuators and controllers within the automobile Due to it s low cost high real time capabilities excellent communications reliability and ability to function in harsh electrical environments the CAN Bus is particularly well suited for networking intelligent I O sensors and actuators in industrial applications and is becoming a communications standard in a number of segments within the industrial automation marketplace In a CAN network see Figure 1 all peers hosts and PAMs receive all messages placed on the CAN Bus by any peer Each peer then decides whether to discard or act upon an individual message based upon which peer originated the me
31. gt NA internal PAM Variable which maps into Channel Variable EVENT_DRIVEN lt YES gt NA channel Variable is event driven PAM automatically updates and sends Channel Variable each time PAM Internal Variable value changes subject to constraint of INHIBIT_TIME parameter YES is the default value EVENT_DRIVEN lt NO gt NA application must update and send Channel Variable see 3 4 5 Function p3 13 lt priority level gt NA specifies transmission priority requested for the variable Default Priority level is taken from DEF_PRIORITY in the CHANNEL Declaration lt inhibit time in ms gt NA For CAL only Specifies minimum delay between successive transmissions of the same variable This parameter provides a means to limit the communications channel bandwidth consumed by rapidly changing event driven channel output variables Default inhibit time is taken from DEF _INHIBIT_TIME in the Channel declaration Doc No 006 8029 B Page 3 10 Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual EXAMPLE In this example Internal Flag Variable LFO_Flag1 is mapped to Channel Variable HOV_Flag1 and Internal Real Variable LRO_Axis1Speed is mapped to Channel Variable HOV_Axis1Speed Channel declaration CAN_CHANNEL CAN_MyChannel END_CHANNEL Linked application variables INTERNAL AAG_VAR LFO_Flagl INTERNAL REAL VAR LRO AxislSpeed Hy Chan
32. input variable CHANNEL REFERENCE HRF_IFlg1FH1 Input Flagl From Hostl CHANNEL_VAR HIV_InFlagl ti gt D Q m D A lt Hy 7 ENCE HRF_IFlg1FH2 7 Input Flagl From Host2 CHANNEL VAR HIV_InFlagl Z Q HANNEL_REFERENCE HRF_IF1g1FH3 Input Flagl From Host3 CHANNEL_VAR HIV_InFlagl ND Channel input direct access message CHANNEL INPUT SET HIS_Axisl CHANNEL CAN _ MyChannel PRIORITY 4 VARS LFI_AxislStart 0 LFI_AxislStop 1 LWI_AxislCmd 0 31 Doc No 006 8029 B Rev 4 June 1997 Page 4 1 Example Programs PAM CAN Bus Interface User s Manual Host CHANNEL _REF CHANNEL ERENCE VAR HRF_IAx1MFH2 HIS_Axisl END CHANNEL _ REFERENCE CHANNEL _ VAR HREF_IAXIMFH3 HIS _Axisl Z Channel output variable Er Bs I D zZ Z L_OUTPUT_VAR HOV_AxislPosition NNEL CAN MyChannel ORITY 6 LRO_AxislPosition gua Z CHANNEL _ REFERENCE CHANNEL _ VAR HRF_OAx1PTH HOV_AxislPosition Fi Z reference to input direct access message Input 51 Message From Host2 Input 51 Message From Host3 Output Axisl Position To Hosts Channel output variable not
33. iple PAM Internal Variables DECLARATION SYNTAX CHANNEL_INPUT_SET lt identifier gt NUMBER lt Number gt NODES_GROUP lt Group identifier gt CHANNEL lt ChannelName gt PRIORITY lt Priority level gt VARS lt VariableName lt Bit range gt gt lt VariableName lt Bit range gt gt END lt Identifier gt Specifies the Channel Variable name lt Number gt NA number for i variables lt Group identifier gt NA group identifier for i variables lt ChannelName gt NA communications channel name from CHANNEL declaration lt Priority level gt NA specifies priority level for the variable Determines whether the variable is placed onto the Input Priority FIFO or the Input FIFO Default Priority level is taken from DEF_PRIORITY in the CHANNEL declaration lt VariableName gt NA name of Internal PAM Variables into which Channel Variable maps lt Bit range gt NA indicate the bits from the Channel Variable that map into this variable For a FLAG_VAR only one bit for a WORD_VAR a range of bit Ex 0 9 Doc No 006 8029 B Page 3 8 Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual EXAMPLE In the following example the CHANNEL_INPUT_SET declaration distributes the content of HIS_Msg among four internal variables as follows The CHANNEL_INPUT_SET declaration provides great flexibility for re arranging a message content into a fo
34. islSpeed lt send Manually send var to DP LFO_AxislInError lt set LWO_AxislStatus lt 12 HOS_Axisl lt send Manually send var to DP Doc No 006 8029 B Page 4 4 Rev 4 June 1997 Example Programs Host 1 HRF_IFigiFH1 Host2 HRF_IFlgiFH2 PAM CAN Bus Interface User s Manual PAM Application HRF_IAx1MFH2 HRF_OAx1STH HRF_OAx1PTH HRF_OAx1MTH Hosts HRF_IFIg1FH3 J HRF_IAx1MFH3 HRF_OAx1STH HRF_OAx1PTH HRF_OAx1MTH HOV_Axis1Position CAN CHANNEL Variables gt HIV InFlagi gt LFI Flagt gt LFI_Axis1Start gt HIS_Axis1 m LFI_Axis1Stop LWI_Axis1Cmd HOV_Axis1Speed LRO_Axis1Speed lt LRO_Axis1Position HOS_ Axis1 LFO_Axis1InError rt Figure 9 Linkages for Example Program CAL Doc No 006 8029 B Rev 4 June 1997 LWO_AxisStatus pac009_b dsf 02 06 97 Page 4 5 Example Programs PAM CAN Bus Interface User s Manual 4 3 Page 4 6 FOR DEVICENET The declarations in this example program establish the communications linkages illustrated in Figure 10 during application execution Commu CAN_CHAN nication channel declaration NEL CAN_MyDevNetChannel GENERAT BAUDRATE 250000 E_VARID YES 7 Without dynamic distributi
35. l ee maximum size of a CHANNEL_OUTPUT_SET is 64 bits lt Priority level gt NA specifies transmission priority requested for the variable Default Priority level is taken from DEF_PRIORITY in the CHANNEL declaration lt Inhibit time inms gt NA for CAL only Specifies minimum delay between successive transmissions of the same variable This parameter provides a means to limit the communications channel bandwidth consumed by rapidly sending channel output sets Default inhibit time is taken from DEF _INHIBIT_TIME in the Channel declaration As they are comprised of several variables Channel Output Sets can not be event driven EXAMPLE In the following example the CHANNEL_OUTPUT _SET declaration assembles the content of the Internal Word Variables LWO_Subcodel LWO_Subcode2 LWO_Subcode3 and Internal Flag Variable LFO_Flag1 into CHANNEL_OUTPUT_SET HOS_Msg as illustrated in the following table Note that the CHANNEL_OUTPUT_SET variable is the bitwise OR of all it s components Channel declaration CAN_CHANNEL CAN_MyChannel GENERATE VARID NO END_ CHANNEL Linked application variables INTERNAL FLAG _ VAR LFO Flagl INTERNAL WORD_VAR LWO_SubCodel INTERNAL WORD_VAR LWO_SubCode2 INTERNAL WORD_VAR LWO_SubCode3 Doc No 006 8029 B Page 3 12 Rev 4 June 1997 Interface Software 3 4 5 PAM CAN Bus Interface User s Manual Channel output vari
36. nel output variable CHANNEL _OUTPUT_VAR HOV_Flagl CHANNEL CAN_MyChannel EVENT DRIVEN NO PRIORITY 4 VAR LFO_Flagl END CHANNEL_OUTPUT_VAR HOV_AxislSpeed CHANNEL CAN_MyChannel VAR LRO_AxislSpeed END 3 4 4 CHANNEL OUTPUT SET A Channel Output Set declaration maps multiple PAM Internal Variable into a specified Channel Variable The CHANNEL_OUTPUT_SET is useful for constructing messages comprised of several pieces of data DECLARATION SYNTAX CHANNEL_OUTPUT_SET lt Identifier gt NUMBER lt Number gt NODES_GROUP lt Group identifier gt lt VariableName lt Bit range gt gt PRIORITY lt Priority level gt INHIBIT_TIME lt Inhibit time in ms gt CHANNEL lt ChannelName gt VARS lt VariableName lt Bit range gt gt END lt Identifier gt Specifies the channel variable name lt Number gt NA number for i variables lt Group identifier gt NA group identifier for i variables lt ChannelName gt NA communications channel name from CHANNEL declaration lt VariableName gt NA name of Internal PAM Variable which maps into Channel Variable lt Bit range gt NA indicate where the variable maps into the Channel Variable For a FLAG_VAR only one bit for a WORD_VAR a range of bit E g 0 9 Doc No 006 8029 B Rev 4 June 1997 Page 3 11 Interface Software PAM CAN Bus Interface User s Manua
37. on Communication channel declaration YES Without dynamic distribution of identifier CAN_CHANNEL CAN_MyChannel BAUDRATE 200000 GENERATE_VARID END_CHANNEL Application variables INTERNAL FLAG VAR LFI_Flagl INTERNAL FLAG VAR LFI_AxislStart INTERNAL FLAG VAR LFI_AxislStop INTERNAL WORD_VAR LWI_AxisiCmd INTERNAL REAL VAR LRO AxislSpeed INTERNAL REAL_VAR LRO_AxislPosition INTERNAL FLAG VAR LFO_AxislInError INTERNAL WORD_VAR LWO_AxisiStatus Channel input variable CHANNEL _INPUT_VAR HIV_InFlagl CHANNEL CAN_MyChannel END VAR LFI_Flagl r Host reference to input variable CHANNEL_REF ERENCE CHANNEL COMM_ID END _VAR 1542 HRF_InFlaglFromHostl HIV_InFlagl r CHANNEL_REF ERENCE COMM_ID END CHANNEL VAR 1540 HRF_InFlaglFromHost2 HIV_InFlagl r ERENCE CHANNEL_REF CHANNEL COMM_ID ND Channel CHANNEL ANNEL_ INPUT 5 VAR 1541 input HRF_InFlaglFromHost3 HIV_InFlagl a direct access message ET HIS_Axisl CAN MyChannel PRIORITY 4 VARS END Host reference to input direct access message LFI_AxislStop 1 LWI_AxisiCmd 0 LFI_AxisiStart 0 LA
38. on of identifier m 2 HAN pli NAL NEL cation variables AAG_VAR LFI_Flagl NAL NAL 7 AG VAR LFI_Axis1Start AAG_VAR LFI_AxislStop NAL AG _VA FO _AxislInError NAL NAL D_VAR LWI AxislCmd D VAR LWO_AxislStatus NAL VA RO_AxislSpeed VA RO _AxislPosition DOSS ayy D D D 0 wD O O nn O A EA HAA S C pP R R R R RNAL R R R N N H Z Host He W nput variable INPUT_VAR HIV_InFlagl el a ANNEL CAN MyDevNetChannel R LFI_Flagl reference to input variable I ANNEL C COMM Z HANN REFERENCE HRF_InFlaglFromHost0O L_VAR HIV_InFlagl D 0x01 Gl H CHANNEL R FERENCE HRF_InFlaglFromHostl CHANN COMM Z Chann Q m N CHANN RIOR VARS m ND Host lt AR HIV_InFlagl 0x401 EL ID el input direct access message EL_INPUT_SET HIS_Axisl EL CAN MyDevNetChannel TRY SA LFI_AxisiStart 0 LFI_AxislStop 1 LWI_AxisilCmd 0 31 reference to input direct access message D I ANNEI CO Z CHANNI REFERENCE HRF_InAx1lMsgFromHostO L_VAR HIS _Axisl D 0x02 Gl H FERENCE HRF_InAx1MsgFromHost1 Z n
39. r female 505 3020 connector shell for circular cable quantity 2 Table 2 Mating Connector Part Numbers 2 3 2 INTERFACE CONTROLLER The CAN bus interface for PAM is based on the 80C592 microcontroller from Philips It consists of a 80C51 microcontroller core and a 82C200 CAN controller integrated onto the same die The 80C51 microcontroller utilizes an 8 bit architecture and is clocked at 16 MHz providing a 750 nsec instruction cycle The 82C200 CAN controller implements a Basic Standard CAN which means the CAN identifier is limited to 11 bits 2 3 3 PHYSICAL INTERFACE The CAN Bus standard allows for variations in the implementation of the physical layer of the interface The CAN Bus Interface board for PAM is supplied as standard with Philips PCA82C250T PCA82C251T in version B and a 120 Q terminal resistor 2 3 4 NODE ADDRESS SELECTOR Two coding wheels provide a way to assign a node address to the board Each node on the CAN bus must have it s own address The addresses are used during network initialization Address 0 is prohibited For DeviceNet address 1 is also prohibited and two addresses are automatically selected Address on the coding wheel Selected addresses Table 3 DeviceNet selected addresses Doc No 006 8029 B Page 2 4 Rev 4 June 1997 Interface Description PAM CAN Bus Interface User s Manual 2 3 5 CAN BUS INTERFACE SPECIFICATIONS ABSOLUTE MINIMUM AND MAXIMUM VALUES Any stress in exc
40. re PAM CAN Bus Interface User s Manual 3 7 FATAL ERROR MANAGEMENT When a fatal error occurs in PAM it is possible before the application is stopped to send up to two messages Size and reference of these messages are defined by the Channel Output Variable s or Channel Output Set s declared as FATAL ERROR VARIABLEI e FATAL ERROR VARIABLEZ2 in the CHANNEL declaration These variables are constructed with four predefined 32 bits variables e FatalError1High and FatalError1Low for FATAL_ERROR_VARIABLE1 e FatalError2High and FatalError2Low for FATAL_ERROR_VARIABLE2 When a fatal error occurs the contents of these predefined variable is automatically set e FatalErroriLow lt PAMFatalErrorCode Figure 7 shows the format used e FatalErrorlHigh lt Field1 D1 FatalError2Low lt Field2 D2 e FatalError2High lt Field3 D3 The contents of these variables can also be set or modified in a routine which is declared in the CHANNEL declaration as FATAL_ERROR_ROUTINE If it exists this routine is automatically executed before the message are constructed see Figure 8 31 28 27 24 23 20 19 16 15 12 11 817 43 0 Error code on PAM Display O R xX T N N 3 28 27 24 23 20 19 6115 2 817 43 0 PAMFatalErrorCode x not used 0 O Origine NNN Error code number pac010_a dsf 17 10 96 Figure 7 PAMFatalErrorCode Format see PAM V2 5 Reference Manual appendix B for more details Doc No 00
41. rmat convenient for internal use Channel declaration CAN_CHANNEL CAN_MyChannel GENERATE _VARID NO END_CHANNEL Linked application variables INTERNAL FLAG VAR LFI_Flagl INTERNAL WORD_VAR LWI_SubCodel INTERNAL WORD_VAR LWI_SubCode2 INTERNAL WORD_VAR LWI_SubCode3 Channel input variable set CHANNEL_INPUT_SET HIS_Msg CHANNEL CAN_MyChannel PRIORITY 5 VARS LFI_Flag1 15 LWI_SubCodel 0 7 LWI_SubCode2 8 14 LWI_SubCode3 0 14 END Channel references s paragraph 3 5 Doc No 006 8029 B Rev 4 June 1997 Page 3 9 Interface Software PAM CAN Bus Interface User s Manual 3 4 3 CHANNEL OUTPUT VARIABLE A Channel Output Variable declaration maps a single PAM Internal Variable into a specified Channel Output Variable DECLARATION SYNTAX CHANNEL_OUTPUT_VAR lt identifier gt NUMBER lt Number gt NODES_GROUP lt Group identifier gt CHANNEL lt ChannelName gt EVENT_DRIVEN lt YES NO gt PRIORITY lt Priority level gt INHIBIT_TIME lt Inhibit time in ms gt VAR lt VariableName gt END lt Identifier gt Specifies the Channel Variable name lt Number gt NA number for i variables lt Group identifier gt NA group identifier for i variables lt ChannelName gt NA communications channel name from CHANNEL declaration lt VariableName
42. select the port number to be used then the master to communicate with So available COMM_IDs are 0x0000 to OxO3FE for port 0 and 0x0400 to OxO7FE for port OxO3FF and Ox7FF are reserved for COMM_ID of error response message see Table 4 DeviceNet Master sends PAM CAN interface PAM error response message Invalid fragmentation size OxAAAA OBxxE01B Invalid fragmentation size Different COMM _ID in two OxBBBB OBxxE01C fragmented frames Two different COMM_ID on port COMM_ID not defined as input OxCCCC OBxxEO01D Invalid input COMM_ID Invalid port number OxDDDD OBxxEOIE Invalid port number Correct Comm_ID Application data or none 0x0000 Default COMM_ID Application data or 0x0000 Correct Comm_ID or default OBxxE014 COMM_ID but input FIFO of Input FIFO full PAM is full TABLE 4 CAN BUS INTERFACE ERROR MESSAGE COMM_ID 0x03FF or 0 07FF depending on the port on which the error occurs Example How to declare 2 variables ID 3 and 4 for MasterA via portO and 2 variables ID 0 and 1 for MasterB via port 15 10 9 0 ee ee ee port O ID 3 gt COMM_ID 0x0003 15 10 9 0 0 1 port 0 ID 4 gt COMM_ID 0x0004 15 10 9 0 1 ee i port 1 ID 0 gt COMM_ID 0x0400 15 10 9 0 port 1 ID 1 gt COMM_ID 0x0401 The maximum number of Channel_ Reference is 400 for CAL and 500 for DeviceNet as Page 3 15 Interface Software PAM CAN Bus Interface User s Manual EXAMPLE This example creates the following linkages be
43. ssage and the nature of the message Each message placed on the CAN Bus includes three main parts e an identifier field which identifies the message originator and nature of the message e a data field which holds the data content of the message e a CRC Cyclic Redundancy Check field which contains a CRC code used to verify message integrity Host1 Host2 Hostn an CAN Network PAM1 PAM2 PAMn pac002_a dsf 11 10 96 Figure 1 CAN Network PAM CAN BUS INTERFACE The PAM CAN Bus Interface utilizes standard CAN interface hardware and custom software which implements the CAL and DeviceNet communication protocols An intermediate protocol handles transfers to and from the application via PAM Dualport memory Figure 2 illustrates the configuration The PAM CAN interface hardware and software reside on a CAN Bus Interface board see paragraph 2 3 On the PAM side PAM firmware version 2 7 or higher supports the PAM CAN Bus interface Doc No 006 8029 B Rev 4 June 1997 Page 2 1 Interface Description PAM CAN Bus Interface User s Manual The CAN Bus interface board is mounted in an available space in the PAM Stand alone rack above the power supply Power and signal connections to PAM are made through the backpanel 4 N Comm Process DP RAM Application w 3 P One or many CAN intermediate host interface protocol pa
44. t FATAL_ERROR_VARIABLE2 lt Fatal error channel variable name for msg 2 gt FATAL_ERROR_ROUTINE lt Fatal error routine for message 1 and 2 gt NODE_NAME lt Node name for first access gt BAUDRATE lt Baudrate for communication protocol gt NODE_GUARDING_TIME lt Node guarding time value in ms gt LIFE_TIME_FACTOR lt Life time factor gt DEF_INHIBIT_TIME lt Default Inhibit time in ms gt DEF_PRIORITY lt Default variable priority gt DEF_FORMAT_NAME lt CAL_FIXED CAL_FREE gt END_CHANNEL PARAMETER DESCRIPTIONS SYNCHRO_TIMEOUT NA in milliseconds Timeout value used to wait for synchronization between PAM and the Can Bus interface through the dualport The default value is 10000 10 seconds WATCHDOG_TIMEOUT NA in milliseconds Timeout value used to sense a breakdown in the communications process between the PAM and CAN Bus interface The default value is 1000 1second Doc No 006 8029 B Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual GENERATE_VARID NA YES NO This option must be set to NO if you have a dynamic identifier distributor and to YES if PAM must generate the communication identifiers The default value is NO MAX_PRIORITY_READ NA Specifies the maximum number of successive reads of the Priority Input FIFO allowed in one PAM cycle When no value is specified the default value is no limit MAX_PRIORITY_FIFO_DATA_SIZE
45. tween external channel and application variables External AN CHANNEL CAN Netw ork CANES pplication HRF_IFigtFH2 p Ss HIIV_INFlagi pe Flag1 pac005_a dsf 17 10 96 Figure 4 Linkage between Internal Channel and External Communications Variables Channel declaration CAN_CHANNEL CAN_MyChannel GENERATE VARID NO HANNEL ea Z J Q Linked application variables NTERNAL FLAG_VAR LFI_Flagl QON HN Channel input variable EL_INPUT_VAR HIV_InFlagl CHANNEL CAN_MyChannel VAR LFI_Flagl m ND Host reference to input variable CHANNEL_REFERENCE HRF_IF1g1FH2 Input Flagl From Host 2 CHANNEL_VAR HIV_InFlagl m ND Doc No 006 8029 B Page 3 16 Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual 3 5 1 MULTIPLE LINKAGES The following examples illustrate the configuration when multiple Channel References are linked to a Channel Variable With CAL broadcast is allowed This means that you can declare the same variable in different Hosts Note that every send of Channel Output Set HOS_Axis1Status produces only one HRF_OAx1STH message which can be read by both host1 and host2 See Example 1 With DeviceNet broadcast is not allowed Nevertheless as two ports are available to communicate you can send the same variable to two hosts
46. tween successive transmissions of the same variable It provides a means to limit the communications channel bandwidth consumed by rapidly changing event driven channel output variables Default value is 0 DEF_PRIORITY NA 0 7 Specified the default Channel Variable priority when PRIORITY is not specified in the Channel Variable declaration Priority level specifies transmission priority requested for variable Default value is 7 lowest DEF_FORMAT_NAME NA CAL_FREE CAL_FIXED For CAL only This parameter give the default format name for CHANNEL_REFERENCE declarations when no FORMAT_NAME is specified Format name specifies the format used for CHANNEL_REFERENCE names see Channel References page 3 14 Default value is CAL_FREE Doc No 006 8029 B Rev 4 June 1997 Interface Software PAM CAN Bus Interface User s Manual 3 3 2 FUNCTIONS The following inquire functions available for Channel ERROR This Boolean inquire function is true if the channel is in error The statement syntax is as follows lt ChannelName gt error EXAMPLES IF CAN_MyChannel error THEN EXCEPTION CAN_MyChannel error SEQUENCE SEQ MyChanelErrorHandling ERROR_CODE BOOLEAN This Boolean inquire function is true if the parameter error code matches the error state of the channel The syntax of the statement is as follows lt ChannelName gt error_code lt error code gt EXAM

Download Pdf Manuals

image

Related Search

Related Contents

RMPC-05S Media Player 取扱説明書    USER`S MANUAL    Betriebsanleitung Insoric RealPower  取扱説明書 (設置マニュアル) / Instruction Manual (Installation Manual)  Survey distance calculation (T10)  Nobo Modular Display System - Panels    Samsung 171S Εγχειρίδιο χρήσης  

Copyright © All rights reserved.
Failed to retrieve file