Home
KRD as a subscriber in the PROFIBUS-DP - TWK
Contents
1. Copy all of the module container s modules from the selected programme folder e g Diag1 from TWKDPCL2 into your own project s still empty module container e g S7 programme 1 from DP_ CLAS2 Note Each module container even an empty one contains at least one OB this is of course also empty and can therefore be overwritten If you have installed a class 2 16 bit encoder and have selected the ActualRef or Diag1 2 program me you must in order to set the preset value release the FB10 in the OB1 i e supply the EN input with M 0 1 and block the FB11 s i e supply the EN input with M 0 0 If necessary replace the M 1 0 Acknowledge message and the M 10 0 and M 10 1 in the case of two encoders Set the preset value with your signals Transfer all modules into the control system Now call up the OB1 in the on line view and switch Test Observe on in order to have the current values of the encoder displayed on the monitor For ActualRef and Diag1 2 programme only Enter a preset value into DB100 data doubleword 0 for the second encoder DB100 data doubleword 8 and set this with the M 10 0 or M 10 1 If the preset value lies outside of the parameterised measurement range of the encoder the correspon ding error message is set in OB1 7 3 4 Explanations regarding the example programmes Each programme folder contains a symbol table which contains all global variables of the maximum ex
2. eceeecceeeeeneeeeeeeeene eee eeeeaeeeeeeeaaaeeeeeeeaeeeeseeaaeeeeeeeneeeeseeeaas 22 Dc AMOR AU UNG pa E E A A T A obsneeduaudddasainnediu indian dasnetadniaubandetutinidedehbntvacadcocsianadinb towed 23 Appendix Encoder termMS sssrinin annaa iaaa a aa au a Eaa e a aaa anaa aa aeaa ANKE aE 23 COPYRIGHT The Operating Instructions KRD 11109 is owned by TWK ELEKTRONIK GMBH and is protected by copyright laws and international treaty provisions 2006 by TWK ELEKTRONIK GMBH POB 10 50 63 40041 D sseldorf E Germany Tel 49 211 96117 0 E Fax 49 211 96117 99 e mail info twk de internet KRD 11109 BE Page 2 rT VV K_ 1 General 2 Installation instructions for PROFIBUS DP RS 485 1 General The encoder of the series KBD KRD are new developments in the area of fieldbus components Wide experience resulting out the series CRD be considered in the device design Beside the increasing of the resolution max 16 bit is a short diagnostics max 16 byte and a velocity signal now available The model KBD max 16 Bit is amonotour and the model KRD max 28 bit is a multitour encoder In the data sheet 10941 are all relevants technical parameter described In the first part of the manual are the general premises for understanding the use of the encoder in PROFI BUS DP bus system and in the second part is a instruction and application software under Step 7 shown For the general understanding of the field bus system PROFIBUS
3. 11109 BE Page 18 BUZA 7 Simatic Step7 7 1 8 Setting the diagnostic address Setting the diagnostic address is only required if the special profibus diagnostic functions are used within the S7 programme So that the diagnostic range of the encoder can be accessed within the S7 programme a special S7 di agnostic address must be allocated to this This address may lie within the entire peripheral range of the control system It does not therefore occupy any input output addresses By double clicking onto the encoder symbol the Properties DP slave window appears with the General register For the example programme please specify diagnostic address 200 for the first encoder and 202 for the second encoder Eigenschaften DP Slave Allgemein Baugruppe Bestellnummer GSD Datei T ypdatei KRDZ28 GSD Familie Encoder DP Slave Typ TWK KAD Z 28 Bit Bezeichnung TWK KRD Z 28 Bit Adressen Teilnehmer Mastersystem Diagnoseadresse 200 PROFIBUS 123 1 SYNC FREEZE F amp higkeiten V v M Ansprechiiberwachung Kommentar Abbrechen Hilfe Following confirmation with OK the encoder is configured and parameterised The hardware configuration can now be translated and transferred into S7 7 2 Setting the subscriber address in the case of the plug version encoder Setting the address of the plug version KBD KRD under S7 is possible with a profibus protocol capable MPI card from Siemens e g CP5611
4. TWK KBD Z 16 Bit Auswahl der Sollkonfiguration 7 1 4 Configuration of the encoder 32 Bit In Out 32 Bit Velocity Class 2 32 Bit In Out After the appropriate encoder type has been selec Class 2 16 Bit In Out ted in the hardware Catalog the following window Class 1 32 Bit In appears for the selection of encoder functionality Class 1 16 Bit In and single turn resolution In this case select class 1 or class 2 functionality vf and 16 32 or 64 bit data frame in accordance with Abbrechen Hilfe your requirements See chapter 3 KRD 11109 BE Page 16 TWK 7 1 5 Allocation of profi bus address If you have selected your nominal configuration the following window in which you must spe cify the profibus address set in the encoder ap pears For the examp le programmes please select address 123 for the first and address 122 for the second encoder here Note The profibus address of the encoder is set in the case of the cap version via dip switches See Chapter 2 2 and in the case of the plug ver sion via software See Chapter 7 2 In addition select your planned pro fibus in the Subnet and quit the window with OK 7 Simatic Step7 Eigenschaften PROFIBUS Schnittstelle ENCODER KRD Haube x Allgemein Parameter Adresse Ubertragunasgeschwindigkeit 1 5 Mbit s Subnetz ex Eigenschaften Abbrechen Hilfe The encoder subsequently appears as a subscriber in y
5. address of this slave is provided by OB82 in its local data Only the manufacturer specific error message bits are evaluated and of these only those which may occur in Data Exchange Mode in normal bus operation Errors which can occur during bus initialisation cannot be detected by OB82 In this case the error messages must be read out via the Diagnosing hardware function of the Step7 package KRD 11109 BE Page 22 TV K_ 8 Literature Appendix Encoder terms 8 Literature 1 PROFIBUS Profile for Encoders Order No 3 062 1997 PROFIBUS Nutzerorganisation e V Haid und Neu Str 7 D 76131 Karlsruhe 2 The NEW RAPID WAY to PROFIBUS DP Order No 4 072 PROFIBUS Nutzerorganisation e V 3 PROFIBUS DP Specification IEC 61158 Type 3 and IEC 61784 4 SIMATIC NET SPC3 Siemens PROFIBUS Conroller Hardware Description Siemens AG Appendix Encoder terms Explanation Measuring units per revolution The single turn resolution specifies the number of measuring units per revolution 360 Measuring range The measuring range specifies the maximum number of revo lutions The specification of the revolutions must be carried out in 2N powers Total measuring range in units The total measuring range in units is revealed as follows Total measuring range in units Single turn resolution x Measuring range Code sequence The code sequence specifies the direction of rotation in which the output code of the encoder corresponds to i
6. ojo ojo Ql wo N O O Extended header 39 hex 63 diagnosis byte byte Alarm messages 00 hex No alarms are present Operating mode OA hex CW class 2 diagnosis no scaling yes Velocity unit steps 10ms not short diagnostic Encoder type 01 hex Multitour absolute Standard diag nostic information 11 14 Single turn reso 10000 hex 65536 steps per revolution lution 1000 hex 4096 revolutions lesa ee messages messages sages ning messages 1 2 0100 hex Hardware version 1 00 3 5 1 T 0 1 1 0 4 5 7 24 26 27 0108 hex Software version 1 08 FFFF FFFF hex fee 32 35 0000 0000 hex e Se 8 0000 0000 hex currently not supported set value lution units units be ee ed 0000 hex 60 63 Manufacturer spe 0000 0000 hex No errors are present cific diagnosis 3 D x lt KRD 11109 BE Page 15 TANK 7 Simatic Step7 7 Simatic Step7 This Chapter explains the procedure for integrating the TWK encoder into the profibus of Siemens S7 control system and the set up and the utilisation of the example programmes for Step7 The basis of the documentation is Step 7 Version 5 0 7 1 Integration of the TWK profibus encoder Prerequisites You have configured your hardware in accordance with the structure of your control system and have installed a profibus subnetwork 7 1 1 Installation of the GSD file Close all projects in the hardware configuration Insert the diskette provided by T
7. pansion class 2 project Diag2 programme The programme structure of this maximum expansion is explained in the following The reference data provide the following overview The symbolic name is always contained in the round brackets yclical programme a Programm Reading the actual value in 081 lt maximal 30 gt Setting the preset value class 2 only for O DB100 ReferenzData 26 16 bit FB10 or 32 bit FB11 O Fb10 SetRef16 DB10 SetRef16_IDB1 28 Error messages from OB82 O FB11 SetRef32 DB11 SetRef32_IDB1 30 Error messages from OB 86 O FB11 SetRef32 DB21 SetRef32_IDB2 30 o DB120 FaultDB 26 OB82 is run through as soon as a DP slave O DB121 EncoderFaultDB 26 places a diagnostic request in the case of 0 0882 lt maximal 116 gt an incoming and outgoing event In OB82 3 0 FB13 ReadDiag32 DB13 ReadDiag32_IDB1 the diagnostic data are collected by FB13 or O SFC13 116 SFC13 The errors are reported in OB1 O DB121 EncoderFaultDB 30 8 up by the system in the event SO 0886 lt maximal 32 gt of the failure of a DP slave e g power failure O FC16 SearchSlave 32 etc in the case of an incoming and outgoing O FC16 SearchSlave 32 event The failed encoder is determined in FC16 and is displayed in OB1 The entire diagnostic range of the disturbed encoder is always read out via system function SFC13 16 bytes in the case of class 1 and 63 bytes in the case of class 2 The
8. 0 MSB Singleturn resolu 1 to 65536 steps revolution 13 LSB tion 14 MSB Total measuring KBD 1 to 65536 steps 17 LSB steps KRD 1 to 268 435 456 steps 1829p Note It must be noted that the calculation of the number of revolutions is carried out in 2 powers internally within the encoder Regardless of this requirement the user may programme the desired total measuring range in units and the desired single turn resolution in accordance with the application During calculation the encoder accesses the next highest 2 power if required In this case the values are designated as the actual single turn resolution or as the actual total measuring range in units and are displayed as the output value Example desired total measuring range in units 20480 desired single turn resolution 4096 desired number of revolutions 5 internal encoder calculation actual total measuring range in units 32768 actual single turn resolution 4096 calculated number of revolutions 8 Note The above mentioned note must be taken into consideration in the event of irreversible operation In the example which is described the position 0 is only achieved after 32767 steps and not as desired after 20479 steps KRD 11109 BE Page 9 LAE 5 Programming parameters for class 1 2 encoder DDLM_Set_Prm 5 1 Definition of the programming parameters Operating parameters definition of the operating mode of the encoder m Code seque
9. 00 1000 Data Preset control Preset value 8 Following the receipt of this message an offset value from the current actual position value and preset value is calculated by the encoder If the output position value is equal to the preset value bit 31 can be reset by the master as the preset mode is terminated The timing diagrams are specified in a separate TY sheet After bit 31 0 has been reset the encoder operates in normal operating mode The offset value is stored in the diagnostic data and can be read in the event of a power failure and restar ting Also see Diagnostic messages in chapter 6 KRD 11109 BE Page 8 TANK 5 Programming parameters for class 1 2 encoder DDLM_Set_Prm 5 Programming parameters for class 1 2 encoder DDLM_Set_Prm The parameterisation data are comprised from bus specific data and DP slave specific data Bus specific data Octet 1 7 Octet 1 Station status Octet 2 WD_Fact_1 Octet 3 WD_Fact_2 Octet 4 Min station delay responder min TSDR Octet 5 Ident_Number 19 Octet 6 Ident_Number 63 hex Octet 7 Group_lIdent DP slave specific data Octet 8 9 Class 1 encoder 2 byte User_Prm_Data Octet 8 29 Class 2 encoder 22 byte User_Prm_Data See below for description Operating Parameter DDLM_Set_Prm Parameter Data Class Comment 9 Bit 0 Code sequence Te clockwise diagnostic control 9 Bit 3 Scaling funtion 2 ee ee ee 9 Bit 7 Short diagnostic 2 a ee ce a 1
10. 2 encoder DDLM_Set_Prm 4 Access to I O data of the encoder The PLC S7 Siemens works not with the i O data format from the length of 8 byte Hence the 8 byte input data and 8 byte output data at the identification F3 of the encoder must fetched with the system function logic arrays SFC14 and SFC15 These system function blocks are in the PLC available and can call up in the OB FB or FC As parameters must the Enable Marker here TrueFlag a variable for the Return value here RetVal and the I O address here 90 respectively 5A wich are defined in the hardware catalogue assigned The input data are available on the module output RECORD of the SFC 14 and the output data must as signed on the module input RECORD of the SFC 15 The type of the parameter RECORD is Any Pointer and must be a pointer to a 8 byte great Array When for the I O address again used a pointer then the data following in the periphery area under this address are available Also the data are observable in the variable table on this addresses Network 1 Consistent data read out from slave via SFC 14 RET_VAL egRetVal TrueFlag P E 90 0 B__ 1 O Address 90 Network 2 Consistent data write to slave via SFC 14 DPWR_DAT TrueFlag We1l6g5a RET_VAL gRetVal P A 90 0 B Pointer on A Address 90 KRD 11109 BE Page 12 TV K_ 6 Diagnostic messages DDLM_Slave_Diag 6 Diagnostic messages DDLM_Slave_Diag Explanations rega
11. According to Siemens the prerequisites for allocating a new address are as follows 1 No DP master is contained in the PROFIBUS network 2 At least one DP slave exists in the PROFIBUS network 3 APROFIBUS address has already been directly allocated to each DP slave in the PROFIBUS network either via software via PG DP slave direct connection or via setting the switches on the DP slave Assignment is DP slave dependent therefore consult the DP slave manual 4 You have connected the programming device to the PROFIBUS network via a stub line See the manual regarding the DP master See on line help under Assignment of profibus address in the Simatic Manager KRD 11109 BE Page 19 LVA 7 Simatic Step7 l e if the encoder is not the only slave on the profibus MPI card all slaves contained in the bus must pos sess a unique allocated only once address and the master S7 CPU must be disconnected from the bus It is therefore impossible for example to simultaneously connect two encoders with address 123 to the bus and to then assign a new address to one of the two If the encoder whose address is to be changed has already previously been used in bus operation this must be rendered potential free before it can be set to a new address Address setting is carried out in the Simatic Manager under PLC Assign PROFIBUS Address If the encoder is connected to the profibus MPI interface of your programming device the depicted dial
12. Encoder KBD KRD as a subscriber in the PROFIBUS DP KRD 11109 BE Related data sheet KRD 10941 preliminary 04 2006 TWK ELEKTRONIK GmbH PB 10 50 63 D 40041 D sseldorf Tel 49 211 63 20 67 Fax 49 211 63 77 05 info twk de www twk de Structure 1 GEMS Al sescsiseiscaneapis coavitenciatinaanzeneat aaiae a ran aa aaar Aaaa aiaa Aa aaa Aaaa Aaaa raaa anA Aa aa raana kanake uaaa 3 2 Installation instructions for PROFIBUS DP RS 485 0 0 ccccceeseeeeeee eee eeeeeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeeeeeeeseenenees 3 2 1 Connection of encoder with RS plug 0 0 eer rt nt er ene nee eee ene e etre neae eee ee naaeeeeeenaaeeeeeeenaaeeeeeeeaees 5 2 2 Connection of encoder with connecting CAP cc cece eee eete eee e ee etne eee erent eee e teat eee ee eaeeeeeeeaeeeeeeeedaeeeeseenaeeeseeeaees 5 3 Configuration function DDLM_ChK_CfQ cceceeeeeeeeeeeeeeeeeneeeeeeeeeeeesseeeeeeeeeeeseseseeeeeeeeeeeeeaeeeeeeneeeeeees 6 4 Data exchange function DDLM_Data_Exchange cccccccseseeeeeeeeeeeeeeeeeeeeeeeeeeeeuaaseeeeneeeeeeeeeeeeeeseeneees 7 4 1 Actual position value Input Data cvs csceces cipnceccnssascceci ae saacddens siycezcins denned cae squaeda did REEE ARANAN EAEEREN EENAA RENER 7 4 2 Set preset value Output Data serrera aia ENE ENA ETENEE AANEEN A AE 7 5 Programming parameters for class 1 2 encoder DDLM_Set_Prm 222 eeeeeeeeeeeeeeeeeeeeees 9 5 1 Definition of the programming parame
13. Receive transmit data A B Sub D connector 15 poles sockets DIP switch Terminal 2 Profibus KRD 11109 BE Page 5 LAE 3 Configuration function DDLM_Chk_Cfg 3 Configuration function DDLM_Chk_Cfg The absolute encoders with PROFIBUS DP are classified as follows Encoder with Class 1 functionality Class 1 devices are characterised by the fact that only the position value 16 bit or 32 bit of the encoder is transmitted via the bus No parameterisation of encoder parameters is carried out In this case a distinction is made between the DO and D1 configurations The DO configuration contains the data format 1 word input data consistency and D1 contains 2 word input data consistency Encoder with Class 2 functionality Class 2 devices are characterised by the fact that they can be parameterised via the bus In this case a distinction is made between the FO F1 and F3 configurations The FO configuration has the data format 1 word input data 1 word output data consistency F1 contains 2 word input data 2 word output data consistency and F3 contains 4 word input data 4 word output data The F3 contains beside the position value additional the velocity signal The Class 2 funtionality remains constant at identification F3 ID Identification Configuration Configuration function DDLM_Chk_Cfg Selection Class Data Identifier Comment Assign
14. WK into your disk drive In the hardware configuration select Install new GSD under Options Select the GSD file which corresponds to your encoder from the diskette Version with connecting cap e g KBDZ16 GSD KRDZ28 GSD Version with plug connection e g KBDL16 GSD KRDL28 GSD Update the Step7 hardware catalogue via Options Update Catalog 7 1 2 Installation of the TWK encoder symbol Via the installation of the TWK encoder symbol your encoder is not depicted as an unknown subscriber in the hardware configuration but assumes the appearance of your encoder This is not however of significance as regards the function of the encoder In order to install the symbol bitmap copy the file KBD_Z_an BMP or KBD_L_an BMP respectively KRD_Z_an BMP oder KRD_L_an BMP from A Bitmaps into the C Siemens Step7 S7Data NSBMP directory if C is your S7 drive The symbols first appear after restarting the Simatic Manager 7 1 3 Selection of the TWK encoder from the Step7 hardware catalogue After opening the hardware catalogue you will find under Profibus DP Additional Field Devices Encoder the TWK profibus encoder KRD plug encoder in plug version or Encoder CRD cap encoder with connec ting cap e g TWK KBD Z 16 Bit TWK KBD L 16 Bit TWK KRD Z 28 Bit TWK KRD L 28 Bit Now open your project mark the bus and integrate the encoder into the bus by double clicking onto the corresponding line in the hardware catalogue e g
15. ameter Assi gnment register the fol lowing window in which the characteristics of the encoder can be de fined is accessed The parameters of a class 2 slave are shown In the case of a class 1 slave only the code sequence parameter can be set here See chapter 5 Eigenschaften DP Slave Adresse Kennung Parametrieren E amp Typ m Ausgang Adresse Lange Einheit Anfang i00 2 worte gesamte Linge Ende 103 r Eingang Adresse Lange Einheit Anfang i00 2 worte gesamte L nge Ende 103 B Tiahne Nr 4 Kommentar CO 14 Byte hexadezimal durch Komma oder Leerzeichen getrennt 7 Simatic Step7 Direkteingabe Konsistent uber Konsistent Uber Hersteller spezifische Daten max Eigenschaften DP Slave Adresse Kennung Parametrieren Parameter 4J Stationsparameter mf Geratespezitische Parameter Code sequence Class 2 functionality Commissioning diagnostics Scaling function status Velocity unit Short diagnostic 16 Byte 2 Singletum resolution Total measuring steps Hex Parametrierung User_Prm_Data 0 bis 7 User_Prm_Data 8 bis 15 User_Prm_Data 16 bis 21 Abbrechen Hilfe Increasing clockwise Supported Not supported Disabled Steps 10 ms Not supported 65536 268435456 00 02 00 01 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Abbrechen Hilfe KRD
16. as well as for further reading we would refer to the PROFIBUS Nutzerorganisation PNO www profibus com 2 Installation instructions for PROFIBUS DP RS 485 Basic characteristics of RS 485 transmission technology Oo Network topology Linear bus terminating resistors for bus termination Stub lines are only permissible in the case of baudrates lt 1 5 MBit s oO Lead Sheathed twisted pair cable oO Number of stations 32 stations in each segment without repeaters Can be extended up to 126 with repeaters oO Plug type connector Variants implemented in the case of the KBD KRD model series Round plug RS 25 12 pin Connecting cap D SUB 9 pin or others on request pin assignment according to 1 Wiring and bus termination for PROFIBUS DP 2 Note 9 pin Sub D plug Station 1 Station 2 Data line B RxD TxD P 3 O lt 3 RxD TxD P RxD TxD P 3 DGND 5 5 DGND 2200 VP 6 O 6 VP Data line A RxD TxD N 8 8 RxD TxD N RxD TxD N 8 Shield PE 390 Q Connection Terminating resistance of the bus DOND 9 KRD 11109 BE Page 3 TANK 2 Installation instructions for PROFIBUS DP RS 485 The encoder is connected via the 15 pin SUB D plug In the event of an error the encoder can be replaced without time consuming installation The connecting cap is disconnected from the encoder by undoing 2 fastening screws Note O ring seal Note The protection grade is only warranted at screwed con
17. ate kBit s 9 6 19 2 93 75 187 5 500 1500 1200 Transmission length in m 1200 1200 1200 1000 400 200 100 Cable type A specifications also see Characteristic impedance 135 165 Ohm Capacitance per unit length coating lt 30 pF m Load resistance 110 Ohm km Core diameter 0 64 mm Core cross section gt 0 34 mm Installation guideline for PROFIBUS FMS DP No 2 111 Implementation guide DIN E 19245 Part 3 No 2 041 2 1 Connection of encoder with RS plug The pin assignment for the 12 pin RS plug Note Numeration of the pins in clockwise direction view facing contact side of the bushing encoder Bushing conforms to the profile definition for encoders 1 The terminating resistors must be implemented in the counterplug or in the subsequent electronics When delivered each encoder with RS plug has the default address 123 Via the DP master it is possible to change the address of a DP slave The slave address which is to be newly assigned must lie within the range 1 126 DDLM_Set_Slave_Add 2 2 Connection of encoder with connecting cap The connecting cap for triple connection technology is a T coupler which is installed in the PROFIBUS It is equipped with three PG connections which are subdivided as follows Oo PG 7 Voltage supply for the encoder 24 VDC m PG 9 Bus in Receive transmit data A B O PG 9 Bus out
18. e CatalOQue cceeccceeeeeeeeeeeeeeeteeeeeeeeneeeeeeentaeeeeeeeaes 16 7 1 4 Configuration Of the GNCOd6n c c cccdadiaiecediides tiiti dns dees shade cess tances eet aneeeevs Hiiadeeees Haacesusd E NO 16 7 1 5 Allocation of profibus address 02 0 0 ccc cee eeceececeec cee ce eee ee eee ee eee eaae cance eeeeeedec ce acaaeaecaeeeeeeeeeeeseceeacaeceeeeeeeeeeeeteeseenaees 17 7 1 6 Setting the I O addresses S7 addresses 0 eeceeeeeeeeeeeeente eee eeeaee eee eeeeae eee eeeeaaeeeeeeeaaaeeeeeeeaeeeeseeaaeeeeeeeneeeeeeeeaas 18 7 1 7 Parameterisation of the encoder 000 0 eee eet eee eente eee ee tea ae erence eee e eee ea anaes eee eaaeeeeeeeeaaeeeeeeeaaaeeeseeenaeeeeeeenaeeeeeseaas 18 7 1 8 Setting the diagnostic address soedinioriiiiir ninina AN ANAA ARRETAN aa AANA ARAA ARRETAN dels EAA 19 7 2 Setting the subscriber address in the case of the plug version encoder eeeessssssrrssessrrsssrsrrsssrtrrnsnttrnnssrennennt 19 123 Example programmes ssi osriiirenis aiiai a aa aad a a i aaa a aaan aa aaao san 20 1 3 1 The TWKDPCL1 project iesseccsichecssaccandestiececccezeangpctes hanicedeesiapasadicervaceecetediaicdsdaansascesttaaceeesstsagctadecaandneeeataenacezansds 20 73 2 The TWKDPCL2 project sissies ete eae eh aaa a aie Alienate 21 7 3 3 Installation of the example programmes ccccccecceeeeeeeececeeecaeeeeeeeeeeeeececaaaaaecaeeeeeeeeeeeeedeccacaeeaeeeeeeeeeeesensesaeas 21 7 3 4 Explanations regarding the example programmes
19. e files TWKDPCL1 ARJ Class 1 project with Diagnosis and Istwert programme folders comments in German TWKDPCL2 ARJ Class 2 project with Diagnosis IstRef and Istwert programme folders com ments in German DP_C1_GB ARJ Class 1 project with Diagnosis and Istwert programme folders comments in English DP_C2_GB ARJ Class 2 Project with Diagnosis IstRef and Istwert programme folders com ments in English 7 3 1 Das Projekt TWKDPCL1 The following Figure shows the class 1 project programme folders JARA sz Diag Diag2 s7 Istwert Program Istwert The program Istwert is comprised only of an OB1 and is intended to briefly show the manner in which the actual position value of the encoder is accessed within the S7 programme Program Diag1 In addition to the program Istwert the Diag1 programme also contains error hand ling for a class 1 encoder It contains amongst other things OB86 for detecting the failure of the encoder and OB82 for detecting a diagnostic request on the part of the encoder Step7 system function SFC13 is used to read the diagnostic range out The diagnostic range of the class 1 encoder is 16 bytes See Chapter 6 Program Diag2 The Diag2 programme provides the same functionality as Diag1 but is designed for two encoders KRD 11109 BE Page 20 TV K_ 8 Simatic Step7 Within each programme a selection may be made between functions for a 16 or 32 bit wide encoder input To achieve this eithe
20. fic diagnosis Octet 60 63 Manufacturer specific diagnosis Octet 60 63 Comment Possible error rectification Currently not assigned sd 7 Currently not assigned felled ojo N EEPROM error Reset encoder Reset encoder Reset encoder Reset encoder IniFlg Reinitialisation of EEPROM 7 _ Currently not assigned CRCO error Reprogramming and reboo ting of the encoder ting of the encoder parameter ErrSkla Is covered by communication ROM code error Reset encoder Errint Internal controller Reset encoder error ErrPre Preset value error Input preset value within total measuring range in units 1 7 ErrStat Unknown order Proper order from communi from communica cation tion At input of faulty preset values must set the preset control bit 31 to zero before you can set the accurate preset value again see chapter 4 2 i O o gt ep oO N 6 2 2 Example of diagnostic message Diagnosis in hex format Octet j1 2 3 4 5 je 7 8 9 10 11 12 13 f1 32 47 _ 27 EA D4 00 00 oo oo foo o1 foo oo 48 63 _ 2a 2a 2a 2A 2A 2A 2a 2A 2A joo 00 00 16 31 00 oo 10 oo oo oo oo o1 oo o1 oo 00 00 KRD 11109 BE Page 14 Baus 6 Diagnostic messages DDLM_Slave_Diag Diagnosis messages 6 00 hex a OC hex Response monitoring activa ted bit 2 set to 1 00 hex 02 hex Parameterisation via master with address 02 1963 hex Ident Number A O
21. ment Octet No and pyte MSB LSB 32 Bit In Out 64 Bit KRD Octet1 Bit 63 MSB 32 Bit Velocity In Output data Velocity Octet 4 Bit 32 LSB signal Position value Octet 5 Bit 31 MSB Octet 8 Bit 0 LSB Velocity signal Class 2 2 32 Bit F1 KRD Octet 1 Bit 7 MSB 32 Bit In out In Output data Octet 4 Bit 0 LSB Class 2 2 16 Bit FO KRD KBD Octet 1 Bit 7 MSB 16 Bit In Out In Output data Octet 2 Bit 0 LSB Class 1 1 32 Bit D1 KRD Octet 1 Bit 7 MSB 32 Bit In Input data Octet 4 Bit 0 LSB Class 1 1 16 Bit KRD KBD Octet 1 Bit 7 MSB 16 Bit In Input data Octet2 Bit 0 LSB KRD 11109 BE Page 6 TV K_ 4 Data exchange function DDLM_Data_Exchange 4 Data exchange function DDLM_Data_Exchange Input data are data which are transmitted from the peripheral devices to the master or into the bus Output data are data which are transmitted from the master to the subscriber in the bus The control of the preset value see below is listed as an example of output data at this point 4 1 Actual position value Input data The actual position value is output in 16 32 or 64 bit data format input data also see identification of the encoder Actual position value DDLM_Data_Exchange 16 bit data format Identification F1 D1 Input data O19 90 2 20 Actual position value DDLM_Data_Exchange 32 bit data format Identification F1 D1 Input data Octet a Bit MSB 31 24 _ 23 16 Data 231 SF 923 916 Ta 28 TE 20 Posi
22. nce The code sequence defines the direction of rotation in which the position value corresponds to increasing values viewed in the direction of the shaft o CW clockwise o CCW counter clockwise m Class 2 This operating parameter serves to distinguish between encoders with class 1 or class 2 functions o Class 1 Code sequence release of the class 2 functions o Class 2 Contains class 1 functions Scaling function control see below short diagnosis velocity signal m Diagnostic The diagnostic routine enables the extensive examination of all encoder compo nents to ensure perfect routine functional capability The routine is run through each time the device is switched on If faults are determined by the diagnostic routine these are displayed with the alarm bit This function is not currently supported Scaling function The scaling function control the parameterisation of the single turn resolution and the total measuring steps This function is only effective when changing the single turn resolution and total measuring steps parameter Following the execution of scaling function control the position value is recalculated and issued Velocity signal The velocity signal are detailed described in chapter 5 2 Short diagnosis For some applications depending from the kind of PLC it is necessary to work with a short diagnosis In this case the encoder works only with 16 diagnostic bytes 5 2 Notes to the velocity signal General remark
23. ncreasing va lues A distinction is made between the following depending on the direction of rotation CW _ clockwise clockwise direction of rotation CCW counter clockwise anti clockwise direction of rotation viewed in the direction of the shaft Preset value The preset value is the value which appears in the encoder s output value parameter according to the preset function KRD 11109 BE Page 23
24. nd encoder Profibus address 122 Inputs outputs From address 110 Diagnostic address 202 Installation In the Simatic Manager select File Retrieve Change the file type to arj and select the class 1 or class 2 project in the S7_BSP directory on the enclosed diskette In the next window specify your project directory normally S7pro j Via integration with OK the dearchiving programme is started After terminating this you will find your selected TWK example project in your S7 project directory If you now select File Open User project you will be provided with a list of the projects available on your system If the example project is not yet available here select Browse and search for the TWKDPCL1 s7p or TWKDPCL2 s7p file under the TWK example project Open the example project so that you now have both projects your own and the example project open This may then for example look like the Figure on the next Page Select a subordinate S7 programme folder of the TWK example project In this case either Diag1 Diag2 IstRef or Istwert Also see chapter 7 3 1 KRD 11109 BE Page 21 maa 7 Simatic Step7 A DP_CLAS2 lt Standardhierarchie Offline gt Projekt C SIE_ FET ES DP_CLAS2 E SIMATIC 300 Station 1 a fA CPU315 2 DPA a E7 7 Programm 1 H 0 Quellen By Bausteine lt 2 TWKDPCL2 Quellen 9 Diagl Bausteine Ey Diag2 Ez IstRef Ez Istwert
25. necting cap Setting the station subscriber address is carried out via the DIP switches in the connecting cap The address range lies between 1 and 126 Default address 123 The address cannot be changed via the DDLM_Set_Slave_Add service Note GSD file in accordance with encoder version Setting the terminating resistors is carried out via the 10 fold DIP switch 9 10 in the connecting cap which may be activated as lead termination as required DIP switch address setting DIP switch terminating resistors DIP Switch Swithj1 2 3 j4 s Je 7_ 8 jo fio w On 1 LSB s S sSMSSSBJ LSB ti MSB MSB nc Terminating resistors i MN Off 0 Address 1 to 128 aea No terminating resis OFF aj A n A n A A Default address 123 address 123 tors Terminating resistors switched on The following status LED are located in the rear wall of the connecting cap Status LED Status LED connecting cap po UB SRD e Err OO screw Incorrect configuration x x Xx impermissible parameter x x x _ Encodererror x Tx Class 1 device configuration ok x x J Class 2 device configuration ok x x x _ x LED on UB Supply voltage Err Error message C Class SRD Data transfer KRD 11109 BE Page 4 2 Installation instructions for PROFIBUS DP RS 485 Transmission length depending on transmission speed for cable type A Baud r
26. ogue appears PROFIBUS Adresse vergeben x Aktuelle PROFIBUS Adresse 1123 ba Neue PROFIBUS Adresse Ubemehmen Abbrechen Hilfe This displays the current address of the encoder and requests the input of the new profibus address If this is confirmed with Apply the new address is stored in the encoder in a zero voltage protected manner The dialogue subsequently displays the new address as the current address 7 3 Example programmes On the diskette which is supplied by TWK path S7_BSP contains several S7 archive files which contain S7 example programmes which have been generated by TWK for working with the TWK profibus encoder The programmes have been developed for a CPU315 2DP and have been designed such that no periphe ry other than a TWK profibus encoder is required The diskette contains one project for encoders with class 1 functionality and one for encoders with class 2 functionality Each project contains several programme folders for different application cases The standard Sources and Blocks folders are located beneath the programme folders The TWK examples only contain modules which have been generated with the KOP FUP AWL Editor The generation language was FUP Within the modules comprehensive documentation is made available on the basis of network comments TWK cannot undertake to provide any guarantee for the function of these programmes on customers sys tems control systems Programmes in the archiv
27. our profibus Depending on the configuration and address this may appear as follows a HW Konfig SIMATIC 300 Station 1 Konfiguration aly Station Bearbeiten Einfiigen Zielsystem Ansicht Extras Fenster Hilfe D ce a S S win x Cl 22 e Double clicking for the diagnostic address configuration See 7 1 8 EE kl 123 TWK KRD 2Z 28 Bit Steckplatz re hy Baugruppe DP Kennung Bestellnummer E Adresse A Adresse Kommentar Eas 2 GE BR inet configuration and parameter pro gramming See 7 1 6 und 7 1 7 The value for Module DP ID results from the configuration which is selected The values for I O address are default values which may vary depending on the control system KRD 11109 BE Page 17 TWK 7 1 6 Setting the I O addresses S7 addres ses Double clicking onto the Slot 0 line opens the Properties DP slave window with the Address ID and Parameter Assi gnment registers In the Address ID registers under output in the case of class 2 encoder only and input the addresses under which the enco der is to be addressed in S7 must be allocated The other entries in this register should not be changed The following Figure depicts an ex ample of this register for a class 2 encoder with 32 bit single turn resolu tion For the example pro gramme please input address 100 for outputs and inputs 7 1 7 Parameterisation of the encoder Via the Par
28. r the 16 or the 32 bit function is simply provided with a 1 signal one marker M 0 1 at the EN input and the non required function with a 0 signal zero marker M 0 0 7 3 2 The TWKDPCL2 project ey TWKDPCL 2 ex Diag The class 2 project contains the following programme folders H 7 Diag2 En IstRef Ez Istwert Program Istwert Identical to class 1 programme En siwer Program IstRef The program IstRef contains the reading out of the actual position value and in addition the setting of a preset value which is possible in the case of class 2 functionality Program Diag1 In the same manner as Diag1 from the class 1 project the Diag1 programme contains the error handling of a class 2 encoder In this case the scope of the diagnostic range is 63 bytes Program Diag2 Once again Diag2 is the variant of Diag1 which is extended to encompass two encoders 7 3 3 Installation of the example programmes Prerequisites You have generated a project and have inserted a control system into this with its hardware configuration This may appear as follows for example 2 Ey E SIMATIC 300 Station 1 a fA CPU315 2 DP a E7 Programm 1 By Quellen 9 Bausteine In the hardware configuration you have connected one or two encoders with the following settings to a profibus subnetwork See chapter 7 1 First encoder Profibus address 123 Inputs outputs From address 100 Diagnostic address 200 Poss Seco
29. rding the diagnostic information 6 1 Standard diagnostic information Octet 1 6 For detailed description see IEC 61158 3 Note Octet 5 6 Manufacturer identification 1963 hex This manufacturer identification number is stored in the PNO and identifies the subscriber as a TWK encoder 6 2 Device related diagnosis In the range from Octet 7 up to max 244 according to standard 3 the DP slave may store its specific diagnosis Diagnostic information DDLM_Slave_Diag mee i a a Class o ee information Device related diagnosis Extended header byte CT Operating mode en 0 code sequence 1 2 coder status 1 Class 2 functionality 2 Commissioning diagnostic control 3 Scaling funtion status 6 Velocity unit 7 Short diagnostic 16 Byte Encoder type 1 hex Absolute encoder 11 MSB 14 LSB to 65536 steps per revolution 15 MSB 16 LSB to 4096 revolutions End of diagnosis data for class 1 encoder and short diagnostic 17 Additional alarm mes ee sages 18 19 Supported alarm mes sages 20 21 Warning messages S e messages 26 27 1 2 N N _ 2 2 2 2 l 28 31 Operating time FFFF FFFF hex 32 35 Offset value e g OOFF 230F hex 36 39 Manufacturer offset not implemented value 40 MSB 43 LSB 1 268 435 456 steps 60 63 Manufacturer specific see below diagnosis KRD 11109 BE Page 13 LAE 6 Diagnostic messages DDLM_Slave_Diag 6 2 1 Manufacturer speci
30. s to identification F3 32 bit positions data and 32 bit velocity signal 64 bit In Out data Class 2 functionality are supported in the full range see identification F1 Update rate of the position value ca 700 us Take over of the reference value are ca 3 s The velocity signal won t issued if a false parameter set is programming The calculation of the velocity signal does not take place on the programmed parameter single turn resolution and total number of steps The physical position values to the time t4 and t4 x are used The encoder works internally with two different time base see also the parameter velocity unit Velocity Unit time base Steps 10ms ims Steps 100ms 10 ms The velocity signal is the arithmetical mean over 16 measured values The velocity signal is updated to 16 ms time base t 1 ms or 160 ms time base t 10 ms KRD 11109 BE Page 10 TV K_ 5 Programming parameters for class 1 2 encoder DDLM_Set_Prm Calculation of speed Adjustment Velocity unit Steps 100 ms Revolutions per minutes min Indicated value x 10 x 60 65536 Adjustment Velocity unit Steps 10 ms Revolutions per minute min Indicated value x 100 x 60 65536 Revolutions per minute wees value hex 4000 min 1 3000 min 1 oo 2000 min 1 5555 1000 min forming 2 DE Overflow 8888 8888 32 bit value at rom 2 4000 min KRD 11109 BE Page 11 LAVE 5 Programming parameters for class 1
31. ters ssssesessserrrssttttttttttt tn eee eeeaaeeeeeeeaeeeeeeeaaeeeeeeeaeeeeeeeeaeeeeeeenaeeeeseeaas 10 5 2 Notes to the velocity Signal sccccrccisnicericr a EEA eh tenet ea nee 10 6 Diagnostic messages DDLM_Slave_Diag scccccssseeseeeeeeeeeeseeesseeeeseeeeeeeeeseeneeseeseenseseeeeeneeeees 13 6 1 Standard diagnostic information Octet 1 6 cece teen eee e eee treet nade NEERA ATRAEN N 13 6 2 Device related CiaQnOSIS isisis2o3 cseotha scans felanes cguidatte gated ite dpana Hibt aaansudund eeeseveiea a peelsid aga ends tadennseystiaageaeddidapebieaiateneseeniteas 13 6 2 1 Manufacturer specific diagnosis Octet 60 63 0 0 cece eee ee eenne terre eae e ee eeeeaeeeeeeeeaaeeeeeeeaeeeeeeeaaeeeeeeedeeeeeneeaas 14 6 2 2 Example Of diagnostic MESSAGES ive wc eee cdc ccezedt ep anee a see sndgesyansadveensnsededdeyvaenedeasvanieagdetenssescclaaneeedenineneneservesl 14 Me SUM ATIC SUC PT arenira a seu sida bun s e aevss eens dua dadey sais ansdaduvendssiceshidvastavenssis 16 7 1 Integration of the TWK profibUS CENCOdED eee eennet ee enter rete tenet rete eaaae ee eeeeaaeeeeeeeaaeeeeeeeaeeeeseeenaeeeeeeeiaeeeseeeaas 16 7 1 1 installation of the GSD file 00 nt nn ne tener enn K eee enna N AAEE ENAKE EANAN EAA AEAEE 16 7 1 2 Installation of the TWK encoder symbol ccc cc eeeeeeeeeene eee eeee eters eeeaaae ee eeeeaaeeeeseeaaaeeeeeeeaeeeeeeeenaeeeeeeenaeeeeeeeaas 16 7 1 3 Selection of the TWK encoder from the Step 7 hardwar
32. tion value Actual position value DDLM_Data_Exchange 64 bit data format Identification F3 Input data C __f2___ s__ 4_ s__ e__ 7_ e__ Bit_ 63 56 55 48 T2 A e a e E LSB Positionvalue Velocity signal O 4 2 Set preset value Output data The set preset value function should only be executed when the encoder shaft is stationary In order to compare machine position values and the absolute position of the encoder setting the preset value is unavoidable in certain cases The preset value is the position value which is displayed in the reference point The possibility of setting the preset value is available in the case of the TWK encoder with class 2 functionality The user must note the fact that the preset value must lie within the total measuring range in units 1 In particular this must be taken into consideration when changing the total measuring range in units The preset value binary code is transmitted in data exchange mode by setting bit 31 32 bit data format or bit 15 16 bit data format The following explanations refer to the 32 bit data format Set preset value DDLM_Data_Exchange Output data pctet ff E a a MSB 30 24 23 16 15 8 7 0 LSB 230 224 923 916 ae 28 oT 55 Preset control Preset value KRD 11109 BE Page 7 TANK 4 Data exchange function DDLM_Data_Exchange Example Setting the preset value e g 32 bit data format Output data 30 0 00 0000 0000 0000 0000 0000 00
Download Pdf Manuals
Related Search
Related Contents
Acer Aspire L310 Owner's Manual Network Computing Devices SPA2102 User's Manual TransTig 1600 TransTig 1700 3 à 7 Copyright © All rights reserved.
Failed to retrieve file