step7_資料_02profibuscp 5511 manual_第1頁
step7_資料_02profibuscp 5511 manual_第2頁
step7_資料_02profibuscp 5511 manual_第3頁
step7_資料_02profibuscp 5511 manual_第4頁
step7_資料_02profibuscp 5511 manual_第5頁
已閱讀5頁,還剩51頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、SIMATIC NETDP Slave Programming Interface for CP 5511 and CP 5611ManualC79000-G8976-C126-04Release 05/2000SIMATIC NET is a trademark of Siemens Siemens AktiengesellschaftWir haben den Inhalt der Druckschrift auf bereinstim- mung mit der beschriebenen Hard- und Software geprft. Since deviations canno

2、t be precluded entirely, we cannot guarantee full agreement. Die Angaben in der Druckschrift werden jedoch regelmig berprft. Notwendige Korrek- turen sind in den nachfolgenden Auflagen enthalten. Sug- gestions for improvement are welcome.Technische nderungen vorbehalten.Weitergabe sowie Vervielfltig

3、ung dieser Unterlage, Ver- wertung und Mitteilung ihres Inhalts nicht gestattet, soweit nicht ausdrcklich zugestanden. Zuwiderhandlungen ver- pflichten zu Schadenersatz. Alle Rechte vorbehalten, ins- besondere fr den Fall der Patenterteilung oder GM- Eintragung.C79000-G8976-C126-04Copyright Siemens

4、AG 1999 All Rights ReservedWe have checked the contents of this manual for agree- ment with the hardware described. Since deviations cannot be precluded entirely, we cannot guarantee full agreement. However, the data in this manual are reviewed regularly and any necessary corrections included in sub

5、sequent editions. Suggestions for improvement are welcome.Technical data subject to change.The reproduction, transmission or use of this document or its contents is not permitted without express written authority. Offenders will be liable for damages. All rights, including rights created by patent g

6、rant or registration of a utility or design, are reserved.C79000-G8976-C126-04Copyright Siemens AG 1999 All Rights ReservedNous avons vrifi la conformit du contenu du prsent manuel avec le matriel et le logiciel qui y sont dcrits. Or, des divergences ntant pas exclues, nous ne pouvons pas nous porte

7、r garants pour la conformit intgrale. Si lusage du manuel devait rvler des erreurs, nous en tiendrons compte et apporterons les corrections ncessai- res ds la prochaine dition. Veuillez nous faire part de vos suggestions.Toute communication ou reproduction de ce support din- formations, toute exploi

8、tation ou communication de son contenu sont interdites, sauf autorisation expresse. Tout manquement cette rgle est illicite et expose son auteur au versement de dommages et intrts. Tous nos droits sont rservs, notamment pour le cas de la dlivrance dun brevet ou celui de lenregistrement dun modle dut

9、ilit.C79000-G8976-C126-04Copyright Siemens AG 1999 All Rights ReservedNous nous rservons le droit de modifier les caractristi- ques techniques.Siemens AktiengesellschaftElektronikwerk KarlsruhePrinted in theFederal Republic of Germany6,0$7,& 1(7DP Slave Programming Interface CP 5511 and CP 5611forMa

10、nualC79000-B8976-C125-04123IntroductionDescription of the Functions Structure of a DP Slave Application Additional DP Slave InformationChecklist for Programmers4567Formats of the Slave Data Where to Get Help GlossaryIndexNotes on the CE Mark of SIMATIC NET ProductsNoteWe would point out that the con

11、tents of this product documentation shall not become a part of or modify any prior or e- xisting agreement, commitment or legal relationship. The Purchase Agreement contains the complete and exclusive obli- gations of Siemens. Any statements contained in this documentation do not create new warranti

12、es or restrict the existing warranty.We would further point out that, for reasons of clarity, these operating instructions cannot deal with every possible problem arising from the use of this device. Should you require further information or if any special problems arise which are not sufficiently d

13、ealt with in the operating instructions, please contact your local Siemens representative.GeneralThis device is electrically operated. In operation, certain parts of this device carry a dangerously high voltage.WARNING !Failure to heed warnings may result in serious physical injury and/or material d

14、amage.Only appropriately qualified personnel may operate this equipment or work in its vicinity. Personnel must be thoroughly familiar with all warnings and maintenance measures in accordance with these o- perating instructions.Correct and safe operation of this equipment requires proper transport,

15、storage and assembly as well as careful operator control and maintenance.Personnel qualification requirementsQualified personnel as referred to in the operating instructions or in the warning notes are defined as persons who are familiar with the installation, assembly, startup and operation of this

16、 product and who possess the relevant qualifications for their work, e.g.:-Training in or authorization for connecting up, grounding or labeling circuits and devices or systems in accordance with current standards in safety technology;-Training in or authorization for the maintenance and use of suit

17、able safety equipment in accordance with current stan- dards in safety technology;-Training in firstaidContentsNoteThe table of contents below only includes two levels to preserve clarity.You will find a detailed table of contents at the beginning of each chapter.1Introduction71.1 Classification81.2

18、 Properties of the Programming Interface102Description of the Functions112.1 Introduction122.2 Logging on a DP Slave Application DPS_open132.3 Logging off a DP Slave Application DPS_close172.4 Switching the Slave Online DPS_start182.5 Switching the Slave Offline DPS_stop192.6 Setting Input Data of t

19、he Slave (input data for master) DPS_set_input202.7 Getting the Output Data of the Slave (output data of the master) DPS_get_output213Structure of a DP Slave Application233.1 Requirements243.2 Example of a DP Slave Application254Additional DP Slave Information294.1 Evaluating Errors304.2 Access to t

20、he CP 5x11, Range of Functions of the DP Slave, GSD File355Checklist for Programmers396Formats of the Slave Data416.1 Formats of the Input and Output Data426.2 Formats of the Slave Diagnostic Data437Where to Get Help.49Glossary51Index53Notes on the CE Mark of SIMATIC NET Products55DP Slave Programmi

21、ng Interface for CP 5511 and CP 5611 C79000-G8976-C126-045Notes for the UserDocumentationThis manual describes the DP slave programming interface.Symbols in the TextThe following symbol is used in the text.This symbol highlights special features and dangers.1IntroductionContents of the Chapter1.11.2

22、Classification8Properties of the Programming Interface10DP Slave Programming Interface for CP 5511 and CP 5611 C79000-G8976-C126-047This description introduces the DP slave programming interface.With this programming interface, a user program can use the services intended for a DP slave. The DP slav

23、e programming interface consists of functions belonging to the C programming language, grouped together to form a library (DLL).The following section provides you with an overview of the properties and features of the DP slave programming interface.Introduction1.1ClassificationDP Master Class 1A DP

24、master class 1 communicates cyclically with the DP slaves. The communication includes central functions such as:Configuration and assignment of parameters to the slaves Cyclic data transfer (input/output) to the DP slaves Monitoring of the DP slavesStorage of diagnostic informationDP Master Class 2W

25、ith the CP 5x11 range of CPs, access to the following diagnostic and parameter assignment functions are possible via a DP master class 2:Read slave diagnostic data Read master diagnostic data Read slave inputsRead save outputsRead slave configuration data Set slave addressDP SlaveThe slave is activa

26、ted via the DP slave programming interface, confi- gured and assigned parameters by the DP master class 1 and it then exchanges input and output data with the DP master in cyclic data transfer (see DP master class 1).Set input data for DP master (max. 122 bytes)Read output data of the DP master (max

27、. 122 bytes) Start/stop DP slaveDP Slave Programming Interface for CP 5511 and CP 5611C79000-G8976-C126-048IntroductionOverview of the DP ProtocolThe following diagram illustrates how a DP master class 2 is included in a PROFIBUS network.DP Slave Programming Interface for CP 5511 and CP 5611 C79000-

28、G8976-C126-049DP modePROFIBUSExamples: Controller Pos. motor SensorDP slave PC 3CP 5x11DPslaveDPslaveDPslavePC 2DP master class 2CP 5x11PC 1DP master class 1CP 5x11/5412Introduction1.2Properties of the Programming InterfaceNamesThe names of the functions and data components are based on the DP speci

29、fication.Single User OperationThe programming interface is designed for a call within one thread within a user program.Multi-user operation is not possible.Multiboard OperationNot approved.Operating Systems and CompilersThe programming interface is designed for use in Windows 98, Win- dows NT 4.0 an

30、d Windows 2000 Professional. Implementing the pro- gramming interface as a DLL allows the use of different compilers and programming languages.Compilers supported:MS Visual C V5.0 MS Visual C V6.0 MS Visual Basic V5.0MS Visual Basic V6.0Synchronous and Parallel ProcessingThe function calls of the pr

31、ogramming interface are synchronous. Syn- chronous functions only return to the caller after the job has been exe- cuted and provide the results of the job.The parallel execution of more than one DP slave service is not pos- sible and is rejected with an error.Supported Data TypeThe byte data type i

32、s supported.ConsistencyMaximum Data LengthsByte consistency is supported.A maximum of 122 bytes are possible in both the input and output direction.Compatibility with the CP 5614The call interface is compatible with the CP 5614, however, it provides only a subset of the CP 5614 slave functions.DP Sl

33、ave Programming Interface for CP 5511 and CP 5611C79000-G8976-C126-04102Description of the FunctionsContents of the Chapter2.7Introduction12Logging on a DP Slave Application DPS_open13Logging off a DP Slave Application DPS_close17Switching the Slave Online DPS_start18Switching the

34、Slave Offline DPS_stop19Setting Input Data of the Slave (input data for master) DPS_set_input20Getting the Output Data of the Slave (output data of the master) DPS_get_output21DP Slave Programming Interface for CP 5511 and CP 5611 C79000-G8976-C126-0411This chapter describes the administrative and p

35、roductive functions of the DP slave pro- gramming interface.Description of the Functions2.1IntroductionFunctionsThe DP slave programming interface consists of a number of C functions that can be grouped as follows:Administrative FunctionsProductive functions (functions for data exchange)Administrati

36、ve FunctionsThe following table illustrates the calls for administrative functions.Functions for Data ExchangeThe following table illustrates the additional functions for data ex- change.Conventions used in NotationThe following table explains the meaning of the special representations in the follow

37、ing sample programs for the functions:DP Slave Programming Interface for CP 5511 and CP 5611C79000-G8976-C126-0412RepresentationMeaning/ inThe value is provided by the user program as in- put to the DP slave programming interface./ outThe value is returned to the user program by the DP slave program

38、ming interface.FunctionsDescriptionDPS_set_inputSet input data of the slave (input data for the DP master)DPS_get_outputRead the output data of the slave. (output data from DP master)Administrative Func- tionsDescriptionDPS_openDP slave user program logs on at the in- terface.DPS_closeUser program l

39、ogs off at the interfaceDPS_stopDeactivates the slave module (offline).DPS_startActivates the slave module (online).Description of the Functions2.2Logging on a DP Slave Application DPS_openPurposeWith this function, the a DPS application logs on at the driver and sets the slave parameters. If succes

40、sful, the function returns a user handle. The user handle must be included in all further function calls.The bit DPS_SM_SIMPLE“ is set in the parameter slave_mode“; the expected parameter and configuration data are located in the para- meter init_data“.SyntaxExampleDP Slave Programming Interface for

41、 CP 5511 and CP 5611 C79000-G8976-C126-0413if (DPS_open (DPSONLINE,&user_handle, DPS_SM_SIMPLE, (DPR_BYTE)StationAddr, 0, 0x8076,0,&init_data,NULL, baudrate, &error)= DP_OK) / OK. Further actions else / Error handling DPR_DWORDDPS_open( DPR_STRING*cp_name,/ in DPR_DWORD*user_handle,/ outDPR_DWORDsla

42、ve_mode,/ inDPR_WORDstation_addr,/ inDPR_WORDaddr_change,/ in, not used! DPR_WORDpno_ident_nr,/ inDPR_WORDuser_wd,/ in, not used! DPS_INIT_DATA_T*init_data/ in DPS_MAX_DATA_T*max_data_len/ in, not used! DPR_WORDbaud_rate/ in DP_ERROR_T*error);/ outDescription of the FunctionsParametersTable continue

43、d on next pageDP Slave Programming Interface for CP 5511 and CP 5611C79000-G8976-C126-0414NameDescriptioncp_nameAccess point to the hardware - Using the program Set PG/PC Inter- face“, a CP5x11 PROFIBUS DP SLAVE“ interface parameter set must be assigned to this access point.user_handlePointer to the

44、 user-handle variable - If successful, the user handle assigned to the application is entered here.slave_modeDPS_SM_SIMPLEstation_addrStation address of the slaveaddr_changeAlways 0: address changes via the bus are not permittedpno_ident_nrUnique number for the slave assigned by the PROFIBUS Users O

45、r- ganization (for example 0x0008 for the sample application) when the customer applies for certification.user_wdNo significanceDescription of the FunctionsTable continued from previous pageTable continued on next pageDP Slave Programming Interface for CP 5511 and CP 5611 C79000-G8976-C126-0415init_

46、dataPointer to a structure with information on the extended slave data.Typedef union DPS_INIT_DATA_Sstruct DPS_SIMPLE_SDPR_WORD user_prm_data_len;/ in DPR_BYTE user_prm_dataDPS_MAX_PDU_LEN; / in DPR_WORD cfg_data_len;/ in DPR_BYTE cfg_dataDPS_MAX_PDU_LEN; / insimple;struct DPS_DYNAMIC_SDPR_WORDdef_c

47、fg_data_len;/ in DPR_BYTEdef_cfg_dataDPS_MAX_PDU_LEN;/ indynamic;DPS_INIT_DATA_Tuser_prm_data_len:Length of the specified user parameter assignment data : always 0 !*user_prm_data:Specified user parameter assignment data : always 0 ! *cfg_data_len:Length of the specified configuration datacfg_data:P

48、redefined configuration data from the GSD filedef_cfg_data_len:No significance, (struct DPS_DYNAMIC_S not used)def_cfg_data:No significance, (struct DPS_DYNAMIC_S not used)* user_prm_data are data specific to the application and are appen- ded to the standard section of parameter data (for example t

49、o set a mode, measuring range etc. on the slave). With a SIMPLE_SLAVE, the user parameter data of the master are simply compared with the specified parameter data.Description of the FunctionsTable continued from previous pageReturn ValuesNoteMake sure that the node address of the slave does not alre

50、ady exist on the bus.This function is synchronous.DP Slave Programming Interface for CP 5511 and CP 5611C79000-G8976-C126-0416NameDescriptionDP_OKSuccessful completion of the functionotherIncorrect completion - the error IDs correspond to the function. For more detailed information, refer to Chapter

51、 4.max_data_lenThe structure is not evaluated by the CP 5x11 DP slave and is the- refore of no significance.Typedef DPS_MAX_DATA_SDPR_BYTE max_input_data_len; / in DPR_BYTE max_output_data_len; / in DPR_BYTE max_user_diag_len; / in DPR_BYTE max_user_prm_data_len; / in DPR_BYTE max_cfg_data_len; / in

52、 DPR_BYTE max_user_ssa_data_len; / inDPS_MAX_DATA_Tbaud_rateTransmission rates that can be set: The following constants are defi- ned:DPS_BD_9K6/9.6KbpsDPS_BD_19K2/19.2KbpsDPS_BD_45K45/45.45 KbpsDPS_BD_93K75/93.75 KbpsDPS_BD_187K5/187.5KbpsDPS_BD_500K/500KbpsDPS_BD_1M5/1.5MbpsDPS_BD_3M/3MbpsDPS_BD_6

53、M/6MbpsDPS_BD_12M/12MbpserrorAddress of a structure provided by the user program of the type DP_ERROR_T. If an error occurred, the structure contains details for troubleshooting.Description of the Functions2.3Logging off a DP Slave Application DPS_closePurposeWith this function, a DP user program lo

54、gs off for communication at the slave module.SyntaxParametersReturn ValuesDP Slave Programming Interface for CP 5511 and CP 5611 C79000-G8976-C126-0417NameDescriptionDP_OKSuccessful completion of the functionotherIncorrect completion - the error IDs correspond to the function. For more detailed info

55、rmation, refer to Chapter 4.NoteIf the logoff was successful, the user handle is no longer valid and must not continue to be used.This function is synchronous.NameDescriptionuser_handleUser handle assigned with the DPS_open call.errorAddress of a structure provided by the user program of the type DP_ERROR_T. If an error occurred, the stru

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論