Home
PROFIBUS-DP Slave Protocol API
Contents
1. The Application Interface 86 238 In detail the following functionality is provided by the FSPMS Task Overview over Packets of the FSPMS Task No of Command Packet Page LFW section code LOM REQ CNF or IND RES 6 2 1 0x0402 PROFIBUS_FSPMS_CMD_INIT_MSO_REQ CNF Initializing the 88 0x0403 MSCY1S State Machine manda tory for LOM 6 2 2 0x0404 PROFIBUS_FSPMS_CMD_INIT_MS1_REQ CNF Initializing the 93 ae 0x0405 MSAC1S State Machine 6 2 3 0x0406 PROFIBUS_FSPMS_CMD_INIT_MS2_REQ CNF Initializing the 98 0x0407 MSAC2S State Machine 6 2 4 0x0408 PROF IBUS_FSPMS_CMD_ABORT_REQ CNF Send an Abort Signal 102 ae 0x0409 6 2 5 0x042E PROF IBUS_FSPMS_CMD_SET_CFG_REQ CNF Setting new I O Is 104 Wa 0x042F Configuration Data 6 2 6 0x040E PROFIBUS_FSPMS_CMD_SET_SLAVE_DIAG_REQ CNF Transmitting 108 z 0x040F Diagnostic Data 6 2 7 0x040C PROF IBUS_FSPMS_CMD_SET_INPUT_REQ CNF Setting the Input 112 E 0x040D Data 6 2 8 0x040A PROF IBUS_FSPMS_CMD_GET_OUTPUT_REQ CNF Getting the latest 115 vi 0x040B Output Data 6 2 9 0x041C PROF IBUS_FSPMS_CMD_NEW_OUTPUT_IND Indicating the Reception 118 of new cyclic Output Data 6 2 10 0x044E PROFIBUS_FSPMS_CM
2. initialization request PEE EE S EAE EE E T cade semacesuiodsiderseaeanttiaea see desedics tpevbvadecthcensaseesuaen 166 Table 117 PROFIBUS_FSPMS_CMD_C2_READ_IND Indication Command of a Process Data Read Request 168 Table 118 PROFIBUS_FSPMS_CMD_C2_READ_RES_POS Positive Response Command of a Process Data read 169 Table 119 PROFIBUS_FSPMS_CMD_C2_READ_RES_NEG Negative Response Command of a Process Data read 170 Table 120 PROFIBUS_FSPMS_CMD_C2_WRITE_IND Indication Command of a Process Data Write Request 172 Table 121 PROFIBUS_FSPMS_CMD_C2_WRITE_RES_POS Positive Response Command of a Process Data Write 174 Table 122 PROFIBUS_FSPMS_CMD_C2_WRITE_RES_NEG Negative Response Command of a Process Data write 175 Table 123 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_IND Indication Command of a Process Data Transport Request cesee ete PEE EFT P A E EA E A E E T 177 Table 124 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_RES_POS Positive Response Command of a Process Data Transport Request ee eeeeeeeees E EE E E E 179 Table 125 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_RES_NEG Negative Response Command of a Process Data Transport Regq eStn nisin E a e E eh vc ee ede ies oe elie 180 Table 126 Allowed Values of Subnet Variable c e ie e e e a e aaa aae E aa E ae
3. The Application Interface 87 238 Overview over Packets of the FSPMS Task No of Command Packet Page LFW section code LOM REQ CNF or IND RES 6 2 20 0x0482 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_IND RES_POS 155 0x0483 RES_NEG Indicating an Alarm Request 6 2 21 0x04A2 PROFIBUS_FSPMS_CMD_C2_INITIATE_IND RES_POS RES_NEG 160 0x04A3 Indicating a Request to establish an acyclic Connection to a DP Master Class 2 6 2 22 0x04A4 PROFIBUS_FSPMS_CMD_C2_READ_IND RES_POS RES_NEG 167 0x04A5 Indicating an acyclic read Request Class 2 to a specific Process Data Object 6 2 23 0x04A6 PROFIBUS_FSPMS_CMD_C2_WRITE_IND RES_POS RES_NEG 171 0x04A7 Indicating an acyclic write Request to a specific Process Data Object 6 2 24 0x04A8 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_IND RES_POS RES_ 176 0x04A9 NEG Indicating an acyclic Data Transport Request to a single combined Process Data Object 6 2 25 Ox04AA PROFIBUS_FSPMS_CMD_C2_ABORT_IND RES Indicating the Abort of 181 0x04AB Class 2 Connection 6 2 26 0x0448 PROF IBUS_FSPMS_CMD_STATE_CHANGED_IND Indication for Change 185 a of State 6 2 27 0x044A PROFIBUS_FSPMS_CMD_REGISTER_DIAG_STRUCT_REQ CNF 188 0x044B Request for Registration of Diagnostic Structure 6 2 28 0x044C PROFIBUS_FSPMS_CMD_IND_SETTING_REQ CNF Request for 190 0x044D deactivating the Output Indication 6
4. Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS task Process Queue ulSre UINT32 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrc d UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 1 Sizeof PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_RE S_T Packet Data Length in bytes ullId UINT32 C2271 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCcmd UINT32 0x0417 PROF IBUS_FSPMS_CMD_CHECK_USER_PRM_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_F SPMS_CHECK_USER_PRM_RES_T fPrmOk BOOLEAN8 0 1 If set to TLR_TRUE 1 the AP task has accepted the Parameter Data If set to TLR_FALSE 0 the Parameter Data is not ok Table 98 PROF IBUS_FSPMS_CMD_CHECK_USER_PRM_RES Response to Indication Command of a Check Configuration PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Releas
5. System Area Handshake Area Channel Area MBX MBX HC MBX MBX DPM Out In hee rannel out tn Out In X y net l vv MBX MBX MBX MBX A B C A B C Tripe Task Task Task Task Buffer for rX Idle cyclic lO i Watchd rX Timer rX System APS Task oy PROFIBUS FSPMS i Function Interface Packet Interface PROFIBUS DL Task Other kind of _ pen i xC I PROFIBUS XC SRD SDN SDA Figure 6 Internal Structure of PROFIBUS DP Slave Firmware For the explanation of the different kinds of arrows see lower left corner of figure The dual port memory is used for exchange of information data and packets Configuration and IO data will be transferred using this way The user application only accesses the task located in the highest layer namely the APS task which constitute the application interface of the Profibus Slave Stack The Profibus FSPMS task and Profibus DL task represent the core of the Profibus Slave Stack PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Getting started Configuration 42 238 In detail the various tasks have the following functionality and responsibilities APS task The APS task provides the interface to the user application and the control of the stack It also completely handles the Dual Port Memory interf
6. Table 62 PROFIBUS_APS_CHECK_CFG_RES Response to Check Configuration Indication ccccceseeseeeteeenees 80 Table 63 PROFIBUS_APS_GET_USER_PRM_REQ Get User Parameter Data Request 0 ees eee eee teeeteeees 81 Table 64 PROFIBUS_APS_GET_USER_PRM_CNF Confirmation of Get User Parameter Data Request ee 82 Table 65 PROFIBUS_APS_GET_CFG_REQ Get Configuration Data REQUEST eccceseeeeeeeeteeeeeeeteneeeeeeereteeeeeeeenees 83 Table 66 PROFIBUS_APS_GET_CFG_CNF Confirmation to Get Configuration Data Request ccceeeceeeseeeeeeeeenees 84 Table 67 FSPMS task Process QUCUC cccceseceesceeeseeteseeeeaeeeeseeeeaeeeeseeseaeeeeaaeseaeeeesaeeeaeeessaeseaeeeesaeseaeeseaeeseaeessaeeseaeetsaees 85 Table 68 Overview over the Packets of the FSPMS Task of the PROFIBUS DP Slave Protocol Stack c cceeee 87 Table 69 PROFIBUS_FSPMS_CMD_INI SO_REQ Request Command for MSO Initialization Table 70 PROFIBUS_FSPMS_CMD_INIT_MSO_CNF Confirmation Command of MSO Initialization 0 cee 92 Table 71 Coding of the bALarmModeS lave Parameter cenin a aa a e EE E a aa EA E EEKEREN 93 Table 72 PROFIBUS_FSPMS_CMD_INI S1_REQ Request Command for MS1 Initialization eeeeeeeeeeeees 95 Table 73 PROFIBUS_FSPMS_CMD_INIT_MS1_CNF Confirmation Command of MS1 Initialization ees 97 Table
7. Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS task Process Queue ulSre UINT32 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMS1 ld Destination end point identifier specifying the final receiver ulFSPMS2ld of the packet within the Destination Process ulSrcId UINT32 ulAPMS1 ld Source end point identifier specifying the origin of the ulAPMS2ld packet inside the Source Process ulLen UINT32 3 sizeof PROFIBUS_FSPMS_C1_WRITE_RES_NEG_T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 TLR_E FAIL See chapter 7 1 Error Codes of the FSPMS Task Not 0 ulCmd UINT32 0x0487 PROFIBUS_FSPMS_CMD_C1_WRITE_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C1_WRITE_RES NEG T bErrorDecode UINT8 Error decode value classifying the error bErrorCodel UINT8 Detailed error code bErrorCode2 UINT8 User specific error code Table 106 PROFIBUS_FSPMS_CMD_C1_WRITE_RES_NEG PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Negative Response Command of a Process Data write Hilsc
8. Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS task Process Queue ulSre UINT32 Source Queue Handle of AP task Process Queue ulDestid UINT32 ulFSPMS1 ld Destination end point identifier specifying the final receiver ulFSPMS2ld of the packet within the Destination Process ulSrcId UINT32 ulAPMS1Id Source end point identifier specifying the origin of the ulAPMS2ld packet inside the Source Process ulLen UINT32 3 sizeof PROFIBUS_FSPMS_C1_READ_RES_NEG_T Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 Not 0 See chapter 7 1 Error Codes of the FSPMS Task TLR_E_FAIL ulCmd UINT32 0x0485 PROFIBUS_FSPMS_CMD_C1_READ_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C1_READ RES POS T bErrorDecode UINT8 0 255 Error decode value classifying the error bErrorCodel UINT8 0 255 Detailed error code bErrorCode2 UINT8 0 255 User specific error code Table 103 PROFIBUS_FSPMS_CMD_C1_READ_RES_NEG Negative Response Command of a Process Data Read PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013
9. typedef struct PROFIBUS_FSPMS_C2_WRITE_RES_NEG Ttag LR_UINT32 ulReference LR_UINT8 bErrorDecode LR_UINT8 bErrorCodel LR_UINT8 bErrorCode2 IPIROM ICUS I SIMIS C2 ARIE Win IRS Nae IEE Negative response packet of an acyclic read command typedef struct PROFIBUS_FSPMS_PACKET_C2_WRITE_RES_NEG_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_C2_WRITE_RES_NEG_T tData IPIRNOMINENUIS ISIS VAC IE C2 IRIE RB RES INGE Ihe Packet Description structure PROFIBUS_FSPMS_ PACKET _C2_ WRITE_RES_ NEG T Type Response Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle of FSPMS Task Process Queue ulSre UINT32 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulFSPMS2lId Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 7 sizeof PROFIBUS_FSPMS_C2_WRITE_RES_NEG_T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 TLR_E FAIL See chapter 7 1 Error
10. Init 6 2 1 PROF IBUS_FSPMS_CMD_INIT_MS0O_REQ CNF Initializing the MSCY1S State Machine Set Input 6 2 7 PROF IBUS_FSPMS_CMD_SET_INPUT_REQ CNF Setting the Input Data Get Output 6 2 8 PROF IBUS_FSPMS_CMD_GET_OUTPUT_REQ CNF Getting the latest Output Data New Output Ind 6 2 9 PROF IBUS_FSPMS_CMD_NEW_OUTPUT_IND Indicating the Reception of new cyclic Output Data Acyclic data 5 5 Acyclic Data Transfer transfer Records Init Class 1 6 2 2 PROF IBUS_FSPMS_CMD_INIT_MS1_REQ CNF Initializing the MSAC1S State Machine Init Class 2 6 2 3 PROF IBUS_FSPMS_CMD_INIT_MS2_REQ CNF Initializing the MSAC2S State Machine Initiate Ind Class 2 6 2 21 PROF IBUS_FSPMS_CMD_INITIATE_IND Indicating a Request to establish an acyclic Connection to a DP Master Class 2 Class 1 Read 6 2 17 PROFIBUS_FSPMS_CMD_READ_IND Indicating an acyclic read Request to a specific Process Data Object Class 1 Write 6 2 18 PROFIBUS_FSPMS_CMD_WRITE_IND Indicating an acyclic write Request to a specific Process Data Object Class 2 Read 6 2 22 PROFIBUS FSPMS CMD C2 READ IND Indicating an acyclic read Request Class 2 to a specific Process Data Object Class 2 Write 6 2 23 PROFIBUS FSPMS CMD C2 WRITE IND Indicating an acyclic write Request to a specific Process Data Object Alarm Handling 5 6 Alarm Processing Alarm Notification 6 2 19 PROFIBUS_FSPMS_CMD_C1_ALARM NOTIFICA
11. TLR_PACKET_HEADER_T tHead RCX_SET_HW_ SWITCH VALUES REO DATA T tData RCX_SET_HW_SWITCH_VALUES_REQO_T Packet Description packet header structure RCX_SET_HW_SWITCH_ VALUES_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of application task process queue ulSre UINT32 Source Queue Handle of PNSIF task process queue ulDestId VINT32 0 Destination End Point Identifier ulSrciId UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 20 N Packet data length in bytes N depends on the number of used switch values ulId UINT32 6 2 Packet identification as unique number generated by the source process of the packet ulSta UINT32 Status not used for request ulCmd UINT32 RCX_SET_HW_SWITCH_VALUES_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure RCX_SET_HW_SWITCH_VALUES_REQ DATA T ulNumberOfSwitches UINT32 0 10 The number of used hardware switches tSwitchValue See below The tSwitchValue structures which contain the name and value for each switch Table 159 RCX_SET_HW_SWITCH_VALUES_REQ_T Set Hardware Switch
12. typedef struct PROFIBUS_FSPMS_PACKET_SET_SLAVE_DIAG REO Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_SET_SLAVE_DIAG_REQ_T tData PROFIBUS_FSPMS_PACKET_SET_SLAVE_DIAG REQ T Packet Description structure PROFIBUS_FSPMS_ PACKET _SET_SLAVE_DIAG REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 0x20 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 25 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 2 n PROFIBUS_FSPMS_SET_SLAVE_DIAG_REQ_SIZE n number of bytes in extended Diagnostic block abExtDiagData Packet Data Length in bytes ulId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x040E PROFIBUS_FSPMS_CMD_SET_SLAVE_DIAG_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Rout
13. define PROFIBUS_FSPMS_REGISTER_DIAG STRUCT_REQ_SIZE sizeof PROF IBUS_FSPMS_REGISTER_DIAG STRUCT_REQO_T typedef struct PROFIBUS_FSPMS_PACKET_REGISTER_DIAG STRUCT_REOQ_ Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_REGISTER_DIAG_STRUCT_REQ tData PROFIBUS_FSPMS_PACKET_REGISTER_DIAG STRUCT_REQ_T Packet Description structure PROFIBUS_FSPMS_ PACKET _REGISTER_DIAG STRUCT_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER T ulDest UINT32 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 6 224 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulsreld UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 n Packet Data Length in bytes n number of bytes in diagnostic area block pbDiagArea ulId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x044A PROFIBUS_F
14. 5 5 1 1 Slot and Index based Addressing Mechanism With these packets you can access data areas within single modules of the slave These data areas can be addressed by a slot and index based mechanism The ulSlot parameter is used both for read and write access to determine the desired slot in the destination device Slot in this context usually simply means a single module of the destination device The allowed range for this parameter extends from 0 to 254 as the value 255 is reserved by the Profibus DP V1 specification The ulIndex parameter is used both for read and write access to determine the desired data block in the desired module of the destination device The allowed range for this parameter extends from 0 to 254 as the value 255 is reserved by the Profibus DP V1 specification The length of the data area to be read can be specified by the ul Length parameter but it may not exceed the upper limit of 240 bytes 5 5 1 2 Error Handling The error handling is similar for read and write access In case of error two Error_Codes are delivered in the data area representing further detailed error information The first variable bErrorDecode has to be set to the value PROFIBUS_FSPMS_ERROR_DECODE_ DPV1 128 which declares the error to be a user specific error For bErrorCodel one class bits 4 to 7 of the following three bitmasks has to be selected first PROFIBUS DP Slave
15. No of Packet Command Page section code REQ CNF or IND RES 6 1 1 PROFIBUS_APS_SET_CONFIGURATION_REQ CNF Set Configuration Parameters 0x3102 71 0x3103 6 1 2 PROF IBUS_APS_CHECK_USER_PRM_IND RES Check User Parameter Data 0x3104 75 0x3105 6 1 3 PROF IBUS_APS_CHECK_CFG_IND RES Check Configuration Data 0x3106 78 0x3107 6 1 4 PROF IBUS_APS_GET_USER_PRM_REQ CNF Request User Parameter Data 0x3108 81 0x3109 6 1 5 PROF IBUS_APS_GET_CFG_REQ CNF Request Config Data 0x310A 83 0x310B Table 56 Overview over the Packets of the APS Task of the CANopen Master Protocol Stack All of these packets are suitable in the context of loadable firmware PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 71 238 6 1 1 PROFIBUS_APS_SET_ CONFIGURATION_REQ CNF Set Configuration Parameters The packet below is used to provide configuration to the PROFIBUS stack It holds values for the system flags watchdog time network parameter and the current IO data lengths respectively its data modules type and size Currently the system flags variable ulSystemF lags can have the following values Value Meaning WRMSTRT_FLG_START_APPLICATION 0x1 WRMSTRT_FLG_START_AUTO 0x0 The structure of the configuration data specified in general or special identifier format is described in section Configura
16. typedef struct PROFIBUS_FSPMS_C2_DATA_TRANSPORT_IND_Ttag LR_UINT32 ulReference LR_UINT8 bSlotNumber LR_UINT8 bIndex LR_UINT8 bLength LR_UINT8 abData PROFIBUS_FSPMS_MAX_ DATA_TRANSPORT_DATA_SIZE PROFIBUS_FSPMS_C2_DATA_TRANSPORT_IND_T typedef struct PROFIBUS_FSPMS_PACKET_C2_DATA_TRANSPORT_IND_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_C2_DATA_TRANSPORT_IND_T tData PROFIBUS_FSPMS_ PACKET _C2_DATA_TRANSPORT_IND_T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 177 238 structure PROFIBUS_FSPMS_PACKET C2_DATA_TRANSPORT_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle of AP Task Process Queue ulSre UINT32 Source Queue Handle of FSPMS Task Process Queue ulDestId UINT32 ulAPMS2ld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrclId UINT32 ulFSPMS2Id Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 7 n PROFIBUS_FSPMS_C2_DATA_TRANSPORT_IND_IND_SI ZE n number of by
17. Table 116 PROFIBUS_FSPMS_CMD_C2_INITIATE_RES_NEG Negative Response Command of a DP Master Class 2 initialization request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 167 238 6 2 22 PROFIBUS_FSPMS_CMD C2 READ IND RES_POS RES_NEG Indicating an acyclic read Request Class 2 to a specific Process Data Object This service indicates the AP Task that a specific Process Data Object shall be read by a DP Master Class 2 The AP Task has to take care of the Process Data objects themselves This means that it is fully application specific where those Process Data objects are read from and what purpose they have To complete the Process Data read indication the AP Task has to respond and deliver the requested data by using the service described in Table 118 PROF IBUS_FSPMS_CMD_C2_READ_RES_POS Positive Response Command of a Process Data read or in Table 119 PROFIBUS_FSPMS_CMD_C2_READ_RES_NEG Negative Response Command of a Process Data read In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapsms2t1a value of the request packet referenced in Table 74 PROF IBUS_FSPMS_CMD_INIT_MS2_REQ Request Command for MS2 Initialization for a DP Master Class 2 read Assign this end point identifier to ulLReference The variable bSlotNumbe
18. ulDest UINT32 Destination Queue Handle of FSPMS Task Process Queue ulSre UINT32 Source Queue Handle of AP Task Process Queue ulDestid UINT32 ulFSPMS2Id Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 114n PROFIBUS_FSPMS_INITIATE_RES_DATA_SIZE n number of byte in the Source Destination Address field abSAddrDAdadr Packet Data Length in bytes ullId UINT32 O24 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 TLR_S_ OK 0 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04A3 PROF IBUS_FSPMS_CMD_C2_INITIATE_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_INITIATE_RES POS _T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bMaxLenDataUnit UINT8 1 240 Maximum number of bytes allowed to be transported via the DP Master Class 2 connection tFeaturesSupport UINT16 Bit mask Supported features of the DP Master Class 2 connection ed tProfileFeatures UINT16 Bit mask Supported profile features of the DP Master Class 2 Supported connection usProfileIdentNu UINT16 Bit mask Corresponding Profile Ident Number 0 indicates that no m
19. Table 1 List of Revisions PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 7 238 1 3 System Requirements The software package has the following system requirements to its environment netX Chip as CPU hardware platform operating system for task scheduling required 1 4 Intended Audience This manual is suitable for software developers with the following background Knowledge of the programming language C Knowledge of the use of the realtime operating system rcX Knowledge of the Hilscher Task Layer Reference Model Knowledge of the IEC 61158 specification PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 1 5 Technical Data 8 238 The data below applies to the PROFIBUS DP slave firmware and stack version V2 7 x x Supported State Machines Name State Machine FSPMS Fieldbus Service Protocol Slave state machine MSCY1S Master to Slave cyclic state machine DMPMS Data Link Mapping Protocol Slave state machine MSAC1S Master Class1 to Slave acyclic state machine MSAC2S Master Class2 to Slave acyclic state machine MSRM2S Master Class2 to Slave resource Manager state machine Table 2 Technical Data Supported State Machine Technical Data Features Parameter Maximum number of cyclic inpu
20. BACKE Sia INP CIN ieee 4 TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_SET_INPUT_CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET_SET_INPUT_CNF_T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle unchanged UINT32 Source Queue Handle unchanged ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 0 Packet Data Length in bytes ulId UINT32 0 25 1 Packet Identification unchanged ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x040D PROFIBUS_FSPMS_CMD_SET_INPUT_CNF Command ulExt UINT32 0 Extension reserved ulRout UINT32 x Routing do not touch Table 83 PROFIBUS_FSPMS_CMD_SET_INPUT_CNF Confirmation Command of updating the Input Data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 115 238 6 2 8 PROFIBUS_FSPMS_CMD GET _OUTPUT_REQ CNF Getting the latest Output Data This service has to be used by the AP task in order to get the latest output data from the underlying MSCY1S state machine The output data are available in the field abOutputData_ The maximum number of Output D
21. TLR_PACKET_HEADER_T tHead PROP LBUS FSPMS SET uCrG RROUT chatay PROFIBUS_FSPMS_ PACKET SET _CFG REQ T Packet Description structure PROFIBUS_FSPMS_ PACKET SET_CFG_ REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 0x20 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 25 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 n n number of bytes in Configuration block abCfgData Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x042E PROFIBUS_FSPMS_CMD_SET_CFG_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_SET_CFG_REQ T abCfgData_l UINT8 Is Configuration data to be set Table 78 PROFIBUS_FSPMS_CMD_SET_CFG_REQ Request Command for setting new Configuration Data
22. USER PRM RES tData CHE CKSUSE REP RMERE Oss PROFIBUS_APS_PACKE Packet Description structure PROFIBUS_APS PACKET CHECK _USER_PRM_RES_ T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 1 Packet Data Length in bytes ulld UINT32 0 2 74 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task ulcmd UINT32 0x3105 PROF IBUS_APS_CHECK_US ER_PRM_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch structure PROFIBUS_APS_C HECK _USER_PRM_RES_ T PrmOk BOOLEANS8 This Boolean variable indicates whether the user parameter data are ok or not Table 60 PROF IBUS_APS_CHECK_USER_PRM_RES Response to Check User Parameter Indication PROFIBUS DP Slave Protocol API DOC05040
23. Table 109 PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_CNF Request Command for Alarm Notification bAlarm_Type identifies the alarm type The coding is explained in the table below in the previous section Table 108 PROFIBUS DPV1 Possible Alarm Types about packet PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFI CATION_REO PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 155 238 6 2 20 PROFIBUS_FSPMS_CMD_Cl1_ ALARM ACK _IND RES_POS RES_NEG Indicating an Alarm Request The slot number of the slot reporting the alarm should be filled into the variable bs1otNumber The variable bseqnr holds a sequence number that is used to distinct alarms that are active at the same time Thus the sequence number must be unique to each alarm The alarm type should be written to the variable bAlarmtype For a more detailed description of all alarm parameter please refer to the PROFIBUS DP V1 specification All parameters will be checked by the device In case of an error the alarm will be rejected and an error message will be returned to the host application Else the alarm will be sent and the device waits for the Alarm Acknowledge service from the master When it is received the device informs the host application of the successful alarm processing by returning an answer message The variable bSlotNumber has to be us
24. ulCmd UINT32 0x3109 PROFIBUS_APS_GET_USER_PRM_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch structure PROFIBUS_APS_GET_USER_PRM_CNF_T abUserPrmData PR UINT8 User parameter data OF IBUS_APS_MAX_U SER_PRM_DATA_SIZ E Table 64 PROFIBUS_APS_GET_USER_PRM_CNF Confirmation of Get User Parameter Data Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 83 238 6 1 5 PROFIBUS_APS_GET_CFG_REQ CNF Request Config Data This packet is used to request current configuration information about the Profibus DP slave The request packet does not have any parameters The confirmation packet contains the requested configuration data which are returned in parameter abCfgData and sometimes denominated as real configuration data These data are structured in the way described in section Format of Profibus DP Configuration Data on page 55 Their length is limited to 244 bytes by the Profibus DP specification Note Use this packet only when working with loadable firmware It has not been designed for usage in the context of linkable object modules Packet Structure Reference define PROFIBUS_APS_ GET_CFG_REQ SIZE 0 typedef struct PROFIBUS_APS_PACKET_GET_CFG_REQ Ttag TLR_PACKET_HEFADER tHea
25. define PROFIBUS_FSPMS_C2_ABORT_IND_SIZE typedef struct PROFIB sizeof PROFIBUS_FSPMS_C2_ABORT_IND_T WSmESEMSSPACKE TAC2 ABORT SENDS N ao TLR_PACKET_HEADER_T tHead PROFIBUS FSPMS_C2_ABORT_IND_T tData PROFIBUS ESPMS PACKET C25ABORT IND i Packet Description structure PROFIBUS_FSPMS_ PACKET _C2_ABORT_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP Task Process Queue ulSre UINT32 Source Queue Handle of FSPMS Task Process Queue ulDestId UINT32 ulAPMS2ld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulFSPMS2Id Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 20 Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04AA PROFIBUS_FSPMS_CMD_C2_ABORT_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_ ABORT_IND_T ulReference UINT32 See above Reference number of DP V1 Class 2 connection ulLocal UINT32 0 6
26. ulDest UINT32 PB_FSPMS_QUE Destination Queue Handle of FSPMS task Process Queue ulSre UINT32 0 25 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 0 Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 9 n PROFIBUS_FSPMS_INIT_MSO_REQ_SIZE n number of bytes in Is Configuration block abRealCfgData Packet Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0402 PROF IBUS_FSPMS_CMD_INIT_MSO_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch structure PROFIBUS_FSPMM MODE_CHANGE_REQ T fSyncSupported BOOLS8 0 1 Flag indicating if set to TLR_TRUE 1 that the slave stack shall support the SYNC command If set to TLR_FALSE 0 the slave stack shall not support the SYNC command fFreezeSupported BOOLS8 0 1 Flag indicating if set to TLR_TRUE 1 that the slave stack shall support the FREEZE command If set to TLR_FALSE 0 the slave stack shall not support the FREEZE command G fNoAddChg BOOL8
27. 2 typedef LR UT ROFIBUS U SEGUCE PROP IBUS EY SPMSZIMsEND 32 LESNE 32 wilS lees 32 ulIM_Index 32 ulLen HSE SEMENE A ET BROPIBUSLESPMS IM LR_UI ErrorDecode LR_UI ErrorCodel 2 typedef E LR_UI ROFIB U ErrorCode2 S_IM_ERROR_T s ROFIBUS TRUC FSP amp PROFIBUSIESPMS IM_RE AD_R S_IM_INDEX GIE UNON TLR_UI PROFIBUS FE SPMS IM un PROFIBUS_FSP NT8 abData 236 nfo ERROR_T ja S_IM_READ_RE typedef struct TLR_PACK PROFIBUS FSP PROF IBUS_FSPMS_PACK EPROEEB US H SP CEE roe EX_Ttag ERROR_Ttag 202 238 ES _ Ttag IM EAD DS tresj ET HE ADER_T tHead STIMEREADE RE ta Br ee dt Lig Packet Description structure PROFIBUS_FSPMS_ PACKET IM_READ_RES_T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle ulsre UINT32 Source queue handle ulDestId UINT32 ulFSPMMOld Destination end point identifier specifying the final receiver of the packet within the destination process Set to 0 for the Initialization Packet ulsreld UINT32 ulAPMOld Sou
28. Table 128 Possible Reason Codes caused by FDL and their Meaning If the abort has been caused by DDLM or MSAC_C2 respectively Available Reason Codes D7 D6 D5 D4 D3 Instance Reason Description DO Code 0 0 1 DDLM ABT_SE Sequence Error 2 ABT_FE Invalid request PDU received 3 ABT_TO Timeout of the connection 4 ABT_RE Invalid response PDU received 5 ABT_IV Invalid service received from USER 5 6 ABT_STO_ Send_Timeout requested was not large enough S a 7 ABT_IA Additional address information is not valid 8 ABT_OC Waiting for confirmation of FDL_DATA_REPLY Table 129 Possible Reason Codes caused by DDLM MSAC_C2 and their Meaning If the abort has been caused by the user Available Reason Codes D7 D6 D5 D4 D3 Instance Reason Description DO Code Alwa Alwa 0 0 User User caused abort ysO ys 0 Table 130 Possible Reason Codes caused by the user and their Meaning PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 183 238 Meee i typedef struct PROFIBUS_FSPMS_C2_ABORT_IND LR_UINT32 ulReference LR_UINT32 ulLocal RUAN SZ wil Sisloayeic p TLR_UINT32 ulliInstance LR_UINT32 ulReasonCode PROFIBUS _FSPMS_ 2 ABORT _IND_T
29. Table 76 PROFIBUS_FSPMS_CMD_ABORT_REQ Send an Abort Signal PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference US_FSPMS_PACKET_ABORT ADER_T tHead PACKET _ABORT_CNF_T Packet Description typedef struct PROFIB DiRSP AChE ian jee ROEREBU Sm Hoe S 103 238 CNF_Ttag structure PROFIBUS_FSPMS_ PACKET ABORT_CNF_T Type Confirmation Variable structure TLR_PACKET_HEADER_ T Type Value Range Description ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulcmd UINT32 0x0409 PROF IBUS_FSPMS_CMD_ABORT_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 77 PROFIBUS_FSPMS_CMD_ABORT_CNF Confirmation to Sending an Abort Signal PROFIBUS DP Slave Protocol API DOC050401API15EN Revision
30. 0 1 Flag indicating if set to TLR_TRUE 1 that the slave stack is not able to support the Set Slave Address command If set to TLR_FALSE 0 the slave stack does support the Set Slave Address command fFailSafeSupp BOOLS8 0 1 1 that FAILSAFE mode has been activated If set to TLR_FALSE 0 FAILSAFE mode will not be available Flag indicating if set to TLR_TRUE fDpvlEnabled BOOLS8 0 1 Flag indicating if set to TLR_TRUE functionality is available If set to TLR_FALSE functionality is not supported 1 that DPV1 0 DPV1 usIdentNumber UINT16 Ident Number of the slave that shall be reported to the DP Master The number is assigned by the Profibus Trade Organization www profibus com and is unique per DP Slave device bSlaveAddr UINT8 0 126 Slave address bDataRate UINT8 0 11 15 Baud rate intended for data transmission See Table 34 Available Baud Rate Values for more information abRealCfgData UINT8I Real Is Configuration data to be set for structure see section Configuration of Inputs and Outputs on page 54 Table 69 PROFIBUS_FSPMS_CMD_INIT_MS0O_REQ Request Command for MSO Initialization PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Source Code Examp
31. PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 23 238 3 Dual Port Memory All data in the dual port memory is structured in blocks According to their functions these blocks use different data transfer mechanisms For example data transfer through mailboxes uses a synchronized handshake mechanism between host system and netX firmware The same is true for IO data images when a buffered handshake mode is configured Other blocks like the status block are read by the host application and use no synchronization mechanism Types of blocks in the dual port memory are outlined below Mailbox transfer non cyclic messages or packages with a tHeader for routing information Data Area holds the process image for cyclic IO data or user defined data structures Control Block is used to signal application related state to the netX firmware Status Block holds information regarding the current network state Change of State collection of flags that initiate execution of certain commands or signal a change of state 3 1 Cyclic Data Input Output Data The input block holds the process data image received from the network whereas the output block holds data sent to the network For the controlled buffered mode the protocol stack updates the process data in the internal input buffer for each valid bus cycle Each IO block uses handshake bits for
32. PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 158 238 structure PROFIBUS_FSPMS_ PACKET _C1l_ALARM ACK RES POS T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS task Process Queue ulSre UINT32 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrc d UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 3 sizeof PROFIBUS_FSPMS_C1_ALARM_ACK_RES_POS T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 TLR_S_ OK 0 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0483 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 X Routing do not touch structure PROFIBUS_FSPMS_C1_ALARM_ACK_RES_POS_T bSlotNumber UINT8 0 254 Slot number of the object causing the alarm indicating the source o
33. The Application Interface 146 238 6 2 18 PROFIBUS_FSPMS_CMD C1 _WRITE_IND RES_POS RES_NEG Indicating an acyclic write Request to a specific Process Data Object This service indicates the AP task that a specific Process Data Object shall be written by a DP Master Class 1 The AP task has to take care of the process Data objects themselves This means that it is fully application specific where those process Data objects are stored to and what purpose they have To complete the Process Data write indication the AP task has to respond and deliver the requested data by using the service referenced in Table 105 PROF IBUS_FSPMS_CMD_C1_WRITE_RES_POS Positive Response Command of a Process Data write or Table 106 PROFIBUS_FSPMS_CMD_C1_WRITE_RES_NEG Negative Response Command of a Process Data write The variable bSlotNumber has to be used in the AP task for addressing the desired process Data object in the specified slot typically a module The variable bIndex has to be used in the AP task for addressing the desired process Data object itself The variable bLength indicates the number of bytes of the specified process Data object that has to be written Within the array abData the FSPMS task indicates the new process Data to be written In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapsmsita value of the request packet referenced in Table 72 PR
34. eee 119 Table 87 PROFIBUS_FSPMS_CMD_RESET_REQ Request for resetting the Slave ecceesceseeeeseeeeeeeeeseeeeteneeeeneetias 120 Table 88 PROFIBUS_FSPMS_CMD_RESET_CNF_S1IZE Confirmation for resetting the Slave cceeseeeteeeeeeeees 121 Table 89 PROFIBUS_FSPMS_CMD_APPLICATION_READY_REQ Request Command for setting the Application to ready state E Sandee E E A E EEN ET A ee A EE E E E E E E 123 Table 90 PROFIBUS_FSPMS_CMD_APPLICATION_READY_REQ Packet Status Error ccccecseesseeeeseeeeeeeeeneeeeneetas 123 Table 91 PROFIBUS_FSPMS_CMD_APPLICATION_READY_CNF Confirmation Command of setting the application to ready state hdpe Pehle be EE E FE EE E E T E 124 Table 92 PROFIBUS_FSPMS_CMD_APPLICATION_READY_CNF Packet Status Error c cceccesseeeeeeeeeeeeeeneeeeeetas 124 Table 93 PROFIBUS_FSPMS_CMD_SET_SLAVE_ADD_IND Indication Command that indicates the Request for changing the Slave Address aii nein ae aa n a ae hs eal aE Aaea E ao i aaraa aaie pean ieaiaia 126 Table 94 PROFIBUS_FSPMS_CMD_GLOBAL_CONTROL_IND Indication Command of a Global Control Command 128 Table 95 PROFIBUS_FSPMS_CMD_CHECK_CFG_IND Indication Command of a Check Configuration 008 131 Table 96 PROFIBUS_FSPMS_CMD_CHECK_CFG_RES Response to Indication Command of a Check Configuration 133 Table 97 PROFIBUS_FSPMS_CMD_CHECK_USER_PRM_IND Indication Command of Parameter Dat
35. Hilscher 2005 2013 The Application Interface Packet Description 152 238 structure PROFIBUS_FSPMS_ PACKET _C1l_ALARM NOTIFICATION_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 0x20 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 2 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulsreId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 5 n sizeof PROFIBUS_FSPMS_C1_ALARM_NOTIFICATION _REQ_T Packet Data Length in bytes n number of bytes in block abAlarmData ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0480 PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_RE Q Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C1_ALARM_NOTIFICATION_REQ T bSlotNumber UINT8 0 254 Slot number of the object causing the alarm indicating the source of the alar
36. PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 106 238 Source Code Example void APS_ Set_Cfg_Req PROFIBUS_APS_RSC_T FAR ptRsc PROWLER U Sm AP oma A Chih lay nao eae key ptPck gt tSetCfgDataReq tHead ulCmd PROFIBUS_FSPMS_CMD_SET_CFG_REQ if TLR_POOL_PACKET_GET ptRsc gt tLoc hPool amp ptPck TLR_S_OK INIGIR OJUIE _ ALUN SNe VNC SINC je RCR PERS C Sc LOS i Misewy Ils 1c ENKO ptPck gt tSetCfgDataReq tHead ulLen ptRsc gt tLoc tMscyls uCfgDataSize MEMCPY void amp ptPck gt tSetCfgDataReq tData abCfgData 0 amp ptRsc gt tLoc tMscyls abCfgData 0 ptRsc gt tLoc tMscyls uCfgDataSize TLR_QUE_SENDPACKET_FIFO ptRsc gt tLoc tMscyls tLnkDst ptPck TLR_INFINITI else ProfibusApsFaultind ptRsc TLR_DIAG_E_PROFIBUS_APS_NO_SET_CFG_PACKET CA lt PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 107 238 typedef struct PROFIBUS_FSPMS_PACKET_SET_CFG_CNF_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_SET_CFG_CNF_T Packet Description structure P
37. Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_APS_GET_US 82 238 ER_PRM_CNF_Ttag TLR_UINT8 abUserPrm Data PROF IBUS_APS_MAX_USER_PRM_DATA_SIZE ar PROFIBUS _APS_GET_USER_PRM_CNE_T PROP LTBUSEAPS typedef struct PACKET MaCH ia PRM_CNF_Ttag TLR_PACKET_HEADER tHead PINOWALE WS INES Ela k WSIHR JRL CINE IP ci Daa PROF IBUS_APS_PACKET _GET_USER_PRM_CNE_T Packet Description structure PROFIBUS_APS_ PACKET _GET_USER_PRM_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 237 Packet Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task
38. bit 0 ProfileSpecific 1 amp M bit 1 1 amp M1 bit 2 1 amp M2 bit 15 1 amp M15 Table 141 Meaning of Bits of usIMSupported The I amp MO slot 0 has no retain data To ensure the correctness of variable usRevisionCounter the increment has to be done at application level and rewritten to retain value after channel init power on If I amp M indices different from slot 0 I amp MO are registered PROFIBUS_FSPMS_CMD_IM_READ_IND and PROF IBUS_FSPMS_CMD_IM_WRITE_IND indications are send to application PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface The structure t IMO looks like 196 238 Variable Type Value Description Default Value for Range 1 amp MO abManufactor 10 UINT8 Array Manufacturer of Device A 10 blanks usManufactorld UINT16 0 65535 Manufacturer ID 0x01 1E For a list of registered IDs and the according ee manufacturers see reference 8 Gesellschaft f r Systemautomation mbH abOrder_ld 20 UINT8 Array Order ID 20 blanks abSerialNumber 16 UINT8 Array SerialNumber 1 15 blanks usHwRevision UINT16 0 65535 Hardware Revision 1 abSwRevision 4 UINT8 Array Software Revision V 271 first byte interpreted as ASCII character valid are Default value is V released version y a R revision
39. h ma oS yS op pw S S S a mewo SS y y a 15 16 Bytes Words choice of byte or word depends on length format bit Table 46 General Identifier Format of Identifier Byte according to IEC 61158 EN 50170 Specification Note When transferring data in word mode the high byte is transferred first by Profibus DP then the low byte However the Profibus DP Master has the possibility to swap this sequence of the bytes within the word if required by the target system PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 57 238 5 3 3 3 Identifier Byte for the Special Format To allow extended configurations and to increase flexibility a special extension of the identifier system described above is also supported by Profibus DP The main advantages of this format are It is possible to determine the number of input and output bytes associated to the defined identifier User specific data can be added This format is called the special identifier format and signified by the combination of bit 4 and 5 both being zero as already described above in the discussion of the general identifier format Special Identifier Format of Identifier Byte according to IEC 61158 EN 50170 Specification Se canes tengtormat a7 os SS o i i lenan ove ormus oroas OOOO 1 fo ttenathovieforoupuisfolows 0 o This combination sanitas tne special denier format see ba
40. typedef struct PROFIBUS_FSPMS_PACKET_TOL_CALL_REGISTER_CNF_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS _FSPMS_ PACKET _IOL_ CALL REGISTER_CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET_IOL_CALL_REGISTER_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 0x20 PB_ Destination Queue Handle FSPMS_QUE ulsre UINT32 0 2 1 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSreid VINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 05 21 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0427 PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 153 PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_CNF Confirmation to Register IO Link Call Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public H
41. CEUCEME ROFIBUS_PSPMS_PACKET_INIT_MS1_CNF_Ttag R_PACKET_HEADE ROE TBUSMEH SP R S NIET AMSL CNIT I Da tHead ar PROFIBUS_FSPMS_ PACKET_INIT_MS1_CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET_INIT_MS1_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 0 Destination end point identifier untouched ulSrcId UINT32 ulAPMS1 Id Source end point identifier untouched ulLen UINT32 4 sizeof PROFIBUS_FSPMS_INIT_MS1_CNF_T Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification untouched ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0405 PROF IBUS_FSPMS_CMD_INIT_MS1_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_INIT_MS1_CNF_T ulFSPMS1Id UINT32 Reference to locally generated Reference end point of the FSPMS task for the MS1 context Table 73 PROFIBUS_FSPMS_CMD_INIT_MS1_CNF Confirmation Command of MS1 Initialization Source Code Example WOU NPS SiMsieMisil Cimit EROHIBUS ANS INS WINE IPERS E PROEEE Um NP Sm A Cir aelmm bE AR cen te DiC iats 1R_QUE LINK_SE al N EW
42. Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 2 n PROFIBUS_FSPMS_GET_OUTPUT_REQ_SIZE n number of bytes in Output Data block abOutputData Packet Data Length in bytes ulId UINT32 0 2 1 Packet Identification untouched ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x040B PROFIBUS_FSPMS_CMD_GET_OUTPUT_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_GET_OUTPUT_CNF_T fClearFlag BOOL8 0 1 Flag indicating if set to TLR_FALSE 0 that the Output data block is valid If set to TLR_TRUE 1 the Output data block is cleared and zeroed fNewF lag BOOL8 0 1 Flag indicating if set to TLR_TRUE 1 that new Output data has been received since the last received PROFIBUS_FSPMS_CMD_GET_OUTPUT confirmation command abOutputData_ UINT8 Latest Output Data block received by the DP Master Table 85 PROFIBUS_FSPMS_CMD_GET_OUTPUT_CNF Confirmation Command of getting the Output Data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 118 238 6 2 9 PR
43. Hilscher 2005 2013 Getting started Configuration 39 238 section 5 3 3 or format Special Identifier Byte Format SIF see section Configuration of Inputs and Outputs on page 54 Table 33 Meaning and allowed Values for Warmstart Parameters If necessary further configuration data can be specified up to index value 31 The applicable baud rates can be coded with the values given in the following table Baud rate Symbolic Constant Value Baud rate 9 6 kBit s PROFIBUS_DL_DATA_RATE_96 0 Baud rate 19 2 kBit s PROF IBUS_DL_DATA_RATE_19_2 1 Baud rate 93 75 kBit s PROF IBUS_DL_DATA_RATE_93_75 2 Baud rate 187 5 kBit s PROF IBUS_DL_DATA_RATE_187_5 3 Baud rate 500 kBit s PROF IBUS_DL_DATA_RATE_500 4 Baud rate 1 5 MBit s PROF IBUS_DL_DATA_RATE_1500 6 Baud rate 3 MBit s PROF IBUS_DL_DATA_RATE_3000 7 Baud rate 6 MBit s PROF IBUS_DL_DATA_RATE_6000 8 Baud rate 12 MBit s PROFIBUS_DL_DATA_RATE_12000 9 Baud rate 31 25 kBit s PROFIBUS_DL_DATA_RATE_31_25 10 Baud rate 45 45 kBit s PROFIBUS_DL_DATA_RATE_45_45 11 Baud rate Auto detect PROF IBUS_DL_DATA_RATE_AUTO 15 Table 34 Available Baud Rate Values The single bits of the flags variable have the following meaning Bit 0 DPV1 Enable WRMSTRT_FLG_DPV1_ENABLE Flag that indicates whether DPV1 is supported If set DPV1 fun
44. Packet Description 201 238 structure PROFIBUS_FSPMS_PACKET IM_READ_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 16 Packet Data Length in bytes ullId UINT32 Giver Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0422 PROF IBUS_FSPMS_CMD_IM_READ_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_IM_INDEX_T ulSAPIdx UINT32 SAP Index ulSlot UINT32 Slot ulIM Index UINT32 I amp M Index Table 146 PROFIBUS_FSPMS_CMD_IM_READ_IND I amp M Read Indication PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef LR_UI LR_UI LR_UI
45. RES_NEG_T tData PROFIBUS_FSPMS_PACKET_C2 INITIATE _RES NEG T Packet Description structure PROFIBUS_FSPMS_ PACKET _C2_INITIATE_RES NEG T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS Task Process Queue ulSre UINT32 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulFSPMS2Id Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 3 sizeof PROFIBUS_FSPMS_C2_INITIATE_RES_NEG_T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 TLR_E FAIL See chapter 7 1 Error Codes of the FSPMS Task not 0 ulCmd UINT32 0x04A3 PROF IBUS_FSPMS_CMD_C2_INITIATE_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_INITIATE_RES NEG T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bErrorDecode UINT8 Error decode value classifying the error bErrorCodel UINT8 Detailed error code bErrorCode2 UINT8 User specific error code
46. TLR_PACKET_HEADER_T tHead iPINOMMILEIUS IF Sle MIS IONE CyNILILy IRV S SROS ANE Datan PROFIBUS_FSPMS_ PACKET TOL CALL RES _POS_T Packet Description structure PROFIBUS_FSPMS_PACKET IOL_CALL_RES_POS_T Type Positive Response Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle ae UINT32 Source Queue Handle ulDestId UINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSreid UINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 12 n Packet Data Length in bytes PROFIBUS_FSPMS_IOL_CALL_RES_POS_SIZE bytes read io link error PDU ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 0 TLR_S_OkK See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0429 PROFIBUS_FSPMS_CMD_IOL_CALL_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 X Routing do not touch structure PROFIBUS_FSPMS_IOL_CALL_RES_POS_T tAcyc PROFIBUS __ FSPMS_ACY CLIC_INFO_ HEADER_T Acyclic header tCall PROFIBUS __ FSPMS_CAL L HEADER Call h
47. Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulcmd UINT32 0x044B PROF IBUS_FSPMS_CMD_REGISTER_DIAG_STRUCT_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 135 PROFIBUS_FSPMS_CMD_REGISTER_DIAG_STRUCT_CNF Confirmation for Registration of Diagnostic Structure PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 190 238 6 2 28 PROFIBUS_FSPMS_CMD IND SETTING _REQ CNF Request for deactivating the Output Indication In order to deactivate the output indication this request packet can be used If the flag fOutputIndDeact is set to 1 the output indication will no longer occur To activate the output indication again just sent this packet again with a value of foutputIndDeact equal to 0 Note Use this packet only when working with linkable object modules I
48. packet inside the Source Process ulLen UINT32 1 Sizeof PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_RE S_T Packet Data Length in bytes ulId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulcCmd UINT32 0x0439 PROF IBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 xX Routing do not touch structure PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_RES_T fExtPrmOk BOOLEAN8 0 1 If set to TLR_TRUE 1 the AP task has accepted the extended Parameter Data If set to TLR_FALSE 0 the extended Parameter Data is not ok Table 100 PROFIBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_RES Response to Indication Command of a Check Configuration PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 141 238 6 2 17 PROFIBUS_FSPMS_CMD C1 READ IND RES_POS RES_NEG Indicating an acyclic read Request to a specific Process Data Object This service indicates the AP task that a specific process data object shall be read by a DP Master Class 1 The AP task has to take care of the process data objects themselves This means that it is fully application specific where those process data objects are read from and what purpose they have To complete the process d
49. ptPckt APS_Check_Ext_User_Prm_Result_req ptRsc fExtPrmOk PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 140 238 Packet Structure Reference Eypede amp struct PROFIBUS FSPMS_ CHECK EXT _USER_PRM_RES_Trag TLR_BOOLEANS8 fExtPrmOk IIR IEENUKS IN SISMIS Cll Gke ICI VISIR IRIE Ire S IE typedef struct PROFIBUS_FSPMS_PACKET_CHECK_EXT_USER_PRM_RES_Ttag TLR_PACKET_HEADER_T tHead PROHIBUS FE SPMS CHECK EXT USERIPRMERE SST EData IPIRCOMP ILEUS IN S2NMES VAC isda Ih CARNE Eps USHER PRIME JRUES _ZIL S Packet Description structure PROFIBUS_FSPMS_ PACKET _CHECK_EXT_USER_PRM_ RES T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS task Process Queue ulsre UINT32 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulsreId UINT32 ulAPMSOld Source end point identifier specifying the origin of the
50. ulLen UINT32 2 n PROFIBUS_FSPMS_SET_SLAVE_ADD_IND_SIZE n number of bytes in remanent Slave Data block abRemSlaveData Packet Data Length in bytes ullId UINT32 0 24 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x041A PROFIBUS_FSPMS_CMD_SET_SLAVE_ADD_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_ SET SLAVE_ADD IND _T bNewS laveAdd UINT8 0 126 Value of the new station address that is to be set bNoAddChange UINT8 0 1 Indicates whether there is an address change abRemSlaveData UINT8 Further Parameter data to be validated and accepted Table 93 PROF IBUS_FSPMS_CMD_SET_SLAVE_ADD_IND Indication Command that indicates the Request for changing the Slave Address Source Code Example void APS _Set_Slave_Add_ind PROFIBUS_APS_RSC_T FAR ptRsc PROEEE USmAL SmEACK TLR_UINT uRemSlaveDataLen HIE INR jSiE CKE uRemSlaveDataLen ptPckt gt tSetSlaveAddiInd tHead ulLen PROMI BUSSES EMS SE ies ANE ADD_IND_SIZE if uRemSlaveDataLen 0 Save the remanent data somewhere ptRsc gt tLoc tMscyls uSlaveAdd TLR_QUE_RETURNPACKET ptPckt APS_SInitMsO_req ptRsc PROFIBUS DP Slave Protocol API
51. write and data transport services The FSPMS Task returns its end pointer reference in the Confirmation Packet of the initialization Packet The AP Task has to use this returned value as ulDest Id value from now on in all request and response Packets that are sent to the FSPMS Task context Using the Macro TLR_QUE_SENDPACKET_FIFO will send the packet to the FSPMS Task process queue The SAP for the DP V1 class 2 connection to be set up can be specified using the ulRes_Sap parameter The parameter ulReq_Add is used for storing the station address of the requester in order to provide access protection The maximum length of acyclic data to transmit between the Profibus DP Master class 2 and the Profibus DP Slave can be specified in parameter ulMax_Len The time out ulSend_Timeout specifies the control time interval for the supervision of the DPV1 class 2 connection as long as it is active The time out values are specified in units of 10 milliseconds The bit field tFeaturesSupported informs the AP Task about the requested service functionality The AP Task has the possibility to adjust its functionality to the DP Master s requirements or to reject if it cannot fulfill them The bit field tprofileFeaturesSupported informs the AP Task about the requested service functionality regarding the used profile definition The profile is identified by the Profile Ident number The meaning of the defined bits is profile or vendor specific The variable
52. 0 1O Link Master 1 63 Port number usFI Index UINT16 65098 function invocation index IO Link call Table 155 PROFIBUS_FSPMS_CALL_HEADER_T Structure Structure PROFIBUS_FSPMS_IOL_HEADER_T structure PROFIBUS FSPMS _IOL_HEADER_T Variable Type Value Range Description bControl UINT8 0 3 0 Cancel Release 1 Idle 2 Write 3 Read uslOLIndex UINT16 0 32767 IO Link Device Data Index 65535 Port function invocation blOLSubindex UINT8 0 255 IO Link Device Data subindex or port function Table 156 PROFIBUS_FSPMS_IOL_HEADEFR_T Structure PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 210 238 Four answers are possible positive response with IO Link call done negative response with IO Link call error error response with IO Link busy error response In detail this means If the 1lO Link call request is successfully executed the control byte in tData tIOL bControl must be set to zero to indicate Done Transfer terminated On a read response the requested data should be filled in tData abIOLData and the tHead ullLen to the positive response length plus requested data If the IO Link call request results in an error the control byte in tData tIOL bControl must be set to 128 to indicate an IO Link error PDU which is filled in tData abIOLData The tHead ulLen must be se
53. 1 List of Tables able 1 List OF REVISIONS 2 3 1 cics2 ciel cel A Leda chen a a a head eo iat easel Gace eae Le etd let 6 Table 2 Technical Data Supported State Machine ccc cccccssceceeenneeeeeeeeeeceeeeeeeeeeeeeseneeesesaeeeesseeesecaeeeeseneeeeesseeeesaes 8 Table 3 Technical Data Protocol Stack ccccesseceeeseeceeeeeeceeeeneeceesaeeeeeeaeeceseaaeeeseaeeesseaeeceseaeessecaeeeseceeeessueeesssnneeessnaes 8 Table 4 Technical Data Available for netX c cccccccececccececeeeeeeecceaneeeeeeeceeeaaaeeeeeeesegceaaeeeeeeesesecaaaeeseeesseecaaeeeeeeeeseeceineeeeeees 8 Table 5 technical Data P GIF DMA tases cess st dedeeces cbse ook a e sveceen cence abuse Sa ae SSSR Madan dl as levivedot aaa E E ee arar ea Table 6 Technical Data Slot Number hable 7 Technical Data Limitations a Taaa Ee e aae aa a aee a aea a E ae aeee tea eetacdedeetetes ites Table 8 Terms Abbreviations and Definitions ccccccccccceeeeeeeeceeeeeeeeeeeeeeeaaeeeeeeeeeecceaeeeeeeeeeeccaeeeeeeeeseccieeeeeeeeeeeeenaaees 10 Tabl e 9 References ninme e E et E aoe ees dan ae eran ees ceeded 11 Table 10 Names of Queues in PROFIBUS DP Slave Firtmwatre c cccccssseceeseneeeeeeneeeeecneeceseneeeeescaaeeeseseeeesneeeeeseneeeeea 15 Table 11 Meaning of Source and Destination related Parametelrs cccsccccssscceeeeceeeeeeenee
54. 2 29 0x0442 PROF IBUS_FSPMS_CMD_STARTED_IND Start Indication 192 6 2 30 0x0452 PROF IBUS_FSPMS_CMD_SET_STAT_DIAG_REQ CNF Set Static 193 oh 0x0453 Diagnostic 6 2 31 0x0420 PROF IBUS_FSPMS_CMD_SET_IMO_REQ CNF Change I amp MO 195 le 0x0421 Parameter Settings 6 2 32 0x0422 PROFIBUS_FSPMS_CMD_IM_READ_IND RES 1 amp M Read 200 0x0423 Indication Response 6 2 33 0x0424 PROFIBUS_FSPMS_CMD_IM_WRITE_IND RES I amp M Write 203 0x0425 Indication Response Table 68 Overview over the Packets of the FSPMS Task of the PROFIBUS DP Slave Protocol Stack PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 88 238 6 2 1 PROFIBUS_FSPMS_CMD INIT_MSO_REQ CNF Initializing the MSCY1S State Machine The MSCY1S state machine controls the cyclic data transfer between the Profibus DP Master and the existing slave stack reference implementation The initialization of the MSCY1S state machine is mandatory to start up and operate the cyclic DP Master communication Therefore it is the first service that has to be initiated by the AP task before any cyclic communication can be established to a Profibus DP Master on the network During this initialization the AP task and the FSPMS task have to exchange their end point identifier of the MSO connection that shall be established between both The end point identifier is a 32 bi
55. 236 INOW ICUS Te SIMI TEM IRGC ILIN ID ate typedef struct PROFIBUS_FSPMS_PACKET_IM_WRITE_IND_Ttag TLR_PACKET_HEADER_T tHead PROP IBUS FSPMS TM WRITE IND UT Dana PROFIBUS_FSPMS_PACKET_IM_ WRITE_IND_T Packet Description structure PROFIBUS_FSPMS_PACKET_IM WRITE_IND _T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 16 Packet Data Length in bytes ullId UINT32 0 2 7 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0424 PROF IBUS_FSPMS_CMD_IM_WRITE_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_IM_WRITE_IND_T tInfo PROFIBUS_ Index structure see above FSPMS_IM_l NDEX_T Table 150 PROFIBUS_FSPMS_CMD_IM_WRITE_IND I amp M Write Indication PROFIBUS DP Slave Protocol API DOC
56. 6 2 30 PROFIBUS_FSPMS_CMD_SET_STAT_DIAG_REQ CNF Set Static Diagnostic 193 6 2 31 PROFIBUS_FSPMS_CMD_SET_IMO_REQ CNF Change I amp MO Parameter Settings 195 6 2 32 PROFIBUS_FSPMS_CMD_IM_READ_IND RES I amp M Read Indication Response 200 6 2 33 PROFIBUS_FSPMS_CMD_IM_WRITE_IND RES I amp M Write Indication Response s e 203 6 2 34 PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_REQ CNF Register IO Link Call 206 6 2 35 PROFIBUS_FSPMS_CMD_IOL_CALL_IND RES_POS RES_NEG lO Link Call Indication 209 6 3 Hardware Switches for the Adjustment of Slave Address and Baudrate ccccsseeeeenes 215 6 3 1 RCX_SET_HW_SWITCH_VALUES_REQ CNF Set the values of the Hardware Switch 217 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 7 Introduction 4 238 Status Error Codes Overview scscsceccceeseeeeeeeeeeeeeeesesesesesesasegeeeeeeseseseseeesesesesesesasasaesesesesesesesnessenes 220 7 1 Error Codes of the FSPMS Task c c cccsesesssesescssseseeeeeeeeeeeeseeeeeeeeeeeeeeeeeeeeeeeesececeeeeeeeeeseeeees 220 7 1 1 Diagnostic Codes of the FSPMS TasSk 0 eccsesceseseeeeeeeseeeeeeeeseeeeeeeeseaeesaaeeseaeeeaeeseaeeseaeeseaeetaes 223 7 2 Error Codes of the DL Task cccccsessssseseeeeeseseeeeeseeeeeceseeeeeeeeeseeeeeeeseceeeeeseseseseeeseeeseseeeseeeees 226 7 2 1
57. 74 PROFIBUS_FSPMS_CMD_INI S2_REQ Request Command for MS2 Initialization Table 75 PROFIBUS_FSPMS_CMD_INIT_MS2_CNF Confirmation Command of MS2 Initialization cee 101 Table 76 PROFIBUS_FSPMS_CMD_ABORT_REQ Send an Abort Signal eccceesceeeeeeeeeeeeeeeeseeeeeaeeseeeseaeeseaeeeeaeersas 102 Table 77 PROFIBUS_FSPMS_CMD_ABORT_CNF Confirmation to Sending an Abort Signal cccceeeeeeseeeeereeeees 103 Table 78 PROFIBUS_FSPMS_CMD_SET_CFG_REQ Request Command for setting new Configuration Data 105 Table 79 PROFIBUS_FSPMS_CMD_SET_CFG_CNF Confirmation Command of setting the configuration data 107 Table 80 PROFIBUS_FSPMS_CMD_SET_SLAVE_DIAG_REQ Request Command for sending Diagnosis Data 109 Table 81 PROFIBUS_FSPMS_CMD_SET_SLAVE_DIAG_CNF Confirmation Command of sending the Diagnostic data ites ee EE E A ean ee alti as eee aay eth a i ee i reed Table 82 PROFIBUS_FSPMS_CMD_SET_INPUT_REQ Request Command for setting Input Data eeeeeeeee 113 Table 83 PROFIBUS_FSPMS_CMD_SET_INPUT_CNF Confirmation Command of updating the Input Data 114 Table 84 PROFIBUS_FSPMS_CMD_GET_OUTPUT_REQ Request Command for getting Output Data 0 eee 116 Table 85 PROFIBUS_FSPMS_CMD_GET_OUTPUT_CNF Confirmation Command of getting the Output Data 117 Table 86 PROFIBUS_FSPMS_CMD_NEW_OUTPUT_IND Indication Command for new Output Data
58. A conflict has been detected within the acyclic MSAC1S state machine In state VS WRES an unexpected reply update confirmation has been received 0xC0090023 TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_STATE_CONFLICT_VS_SRES A conflict has been detected within the acyclic MSAC1S state machine In state VS SRES an unexpected reply update confirmation has been received 0xC0090024 TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_STATE_CONFLICT_VS_SRES_IND A conflict has been detected within the acyclic MSAC1S state machine In state VS SRES an unexpected reply indication has been received PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 225 238 Hexadecimal Value Definition Description 0xC0090025 TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_STATE_CONFLICT_AA_SRES A conflict has been detected within the acyclic MSAC1S state machine In state AA SRES an erroneous reply update confirmation has been received 0xC0090026 TLR_DIAG_E PROFIBUS _FSPMS_MSAC1S_SAP_DEACTIVATION_ FAILED A conflict has been detected within the acyclic MSAC1S state machine A deactivation of an Service Access Point failed 0xC0090027 TLR_DIAG_E_PROFIBUS_FSPMS_FSPMS_NO_ALARM_ACK_IND_PACKET Getting a packet from the pool to send an Alarm Acknowledgement indication within the acyclic state machine to the application failed service cannot be
59. Hilscher 2005 2013 Overview 51 238 If 16 modules have been used the next byte would be then D7 D6 D5 D4 D3 D2 D1 DO Description x Module 9 has a diagnosis available x Module 10 has a diagnosis available x Module 16 has a diagnosis available Table 41 Identification related diagnosis Second Data Byte Channel related diagnosis The channel related diagnosis is more detailed compared to the identification related diagnosis and reports about channel errors within the modules of a slave For each channel an own diagnostic block consisting of a 1 byte header according to Table 39 Diagnosis Header and 2 data bytes is used The second byte contains the following information D7 D6 D5 D4 D3 D2 D1 DO Description 0 1 0 63 Number of channel Channel is an input channel 1 0 0 63 Number of channel Channel is an output channel 1 1 0 63 Number of channel Channel is an input and output channel Table 42 Channel related Diagnosis First Data Byte The third byte contains the cause of a diagnosis event in the module D7 D6 D5 D4 D3 D2 D1 DO Description 0 0 1 0 31 see below Bit 0 1 0 0 31 see below 2 Bits 0 1 1 0 31 see below 4 Bits 1 0 1 0 31 see below Byte 1 1 0 0 31 see below Word 1 1 1 0 31 see below 2 Words any 1 Short circuit 2 Lower voltage limit e
60. Meaning of Combinations of Lock_Req and Unlock_Req Bits cc ccccceeceeeeeneeeeeseeeeeseneeeeeeeaeeeeeseneesssnseeeee 53 Table 46 General Identifier Format of Identifier Byte according to IEC 61158 EN 50170 Specification ceeeeeee 56 Table 47 Special Identifier Format of Identifier Byte according to IEC 61158 EN 50170 Specification ceeeeee 57 Table 48 Structure of Length Byte in the Special Identifier Format of the Identifier Byte according to IEC 61158 EN 50170 Specilication r 23 sag see enadtctsacessseceltcntade fe eaaadancense teas sealceck cbhatend iansticatesarssddesassiavan ntadeacchusuts saeesnsecseastnadeensaciis 58 Table 49 Packets for Cyclic Data Transfer cccccscccccseceeeeeseeeceeaeeceeeaeeeeecaeeeseueeeesaeeeeceaaeeeseeneesseeesessaeeeesneeessenseeene 59 Table 50 Packets for Acyclic Data Transfer ice e a r aeaa a a ae E a E a are r aa en e aE a araa 61 Table 51 Error Code 1 indicating general Kind of ErrOr eeccecsceeeeeeeeseeeeeeeeeeeeeeeeecseeeeeeeseaeeeeeeesaeeseeeeaeeseaeeseaeeseeeseaees 62 Table 52 Bitmasks to apply for PROF IBUS_FSPMS_ERROR_CLASS_ APPLICATION ccsscccceceeeeeeeeeeeeeeeeeeeeetneeeeeeeeseeeeaees 62 Table 53 Bitmasks to apply for PROF IBUS_FSPMS_ERROR_CLASS_ACCESS wiseececeeeeeeeeneeceeeeeeeeeeneeeeeeeeeseeennneeeeeeeseeenaees 62 Table 54 Bitmasks to apply for PROF IBUS_FSPMS_ERROR_CLASS_ RESOURCE cceeeseseeneececeeeeeeeeneeeeeeeeeeeeenaeeeeeeesenenaees 63 Table 5
61. Output Data Image Default memory size For netX devices with 8 kByte Dual port Memory the size of the output data image is 1536 byte Output Data Image Offset Type Name Description 0x1000 UINT8 abPdO0Output 1 536 Output Data Image Cyclic Data To The Network Table 20 Output Data Image for netX devices with 8 kByte Dual port Memory 3 2 Acyclic Data Mailboxes The mailbox of each communication channel has two areas that are used for non cyclic message transfer Send Mailbox packet transfer from host system to firmware Receive Mailbox packet transfer from firmware to host system The send and receive mailbox areas are used by field bus protocols providing a non cyclic data exchange mechanism Another use of the mailbox system is to allow access to the firmware running on the netX chip itself for diagnostic and identification purposes The send mailbox is used to transfer cyclic data to the network or to the firmware The receive mailbox is used to transfer cyclic data from the network or from the firmware A send receive mailbox may or may not be available in the communication channel It depends on the function of the firmware whether or not a mailbox is needed The location of the system mailbox and the channel mailbox is described in the netX DPM Interface Manual Note Each mailbox can hold one packet at a time The netX firmware stores packets that are not retrieved by the host appl
62. P prototype U under test T test device The 3 remaining bytes are interpreted as unsigned integer usRevisionCounter UINT16 0 65535 Revision Counter 0 Init State initial value 0 increments on every set of I amp M data must not be 0 after overrun usProfileld UINT16 0 65535 Profile ID 0x0000 for a list of defined IDs see reference 9 Non Profile Device usProfileSpecType UINT16 0 65535 Profile Specific Type 0x0004 for a list of defined types see reference 9 Communication Module usIMVersion UINT16 0 65535 1 amp M Version 0x0102 usIMSupported UINT16 0 65535 1 amp M supported 0x0000 Table 142 Structure tIMO The bit O of usTMSupported is used for signaling that profile specific 1 amp M calls are supported and must be set corresponding to Boolean variable ProfSpecSupp Further information can be found in reference 7 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 197 238 Packet Structure Reference typedef struct FSPMS_IMO_Ttag LR_UINT8 abManufactor 10 LR_UINT16 usManufactorId LR_UINT8 abOrder_Id 20 LR_UINT8 abSerialNumber 16 LR_UINT16 usHwRevision LR_UINTS8 abSwRevision 4 LR_UINT16 usRevisionCounter LR_UINT16 usProfileld LR_UINT16 usProfileSpecType LR_UINT16 usIMVersion LR_
63. Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview General Kind of Error 62 238 Code Value hex Description PROFIBUS_FSPMS_ERROR_CLASS_APPLICATION OxA0 general application error PROFIBUS_FSPMS_ERROR_CLASS_ACCESS 0xBO general access error PROFIBUS_FSPMS_ERROR_CLASS_RESOURCE OxCO resource error Table 51 Error Code 1 indicating general Kind of Error Then next to the error class the value bErrorCodel has to be extended by one of the following bitmasks to make an error more precise Just do a simple or relation here For PROFIBUS_FSPMS_ERROR_CLASS_APPLICATION use PROFIBUS_FSPMS _ERROR_CLASS APPLICATION Code Value hex Description PROFIBUS _FSPMS_ERROR_CODE_APPL_DPV1READ 0x00 read error PROFIBUS_FSPMS_ERROR_CODE_APPL_WRITE 0x01 Write error PROFIBUS_FSPMS_ERROR_CODE_APPL_MODULE 0x02 module failure PROFIBUS_FSPMS_ERROR_CODE_APPL_VERSION 0x08 version conflict PROFIBUS_FSPMS_ERROR_CODE_APPL_NOT_SUPPO 0x09 RTED feature not supported Table 52 Bitmasks to apply for PROFIBUS_FSPMS_ERROR_CLASS_APPLICATION For PROFIBUS_FSPMS_ERROR_CLASS_ACCESS use PROFIBUS_FSPMS_ERROR_CLASS_ACCESS Code Value hex Description PROFIBUS_FSPMS_ERROR_CODE_ACC_INDEX
64. TLR_SWITCH_VALUE_T Variable Type Value Description Range abSwitchName UINT8 16 char Switch Name Identifier string Max 16 characters ulvalue UINT32 0 2 1 Switch value Table 158 t SwitchValue Structure of Switch Value set Initialization behavior At the CHANNEL_INIT the stack shall store the value of the hardware switch i e device address which is set by the previous RCX_SET_HW_SWITCH_VALUES REQ packet Only with a SYSTEM_RESET the device address shall be reset and a configuration with a new RCX_SET_HW_SWITCH_VALUES REQ packet shall be done The behaviour using the configuration packet SET_CONFIG_REQ is the same PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct TLR_SWITCH_VALUE_Ttag 218 238 LR_UINT8 16 abSwitchName Switch Name Identifier i e BAUD_RATE LR_UINT32 ulSwitchValue HW Switch Value to set LR_SWITCH_VALUE_T typedef struct RCX_SET_HW_SWITCH_VALUES_REQO_DATA_Ttag LR_UINT32 ulNumberOfSwitches pe LR_SWITCH_VALUE_T tSwitchValue I sexuccuces Sviten Neme value a used as much as NumberOfSwitches ROX USET EWoiSwiTCe VALUES REO DATA T typede struct RCX_SET_HW_SWITCH_VALUES_REO_Ttag
65. The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_SET_S TLR_BOOLEANS fStatDiag PROFIBUS_FSPMS_SET_STAT_DIAG REQ T 194 238 AT_DIAG_REQ Ttag define PROFIBUS_FSPMS_SET_STAT_DIAG_ REQ SIZE sizeof PROFIBUS_FSPMS_SET_STAT_DIAG REQ _ T Confirmation Packet typedef struct PROFIBUS_FSPMS_PACKET_SET_STAT_DIAG_CNF_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_SET_STAT_DIAG CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET SET _STAT DIAG CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0453 PROFIBUS_FSPMS_CMD_SET_STAT_DIAG_CNF Command ul
66. UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_SET_INPUT_REQ T abInputDatal UINT8 Input Data block to be transferred Table 82 PROFIBUS_FSPMS_CMD_SET_INPUT_REQ Request Command for setting Input Data Source Code Example void APS_Set_Input_req PROFIBUS_APS_RSC_T FAR ptRsc LRALUINT Dineen PROFIBUS_APS_PACKET_T ptPck MERR DERS CENO CEMS ey ls ulnmoUORUny lt sl i LR_UINT8 FAR pabInpData if TLR_POOL_PACKET_GET ptRsc gt tLoc hPool amp ptPck TLR_S_OK ptRsc gt tLoc tMscyls uInpUpRun t ptPck gt tSetInpReq tHead ulCmd PROFIBUS_FSPMS_CMD_SET_INPUT_REQ TER_QUE_LINK_SET_PACKET_SRC pePek pERSc gt tl ptPck gt tSetInpReq tHead ulLen ulInpLen Loc tMscyls tLnkSrc if uInpLen gt ptRsc gt tLoc tMscyls uInpData uInpLen ptRsc gt tLoc tMscyls uInpDataLen Len MEMCPY void amp ptPck gt tSetInpReq tData abInputData 0 pabInpData ulInpLen TLR_QUE_SENDPACKET_FIFO ptRsc gt tLoc tMscyls tLnkDst ptPck TLR_INFINITE PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS 114 238
67. a ae aa ar On Eina Aea 181 Table 127 Instance Codes and their M aning cescececceeeseeeeseeeeeeeteseeseaeeseaeeseaeeseaeeseaeeseaeeseaeeseaeeseeessaeeneeeesaeessaeenaas 181 Table 128 Possible Reason Codes caused by FDL and their Meaning ecceeeeeeeeeeeeeeeeeeeeeseaeeeeeeeseaeeeeeeeseaeeeeeeenaas 182 Table 129 Possible Reason Codes caused by DDLM MSAC_C2 and their Meaning ccsccccceseeeeeeteeeeeseteeeesnneees 182 Table 130 Possible Reason Codes caused by the user and their Meaning cceeceeeeeeeeeeeeeeeteeeeeaeeseeeseaeessaeeneeeensas 182 Table 131 PROFIBUS_FSPMS_CMD_C2_ABORT_IND lndicating the Abort of Class 2 Connection cccceeeeeeeee 183 Table 132 PROFIBUS_FSPMS_PACKET_C2_ABORT_RES Confirmation to Sending an Abort Signal eeeeee 184 Table 133 PROFIBUS_FSPMS_CMD_STATE_CHANGED_IND Indication for Change of State cccceeseseseeeeetees 187 Table 134 PROFIBUS_FSPMS_CMD_REGISTER_DIAG_STRUCT_REQ Request for Registration of Diagnostic Structure pinta has tesco eed 8 bal iacdcnstecgedidaaasecattansiztasctaadecsaddecddecenscethoceea asasuatacaeisaaschazcas ddstebay states Nee Table 135 PROFIBUS_FSPMS_CMD_REGISTER_DIAG_STRUCT_CNF Confirmation for Registration of Diagnostic Structure 0 0 ee ite ats dete ee bier E E A A STE E BE E AE EET 189 Table 136 PROFIBUS_FSPMS_CMD_IND_SETTING_REQ Request for deactivating the Output Indication 190 Tabl
68. accepted by the AP task In the positive event the flag has to be set to TLR_TRUE 1 and the DP Master is informed about the data acceptance If the extended Parameter Data Block is somehow incorrect or cannot be supported the flag has to be set to TLR_FALSE 0 The DP Master is then automatically informed about this refusal by the FSPMS task For more information see section There you can also find a description of the data format valid for parameter data which also applies for the abExtUserPrmData parameter of this packet There you can also find a description of the data format valid for parameter data which also applies for the abExtUserPrmData parameter of this packet Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Troubleshooting Hints If you try to check extended user parameterization data while the slave state is Power_on you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_POWER_ON along with the onfirmation packet You will then have to initialize the slave in order to be able to get input data If you try to check extended user parameterization data while no new user parameterization data are available you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_NOT_PENDING along with the confirmation packet You will then have to wait until new parameter data are availabl
69. access synchronization Input and output data block handshake operates independently from each other When the application toggles the input handshake bit the protocol stack copies the data from the internal buffer into the input data image of the dual port memory Now the application can copy data from the dual port memory and then give control back to the protocol stack by toggling the appropriate input handshake bit When the application driver toggles the output handshake bit the protocol stack copies the data from the output data image of the dual port memory into the internal buffer From there the data is transferred to the network The protocol stack toggles the handshake bits back indicating to the application that the transfer is finished and a new data exchange cycle may start This mode guarantees data consistency over both input and output area 3 1 1 Input Process Data The input data block is used by Fieldbus and industrial Ethernet protocols that utilize a cyclic data exchange mechanism The input data image is used to receive cyclic data from the network The default size of the input data image is 5760 byte However not all available space is actually used by the protocol stack Depending on the specific protocol the area actually available for user data might be much smaller than 5760 byte An input data block may or may not be available in the dual port memory It is always available in the default memory map see the netX Dual P
70. are set to zero indicating this is an alarm message The rest of contains the length of the alarm message in bytes up to 63 bytes are available here The second byte is the alarm type as discussed above It is coded as described in Table 108 PROFIBUS DPV1 Possible Alarm Types on page 153 The third byte contains the number of the affected module The fourth byte is the alarm specifier For more information see section PROF IBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_REQ CNF Request Command for Alarm Notification on page 151 Bytes 5 to 63 of the alarm message provide an area for transparently delivering the received diagnostic data of the slave As these data are slave dependent please refer to the documentation of the slave for more information Identification related diagnosis and channel related diagnosis are described in more detail in section Diagnostic Model of PROFIBUS DP V1 on page 49 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 70 238 6 The Application Interface This chapter defines the application interface of the Profibus DP slave stack The application itself has to be developed as a task according to the Hilscher s task layer reference model The application task is named AP task in the following sections and chapters The AP task s process queue is keeping track of all its
71. data to be set is provided in the parameter abCfgData The format is exactly the same as during initialization see below The third packet PROFIBUS_FSPMS_CMD_CHECK_CFG_IND RES indicates a request from the Profibus DP Master to compare the real configuration data i e those stored in the slave with the configuration data which the master assumes to be correct These are called the assumed configuration data and transmitted from the master with the PROF IBUS_FSPMS_CMD_CHECK_CFG_IND indication see section PROF IBUS_FSPMS_CMD_CHECK_CFG_IND RES Indicating the Request for Validation of the assumed I O Configuration Data on page 130 in the parameter abCfgData All these packets use the same formats describing the configuration of the modules inputs and outputs PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 55 238 5 3 3 1 Format of Profibus DP Configuration Data The rest of this section describes the structure of the parameter block containing the configuration data for the slave s which decides on the number of input and outputs of the slave This data block is sent from the PROFIBUS DP master to the PROFIBUS DP slave with the command Check_Cfg to force the slave to compare this configuration with it
72. four parameters ulDest ulSrc ulDestId and ulSrcId This chapter and the next one inform about how to work with these important parameters PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Fundamentals 15 238 2 2 Accessing the Protocol Stack by Programming the AP Task s Queue In general programming the AP task or the stack has to be performed according to the rules explained in the Hilscher Task Layer Reference Manual There you can also find more information about the variables discussed in the following 2 2 1 Getting the Receiver Task Handle of the Process Queue To get the handle of the process queue of the PROFIBUS DP Slave Device AP Task the Macro TLR_QUE_IDENTIFY needs to be used It is described in detail within section 10 1 9 3 of the Hilscher Task Layer Reference Model Manual This macro delivers a pointer to the handle of the intended queue to be accessed which is returned within the third parameter phQue if you provide it with the name of the queue and an instance of your own task The correct ASCIl queue names for accessing the PROFIBUS DP Slave Device AP Task which you have to use as current value for the first parameter pszIdn is ASCII Queue name Description PB_FSPMS_QUE Name of the FSPMS task process queue PB_APS QUE Name of the APS task process queue Table 10 Names of Queues
73. here The structure of the diagnosis header is D7 D6 D5 D4 D3 D2 D1 DO Description 0 0 0 63 Length of diagnostic block in bytes Indicating device related diagnosis 0 1 0 63 Identifier_Number of related module Indicating identification related diagnosis 1 0 0 63 Number of affected module 1 64 Indicating channel related diagnosis Table 39 Diagnosis Header Device related diagnosis In DP VO the interpretation of device related diagnostic information depends on the contents of the GSD file of the device In Profibus DP V1 device related diagnostic blocks will be either alarm or status blocks so they do not need to be discussed here Identification related diagnosis For identification related diagnosis the structure of the header is explained in Table 39 Diagnosis Header The following bytes indicate which module of the slave has a diagnosis For 8 modules one byte is used to indicate this D7 D6 D5 D4 D3 D2 D1 DO Description x Module 1 has a diagnosis available x Module 2 has a diagnosis available x Module 8 has a diagnosis available Table 40 Identification related diagnosis First Data Byte Note The module numbers applied here relate to the order of the modules within the configuration data telegram PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public
74. in PROFIBUS DP Slave Firmware The returned handle has to be used as value ulDest in all initiator packets the AP Task intends to send to the PB_FSPMS Task This handle is the same handle that has to be used in conjunction with the macros like TLR_QUE_SENDPACKET_FIFO LIFO for sending a packet to the respective task 2 2 2 Meaning of Source and Destination related Parameters The meaning of the source and destination related parameters is explained in the following table Variable Meaning ulDest Application mailbox used for confirmation ulSrc Queue handle returned by TLR_QUE_IDENTIFY as described above ulSrcld Used for addressing at a lower level Table 11 Meaning of Source and Destination related Parameters For more information about programming the AP task s stack queue please refer to 1 Especially the following sections might be of interest in this context 1 Chapter 7 Queue Packets 2 Section 10 1 9 Queuing Mechanism PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Fundamentals 16 238 2 3 Accessing the Protocol Stack via the Dual Port Memory Interface This chapter defines the application interface of the PROFIBUS DP Slave Stack 2 3 1 Communication via Mailboxes The mailbox of each communication channel has two areas that are used for non cyclic message transfer to and from t
75. incoming packets It provides the communication channel for the underlying Profibus DP Slave Stack Once the DP Slave Stack communication is established events received by the Stack are mapped to packets that are sent to the AP task s process queue On one hand every packet has to be evaluated in the AP task s context and corresponding actions be executed On the other hand Initiator Services that are be requested by the AP task itself are sent via predefined queue macros to the underlying DP Stack queues via packets as well The following chapters are describing the packets that may be received or may be sent by the AP task 6 1 The APS task To get the handle of the process queue of the APS task the Macro TLR_QUE_IDEN be used in conjunction with the following ASCIIl Queue name HW IFY has to ASCII Queue name Description PB_APS QUE Name of the APS task process queue Table 55 APS task Process Queue The returned handle has to be used as value ulDest in all initiator packets the AP task intends to send to the APS task This handle is the same handle that has to be used in conjunction with the macros like TLR_QUE_SENDPACKET_FIFO LIFO for sending a packet to the APS task In detail the following functionality is provided by the APs Task Overview over Packets of the APS Task
76. is only present if SType TRUE PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface The field tDAddr contains the following subparameters bAPI This subparameter identifies the application process instance of the destination bSCL This subparameter identifies the access level of the destination 161 238 abNetworkAddress 6 This subparameter identifies the network address of the destination according to ISO OSI Network addresses This value is only present if fDType TRUE abMACAddress This subparameter identifies the MAC Address of the destination This value is only present if DType TRUE The field abSAddrDAdadr contains the additional Source and Destination address information Packet Structure Reference define PROFIBUS_FSPMS_MAX_ typedef struct PROFIBUS_FSPMS_INI LR_UI 8 bAPI HRS i IOSICILS LR_UINT8 abNetworkAddres LR_UINT8 abMACAddress PROFIBUS _FSPMS_INITIATE_A typedef struct PROFIBUS_FSPMS_C2_INITIAT TLR_UINT32 ulReference Struct LR_UI 16 biDPV1_RW LR_UINT16 biReserved tFeaturesSupported LR_UI TLR_BOO LR_UI TLR_BOO LR WI UR UT PROFIBUS_FSPMS_C2_INITIAT EAN8 fS 8 bSLen FANS fD 8 bDLen ype Ype define PROFIBUS_FSPMS_C2_INI sizeof PROFIBU
77. isn t initialized yet PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 221 238 Hexadecimal Value Definition Description O0xC009000F TLR_E_PROFIBUS_FSPMS_CHECK_CFG_NOT_PENDING There is no Configuration Data checking command pending command ignored 0xC0090010 TLR_E_PROFIBUS_FSPMS_CHECK_CFG_NEW_CONFIGURATION The confirmation of the Slave Configuration Data is obsolete there is new Slave Configuration Data available 0xC009001 1 TLR_E_PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_POWER_ON Confirming the extended Slave Parameter Data cannot be performed because slave state machine isn t initialized yet 0xC0090012 TLR_E_PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_NOT_PENDING There is no extended Parameter Data checking command pending command ignored 0xC0090013 TLR_E_PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_NEW_PARAMETER The confirmation of the extended Slave Parameter Data is obsolete there is new extended Slave Parameter Data available 0xC0090014 TLR_E PROFIBUS _FSPMS_ABORT_IGNORED The abort command is ignored in the current state of the slave state machine 0xC0090015 TLR_E_PROFIBUS_FSPMS_GET_OUTPUT_WAIT_CFG Getting the Slave Output Data cannot be performed because slave state is currently in state WAIT CFG 0xC 0090016 TLR_E PROFIBUS _FSPMS_SET_INPUT_NOT_P
78. linkable object modules It has not been designed for usage in the context of loadable firmware PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 119 238 Packet Structure Reference typedef struct PROFIBUS_FSPMS_NEW_OUTPUT_IND_Ttag TLR_BOOLEANS8 fClearFlag PROFIBUS_FSPMS_NEW_OUTPUT_IND_T typedef struct PROFIBUS_FSPMS_PACKET_NEW_OUTPUT_IND_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_NEW_OUTPUT_IND_T tData PROFIBUS_FSPMS_PACKET_NEW_OUTPUT_IND_T Packet Description structure PROFIBUS_FSPMS_ PACKET _NEW_OUTPUT_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_ HEADER _T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulFSPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 1 sizeof PROFIBUS_FSPMS_NEW_OUTPUT_IND_T Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT3
79. not available 03 Invalid parameter See status code 0x20 which is usually applied in this situation value 04 Path segment error A path segment error has been encountered Evaluation of the supplied path information failed 05 Path destination The path references an unknown object class instance or structure unknown element causing the abort of path processing 06 Partial transfer Only a part of the expected data could be transferred 07 Connection lost The connection for messaging has been lost 08 Service not The requested service has not been implemented or has not been supported defined for this object class or instance 09 Invalid attribute value Detection of invalid attribute data OA Attribute list error An attribute in the Get_Attribute_List or Set_Attribute_List response has a status not equal to 0 0B Already in requested The object is already in the mode or state which has been requested by mode state the service oC Object state conflict The object is not able to perform the requested service in the current mode or state oD Object already exists It has been tried to create an instance of an object which already exists 0E Attribute not settable It has been tried to change an non modifiable attribute OF Privilege violation A check of permissions or privileges failed 10 Device state conflict The current mode or state of the device prevents the execution of the requested service 11 Reply data too large The data to be transmi
80. of ulError The error code stored within the ulError variable can have the following values Value Meaning 1 State changed to STOP or IDLE 0 State changed to OPERATE Other value The value represents a diagnostic code see section of this document The reason code ulReason should usually be 0 For more details refer to the following table ulState ulError ulReason Description RCX_COMM_STATE_STOP 1 0 State changed to 0x02 STOP RCX_COMM_STATE_IDLE 1 0 State changed to IDLE 0x03 RCX_COMM_STATE_OPERAT 0 0 State changed to E 0x04 OPERATE 1 TLR_DIAG_E_PROFIBUS_FSPMS_CONNECTI Connection timed out ON_TIMEOUT 0xC009002E Profibus Watchdog Baudrate lost zl Various diagnostic codes see list below 0 Different fatal error codes gt Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware The following diagnostic error codes may occur in case of ulState 1 TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_CFG_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_DATAEXCHANGE_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_DIAG_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_INIT_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_RDINPUT_PACKET PROFIBUS DP Slav
81. of linkable object modules Packet Structure Reference define PROFIBUS_APS_GET_USER_PRM_REQ_ SIZE 0 typedef struct PROFIBUS_APS_PACKET_GET_USER_PRM_REQ Ttag TLR_PACKET_HFADER tHead PROF IBUS_APS_PACKE GET_USER_PRM_REQ_T Packet Description structure PROFIBUS_APS_ PACKET _GET_USER_PRM_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_ T ulDest UINT32 0x20 Destination Queue Handle PB_APS_QUE ulSre UINT32 0 25 1 Source Queue Handle ulDestId UINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task ulCcmd UINT32 0x3108 PROF IBUS_APS_GET_USER_PRM_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch Table 63 PROFIBUS_APS_GET_USER_PRM_REO Get User Parameter Data Request PROFIBUS DP Slave
82. of section Technical Data due to change in limitations 1 amp M 13 2013 02 20 RG MPr Firmware stack version V2 6 2 x Reference to netX Dual Port Memory Interface Manual Revision 12 Corrections in section PROF IBUS_FSPMS_CMD_SET_IM0_REQ CNF Change I amp MO Parameter Settings Added a note to descriptions of PROFIBUS_APS_CHECK_USER_PRM_IND RES and PROFIBUS_APS_CHECK_CFG_IND RES Corrections in section 4 3 1 Behavior when receiving a Set Configuration Warmstart Command New table layout in Diagnosis section New table layout in packet descriptions Removed descriptions of deprecated packets 14 2013 05 27 RG MPr Firmware stack version V2 6 5 x Reference to netX Dual Port Memory Interface Manual Revision 12 6 Added info on LFW or LOM support for most packets 6 2 Updated and extended Table 68 Overview over the Packets of the FSPMS Task of the PROFIBUS DP Slave Protocol Stack 15 2013 09 06 HH RG Firmware stack version V2 7 1 x MPr Reference to netX Dual Port Memory Interface Manual Revision 12 1 5 Added netX10 and netX51 support in Technical Data 4 2 1 Missing configuration possibility via SYCON net mentioned 6 2 31 Some corrections 6 2 34 Added descriptions of two new packets 6 2 35 PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_REQ CNF and PROF IBUS_FSPMS_CMD_IOL_CALL_IND RES_POS RES_NEG
83. on Baudrate Switch This parameter is represented by bit 5 of the system flags It should be set when hardware baudrate switch is used and there is no TAG present 0 off 1 on Watchdog Time ms Watchdog time within which the device watchdog must be retriggered from the application program while the application program monitoring is activated When the watchdog time value is equal to 0 respectively the application program monitoring is deactivated 0 20 65535 ms default 1000 ms 0 Off Ident Number PROFIBUS system specific identification number Generally allowed values 0x0 OxFFFF Default value 0x0A12 indicating netX Bus Address Bus address own network station address Allowed values 0 126 Baudrate Network transmission rate Baudrate of the PROFIBUS connection Allowed values all baud rates offered in Table 34 Available Baud Rate Values Default value Auto detect Flags Some flags see explanation below Default value 0 Length of Configuration Data Number of bytes following containing configuration data 2 244 Configuration Data 0 243 Identifier Byte can be specified in two alternative form General Identifier Byte coded according to the Profibus standard see Valid identifier byte in general or special PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public
84. opens the connection over the chosen service access point and the slave reacts This process is illustrated by the picture below PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 65 238 Initialization Sequence of DP V1 Class 2 Connection MS2 Connection DP Master Class 2 DP Slave Initiate Initiate REQ PDU connection setup Store SAP for Init_MS2_IND Confirmation of intention to set up a connection Waiting for response positive or negative Init_MS2_CNF Initiate RES PDU Init_MS2_RES Connection finally set up Figure 9 Initialization Sequence of DP V1 Class 2 Connection PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 66 238 5 5 2 6 Important Parameters The following parameters are relevant when setting up an MSAC_C2 connection This is relevant for the use of the following packets PROFIBUS_FSPMS_CMD_INIT_MS2_REQ CNF Initializing the MSAC2S State Machine page 98 PROF IBUS_FSPMS_CMD_C2_INITIATE_IND RES_POS RES_NEG Indicating a Request to establish an acyclic Connection to a DP Master Class 2 page 160 Features supported DP master class 2 and DP slave communicate about the suppor
85. performed 0xC0090028 TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_SET_SLAVE_DIAG_FAILED A conflict has been detected within the acyclic MSAC1S state machine Requesting a Slave diagnostic failed 0xC0090029 TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_DL_ADD_PACKET Getting a packet from the pool to configure the new DL Address failed service cannot be performed 0xC009002A TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_RETURN_PACKET_FAILED Returning a packet back to the origin failed service cannot be performed 0xC009002B TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_RETURN_PACKET_FAILED Returning a packet back to the origin failed service cannot be performed 0xC009002C TLR_DIAG_E_ PROFIBUS _FSPMS_MSCY1S_SEND_PACKET_FAILED Sending a packet failed service cannot be performed 0xC009002D TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_SEND_PACKET_FAILED Sending a packet failed service cannot be performed 0xC009002E TLR_DIAG_E_ PROFIBUS FSPMS_ CONNECTION_TIMEOUT Timeout of the current connection Table 162 Diagnostic Messages of the FSPMS Task PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 226 238 7 2 Error Codes of the DL Task Hexadecimal Value Definition Description 0x0000 TLR_S OK Status ok 0xC0060001 TLR_E_PROFIBUS_ DL_COMMAND_INVALID Invalid command received 0xC0060040 T
86. previously FSPMS task issued Process Data write indication The response is required and a must do when having received the indication command declared in Table 104 PROFIBUS_FSPMS_CMD_C1_WRITE_IND Indication Command of a Process Data Write Request In order to address the correct AREP the response command service has to be used in conjunction with the received uirspmsita value of the confirmation packet referenced in Table 73 PROF IBUS_FSPMS_CMD_INIT_MS1_CNF Confirmation Command of MS1 Initialization for a DP Master Class 1 connection The type of connection itself can be distinguished in the AP task via the value ulDestID of the indication command itself declared in Table 104 PROFIBUS_FSPMS_CMD_C1_WRITE_IND Indication Command of a Process Data Write Request The response is generally distinguished into two types Positive response A positive write response does not contain any additional parameter data ulSta shall be TLR_S_ ok 0 Negative response A negative response is issued whenever the indicated request cannot be satisfied by the AP task 3 variables are specifying the type and source of the error in this event The applicable error codes are explained in section Acyclic Data Transfer of the DP Master Class 1 on page 61 ulSta shall be unequal 0 i e TLR_E_FAIL PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005
87. specifying the origin of the packet inside the Source Process ulLen UINT32 7 n PROFIBUS_FSPMS_READ_RES_POS_SIZE n number of bytes in read data block extended abData Packet Data Length in bytes ulId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section Status Error Codes Overview ulCmd UINT32 0x04A5 PROFIBUS_FSPMS_CMD_C2_READ_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2 READ RES POS T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bSlotNumber UINT8 0 254 Slot number of the Process Data Object that has been read bIndex UINT8 0 254 Index of the Process Data object that has been read bLength UINT8 0 240 n Number of data bytes read from the specified Process Data Object abDatal UINT8 Process Data object data that has been read Table 118 PROFIBUS_FSPMS_CMD_C2_READ_RES_POS Positive Response Command of a Process Data read PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 170 238 PROF IBUS_FSPMS_C2_RE typedef struct AD_RES_NEG Ttag LR_UINT32 u
88. started to force validation of the Parameter Data on one hand and to parameterize the DP Slave on the other The AP task has to check the received Parameter Data Set if it is consistent and valid to use it finally in the positive case as parameterization In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapmsortd value of the request packet referenced in Table 69 PROF IBUS_FSPMS_CMD_INIT_MSO_REQ Request Command for MSO Initialization The corresponding response packet has to be used by the AP task in order to confirm a previously FSPMS task issued extended Parameter Data The confirmation is required and a must do when having received the indication command declared in Table 97 PROF IBUS_FSPMS_CMD_CHECK_USER_PRM_IND Indication Command of Parameter Data For more information see section Parameterization There you can also find a description of the data format valid for parameter data which also applies for the abUserPrmData_ parameter of this packet 4 Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Troubleshooting Hints If you try to check user parameterization data while the slave state is Power_on you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_USER_PRM_POWER_ON along with the confirmation packet You will then have to initiali
89. struct PROFIBUS_FSPMS_START LR_UIN TLR_BOOLI y typedef struct T E mE LR_UIN 8 bActual r EnabledAlarms EFAN8 fAlarmSequence 8 bAlarmLimi ROETBUSERSPMSES PROFIB USTHSPMSEPACK ARTED_IND_T ED_IND_Ttag i1R_PACKET_HE AD ERAI tHead ROE BU SMHS ROE EB U SMHS S S START PACKI EDA INDE EDA ta Packet Description ET STARTED_IN DEI D1 _ SUA IND ltag structure PROFIBUS_FSPMS_PACKET_STARTED_IND_T Type Indication Area Variable Type Value Range Description tHead structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSrc UINT32 Source Queue Handle of FSPMS task Process Queue ulDestld UINT32 uIAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcld UINT32 ulIFSPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 3 Packet Data Length in bytes ulld UINT32 0 23 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0442 PROFIBUS_FSPMS_CMD_STARTED_IND Command ulExt UINT32 0 Extension not in use set t
90. structure PROFIBUS_FSPMS_PACKET IND_SETTING_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 O22 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x044D PROFIBUS_FSPMS_CMD_ IND_SETTING_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 137 PROFIBUS PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public FSPMS_CMD_IND_SETTING_CNF Confirmation for deactivating the Output Indication Hilscher 2005 2013 The Application Interface 192 238 6 2 29 PROFIBUS FSPMS CMD STARTED IND Start Indication This packet indicates the start of the MSAL1S state machine for alarm processing Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Packet Structure Reference typedef
91. the accompanying texts and the documentation do not correspond exactly to the described features standards or other data of the delivered product No warranty or guarantee regarding the correctness or accuracy of the information is assumed We reserve the right to change our products and their specification as well as related user manuals accompanying texts and documentation at all times and without advance notice without obligation to report the change Changes will be included in future manuals and do not constitute any obligations There is no entitlement to revisions of delivered documents The manual delivered with the product applies Hilscher Gesellschaft fur Systemautomation mbH is not liable under any circumstances for direct indirect incidental or follow on damage or loss of earnings resulting from the use of the information contained in this publication PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 13 238 1 8 3 Exclusion of Liability The software was produced and tested with utmost care by Hilscher Gesellschaft fur Systemautomation mbH and is made available as is No warranty can be assumed for the performance and flawlessness of the software for all usage conditions and cases and for the results produced when utilized by the user Liability for any damages that may result from the use of the hardware or software or related documents
92. the destination bSCL This subparameter identifies the access level of the destination abNetworkAddress 6 This subparameter identifies the network address of the destination according to ISO OSI Network addresses This value is only present if fDType TRUE abMACAddress This subparameter identifies the MAC Address of the destination This value is only present if fDType TRUE The field abSAddrDAddr contains the additional Source and Destination address information ulSta TLR_S_ OK Negative response A negative response is issued whenever the indicated request cannot be satisfied by the AP Task 3 variables are specifying the type and source of the error in this event For an explanation of the 3 error variables bErrorDecode bErrorCodel and bErrorCode2 refer to section 5 5 1 2 Error Handling ulSta TLR_E_FAIL not 0 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 164 238 The Application Interface Packet Structure Reference define PROFIBUS_FSPMS_MAX_INITIATE_ADD_TABLE_SIZE 234 typedef struct PROFIBUS_FSPMS_INITIATE_ADDR_Ttag LR_UINT8 bAPI LR_UINT8 bSC
93. the extended user parameter checking result failed 0xC01D0008 0xC01D0009 TLR_DIAG_E_PROFIBUS_APS_NO_CHECK_CFG_RESULT_PACKET Getting a packet from the pool to send back the configuration data checking result failed TLR_DIAG_E_ PROFIBUS APS NO GET _OUTPUT_PACKET Getting a packet from the pool to send the request for getting the latest outputs failed 0xC01D000A TLR_DIAG_E_ PROFIBUS _APS_ NO APPLICATION READY _PACKET Getting a packet from the pool to send the application ready request failed 0xC01D000B TLR_DIAG_E_ PROFIBUS APS NO _ABORT_PACKET Getting a packet from the pool to send the application ready request failed Table 166 Diagnostic Messages of the APS Task PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 231 238 The following table contains the possible General Error Codes defined within the EtherNet IP standard General Status Code specified hexadecimally Status Name Description 00 Success The service has successfully been performed by the specified object 01 Connection failure A connection elated service failed This happened at any location along the connection path 02 Resource Some resources which where required for the object to perform the unavailable requested service were
94. the number of maximum possible active alarms bAlarmsSupported UINT8 0 255 Variable indicating the types of alarms which shall be supported Table 72 PROFIBUS_FSPMS_CMD_INIT_MS1_REQ Request Command for MS1 Initialization PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 96 238 Source Code Example void APS_SInitMs1_req PROFIBUS_APS_RSC_T FAR ptRsc PINOM ILEUS IN2 S IVNCIXI IL Il EPERE i TLR_POOL_PACKET_GET ptRsc gt tLloc hPool amp ptPck TLR_S_OK ptPck gt tInitMslReq tHead ulCmd PROFIBUS_FSPMS_CMD_INIT_MS1_REQ MERSOUE IL ILINIKC SNL VNC IH SING jn RCR OERS C S 1c LOS 1 Misjeue Ils 1c EROE ptPck gt tInitMslReq tHead ulLen sizeof PROFIBUS_FSPMS_INIT_MS1_REQ_T TLR_QUE_SENDPACKET_FIFO ptRsc gt tLoc tMscyls tLnkDst ptPck TLR_INFINITE else ProfibusApsFaultind ptRsc TLR_DIAG_E_PROFIBUS_APS_NO_MS1_PACKET PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 97 238 typedef struct PROFIBUS_FSPMS_INIT_MS1_CNF_Ttag aL hy a2 typedef s a ER_UINT32 ules ROFIBUS_ESPMS PMicalbicels JEINIE A _JMISIL_ CiNGa 06
95. to zero for compatibility reasons ulDest UINT32 x Routing do not touch structure PROFIBUS_APS_CHECK_CFG_IND_T abCfgData PROFIB UINT8 Configuration data US_APS_MAX_CFG_D ATA_SIZE Table 61 PROFIBUS_APS_CHECK_CFG_IND Check Configuration Indication PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 80 238 typedef struct PROFIBUS_APS_CHECK_CFG_RES_ Ttag TLR_BOOLEANS8 fCfgOk PROFIBUS_APS_CHECK_CFG_RES_T define PROFIBUS_APS _CHECK_CFG_RES_SIZE sizeof PROFIBUS_APS_CHECK_CFG_RES_T typedef struct PROFIBUS_APS_PACKET_CHECK_CFG_RES_Ttag TLR_PACKET_HEADER_T tHead PRO EEE USmAP Sm Cli CKas Cri Gab ome laste chert PROFIBUS _APS_ PACKET _CHECK_CEG_RES_T Packet Description structure PROFIBUS_APS_PACKET_CHECK CFG _RES_T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPMSOld S
96. ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2 READ RES NEG T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bErrorDecode UINT8 Error decode value classifying the error bErrorCodel UINT8 Detailed error code bErrorCode2 UINT8 User specific error code Table 119 PROFIBUS PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public FSPMS_CMD_C2_READ_RES_NEG Negative Response Command of a Process Data read Hilscher 2005 2013 The Application Interface 171 238 6 2 23 PROFIBUS_FSPMS_CMD C2 WRITE_IND RES_POS RES_NEG Indicating an acyclic write Request to a specific Process Data Object This service indicates the AP Task that a specific Process Data Object shall be written by a DP Master Class 2 The AP Task has to take care of the Process Data objects themselves This means that it is fully application specific where those Process Data objects are stored to and what purpose they have To complete the process data write indication the AP Task has to respond and deliver the requested data by using the service referenced in Table 121 PROFIBUS_FSPMS_CMD_C2_WRITE_RES_POS Positive Response Command of a Process Data Write or Table 122 PROFIBUS_FSPMS_CMD_C2_WRITE_RES_NEG Negative Response Command of a Process Data write In order to address the correct end point identifier the indication command service is used in conjunction
97. 013
98. 050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_IM_INDI I GLROUINT32 ulSAPIdx ER ONTI WL SLE LR_UINT32 ulIM_Index LR_UINT32 ulLen PROF IBUS_FSPMS_IM_ INDEX_T typedef s LR_UI LR_UI LR UL PROFIBUS_FS TU Le Ea S e a S A i ct EROHTBEUSSESEMS SIM bErrorDecode bErrorCodel b P ErrorCode2 S_IM_ERROR_T typedef struct PROFIBUS_FSPMS_IM WRITE EX _Ttag ERROR_Ttag 205 238 vs PROF IBUS_FSPMS_IM_INDEX ELMO PROF IBUS_FSPMS_IM_ERROR elieigoye PROF IBUS_FSPMS_IM_WRITE_RES_T ES Ttag typedef struct PROFIBUS_FSPMS_PACKET_IM WRITE_RES_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_IM_WRITE_RES_T tData PROF IBUS_FSPMS_PACKET_IM_WRITE_RES_T Packet Description Structure PROFIBUS_FSPMS_PACKET_IM WRITE_RES T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle Ulere UINT32 Source Queue Handle ulDestid UINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destinatio
99. 0x00 invalid index PROFIBUS_FSPMS_ERROR_CODE_ACC_WRITE_LENGTH _ 0x01 write length error PROFIBUS _FSPMS_ERROR_CODE_ACC_SLOT_INVALID 0x02 invalid slot PROFIBUS_FSPMS_ERROR_CODE_ACC_TYPE_CONFLICT 0x03 type conflict PROFIBUS_FSPMS_ERROR_CODE_ACC_AREA_INVALID 0x04 invalid area PROFIBUS_FSPMS_ERROR_CODE_ACC_STATE_CONFLIC 0x05 state conflict T PROFIBUS_FSPMS_ERROR_CODE_ACC_ACCESS_DENIED 0x06 access denied PROFIBUS_FSPMS_ERROR_CODE_ACC_RANGE_INVALID 0x07 invalid range PROFIBUS_FSPMS_ERROR_CODE_ACC_PARAMETER_INV 0x08 invalid parameter ALID PROFIBUS_FSPMS_ERROR_CODE_ACC_TYPE_INVALID 0x09 invalid type Table 53 Bitmasks to apply for PROF IBUS_FSPMS_ERROR_CLASS_ACCESS PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 63 238 For PROFIBUS_FSPMS_ ERROR_CLASS RESOURCE use PROFIBUS _FSPMS _ERROR_CLASS RESOURCE Code Value hex Description PROFIBUS_FSPMS_ERROR_CODE_RSC_READ_ CONST _ 0x00 read constraint conflict RAIN PROFIBUS _FSPMS_ERROR_CODE_RSC_WRITE_CONST 0x01 write constraint conflict RAIN PROFIBUS _FSPMS_ERROR_CODE_RSC_BUSY 0x02 resource busy PROFIBUS _FSPMS_ERROR_CODE_RSC_UNAVAILABLE 0x03 resource not available Table 54 Bitmasks to apply for PROFIBUS_FSPMS_ERROR_CLASS_RESOURCE The variable bErrorCode2 is fully user specific and may contain any value Its hand
100. 1 2 List of Revisions Rev Date Name Chapter Revision 10 2010 05 12 RG HH Section PROFIBUS_FSPMS_CMD_STATE_CHANGED_ IND Indication for Change of State completely rewritten Extended section on task structure with descriptions of single tasks Added information of suitability of packets for LFW or LOM approach Corrected Configuration Data in Table 33 Meaning and allowed Values for Warmstart Parameters Section Technical Data DMA support for PCI targets Slot number added Firmware stack version V2 3 x Reference to netX Dual Port Memory Interface Manual Revision 9 11 2010 10 29 RG RH Firmware stack version V2 3 32 x Added description of 2 new flags in Warm Start Parameters 12 2012 01 26 RG FM Firmware stack version V2 4 12 x HH MPr Reference to netX Dual Port Memory Interface Manual Revision 12 Description of 3 1 amp M packets added Added section 6 3 Hardware Switches for the Adjustment of Slave Address and Baudrate Adapted description of system flags accordingly Adapted section Cyclic Data Input Output Data for netX devices with 8 kByte Dual port Memory abCfgData in warmstart packet is 244 not 32 Corrections in dentifier Byte for the General Format Identifier Byte for the Special Format Length Byte and Reason Code Correction of structure name PROFIBUS_APS_ PACKET SET CONF IGURATION_REQ_T Removed data part of packet in section 6 2 3 Update of section References Update
101. 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 104 238 6 2 5 PROFIBUS_FSPMS_CMD SET CFG _REQ CNF Setting new I O Is Configuration Data This service may be used by the AP task in order to pass new I O Is Configuration data to the underlying MSCY1S state machine Because the initial command referenced in Table 69 PROFTBUS_FSPMS_CMD_INIT_MSO_REQ Request Command for MSO Initialization already pre sets the I O Is Configuration this service might only be used in the event that new I O configuration data shall be set In order to address the correct end point identifier the request command service has to be used in conjunction with the received ulrspmsotd value of the confirmation packet referenced in Table 70 PROF IBUS_FSPMS_CMD_INIT_MSO_CNF Confirmation Command of MSO Initialization The macro TLR_QUE_SENDPACKET_FIFO has to be called to send the packet to the FSPMS task process queue After having the new configuration data transferred the specified Is Configuration data may be read by a Master Classi or Master Class 2 via the network due to the Get Configuration command If the MSCY1S state machine is already in state Data Exchange and exchanging O data with the DP Master the DP Master is informed about the configuration change and the Data Exchange is stopped After the change of the slave s configuration data usually an equivalent update of the DP Mas
102. 16 usPackagesAccepted UINT16 usReserved UINT8 abSendMbx 1596 NETX_SEND_MAILBOX_BLOCK typedef struct tagNETX_RECV_MAILBOX_BLOCK UINT16 usWaitingPackages UINT16 usReserved UINT8 abRecvMbx 1596 NETX_RECV_MAILBOX_BLOCK PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 29 238 3 3 Status A status block is present within the communication channel It contains information about network and task related issues In some respects status and control block are used together in order to exchange information between host application and netX firmware The application reads a status block whereas the control block is written by the application Both status and control block have registers that use the Change of State mechanism see also section 2 2 1 of the netX Dual Port Memory manual 3 3 1 Common Status The Common Status Block contains information that is the same for all communication channels The start offset of this block depends on the size and location of the preceding blocks The status block is always present in the dual port memory All Implementations The structure outlined below is common to all protocol stacks Common Status Structure Definition Offset Type Name Description 0x0010 UINT32 ulCommunicationCOS Communication Change of State READY RUN RESET REQ
103. 1API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 78 238 6 1 3 PROFIBUS_APS CHECK _CFG_IND RES Check Configuration Data This indication signals that new configuration data are available The configuration data are stored in variable abCfgData These data are structured exactly in the way described in section Format of Profibus DP Configuration Data page 55 and the following sections Their length is limited to 244 bytes by the Profibus DP specification This indication will only be sent if the following conditions are fulfilled 1 The application has registered itself at the Profibus DP protocol stack formerly 2 Auto configuration mode has been enabled by setting the auto config flag bit 6 in the warmstart parameters see there Note If the auto configuration mode is enabled flag WRMSTRT_FLG_AUTOCONFIG and the application is NOT registered then the requests of the PROFIBUS DP Master are acknowledged with fPrmOk FALSE and f CfgOk FALSE In this case the stack does not check the data This has the consequence that no communication is possible with a PROFIBUS DP Master Note Use this packet only when working with loadable firmware It has not been designed for usage in the context of linkable object modules Packet Structure Reference define PROFIBUS_APS MAX CFG _DATA SIZE 244 typedef struct PROFIBUS_APS_CHECK_CFG_IND_Ttag TL
104. 2 UINT32 ulHostWatchdog UINT32 ulErrorCount UINT32 ulErrorLogInd UINT32 ulReserved 2 union ETX_MASTER_STATUS_T tMasterStatus for master implementation UINT32 aulReserved 6 otherwise reserved unStackDepended NETX_COMMON_STATUS_BLOCK_T Communication Change of State All Implementations The communication change of state register contains information about the current operating status of the communication channel and its firmware Every time the status changes the netX protocol stack toggles the netX Change of State Command flag in the netX communication flags register see section 3 2 2 1 of the netX DPM Interface Manual The application then has to toggle the netX Change of State Acknowledge flag back acknowledging the new state see section 3 2 2 2 of the netX DPM Interface Manual ulCommunicationCOS netX writes Host reads 31 7 Restart Required Enable RCX_COMM_COS_RESTART_REQUIRED_ENABLE Restart Required RCX_COMM_COS_RESTART_REQUIRED Configuration New RCX_COMM_COS_CONFIG_NEW Table 24 Communication State of Change 1 eo jo PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 31 238 Communication Change of State Flags netX System gt Application Bit Definition Description 0 Ready RCX_COMM_COS_READY O 1 The Ready flag is set as
105. 2 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x041C PROFIBUS_FSPMS_CMD_NEW_OUTPUT_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_NEW_OUTPUT_IND_T fClearFlag BOOL8 0 1 Flag indicating if set to TLR_FALSE O that the Output Data Block is still valid If set to TLR_TRUE 1 the outputs needs to be set to a safe state Table 86 PROFIBUS_FSPMS_CMD_NEW_OUTPUT_IND Indication Command for new Output Data Source Code Example void APS _New_Output_ind PROFIBUS_APS_RSC_T FAR ptRsc INO INBUS NES JNCIKE I I INR OEEC KE if ptPckt gt tNewOutpInd tData fClearFlag TLR_TRUE APS_Clear_Outputs ptRsc else APS_Get_Output_req ptRsc TLR_QUE_RETURNPACKET ptPckt PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 120 238 6 2 10 PROFIBUS_FSPMS_CMD RESET _REQ CNF Request for resetting the Slave The packet forces a reset at the Profibus DP Slave stack All connections will be closed and the stack will restart with database or warmstart packet gt Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Packet Structure Refer
106. 2013 The Application Interface Packet Structure Reference 149 238 typedef struct PROF IBUS_ESPMS_Cil_WRITE_RES_POS_Ttag LR_UINT8 bSlotNumber LR_UINT8 bIndex LR_UINT8 bLength PROPIBUS FSPMG Cl OWRITE RES POST Positive response packet of an acyclic write command typedef struct PROFIBUS_FSP S_PACKET_Cil_WRITE RES 20S Wicac TLR_PACKET_HEADER_T tHead PROHUB USMS 2 Mom Cla Relish Home O ome lmateD clieciy PROFIBUS_FSPMS PACKET _Cl_WRITE_RES POS T Packet Description structure PROFIBUS_FSPMS_PACKET C1_WRITE_RES POS T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS task Process Queue ulSre UINT32 Source Queue Handle of AP task Process Queue ulDestiId UINT32 ulFSPMS1 ld Destination end point identifier specifying the final receiver ulFSPMS2ld of the packet within the Destination Process ulSrcId UINT32 ulAPMS1Id Source end point identifier specifying the origin of the ulAPMS2ld packet inside the Source Process ulLen UINT32 3 sizeof PROFIBUS_FSPMS_Cl_WRITE_RES_POS_T Packet Data Length in bytes ullId UINT32 0 24 Packet Identification as unique number generated by the Source Process of the Pa
107. 3 238 7 1 1 Diagnostic Codes of the FSPMS Task Hexadecimal Value Definition Description 0xC0090004 TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_INIT_PACKET Getting a packet from the pool to initialize the Data Link Layer failed bus parameter cannot be configured 0xC0090005 TLR_DIAG_E_PROFIBUS_ FSPMS_DMPMS_BUS PARAMETER_REJECTED The specified bus parameter are rejected by the Data Link Layer 0xC0090006 TLR_DIAG_E_ PROFIBUS _FSPMS_DMPMS_NO_RSAP_PACKET Getting a packet from the pool to initialize the SAPs failed Data Link Layer cannot be configured 0xC0090007 0xC0090008 TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_RSAP_ACTIVATION_DENIED The activation of a RSAP in the DMPMS state machine denied by the Data Link Layer TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_SAP_ACTIVATION_DENIED The activation of a SAP in the DMPMS state machine denied by the Data Link Layer 0xC 0090009 TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_SAPDEACTIVATE_PACKET Getting a packet from the pool to deactivate the SAPs failed Data Link Layer cannot be configured OxC009000A TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_SAP_DEACTIVATION_DENIED The deactivation of a SAP in the DMPMS state machine denied by the Data Link Layer 0xC009000B TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_START_PACKET Getting a packet from the pool to start the Data Link Layer failed Data Link Layer cannot be started 0xC009000C TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO
108. 4 238 5 3 3 Configuration of Inputs and Outputs At the Profibus DP Slave there are three important situations and associated packets dealing with the configuration blocks At the initialization of the state machine for cyclic data processing MSCY1S see section PROFIBUS_FSPMS_CMD_INIT_MSO_REQ CNF Initializing the MSCY1S State Machine on page 88 When the AP task requests a change in the Is configuration data using the Set Cfg command see section PROFIBUS_FSPMS_CMD_INIT_MS2_REQ CNF Initializing the MSAC2S State Machine on page 98 When the slave receives a PROFIBUS_FSPMS_CMD_CHECK_CFG_IND indication from the master see section on page 130 The first packet PROFIBUS_FSPMS_CMD_INIT_MSO_REQ CNF initializes the MSCY1S state machine and provides the current configuration data to use from the initialization of cyclic data transfer until the first request to change the parameter set if one occurs The configuration data so called Is configuration data or Real configuration data is stored in the slave and heavily influences the operation of the slave It is transferred to the slave by the parameter abRealCfgData of PROFIBUS_FSPMS_CMD_INIT_MSO_REQ CNF and use the data format precisely described below The second packet PROFIBUS_FSPMS_CMD_SET_CFG_REQ CNF allows changing the ls configuration data stored at the slave after initialization if necessary In this case the ls Configuration
109. 4 PROFIBUS_FSPMS_CMD CHECK _CFG_IND RES Indicating the Request for Validation of the assumed I O Configuration Data This service indicates the AP task that a Check Configuration command has been received This service is sent by a DP Master to a DP Slave to force a validation of the Is Configuration within the slave and the assumed configuration data of the DP master The AP task has to compare the received configuration data against its own ls Configuration The indication packet itself requires no response packet to be built by the AP task Just using the Macro TLR_QUE_RETURNPACKET will return the packet back to the FSPMS task context In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapmsotda value of the request packet referenced in Table 69 PROFIBUS_FSPMS_CMD_INIT_MSO_REQ Request Command for MSO Initialization The flag fCfgok of the related response packet indicates whether the previously indicated Configuration Data Block is valid and has been accepted by the AP task In the positive case the flag has to be set to TLR_TRUE 1 and the DP Master is informed about the data acceptance If the Configuration Data Block is somehow incorrect or cannot be supported the flag has to be set to TLR_FALSE 0 The DP Master is then automatically informed about this refusal by the FSPMS task Two further values named bInputDataLen and bOutputDataLen ha
110. 401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 27 238 3 2 2 Status amp Error Codes The following status and error codes can be returned in ulState List of codes see manual named netX Dual Port Memory Interface 3 2 3 Differences between System and Channel Mailboxes The mailbox system on netX provides a non cyclic data transfer channel for field bus and industrial Ethernet protocols Another use of the mailbox is allowing access to the firmware running on the netX chip itself for diagnostic purposes There is always a send and a receive mailbox Send and receive mailboxes utilize handshake bits to synchronize these data or diagnostic packages through the mailbox There is a pair of handshake bits for both the send and receive mailbox The netX operating system rcX only uses the system mailbox The system mailbox however has a mechanism to route packets to a communication channel A channel mailbox passes packets to its own protocol stack only 3 2 4 Send Mailbox The send mailbox area is used by protocols utilizing a non cyclic data exchange mechanism Another use of the mailbox system is to provide access to the firmware running on the netX chip itself The send mailbox is used to transfer non cyclic data to the network or to the protocol stack The size is 1596 bytes for the send mailbox in the default memory layout The mailbox is accompanied by counters that hold the number o
111. 5 APS task Process Queue 2 sccceccs2eccsseaeis eeseiegdiecei dete eevee ide ati cedidbescchoieesicdlussceveesseeledevehsyessiaseeeleeaveeslebleeiieveest 70 Table 56 Overview over the Packets of the APS Task of the CANopen Master Protocol Stack cccceseeeeeseeeeeeeeenees 70 Table 57 PROFIBUS_APS_SET_CONFIGURATION_REQ Set Warmstart Parameters cecccsceeseeeeseeeeeeeteneeeeneeteaees 73 Table 58 PROFIBUS_APS_SET_CONFIGURATION_CNF Confirmation for Setting Warmstart Parameters 74 Table 59 PROFIBUS_APS_CHECK_USER_PRM_IND Check User Parameter Indication ccccsceeeseeeeeeeeteseneetenees 76 Table 60 PROFIBUS_APS_CHECK_USER_PRM_RES Response to Check User Parameter Indication ceee 77 Table 61 PROFIBUS_APS_CHECK_CFG_IND Check Configuration Indication c ccccceseceeeeeeeeeeeeeneeeeeeeeeneeeeneeeenees 79 PROFIBUS DP Slave Protocol API DOCO050 401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Appendix 235 238
112. 5 2013 Dual Port Memory 26 238 Source Identifier The ulSrcid field identifies the originator of a packet This field is used by a host application which passes a packet from an external process to an internal netX task The u Srcid field holds the handle of the external process When netX operating system returns the packet the application can identify the packet and returns it to the originating process The receiving task on the netX does not evaluate this field and passes it back unchanged For inter task communication this field is not used Length of Data Field The ulLen field holds the size of the data field in bytes It defines the total size of the packet s payload that follows the packet s tHeader The size of the tHeader is not included in u Len So the total size of a packet is the size from u Len plus the size of packet s tHeader Depending on the command a data field may or may not be present in a packet If no data field is included the length field is set to zero Identifier The ulld field is used to identify a specific packet among others of the same kind That way the application or driver can match a specific reply or confirmation packet to a previous request packet The receiving task does not change this field and passes it back to the originator of the packet Its use is optional in most of the cases But it is mandatory for sequenced packets Example Downloading big amounts of data that does not fit into a sing
113. 5535 Local see above ulSubnet UINT32 0 2 Subnet see above ulInstance UINT32 0 15 Instance see above ulReasonCode UINT32 0 15 Reason code see above Table 131 PROFIBUS PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public FSPMS_CMD_C2_ABORT_IND Indicating the Abort of Class 2 Connection Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_C2_ABORT_RES 184 238 Teac i TLR_UINT32 ulReference PROP TBUS IF SPMS C2 ABORT ORES z define PROFIBUS_FSPMS_C2_ABORT_RES_SIZE Positive respons typedef struct PROFIBUS_FSPMS_PAC packet of an KI sizeof PROF IBUS_FSPMS_C2_ABORT_RES_T acyclic read command PC 2 AB ORIEL S A itag TLR_PACKET_HEADER_T tHead EROHIBUSSHSEMSMOCZAABORIERES AMEE PROFIBUS_FSPMS_PACKET_C2_ABORT Data RES lt 0 Packet Description structure PROFIBUS_FSPMS_ PACKET _C2_ABORT_RES_ T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP Task Process Queue ulSre UINT32 Source Queue Handle of FSPMS Task Process Queue ulDestId UINT32 ulFSPMS2lId Destination end point identifier specifying the final receiver of the packet
114. 6 TLR_E_PROFIBUS_FSPMS_SET_CFG_POWER_ON Setting the Slave Configuration Data cannot be performed because slave state machine isn t initialized yet 0xC0090007 TLR_E_PROFIBUS_FSPMS_GET_OUTPUT_POWER_ON Getting the Slave Output Data cannot be performed because slave state machine isn t initialized yet 0xC0090008 TLR_E PROFIBUS _FSPMS_GET_OUTPUT_WAIT_PRM Getting the Slave Output Data cannot be performed because slave state is currently in state WAIT PRM 0xC 0090009 TLR_E_PROFIBUS_FSPMS_SET_INPUT_POWER_ON Setting the Slave Input Data cannot be performed because slave state machine isn t initialized yet OxC009000A TLR_E_PROFIBUS_FSPMS_SET_INPUT_WAIT_PRM Setting the Slave Input Data cannot be performed because slave state is currently in state WAIT PRM 0xC009000B TLR_E_PROFIBUS_FSPMS_CHECK_USER_PRM_POWER_ON Confirming the Slave Parameter Data cannot be performed because slave state machine isn t initialized yet 0xC009000C TLR_E PROFIBUS _FSPMS_CHECK_USER_PRM_NOT_PENDING There is no Parameter Data checking command pending command ignored 0xC009000D TLR_E_PROFIBUS_FSPMS_CHECK_USER_PRM_NEW_PARAMETER The confirmation of the Slave Parameter Data is obsolete there is new Slave Parameter Data available OxC009000E TLR_E_PROFIBUS_FSPMS_CHECK_CFG_POWER_ON Confirming the Slave Configuration Data cannot be performed because slave state machine
115. 7 WR EIERN DA Dana PROFIBUS_FSPMS_ PACKET _C2_WRITE_IND_T Packet Description structure PROFIBUS_FSPMS_ PACKET _C2_WRITE_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP Task Process Queue ulSre UINT32 Source Queue Handle of FSPMS Task Process Queue ulDestId UINT32 ulAPMS2ld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrclId UINT32 ulFSPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 7 n PROFIBUS_FSPMS_C2_WRITE_IND_IND_SIZE n number of bytes in write data block abData Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCcmd UINT32 0x04A6 PROFIBUS_FSPMS_CMD_C2_WRITE_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_ WRITE_IND_T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bSlotNumber UINT8 0 254 Slot number of the Process Data object to be written bIndex UINT8 0 254 Index of the Process Data object t
116. Application as Client The host application sends request packets to the netX firmware The netX firmware sends a confirmation packet in return The host application receives indication packets from the netX firmware The host application sends response packet to the netX firmware may not be required VEQ Request CAF Confirmation IND Indication S Response PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Fundamentals 22 238 2 4 2 Application as Server The host application has to register with the netX firmware in order to receive indication packets Depending on the protocol stack this is done either implicitly or explicitly if application wants to receive unsolicited DPV1 packets Details on when and how to register for certain events is described in the protocol specific manual When an appropriate event occurs and the host application is registered to receive such a notification the netX firmware passes an indication packet through the mailbox transition 1 gt 2 The host application is expected to send a response packet back to the netX firmware transition 3 gt 4 Application netX 2 4 Figure 5 Transition Chart Application as Server The netX firmware passes an indication packet through the mailbox The host application sends response packet to the netX firmware IND Indication MSP Response
117. BUS_FSPMS_CMD_C1_ALARM_ACK_IND Indication Command of an Alarm ccceesseeeeeeeeeeeees 156 Table 111 PROFIBUS DPV1 Possible Alarm Types cceseeeeeeeseceeeeeneeeseseneeeceseneeeesaneeseseneeeceeeeneesaaeeseneneeeseneness 156 Table 112 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_RES_POS Positive Response to Indication Command of an Alarm Request cwdoteves TE E E E EST 158 Table 113 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_RES_NEG Negative Response to Indication Command of an Alarm Request E a a E O e O N e E aa E RE 159 Table 114 PROFIBUS_FSPMS_CMD_C2_INITIATE_IND Indication Command of a Request to establish a DP Master Class 2 Connection E E a E RAA EE A E AA EEE AE 162 Table 115 PROFIBUS_FSPMS_CMD_C2_INITIATE_RES_POS Positive Response Command of a DP Master Class 2 Gonnection Req estiss ei ean ite deaes eau en A en a ad eet E E e ee arenes 165 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Appendix 236 238 Table 116 PROFIBUS_FSPMS_CMD_C2_INITIATE_RES_NEG Negative Response Command of a DP Master Class 2
118. BUS_ON flag but the communication will be interrupted if the BUS_ON flag changes state to 0 communication with controller is allowed only with the BUS_ON flag BIT 1 O STATUS DISABLED ENABLED Not supported yet BIT 2 IO STATUS 32 BIT Not supported yet BIT 3 Reserved for further use set to zero BIT 4 ADDRESS_SWITCH Should be set when hardware address switch is used and there is no TAG present BIT 5 BAUD_SWITCH Should be set when hardware baudrate switch is used and there is no TAG present BIT 6 31 Reserved for further use set to zero ulWdgTime UINT32 0 65535 Host Watchdog Time in ms ignored if 0 usIdentNumber UINT16 0 65535 Own PROFIBUS Identification Number bBusAddr UINT8 0 126 Own Network Station Address bBaudRate UINT8 0 11 15 Network Baud Rate The possible values are listed in Table 34 Available Baud Rate Values bFlags UINT8 0 See description of Flags within section 4 3 Warmstart Parameters bRes 2 UINT8 0 Reserved always set to 0 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 73 238 bCfgLen UINT8 244 Number of bytes following abCfgData 0 UINT8 Identifier Byte can be specified in two alternative forms General Identifier Byte coded according to the Profibus standard see section 5 3 3 or Special Identifier Byte Format SIF see section Co
119. CATION_READY_CNF Confirmation Command of setting the application to ready state Packet Status Error Definition Value Description TLR_S OK Status ok 0x0000 TLR_E_ PROFIBUS _FSPMS_APPLICATION_RE The Application ready command is ignored in the current state of ADY_IGNORED the slave state machine OxC0090019 TLR_E_ PROFIBUS _FSPMS_APPLICATION_AL The Application ready command is ignored because the READY_READY application has already signalled its readiness OxC009001C Table 92 PROFIBUS_FSPMS_CMD_APPLICATION_READY_CNF Packet Status Error Source Code Example void APS_Application_Ready_cnf PROFIBUS_APS_RSC_T FAR ptRsc PROHTBUSSAES JVC In IL JEYNIRS PERCET ERO OLmPACKT MAREE ASHA DERs eC elhOC mmoles meas PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 125 238 6 2 12 PROFIBUS_FSPMS_CMD SET SLAVE_ADD_IND Indicating the Reception of a Change Slave Address Request This service indicates to the AP task that a DP Master requests for changing the slave s current address Next to the new slave address itself the service may include also further slave specific data which are usually stored in a permanent memory This has to be done by the AP task When the service is indicated the MSCY1S state machine has already accepted the new station address
120. CONFIGURATION_REQ was received the other one i e WARMSTART_REQ will be rejected The host has the possibility to modify the configuration with the packet RCX_SET_HW_SWITCH_VALUE_ REQ Using the hardware switches for adjusting of slave address and baudrate requires the option Application_controlled being active either when configuring using SET _ CONFIGURATION_REQ packet see PROFIBUS_APS_SET_CONFIGURATION_REQ CNF Set Configuration Parameters on page 71 or in the SYCON net database file config nxd The stack will start the device with the received configuration as soon as the application ready flag is set by the host application On starting the stack the hardware switches are evaluated if hardware switches are enabled via the TAG The values from the hardware switches will overwrite the values which was set via database or packet previously This can be avoided if the hardware switches are disabled via the Tag List Editor tool A description of the Tag List Editor tool is given in reference 3 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 216 238 No Database available war for packet EEE Yes i No Automatic Start Modify configuration with RCX_SET_HW_SWITCH_VALUE_REQ Wait for Application Ready Yes HW switch enabled Yes
121. Codes of the FSPMS Task not 0 ulCmd UINT32 0x04A7 PROFIBUS_FSPMS_CMD_C2_WRITE_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2 WRITE_RES NEG T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bErrorDecode UINT8 See section Error decode value classifying the error 5 5 1 2 bErrorCodel UINT8 See section Detailed error code 5 5 1 2 bErrorCode2 UINT8 See section User specific error code 5 5 1 2 Table 122 PROFIBUS_FSPMS_CMD_C2_WRITE_RES_NEG Negative Response Command of a Process Data write PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 176 238 6 2 24 PROFIBUS_FSPMS_CMD C2 DATA TRANSPORT_IND RES_POS R ES_NEG Indicating an acyclic Data Transport Request to a single combined Process Data Object This service indicates the AP Task that a specific process data object shall accessed in a client server manner by a DP Master Class 2 The AP Task has to take care of the process data objects themselves This means that it is fully application specific where those Process Data objects are stored to and what purpose they have To complete the data transport indication for process data the AP Task has to respond and deliver the requested data by using the service described either in Ta
122. DOC050401API15EN Revision 15 English 2013 09 Released Public ptPckt gt tSetSlaveAddiInd tData bNewSlaveAdd Release the indication Hilscher 2005 2013 The Application Interface 127 238 6 2 13 PROFIBUS_FSPMS_CMD GLOBAL _CONTROL_IND Indicating a Global Control Command This service indicates the AP task that a Global Control Command has been received The broadcast service is sent by a DP Master via the network for the synchronization of the values of the input data and the output data Sync Freeze of different slaves Furthermore this service is used by the DP Master to send information about its operation mode to its assigned DP Slave gt Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware The indication packet itself requires no response packet to be built by the AP task Just using the Macro TLR_QUE_RETURNPACKET will return the packet back to the FSPMS task context In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapmsotd value of the request packet referenced in Table 69 PROF IBUS_FSPMS_CMD_INIT_MSO_REQ Request Command for MSO Initialization A flag named ClearCommand indicates if set to TLR_FALSE 0 that the DP Master is operating in the state OPERATE If the flag is set to TLR_TRUE 1 the DP Master is in the stat
123. D_CHG_IND_PACKET Getting a packet from the pool to send the received Slave Set Slave Address command to the application failed service cannot be performed PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 224 238 Hexadecimal Value Definition Description 0xC0090015 TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_MINTSDR_PACKET Getting a packet from the pool to configure the minTSDR Timer failed service cannot be performed 0xC0090016 TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_NEW_OUTP_IND_PACKET Getting a packet from the pool to send the new output indication to the application failed service cannot be performed 0xC0090017 TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_GLOBAL_CONTROL_IND_PACKET Getting a packet from the pool to send the global control indication to the application failed service cannot be performed 0xC0090018 TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_SAP_PACKET Getting a packet from the pool to initialize the Global Control SAP failed Data Link Layer cannot be configured 0xC0090019 TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_ALARM_RES_UNEXPECTED An Alarm response has been received while the acyclic State Machine is in POWER ON state and has not been initialized yet 0xC009001A TLR_DIAG_E_PROFIBUS_FSPMS_FSPMS_NO_STARTED_IND_PACKET Getting a packet from the pool to send the start indic
124. D_RESET_REQ CNF Request for resetting 120 0x044F the Slave 6 2 11 0x0412 PROFIBUS_FSPMS_CMD_APPLICATION_READY_REQ CNF Declaring 122 0x0413 the Application ready for Duty 6 2 12 0x041A PROFIBUS_FSPMS_CMD_SET_SLAVE_ADD_IND Indicating the 125 Reception of a Change Slave Address Request 6 2 13 0x0418 PROF IBUS_FSPMS_CMD_GLOBAL_CONTROL_IND Indicating a Global 127 Control Command 6 2 14 0x0414 PROFIBUS_FSPMS_CMD_CHECK_CFG_IND RES Indicating the 130 0x0415 Request for Validation of the assumed I O Configuration Data 6 2 15 0x0416 PROF IBUS_FSPMS_CMD_CHECK_USER_PRM_IND RES Indicating the 134 A 0x0417 Reception of new Parameter Data 6 2 16 0x0438 PROFIBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_IND RES 138 ae 0x0439 Indicating new Extended Parameter Data 6 2 17 0x0484 PROFIBUS_FSPMS_CMD_C1_READ_IND RES_POS RES_NEG 141 0x0485 Indicating an acyclic read Request to a specific Process Data Object 6 2 18 0x0486 PROFIBUS_FSPMS_CMD_C1_WRITE_IND RES_POS RES_NEG 146 0x0487 Indicating an acyclic write Request to a specific Process Data Object 6 2 19 0x0480 PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_REQ CNF 151 e 0x0481 Request Command for Alarm Notification PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013
125. Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0414 PROF IBUS_FSPMS_CMD_CHECK_CFG_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_CHECK_CFG_IND_T abCfgData_l UINT8 Assumed Configuration data to be validated Table 95 PROFIBUS_FSPMS_CMD_CHECK_CFG_IND Indication Command of a Check Configuration PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 132 238 Source Code Example void APS Check Cfig_ind PROFIBUS_APS RSC_T FAR ptRse ROMO IBS ANeNS VNC IHW IE JEVAIRE joc ECEE TLR_UINT uCfgDataLen uCfgDataLen ptPckt gt tChkCfgInd tHead ulLen if ucfgDataLen ptRsc gt tLoc tMscyls uCfgDataSize amp amp MEMCMP void amp ptRsc gt tLoc tMscyls abCfgData 0 void amp ptPckt gt tChkCfgInd tData abCfgData 0 uCfgDataLen 0 APS_Check_Cfg_Result_req p RSG UE Rsc gt tLoc tMscyls uInpDataLen Rsc gt tLoc tMscyls uOutpDataLen ct W T p p CE AT APS_Read_Inputs ptRsc APS_Application_Ready_req ptRsc else APS_Check_Cfg_Result_req ptRsc FAL
126. Diagnostic Codes of the DL Task ceseceesseeeseeeteeeeeneeeeeneeeseeeeeaeessaeenaeeseaeesaeessaeeseaeessaeennaeetaaes 228 3 Error Godes Of thes APS TaSkanina atena Avance Me veitenclvasdiediaieas isla a 229 7 3 1 Diagnostic Codes of the APS Task 000 eecceceseeseeeeeeneeeeneeeeeeeseaeeseaeeseaeeseaeeseaeeseaeeseaeeseaeeseeeseaeeeeaes 230 PDP eLa e AE EE DE E sees ke E ete EE E dace Dadi vee E ada E 234 8 1 Etot Tables i a aa a a a a an nin e Me 234 8 2 List OF Fig r E Siei iu anii aaia aa aigi a i Gaul Med 236 83 Contaci anian a a ais tare Beate ital Gata a a i 238 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 5 238 1 Introduction 1 1 About this Document This manual describes the application interface of the Profibus DP Slave Stack implementation on the netX chip The aim of this manual is to support the integration of devices based on the netX chip into own applications based on driver functions or direct access to the dual port memory The general mechanism of data transfer for example how to send and receive a packet or how to perform a warmstart is independent from the protocol These procedures are common to all devices and are described in the netX DPM Interface manual PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 6 238
127. ENDING Setting the Slave Input Data cannot be performed because input update is not pending 0xC0090017 TLR_E_PROFIBUS_FSPMS_CHECK_USER_PRM_INVALID_MASTER_ADDRESS The confirmation of the Slave Parameter Data is obsolete because meanwhile another master has parameterized the slave 0xC0090018 TLR_E_PROFIBUS_FSPMS_CHECK_CFG_INVALID_MASTER_ADDRESS The confirmation of the Slave Configuration Data is obsolete because meanwhile another master has configured the slave 0xC0090019 TLR_E_PROFIBUS_FSPMS_APPLICATION_READY_IGNORED The Application ready command is ignored in the current state of the slave state machine 0xC009001A TLR_E PROFIBUS _FSPMS_CHECK_EXT_USER_PRM_INVALID_MASTER_ADDRES S The confirmation of the extended Slave Parameter Data is obsolete because meanwhile an other master has parameterized the slave 0xC009001B TLR_E_PROFIBUS_FSPMS_GET_OUTPUT_DATA_EXCHANGE_NO_CYCLE Getting the Slave Output Data cannot be performed because slave state machine is in state DATA EXCH but no output cycle has been driven yet 0xC009001C TLR_E PROFIBUS_FSPMS_APPLICATION_ALREADY_READY The Application ready command is ignored because the application has already signaled its readiness 0xC009001D TLR_E_PROFIBUS_FSPMS_SLAVE_DIAG_PENDING A new Slave Diagnostic command cannot be accepted while a previous one is pending OxC009001E TLR_E PROFIBUS_FSPMS_READ_RESPONSE_NEG e rea
128. ERATE USIF_OPERATE These states differ in the degree of allowed functionality as follows In OFFLINE state there is no communication data transfer permitted at all This is the state after initialization This means the master is waiting for a signal to start and does not participate in the token ring of the Profibus access control mechanism In STOP state there is no data transfer permitted between master and slaves Data transfer to other masters in multi master system is allowed however The bus parameter set has been loaded successfully in order to get into STOP state In CLEAR state the master is able to read the input data from the DP slaves The master forces the outputs to the slaves to be in a safe state i e they contain only the value 0 For instance incorrect data transfer of a slave can cause the Profibus DP Master to fall back from OPERATE state to CLEAR state Parameterization and configuration checks are possible in this state In OPERATE state data transfer is possible without any restriction This data transfer is cyclic i e periodically the input values are read from the slaves and the output data are written to the slaves Changes of the operation mode are supervised by an internal state machine within the Profibus DP Master Depending on the parameterization of the DP master a DP slave can automatically be switched over from OPERATE condition to the STOP condition A change of the mode is indicated to the AP task by
129. ES_NEG Indicating an Alarm REQUEST eeeeeeeeeeeeee nites See chewed ce ee eT A hee E T Soe ae 155 6 2 21 PROFIBUS_FSPMS_CMD_C2_INITIATE_IND RES_POS RES_NEG Indicating a Request to establish an acyclic Connection to a DP Master Class 2 eccceeceeeeceeeeeeeeseeeeeeeeeeeeseeeeeeeeeeeeseeeeeeeeeeaees 160 6 2 22 PROFIBUS_FSPMS_CMD_C2_READ_IND RES_POS RES_NEG Indicating an acyclic read Request Class 2 to a specific Process Data Object c cccceeeccceeeneeeeeeeneeeeeeneeeesenaeeeesseeeesseeeesenneees 167 6 2 23 PROFIBUS_FSPMS_CMD_C2_WRITE_IND RES_POS RES_NEG Indicating an acyclic write Request to a specific Process Data Object E E E aie Soh oe eee es 171 6 2 24 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_IND RES_POS RES_NEG Indicating an acyclic Data Transport Request to a single combined Process Data Object ccccsesceeeeeeeeeeseneeeeeseeeeesnaeees 176 6 2 25 PROFIBUS_FSPMS_CMD_C2_ABORT_IND RES Indicating the Abort of Class 2 Connection 181 6 2 26 PROFIBUS_FSPMS_CMD_STATE_CHANGED_IND Indication for Change of State 185 6 2 27 PROFIBUS_FSPMS_CMD_REGISTER_DIAG_STRUCT_REQ CNF Request for Registration of Diagnostic Structure A iG ee as sd tne idle dD es ee eA 188 6 2 28 PROFIBUS_FSPMS_CMD_IND_SETTING_REQ CNF Request for deactivating the Output Indication190 6 2 29 PROFIBUS_FSPMS_CMD_STARTED_IND Start Indication c cccccccsssseeeeeseeeseeeeeeeeeeeeeeeeeeen 192
130. Ext UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 140 PROFIBUS FSPMS_CMD_SET_STAT_DIAG_CNF Configuration of Set Static Diagnostic Request PROFIBUS DP Slave DOC050401API15EN Revision 15 English 2013 09 Released Public Protocol API Hilscher 2005 2013 The Application Interface 195 238 6 2 31 PROFIBUS_FSPMS_CMD SET _IMO_REQ CNF Change lI amp MO Parameter Settings In order to change the default listed below I amp MO parameter and or dis enable the other I amp M indices the command PROFIBUS_FSPMS_CMD_SET_IMO_REQ has to be send to the FSPMS Task The Profibus DP Slave stack handles the I amp MO index slot 0 itself If a write request is successful the stack increments the revision counter variable of I amp MO slot O structure To receive I amp M calls not including I amp MO slot 0 the variables usIMSupported fProfSpecSupp and fManuSpecSupp of I amp MO index have to be changed for slot 0 requests If slots different from zero should be supported the variable ulSlot sNot ZeroSupp must be set to the corresponding value The stack supports the slots from 0 up to ulSlotsNotZeroSupp The I amp MO of a slot different from 0 has to be handled by the application The variable usIMSupported is interpreted as bit array which represents the supported I amp M records Bit Meaning
131. FIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 11 238 1 7 References This document based on the following specification 1 2 3 4 5 6 7 8 9 Task Layer Reference Manual Hilscher GmbH 2005 DPM Interface Manual for netX based Products Hilscher GmbH 2011 IEC 61158 5 3 Edition 2 0 August 2010 IEC 61158 6 3 Edition 2 0 August 2010 PROFIBUS document 0 032 Normative Parts of Profibus FMS DP PA according to the European Standard EN 50170 Volume 2 Edition 1 0 March 1998 Published by PROFIBUS International PROFIBUS document 2 082 Technical Guideline PROFIBUS DP Extensions to EN 50170 Version 2 0 April 1998 Published by PROFIBUS International PROFIBUS document 3 502 Profile Guidelines Part 1 Identification amp Maintenance Functions Version 1 2 October 2009 Published by PROFIBUS International PROFIBUS document 6 012 Manufacturer ID Table Version V61 May 2009 http www profibus com IM Man_ID_Table xml PROFIBUS document 6 022 Profile ID Table Version V11 November 2011 http www profibus com IM Profile_ID_Table xml Table 9 References PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 12 238 1 8 Legal Notes 1 8 1 Copyright 2005 2013 Hilscher Gesellschaft f r Sys
132. FIFO has to be used to send the packet to the FSPMS task process queue The 6 bytes standard diagnosis data cannot be specified by this command They are automatically added by the MSCY1S state machine when the whole diagnosis data is transferred via the network to a requesting DP Master The overall transmitted diagnostic data in the abExtDiagData may not exceed the total size of 238 bytes The flag f amp xtDiagoverflow indicates if there is more diagnostic data available that the array abExtDiagDatal Can contain If it is set to TLR_TRUE 1 the DP Master is informed about this status in the same diagnostic by the MSCY1S state machine The flag fextDiagFlag informs the DP Master if the abExtDiagData field shall be interpreted as extended diagnostic data TLR_TRUE 1 or as user specific ae TLR_FALSE 0 without any standardized background The coding of the abExtDiagData has to meet the specification 61158 6 IEC 2003 E page 510 chapter Coding section eee to the slave diagnosis PDU excluding the 6 bytes standard diagnosis data For detailed information also see section 5 3 1 Diagnosis Troubleshooting Hints If you try to set new diagnostic data while the slave state is Power_on you will receive an error code TLR_E_PROFIBUS_FSPMS_SLAVE_DIAG_POWER_ON along with the confirmation packet You will then have to initialize the slave in order to be able to set diagnost
133. FSPMS Task Process Queue ulSrec UINT32 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulFSPMS2Id Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 7 sizeof PROFIBUS_FSPMS_C2_WRITE_RES_POS_T Packet Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 TLR_S_OK 0 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04A7 PROFIBUS_FSPMS_CMD_C2_WRITE_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2 WRITE_RES POS T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bSlotNumber UINT8 0 254 Slot number of the Process Data object that has been written bIndex UINT8 0 254 Index of the Process Data object that has been written bLength UINT8 Number of real written process data bytes Table 121 PROFIBUS_FSPMS_CMD_C2_WRITE_RES_POS Positive Response Command of a Process Data Write PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 175 238
134. FSPMS_PACKE SET_STAT_DIAG_REQ_T Packet Description structure PROFIBUS_FSPMS_ PACKET SET STAT DIAG REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 PB_ Destination Queue Handle FSPMS_QUE ulSre UINT32 0 0841 Source Queue Handle ulDestId UINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulsreId UINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 1 Packet Data Length in bytes ullId UINT32 24 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0452 PROF IBUS_FSPMS_CMD_SET_STAT_DIAG_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_SET_STAT DIAG REQ T fStatDiag BOOLEAN8 Static diagnostic flag Table 139 PROFIBUS_FSPMS_CMD_SET_STAT_DIAG_REQ Set Static Diagnostic Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013
135. Head PROHIBUS LE SP S_C1_ALARM_NOTIFICATION_CNF_T tData PROFIBUS_FSPMS PACKET _Cl_ALARM NOTIFICATION_CNEF_T Packet Description structure PROFIBUS_FSPMS_ PACKET _C1_ALARM NOTIFICATION_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 2 Packet Data Length in bytes ulId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0481 PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_CN F Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C1_ALARM NOTIFICATION_CNF_T bSlotNumber UINT8 0 254 Slot number of the object causing the alarm indicating the source of the alarm The allowed range here goes from 0 to 254 The value 255 is declared as reserved in the DPV1 norm description bAlarmType UINT8 0 127 Alarm type See below bSeqNr UINT8 0 31 Sequence number for the distinction of alarms that are active at the same time
136. ITIATE_IND RES_POS RES_NEG Indicating a Request to establish an acyclic Connection to a DP Master Class 2 indication page 160 MSAC2_ Abort service This service is used by the DP master class 2 in order to abort a DP V1 Class 2 connection to the DP slave The DP slave then receives an abort indication The DP slave may also request an abort of the class 2 connection by itself For instance this can be accomplished by sending the packet PROF IBUS_FSPMS_CMD_C2_INITIATE_IND RES_POS RES_NEG Indicating a Request to establish an acyclic Connection to a DP Master Class 2 page 160 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 64 238 5 5 2 4 Basic Services available after Establishing a DP V1 Class 2 Connection The following services are available after a DP V1 Class 2 connection has been set up successfully DS_ Read This service is suited for reading a data block from the specified index of the module specified by the choice of the slot of the specified API DS_Write This service is suited for writing a data block to the specified index of the module specified by the choice of the slot of the specified API DS_Transport This service is suited for reading and simultaneously writing a data block from the specified index of the module specified by the
137. L LR_UINT8 abNetworkAd dress 6 LR_UINT8 abMACAddress PROFIBUS_FSPMS_INITIATE_ADDR_T typedef struct PROFIBUS_FSPMS_C2_INITIATE_RES_POS_Ttag LR_UINT32 ulReference LR_UINT16 usMaxLenDataUnit struct LR_UINT16 biDPV1_RW 1 LR_UINT16 biReserved WSA tFeaturesSupported SLruUcCE LR_UINT16 biReserved RG tProfileFeaturesSupported LR_UINT16 usProfileIdentNumber TLR_BOOLEAN8 fSType LR_UINT8 bSLen TLR_BOOLEAN8 fDType LR_UINT8 bDLen LR_UINT8 abSAddrDAddr PROF IBUS_FSPMS_MAX _INITIATE_ADD_TABLE_SIZE PROFIBUS_FSPMS_C2_INITIATE_RES_POS_T define PROFIBUS_FSPMS_C2_INITIATE_RES_DATA_SIZE sizeof PROFIBUS_FSPMS_C2_INITIATE_RES_POS_T PROFIBUS_FSPMS_MAX INITIATE ADD TABLE SIZE Positive response packet of an acyclic DP Master Class 2 initialization typedef struct PROFIBUS_FSPMS_PACKET_C2_INITIATE_RES_POS_Ttag TLR_PACKET_HEADER_T tHead PROEPEBU Smt ob MsmC2ane Nien AVE RE om omelent Dichtecr PROFIBUS_FSPMS_PACKET_C2 INITIATE _RES POS _T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 165 238 structure PROFIBUS_FSPMS_ PACKET _C2_INITIATE_RES POS T Type Response Variable Type Value Range Description structure TLR_PACKET_ HEADER T
138. LR_E_PROFIBUS_DL_XC_INVALID The assigned XC Data Link Layer is not installed or has a pending error 0xC0060041 TLR_E PROFIBUS DL_BAUDRATE_INVALID The specified baudrate option is not supported and is out of range 0xC0060042 TLR_E PROFIBUS DL_GAP_UPDATE_INVALID The specified GAP update factor option is not supported and is out of range 1 100 0xC0060043 TLR_E PROFIBUS DL_DL_ADDR_INVALID The specified local Profibus address option is not supported and is out of range 0 125 0xC0060044 TLR_E PROFIBUS DL_RETRY_LIMIT The specified retry limit option is not supported and is zero 0xC0060045 TLR_E PROFIBUS _DL_HSA_INVALID The specified highest station address option is not supported and is out of range 0 126 0xC0060046 TLR_E PROFIBUS DL_NO_ BUS _PARAMETER_SET The service cannot be executed there are no bus parameter specified yet 0xC0060047 TLR_E_PROFIBUS_DL_DLE_NOT_RESPONDING The service has detected a timeout at the connected XC Data Link Layer entity 0xC0060048 TLR_E PROFIBUS DL_NO_DL_RESOURCE There are no further resource blocks available to execute the service within the connected XC Data Link Layer entity 0xC0060049 TLR_E_PROFIBUS_DL_FATAL_DL_RESOURCE There are no further resource blocks available to execute the service within the connected XC Data Link Layer entity 0xC0060052 TLR_E_PROFIBUS_DL_SLAVE_MODE Command could not be executed DL task is running at slave
139. MO_REQ command It is possible to unregister a previously registered slot index combination the variable ulUnregister must be set to 1 to unregister to 0 to register and to OXFFFFFFFF to unregister all IO Link calls If a registered IO Link Call is on an enabled I amp M slot index combination the I amp MO of that combination must set bit 0 of usTMSupported Packet Structure Reference typedef struct PROFIBUS_FSPMS_IOL_CALL_REGISTER_REO Ttag IR WANS 2 wIlSuleie LR_UINT32 ulIndex LR_UINT32 ulUnregister PROFIBUS _FSPMS_IOL CALL REGISTER _REQ_T typedef struct PROFIBUS_FSPMS_PACKET_IOL_CALL_REGISTER_REQ_ Ttag TLR_PACKET_HEADER_T tHead PROFIBUS _FSPMS_IOL CALL REGISTER REQ T tData PROFIBUS_FSPMS_ PACKET _IOL_CALL REGISTER_REQ_T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 207 238 structure PROFIBUS_FSPMS_ PACKET IOL_CALL_REGISTER_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_ HEADER T 0 DESE UINT32 0x20 PB_ Destination Queue Handle FSPMS_QUE ursre UINT32 0 27 1 Source Queue Handle ulDestId UINT32 u
140. MSO_CNF Confirmation Command of MSO Initialization Source Code Example void APS SInitMs0_cnf PROFIBUS_APS RSC_T FAR ptRsc PINOUP IIE WS MARSS PACKETMEREAR OEE Ke i1R_QUE_LINK_SET_NEW_D ptPckt gt tInitMsOCnf tData ulFSPMSOId TLR_POOL_PACKET_RELEAS PROFIBUS DP S DOC050401API15EN Revision 15 English 2013 09 Released Public lave Protocol API HS WIND HIN C cle cMisew1ls 1c MAD Sie ISIN t ILO AEON PERCRE Hilscher 2005 2013 The Application Interface 93 238 6 2 2 PROFIBUS_FSPMS_CMD INIT _MS1_ REQ CNF Initializing the MSAC1S State Machine The MSAC1S State machine controls the acyclic data transfer between the DP Master Class1 and the existing slave stack reference implementation This state machine within the FSPMS task has to be initialized first before any acyclic communication can be established to a DP Master Class 1 During this initialization the AP task and the FSPMS task have to exchange their end point identifier of the MS1 connection that shall be established between both The end point identifier is a 32 Bit value specified by each process in order to associate incoming and address outgoing packets to the correct communication end point The AP task has to specify its end point identifier in the ulSrctid of the initializing request packet In case of a successful initialization the FSPMS task uses this specified value in t
141. MSRM2S_SAP_DEACTIVATION_FAILED PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct TLR_UINI PROFIB TLR_UIN SEZ WELES US_FSPMS_ STATE r32 ulState 187 238 CHANG ED_IND_Ttag TLR_UINT32 ulReason PROFIBUS_FSPMS_ STATE _CHANGED_IND_T define PROFIBUS _FSPMS_STATE CHANGED _IND_DATA_ SIZE sizeof PROFIBUS_FSPMS_ STATE _CHANGED_IND_T typedef struct PROFIBUS_FSPMS_PACKET_STATE_CHANGED_IND_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_STATE_CHANGED_IND_T tData S_PACKET_STATE_CHANGED_IND_T PROFIBUS PSP Packet Description structure PROFIBUS_FSPMS PACKET STATE _CHANGED_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source end point ident
142. MS_CMD_IM_WRITE_IND I amp M Write Indication eccceeceeeeeeeneeeeeeeteneeseeeteeeeeaeereas 204 Table 151 PROFIBUS_FSPMS_CMD_IM_WRITE_RES I amp M Write Response ceeceeeeeeeeeeeeeeeeteneeeeaeeteaeeeeaeeneas 205 Table 152 PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_REQ Register IO Link Call Request ceeeeee 207 Table 153 PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_CNF Confirmation to Register IO Link Call Request 208 Table 154 PROFIBUS_FSPMS_ACYCLIC_INFO_HEADER_T StrucCture ec cecceeesceseseeeseeeceeeeeeaeeseaeeseaeeseaeeseaeeteaeeseaeensas 209 Table 155 PROFIBUS_FSPMS_CALL_HEADER_T Structure ccessccsscecsececeseeeseneseseeceaneneaeeseaneneaeensaneneaeessaneneneetennenene 209 Table 156 PROFIBUS_FSPMS_IOL_HEADER_T Structure 00 0 cece eeceeeeeeeeneeeeneeeeneeeeaeeeeeeeeeaeeeeaeeeeaeeeeaeeeeaeeeeneeseeeenaas 209 Table 157 PROFIBUS_FSPMS_CMD_IOL_CALL_IND IO Link Call Indication t ccceeeeeeeeeeeeeeeeeeeeeeeeeteeeseeeras 212 Table 158 tSwitchValue Structure of Switch Value Set ceeeececeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaeeeeeeeseaeeeeeeessaeeseeeesiaeeteeeete 217 Table 159 RCX_SET_HW_SWITCH_VALUES_REQ_T Set Hardware Switch Values Request csceeeseeeseeeeteetens 218 Table 160 RCX_SET_HW_SWITCH_VALUES_CNF Confirmation to Set Hardware Switch Values Request 219 Table 161 Error Messages of the FSPMS Task cccccsccccssecceeseneeeesenneeeeeeaeeeeseneee
143. OF IBUS_FSPMS_CMD_INIT_MS1_REQ Request Command for MS1 Initialization for a DP Master Class 1 read For more information see section Acyclic Data Transfer of the DP Master Class 1 on page 61 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 147 238 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_Cl1_WRITE_IND_Ttag LR_UIN LR_UIN 8 bSlotNumber 8 bIndex LR_UINT8 bLength LR_UINT8 abData PROFIBUS_FSPMS_MAX_WRIT E_DATA_SIZE Pee ROE EBU Sito EMOm Giss Wiki ENDA define PROFIBUS_FSPMS_C1_W PROF IBUS_FSPMS_MAX WRITE_DA RITE_IND_SIZE TA_ SIZE typedef struct PROFIBUS_FSPMS_PACK sizeof PROF IBUS_FSPMS_C1_WRITE_IND_T ET _ i_WRITE_IND Treag TLR_PACKET_HEADER_T tHead PINOM ILEUS JES 12S CAL_ NRUC eg _ IED It ieiDeNie ete PROFIBUS_FSPMS_ PACKET_C1_WRITE_IND_T Packet Description structure PROFIBUS_FSPMS_ PACKET _C1_WRITE_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPM
144. OFIBUS_FSPMS_CMD NEW_OUTPUT_IND Indicating the Reception of new cyclic Output Data This service indicates the AP task that new output data is available The service will be received usually once each DP Master main cycle The indication packet itself requires no response packet to be built by the AP task Using just the Macro TLR_QUE_RETURNPACKET will return the packet back to the FSPMS task context In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapmsortd value of the request packet referenced in Table 69 PROF IBUS_FSPMS_CMD_INIT_MSO_REQ Request Command for MSO Initialization A flag named fClearF lag indicates if set to TLR_FALSE 0 that the DP Master that has sent the output data is in the state OPERATE If the flag is set to TLR_TRUE 1 the DP Master is in the state CLEAR and the AP task should set its application output data to a safe state This indication can be deactivated i e it can no longer occur if you send a PROF IBUS_FSPMS_CMD_IND_SETTING_REQ packet to the FSPMS task with a value of fOutputIndDeact equal 1 However the indication will again be activated if you send a PROF IBUS_FSPMS_CMD_IND_SETTING_REQ packet to the FSPMS task with a value of fOutputIndDeact equal 0 For more information on cyclic data transfer see section Cyclic Data Transfer Note Use this packet only when working with
145. ONFIG_DBM_INVALID Database is invalid 0xC01D0005L TLR_E PROFIBUS _APS_CONFIG_MODULE_LENGTH Table 165 Error Messages of the APS Task PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 230 238 7 3 1 Diagnostic Codes of the APS Task Hexadecimal Value Definition Description 0x00000000 TLR_S OK Status ok 0xC01D0001 TLR_DIAG_E_PROFIBUS_APS_ NO _MS0O_PACKET Getting a packet from the pool to initialize the Slave s cyclic state machine failed 0xC01D0002 TLR_DIAG_E_PROFIBUS_APS_NO_MS1_PACKET Getting a packet from the pool to initialize the Slave acyclic Master Class 1 state machine failed 0xC01D0003 TLR_DIAG_E_PROFIBUS_APS_NO_MS2_PACKET Getting a packet from the pool to initialize the Slave acyclic Master Class 2 state machine failed 0xC01D0004 TLR_DIAG_E_ PROFIBUS APS NO SLAVE_DIAG_ PACKET Getting a packet from the pool to send a Slave Diagnostic request failed 0xC01D0005 TLR_DIAG_E_PROFIBUS_APS NO _SET_CFG_PACKET Getting a packet from the pool to set the new configuration data failed 0xC01D0006 TLR_DIAG_E_ PROFIBUS APS NO CHECK_USER_PRM_RESULT_PACKET Getting a packet from the pool to send back the user parameter checking result failed 0xC01D0007 TLR_DIAG_E_PROFIBUS_APS_NO_CHECK_EXT_USER_PRM_RESULT_PACKET Getting a packet from the pool to send back
146. Ox Secicccss cec esse ex cages ces seexeey seeds wey selga cesses eu EEEN a EEEE E E EE SAET e EERE sev cevetee esertdeees 27 Table 23 Common Status Structure Definition e r a a r aae e aa Aa r aaa e aa a a araea r aaa a 29 Table 24 Communication State Of CHAnge c cceecceeseceeseeeeseeeeeeeeeeeeeseeeeseeeesaeeeaeeeesaeeeseeessaeeeaeeesaaeseaeessaeeseaeessaeeseaeessaees 30 Table 25 Meaning of Communication Change of State Flags eccesesceseeeeeeneeeeeeeeeneeseeeeeeeseeeeseeeeeeessaeesaeeseeeseeeeeaees 31 Table 26 Meaning of Communication State ccccccccsscccceesneceeseeececeneeeeeceaeeeeseaeeceesaeeeescaeeeseeneeeesseeeesseaeeessneeeessieeeeea 32 Table 27 Meaning of Communication Channel Error ccccccccsesceceeseeeeeeeneeeeeeeneeceseaeeeeescneeeseneeeeeseaeeeesneeeeseeeeeeseneeeeee 32 Table 28 Meaning of Network failures irsinin ennenaikainen earar 32 Table 29 Version All Implementations tei eseeac Acerca aneeeee eed dedaarane ea eevee secede ce iubdiveds Spata anran Era Taaa 33 Table 30 Extended Status BIOCK EEE E E A AT 34 Table 31 Communication Control BIOCK ccceesseceeeeceeeeeeneeeceeneeeeceaeeeescueeeeneaaeeeseueeesscaeeesseaeeeseaeeeessneeeesseeeeesenseeeee 35 Table 32 Overview about essential Functionality Cyclic and acyclic Data Transfer and Alarm Handling ce0 36 Table 33 Meaning and allowed Values for Warmstart Paramete rs 2 cceeeceeeeeeeeeeeneeeeeeeeeee
147. P Master are acknowledged with fPrmOk FALSE and fCfgOk FALSE In this case the stack does not check the data This has the consequence that no communication is possible with a PROFIBUS DP Master Note Use this packet only when working with loadable firmware It has not been designed for usage in the context of linkable object modules Packet Structure Reference define PROFIBUS_APS_ MAX USER_PRM_DATA_SIZE BS 1 typedef struct PROFIBUS_APS_CHECK_USER_PRM_IND_Ttag TLR_UINT8 abUserPrmData PROFIBUS_APS_ MAX _USER_PRM_DATA_SIZE PROFIBUS _APS CHECK USER PRM _IND_T typedef struct PROFIBUS_APS_PACKET_CHECK_USER_PRM_IND_Ttag TLR_PACKET_HEADER tHead PROF TBUSTAP SE CHECK IUSHREPRMEINDET tbData IROOM INBIUIS NZS PVNCKds CHECK SVSEREERRMETNDE PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 76 238 The Application Interface Packet Description structure PROFIBUS_APS_PACKET_CHECK_USER_PRM_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final re
148. PI15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 72 238 structure PROFIBUS_APS_ PACKET _SET_CONFIGURATION_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 0x20 Destination Queue Handle of FSPMS task Process Queue PB_APS_QUE ulSre UINT32 0 2 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 1747 Packet data length in bytes nis the number of bytes according to Module Type and Size in increments of 2 see below ullId UINT32 0 2 1 Packet identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task ulcmd UINT32 0x3102 PROFIBUS_APS_SET_CONFIGURATION_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_APS_SET_CONFIGURATION_REQ T ulSystemFlags UINT32 System Flags BIT 0 AUTOSTART APPLICATION CONTROLLED 0 communication with a controller after a device start is allowed without
149. PMS_CMD_ABORT_CNF packet will then confirm that the connection has been aborted Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Packet Structure Reference typedef struct PROFIBUS_FSPMS_PACKET_ABORT_REQ Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_PACKET_ABORT_REQ_T Packet Description structure PROFIBUS_FSPMS_PACKET_ABORT_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 0x20 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 25 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSreId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 62 244 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0408 PROF IBUS_FSPMS_CMD_ABORT_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch
150. PPLICATION_READY_REQ CNF Declaring the Application ready for Duty 122 6 2 12 PROFIBUS_FSPMS_CMD_SET_SLAVE_ADD_IND Indicating the Reception of a Change Slave Address Request miraiet E E E E A O TE deen T 125 6 2 13 PROFIBUS_FSPMS_CMD_GLOBAL_CONTROL_IND Indicating a Global Control Command 127 6 2 14 PROFIBUS_FSPMS_CMD_CHECK_CFG_IND RES Indicating the Request for Validation of the assumed I O Configuration Dataenheten aseissa taoa eaei cei ddeon incase detainee eee ote 130 6 2 15 PROFIBUS_FSPMS_CMD_CHECK_USER_PRM_IND RES Indicating the Reception of new Parameter Data Sierras saeun e E S EE E E E adie E EAE a a 134 6 2 16 PROFIBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_IND RES Indicating new Extended Parameter Data EET EEE ETTET E TEET 138 6 2 17 PROFIBUS_FSPMS_CMD_C1_READ_IND RES_POS RES_NEG Indicating an acyclic read Request to a specific Process Data ODjeCt ceeccecesceeeeeeeeeeeeeeeeeeaeeseeeeseneeeeaeeseaeeseaeeseaeeseaeeseaeeteaeeeeeee 141 6 2 18 PROFIBUS_FSPMS_CMD_C1_WRITE_IND RES_POS RES_NEG Indicating an acyclic write Request to a specific Process Data ODjeCt eceeceecesceseeeeceeeeeeeeeeeaeeseeeeseaeeseaeeseaeeseaeeseaeeseaeeseeeseaeeeneeee 146 6 2 19 PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_REQ CNF Request Command for Alarm Notification 00 Bakes E E oxi E E tay cuties haste s euete aceasta Wad eee E 151 6 2 20 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_IND RES_POS R
151. RCX_COMM_CONNECTION_TIMEOUT CONNECTION TIMED OUT 0xC0000143 RCX_COMM_LONELY_NETWORK LONELY NETWORK 0xC0000144 RCX_COMM_DUPLICATE_NODE DUPLICATE NODE 0xC0000145 RCX_COMM_CABLE_DISCONNECT CABLE DISCONNECT Table 28 Meaning of Network failures PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 33 238 Version All Implementations The version field holds version of this structure It starts with one zero is not defined Value Definition Description 0x0001 RCX_STATUS_BLOCK_VERSION STRUCTURE VERSION Table 29 Version All Implementations Watchdog Timeout All Implementations This field holds the configured watchdog timeout value in milliseconds The application may set its watchdog trigger interval accordingly If the application fails to copy the value from the host watchdog location to the device watchdog location the protocol stack will interrupt all network connections immediately regardless of their current state For details see section 4 13 of the netX DPM Interface Manual Host Watchdog All Implementations The protocol stack supervises the host system using the watchdog function If the application fails to copy the value from the device watchdog location section 3 2 5 of the netX DPM Interface Manual to the host watchdog location section 3 2 4 of the netX DPM Interface Manual the protocol stack assume
152. ROFIBUS_FSPMS_PACKET_SET_CFG_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 O24 Packet Identification untouched ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x042F PROF IBUS_FSPMS_CMD_SET_CFG_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 x Routing do not touch Table 79 PROFIBUS_FSPMS_CMD_SET_CFG_CNF Confirmation Command of setting the configuration data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 108 238 6 2 6 PROFIBUS_FSPMS_CMD SET _SLAVE_DIAG_ REQ CNF Transmitting Diagnostic Data This service has to be used by the AP task in order to pass diagnostic information data to the underlying MSCY1S state machine In order to address the correct end point identifier the request command service has to be used in conjunction with the received ulrspmsotd value of the confirmation packet referenced in Table 70 PROF IBUS_FSPMS_CMD_INIT_MSO_CNF Confirmation Command of MSO Initialization The macro TLR_QUE_SEND_PACKET_
153. R_HAND i hinpueTriB PROFIBUS Hoe MOM iN bine S One Nigel typedef struc Handle to the FSPMS end point EPROP TBUSEHSEMSmPACKEH Tan tN iat EMS ORCNE A Rheacq TLR_PACKET HEADER_T tHead PROF IBUS_FSF Pp S NT MSO CNH Ae cuir PROFIBUS_FS PMS_PACKET_INIT_MS0_CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET INIT_MSO_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 0 Source end point identifier untouched ulLen UINT32 4 sizeof PROFIBUS_FSPMS_INIT_MSO_CNF_T Packet Data Length in bytes ulld UINT32 0 2285 Packet Identification untouched ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulcmd UINT32 0x0403 PROF IBUS_FSPMS_CMD_INIT_MSO_CNF Command ulExt UINT32 0 Extension untouched ulDest UINT32 x Routing do not touch structure PROFIBUS_FSPMS_INIT_MSO_CNF_T ulFSPMSOId UINT32 Reference to locally generated reference end point of the FSPMS task for the MSO context hOutputTriB HANDLE Handle for output area hInputTriB HANDLE Handle for input area Table 70 PROFIBUS_FSPMS_CMD_INIT_
154. R_UINT8 abCfgData PROFIBUS_APS_MAX_CFG_DATA_SIZE Configuration data that needs to be checked PROFIBUS_APS_ CHECK _CFG_IND_T typedef struct PROFIBUS_APS_PACKET _CHECK_CFG_IND_Ttag TLR_PACKET_HEADER tHead PROFIBUS TAPS CHECK ICHGTINDET EData INO INBIUIS MNES IPACISa CHECE late ILINID _ PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 79 238 structure PROFIBUS_APS_ PACKET _CHECK_CFG_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 244 Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task ulCmd UINT32 0x3106 PROF IBUS_APS_CHECK_CFG_IND Command ulExt UINT32 0 Extension not in use set
155. Rsc TLR_DIAG _ PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public ptPck gt tGetOutpDataReq tHead ulLen 0 CjOUNE seve BINCIPINIEIUIS IN2S _IRS C_ IP IEUNIR PERSE TLR_S_OK SET_PACKET_SRC ptPck ptRsc gt tLoc tMscyls tLnkSrc ET FIFO ptRsc gt tLoc tMscyls tLnkDst ptPck TLR_INFINITE PROM AUSIOKS TARS ANONCI EOUNMNPUTSPRACKESIII Hilscher 2005 2013 The Application Interface Packet Structure Reference 117 238 define PROFIBUS_FSPMS_MAX OUTPUT_DATA_SIZE 244 typeder struct PROF IBUS_FSPMS_GET_OUTPUT_CNF_Ttag TLR_BOOLEANS8 fClearFlag TLR_BOOLEANS8 fNewFlag TLR_UINT8 abOutputData PROFIBUS_FSPMS_MAX OUTPUT_DATA_SIZE PROFIBUS_FSPMS_GET_OUTPUT_CNF_T define PROFIBUS_FSPMS_GET_OUTPUT_CNF_SIZE sizeof PROFIBUS_FSPMS_GET_OUTPUT_CNF_T PROF IBUS_FSPMS_MAX_OUTPUT_DATA_SIZE typedef t struct PROFIBUS_FSPMS_PACKET_GET_OUTPUT_CNF_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_GET_OUTPUT_CNF_T tData PROFIBUS_FSPMS_PACKET GET _OUTPUT_CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET GET _OUTPUT_CNF_T Type
156. S 1d Destination end point identifier specifying the final receiver ulAPMS2ld of the packet within the Destination Process ulSrcId UINT32 ulFSPMS1 ld Source end point identifier specifying the origin of the ulFSPMS2lId packet inside the Source Process ulLen UINT32 3 PROF IBUS_FSPMS_C1_WRITE_IND_IND_SIZE n n number of bytes in write data block abData Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the source process of the packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0486 PROFIBUS_FSPMS_CMD_C1_WRITE_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C1l_WRITE_IND_T bSlotNumber UINT8 0 254 Slot number of the Process Data object to be written bIndex UINT8 0 254 Index of the Process Data object to be written bLength UINT8 N n Number of bytes to be written into the specified Process Data object abData UINT8 Process Data object data that shall be written Table 104 PROFIBUS_FSPMS_CMD_C1_WRITE_IND Indication Command of a Process Data Write Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 148 238 The PROFIBUS_FSPMS_CMD_C1_WRITE_RES service has to be used by the AP task in order to confirm a
157. S Application Change Of State State Of The Application Program INITIALIZATION LOCK CONFIGURATION 0x000C UINT32 ulDeviceWatchdog Device Watchdog Host System Writes Protocol Stack Reads Table 31 Communication Control Block Communication Control Block Structure typedef struct NETX_CONTROL_BLOCK_Ttag UINT32 ulApplicationCOSs UINT32 ulDeviceWatchdog NETX_CONTROL_BLOCK_T For more information concerning the Control Block please refer to the netX DPM Interface Manual PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Getting started Configuration 36 238 4 Getting started Configuration This chapter gives an overview where to find some important information for starters and it explains the parameters of the PROFIBUS DP Slave firmware and the different ways how you can set them 4 1 Overview about Essential Functionality You can find the most commonly used functionality of the PROFIBUS DP slave protocol API within the following sections of this document Topic Section No Section Name Set Configuration 6 1 1 PROFIBUS_APS_SET_CONFIGURATION_REQ CNF Set Configuration Parameters Cyclic data 5 4 Cyclic Data Transfer transfer Input Output
158. S Task ulCmd UINT32 0x044F PROFIBUS_FSPMS_CMD_RESET_CNF_SIZE Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 88 PROFIBUS_FSPMS_CMD_RESET_CNF_SIZE Confirmation for resetting the Slave PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 122 238 6 2 11 PROFIBUS_FSPMS_CMD APPLICATION _READY_REQ CNF Declaring the Application ready for Duty This service has to be used by the AP task to indicate its readiness for the incoming I O communication As long as the service has not been sent once by the AP task the DP Slave Stack reports Station Not Ready in its diagnostic data and the DP Master will not be able to perform any I O exchange with the slave On the other hand it is allowed to request the service multiple times In order to address the correct end point identifier the request command service has to be used in conjunction with the received ulrspmsotd value of the confirmation packet referenced in Table 70 PROF IBUS_FSPMS_CMD_INIT_MSO_CNF Confirmation Command of MSO Initialization The Macro TLR_QUE_SEND_PACKET_FIFO has to be used to send the packet to the FSPMS task Process Queue The service itself is rejected by the FSPMS as long as no valid input process data has been handed over with the request comman
159. SE ptRsc gt tLoc tMscyls uInpDataLen ptRsc gt tLoc tMscyls uOutpDataLen TLR_QUE_RETURNPACKET ptPckt PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_CHECK_CFG_RES_Ttag LR_BOOLEANS8 f CfgOk LR_UINT8 bInputDataLen 133 238 LR_UINT8 bOu PIRQU IBIS Ia S12 tputDataLen SCI Cie IGS Ite typedef struct PROPLBUSm Hoe S_ PACKET GHE CKECE GRRE Salta ad ADER_T tHead ROELIBUS ESP Sm CHE Chas CE Canby Smelt ciel y WIR JVI IE Jel B B RORTBEUSSESE ORPA CKEIECHEG hen RGM RE Sal Packet Description structure PROFIBUS_FSPMS_PACKET_CHECK_CFG_RES_T Type Response Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle of FSPMS task Process Queue ulSre UINT32 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrc d UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet insi
160. SET_INPUT_REQ_T typede struct PROFIBUS_FSPMS_PACKET_SET_INPUT_REQ Ttag TLR_PACKET_HEADER_T tHead PROP BUSSE SPMSoMOr AINE URE OMS te Daca PROFIBUS_FSPMS_PACKET_SET_INPUT_REQ T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 113 238 structure PROFIBUS_FSPMS_ PACKET _SET_INPUT_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 0x20 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 25 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 n n number of bytes in the Input Data block abInputData Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x040C PROFIBUS_FSPMS_CMD_SET_INPUT_REQ Command ulExt
161. SPMS_CMD_REGISTER_DIAG_STRUCT_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_ REGISTER_DIAG STRUCT_REQ T pbDiagArea UINTS8 Area for diagnostic data ulLength UINT32 Length of diagnostic data Table 134 PROFIBUS_FSPMS_CMD_REGISTER_DIAG_STRUCT_REQ Request for Registration of Diagnostic Structure PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference define PROFIBUS_FSPMS_REGISTE sizeof PROFIBUS_FSPMS_REGISTER_DIAG_ST Packet Description typedef struct PROFIBUS_FSP PROFIBUS _FSPMS_REGIST typedef struct PROFIBUS_FSP TLR_PACK ER_DIAG_ STRUCT S REGIS 2D 189 238 ERE DLAGSSTRUCTACNH SA heag _CNF_T REDMAGCESTRUCTLCNERS LAH 0 RUCT_CNF_T As SU PACKE TARE G lS ET HE ADER_T tHead PROFIB PROFIBUS _FSPMS US_ESPEMS RE PACKET_REGIST GIST BIR DIVE SS IVRWIC MW CINI I te DAT HRODIAG STRUCT_CNE_Teag ay EREDTACSSNRUCIECNEAI structure PROFIBUS_FSPMS_PACKET REGISTER_DIAG_STRUCT_CNF_T Type Confirmation
162. S_FSPMS_C2_INI typedef struct PROFIBUS_FSP INITIATE_ADD_TABLE 234 SS TAE Ssi DDR_T 1 TSF 16 usProfileIdentNumber 8 abSAddrDAddr PROFIBUS_FSPMS_MAX_INITIATE_ADD_TABLE_ E IND _T IA IA E_IND_T TLR_PACKET_HE ADER_T tHead r ERORTBUSSESEMS SCZ TN ENAN PROFIBUS_FSPMS_PACKET_C2_INITIATE_IND_T PROFIBUS DP Slave Protocol API E END T EDAC E_IND DATA SIZE IATE_ADDR_Ttag F_IND_Ttag PROFIBUS _FSPMS_MAX_INITIATI S_J2YNGIIa I C2 JUNIE INILieh_ ACINID _ieevey if DOC050401API15EN Revision 15 English 2013 09 Released Public E ADD TABLE OTA E Hilscher 2005 2013 The Application Interface 162 238 Packet Description structure PROFIBUS_FSPMS_PACKET_C2_INITIATE_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle of AP Task Process Queue ulSre UINT32 Source Queue Handle of FSPMS Task Process Queue ulDestId UINT32 ulAPMS2Id Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrclId UINT32 ulFSPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 10 n PROFIBUS_FSPMS_INITIATE_IND_DATA_SIZE n number of bytes in So
163. TION_REQ CNF Request Command for Alarm Notification Alarm 6 2 20 PROFIBUS_FSPMS_CMD_C1_ALARM ACK_IND Indicating an Alarm Acknowledge Request Table 32 Overview about essential Functionality Cyclic and acyclic Data Transfer and Alarm Handling PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Getting started Configuration 37 238 4 2 Configuration Procedures The following ways are available to configure the Profibus DP Slave By set configuration packet By SYCON net for details see according SYCON net documentation By netX configuration and diagnostic utility for details see according documentation of the utility 4 2 1 Using a Packet In order to send the set configuration parameters to the interface and to perform a warmstart subsequently the PROFIBUS APS SET CONFIGURATION REQ packet can be sent to the protocol stack For more information how to accomplish this please refer to section 6 1 1 PROFIBUS_APS_SET_CONFIGURATION_REQ CNF Set Configuration Parameters on page 71 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Getting started Configuration 4 3 Warmstart Parameters The following table contains relevant information about the warmstart parameters for the PROFIBUS DP Slave firmware such as an explanation of the meaning
164. TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_C2_DATA_TRANSPORT_RES_NEG_T tData PROFIBUS_FSPMS PACKET _C2_DATA_TRANSPORT_RES NEG T Packet Description structure PROFIBUS_FSPMS_ PACKET C2_DATA_TRANSPORT_RES NEG T Type Response Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle of FSPMS Task Process Queue ulSre UINT32 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulFSPMS2ld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMS2Id Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 7 sizeof PROFIBUS_FSPMS_C2_DATA_TRANSPORT_RES _NEG_T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 TLR_E_ FAIL See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04A9 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_ DATA _TRANSPORT_RES NEG T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bErrorDecode UINT8 See section Error decode value clas
165. T_DATA_SIZE typedef struct PROFIBUS_FSPMS_C2_DATA_TRANSPORT_RES_POS_Ttag LR_UINT32 ulReference LR_UINT8 bSlotNumber LR_UINT8 bIndex LR_UINT8 bLength LR_UINT8 abData PROFIBUS_FSPMS_MAX_DATA_1 PROFIBUS_FSPMS_C2_ DATA TRANSPORT_RES_POS_ Positive respons packet of an acyclic read command typedef struct PROFIBUS_FSPMS_PACKET_C2_DATA_TRANSPORT_RES_POS_Ttag WILIR JVC IS Ie elle ADER_T tHead PROEPLIBUSSE SP S_C2_DATA_TRANSPORT_RI TS POS Al iclDyscelp PROFIBUS_FSPMS PACKET _C2_ DATA _TRANSPORT_RES POS _T Packet Description structure PROFIBUS_FSPMS_ PACKET C2_DATA_TRANSPORT_RES POS _ T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS Task Process Queue ulSre UINT32 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulFSPMS2ld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 7 n PROFIBUS_FSPMS_C2_DATA_TRANSPORT_RES_POS_SI ZE n number of bytes in data transport data block extended abData Packet Data Length in bytes ulId UINT32 0 25 1 Packet Identification as unique number gene
166. T_MS2_ REQ T Packet Description structure PROFIBUS_FSPMS_ PACKET _INIT_MS2_ REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 PB_FSPMS_QUE Destination Queue Handle of FSPMS Task Process Queue ulSre UINT32 0 23 1 Source Queue Handle of AP Task Process Queue ulDestId UINT32 0 Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCcmd UINT32 0x0406 PROFIBUS_FSPMS_CMD_INIT_MS2_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch Table 74 PROFIBUS_FSPMS_CMD_INIT_MS2_REQ Request Command for MS2 Initialization PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 100 238 Source Code Example void APS _STInitMs2_req PROFIBUS_APS_RSC_T FAR ptRsc PINOMW ILEUS TAES I
167. UI 6 usIMSupported j IEPISIPIMIS _IOM 0 _ 05 typedef struct FSPMS_IM Ttag I SIPIMIS IMG Are IMs TLR_BOOLEAN fProfSpecSupp TLR_BOOLEAN fManuSpecSupp TLR_UINT32 ulSlotsNotZeroSupp SES2IMIS IML are typedef struct PROFIBUS_FSPMS_PACKE TLR_PACKE HEADER_T tHead ESEMS IML Ik E Data PROFIBUS_FSPMS_PACKET_SET_IMO_REQ T n ET _IMO_REQ Ttag PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 198 238 structure PROFIBUS_FSPMS_ PACKET _SET_IMO_ REQ T Type Request Variable Type Value Description Range structure TLR_PACKET_HEADER_T ulbest UINT32 0x20 PB_ Destination Queue Handle FSPMS_QUE ulsre UINT32 OL 27 1 Source Queue Handle ates ee VINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSreid VINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 Packet Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Erro
168. UIRED NEW CONFIG AVAILABLE CONFIG LOCKED 0x0014 UINT32 ulCommunicationState Communication State NOT CONFIGURED STOP IDLE OPERATE 0x0018 UINT32 ulCommunicationError Communication Error Unique Error Number According to Protocol Stack 0x001C UINT16 usVersion Version Version Number of this Diagnosis Structure 0x001E UINT16 usWatchdogTime Watchdog Timeout Configured Watchdog Time 0x0020 UINT16 usHandshakeMode Handshake Mode Process Data Transfer Mode see netX DPM Interface Manual 0x0022 UINT16 usReserved peace Set to 0 0x0024 UINT32 ulHostWatchdog Host Watchdog Joint Supervision Mechanism Protocol Stack Writes Host System Reads 0x0028 UINT32 ulErrorCount Error Count Total Number of Detected Error Since Power Up or Reset 0x002C UINT32 ulErrorLogind Error Log Indicator Total Number Of Entries In The Error Log Structure not supported yet 0x0030 UINT32 ulReserved 2 Reserved Set to 0 Table 23 Common Status Structure Definition PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 30 238 Common Status Block Structure Reference typedef struct NETX_COMMON_STATUS_BLOCK_Ttag UINT32 ulCommunicationCOS UINT32 ulCommunicationState UINT32 ulCommunicationError UINT16 usVersion UINT16 usWatchdogTime UINT16 ausReserved
169. US_FSPMS_C1_ALARM_ACK_IND_T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0482 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C1_ALARM ACK IND T bSlotNumber UINT8 0 254 Slot number of the object causing the alarm indicating the source of the alarm The allowed range here goes from 0 to 254 The value 255 is declared as reserved in the DPV1 norm description bAlarmType UINT8 0 127 Alarm type See below bSeqNr UINT8 0 31 Sequence number for the distinction of alarms that are active at the same time Table 110 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_IND Indication Command of an Alarm bAlarm_Type identifies the alarm type The coding of the alarm type is explained in the table below Alarm_Type Alarm_Type value explanation 0 reserved 1 Diagnostic_Alarm 2 Process Alarm 3 Pull_Alarm 4 Plug_Alarm 5 Status_ Alarm 6 Update_Alarm 7 31 reserved 32 126 manufacturer specific 127 reserved Table 111 PROFIBUS DPV1 Possible Alarm Types PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interfa
170. VNCIXIG IE I joel if TLR_POOL_PACKET_GET ptRsc gt tLoc hPool amp ptPck TLR_S_OK ptPck gt tInitMs2Req tHead ulCmd PROFIBUS_FSPMS_CMD_INIT_MS2_REQ TLR_QUE_LINK_SET_PACKET_SRC ptPck ptRsc gt tLoc tMsac2s tLnkSrc ptPck gt tInitMs2Req tHead ulLen sizeof PROFIBUS_FSPMS_INIT_MS2_REQ_T TLR_QUE_SENDPACKET_FIFO ptRsc gt tLoc tMscyls tLnkDst ptPck TLR_INFINITE else ProfibusApsFaultind ptRsc TLR_DIAG_E_PROFIBUS_APS_NO_MS2_PACKET PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 101 238 Packet Structure Reference typedef struct PROFIBUS_FSPMS_INIT_MS2_CNF_Ttag TIER OAON IE S EMS ZEE IDIOM ALES ISS AUN Ey MSZ CINfa ats typedef struct PROFIBUS_FSPMS_PACKET_INIT_MS2_CNF_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_INIT_MS2_CNF_T tData PROFIBUS_FSPMS_PACKET_INIT_MS2_CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET_INIT_MS2_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMS2Id Destination e
171. Values Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 219 238 typedef struct RCX_SET_HW_SWITCH_VALUES_CNF_DATA_Ttag RCX_SET_HW_SWITCH_VALUES_CNF_DATA_T typedef RCX_SET_HW_SWITCH_VALUES_CNF_Ttag TLR_PACKET_HEADER_T RCX_SET_HW_SWITCH_VALUES_CNF_DATA_T RCX_SET_HW_SWITCH_ VALUES _CNE_T tHead tData packet header packet data define RCX_SET_HW_SWITCH_VALUES_CNF_PACK ae SL ae sizeof RCX_SE HW_SWITCH_VALUES_CNF_T Packet Description structure RCX_SET_HW_SWITCH_VALUE_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle do not touch ulSre UINT32 Source Queue Handle do not touch ulDestId UINT32 0 Destination End Point Identifier Not in use set to zero for compatibility reasons ulSrcId UINT32 0 2 1 Source End Point Identifier do not touch ulLen UINT32 0 Packet data length in bytes ulId UINT32 0 2 1 Packet identification untouched ulSta UINT32 Error code Either TLR_S_OK or TLR_E_FAIL ulCmd UINT32 RCX_SET_HW_SWITCH_VALUES_CNF Command ulExt UINT32 0 Extension untouch
172. X CFG_DATA_SIZE j IPIROW INES _N2 S _ Cin Cine eiNiia_ are typedef struct PROFIBUS_APS_PACKET_GET_CFG_CNF_Ttag TLR_PACKET_HEADER tHead PINOWALS US INES Ela CG CiNis_ Ie se IDyehevelp PROFIBUS APS PACKE T GET_CEG_CNE_T Packet Description structure PROFIBUS_APS_ PACKET _GET_CFG_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 244 Packet Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task ulCmd UINT32 0x310B PROFIBUS_APS_GET_CFG_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch structure PROFIBUS_APS_GET_CFG_CNF_T abCfgData PROFIB UINT8 Configuration data US_APS_MAX_CFG_D ATA_SIZE Table 66 PROFIBUS_APS_GET_CFG_CNF Conf
173. Y Get HW switch values No modify configuration Configure stack Figure 10 Flow Diagram of Start up Process PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 217 238 6 3 1 RCX SET HW SWITCH VALUES REQ CNE Set the values of the Hardware Switch If the Host application needs to change or set the hardware switch value the RCX_SET_HW_SWITCH_VALUES_REQ packet shall be used to transmit the values to the stack These values can be a new station address or a new baud rate setting for instance In this case it is necessary that the device has already received a default configuration and is waiting for application ready or BUS _ON signal As soon application ready is set by the host application the device starts with the last received parameters This means that the hardware switch values shall be set before the application ready is set The data area of the packet contains the number of switches to service variable ulNumberOfSwitches and as many structures of type TLR_SWITCH_VALUE_T describing a single switch as corresponds to the number of switches i e the content of variable ulNumberOfSwitches The structure contains a string uniquely identifying the described switch and the switch value i e the value set on the respective hardware switch It looks like structure tSwitchValue Type
174. _ PACKET GET_OUTPUT_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 0x20 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 25 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 0 2 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x040A PROFIBUS_FSPMS_CMD_GET_OUTPUT_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 84 PROFIBUS_FSPMS_CMD_GET_OUTPUT_REQ Request Command for getting Output Data Source Code Example void APS _Get_Ou PROPER U om Ar om LE TER POC PACKE TLR_QU FE LIN K I CK PACKET_GET ptRsc gt tLoc hPool amp ptPck ptPck gt tGetOutpDataReq tHead ulCmd PROFIBUS_FSPMS_CMD_GET_OUTPUT_REQ TLR_QUE SENDPACK else ProfibusApsFaultind pt
175. _CHECK_USER_PRM_IND_T tData PROFIBUS_FSPMS_PACKET_CHECK_USER_PRM_IND_T Packet Description structure PROFIBUS_FSPMS_PACKET CHECK_USER_PRM_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulFSPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 n n number of bytes in User Parameter Data block abUserPrmData Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0416 PROFIBUS_FSPMS_CMD_CHECK_USER_PRM_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_CHECK_USER_PRM_IND_T abUserPrmData UINT8 Parameter data to be validated and accepted Table 97 PROFIBUS_FSPMS_CMD_CHECK_USER_PRM_IND PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Indication Command of Parameter Data Hilscher 2005 2013 The Application Int
176. _D ptPckt gt tInitMs1Cnf R_POOL_PACKE AL mE EAS PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public TSIM Heirsc tData ulFSPMS11d HEILOS WieMISaCiL SC hiED SE By DIEING troer NEOOIMPERCK EIE Hilscher 2005 2013 The Application Interface 98 238 6 2 3 PROFIBUS_FSPMS_CMD INIT _MS2_REQ CNF Initializing the MSAC2S State Machine The MSAC2S State machine is responsible for the acyclic data transfer between the DP Master Class 2 and the existing slave Stack reference implementation This state machine within the FSPMS Task has to be initialized first before any acyclic communication can be established to a DP Master Class 2 During this initialization the AP Task and the FSPMS Task have to exchange their end point identifier of the MS2 connection that shall be established between both The end point identifier is a 32 Bit value specified by each Process in order to associate incoming and address outgoing packets to the right Communication End Point The AP Task has to specify its end point identifier in the ulSrcId of the initializing request Packet In the event of a successful Initialization the FSPMS Task uses this specified value in the ulSrcid variable of each Confirmation Packet and in the ulDestId variable for Indication Packets sent to the AP Task context from now on This covers packets like they are used for read
177. _DATAEXCHANGE_PACKET Getting a packet from the pool to update the slaves data exchange buffer data failed no Data Exchange update can be driven 0xC009000D TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_DIAG_PACKET Getting a packet from the pool to update the slaves diagnostic data failed no slave diag update can be driven O0xC009000E TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_CFG_PACKET Getting a packet from the pool to update the slaves configuration data failed no slave configuration update can be driven 0xC009000F TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_RDINPUT_PACKET Getting a packet from the pool to update the slaves input data failed no slave input update can be driven 0xC0090010 TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_SETVALUE_FAILED_PACKET Setting a specific Data Link value failed value has not been set 0xC009001 1 TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_REPLY_UPDATE_FAILED_PACKET Updating a specific reply buffer failed buffer has not been updated 0xC0090012 TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_PRM_IND_PACKET Getting a packet from the pool to send the received Slave Parameter Data to the application failed service cannot be performed 0xC0090013 TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_CFG_IND_PACKET Getting a packet from the pool to send the received Slave Configuration Data to the application failed service cannot be performed 0xC0090014 TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_SLAVE_AD
178. _GET_OUTPUT_POWER_ON along with the confirmation packet You will then have to initialize the slave in order to be able to get new output data If you try to get new output data while the slave state is WAIT PRM you will receive an error code TLR_E_PROFIBUS_FSPMS_GET_OUTPUT_WAIT_PRM along with the confirmation packet You will then have to parameterize and configure the slave in order to be able to get new output data If you try to get new output data while the slave state is WAIT CFG you will receive an error code TLR_E_PROFIBUS_FSPMS_GET_OUTPUT_WAIT_CFG along with the confirmation packet You will then have to configure the slave in order to be able to get new output data If you try to get new output data while no new output data are available you will receive an error code TLR_E_PROFIBUS_FSPMS_GET _OUTPUT_NOT_PEND along with the confirmation packet You will then have to wait until a new output cycle has been performed PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_PACKET_GET_OUTPUT_REQ Ttag TLR_PACK 116 238 ET HE AD ER_T tHead PROFIBUS_FSPMS_PACKET_GET_OUTPUT_REQ_ T Packet Description structure PROFIBUS_FSPMS
179. _REPLYUPDATE_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_NO_RSAP_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_REPLY_UPDATE_CONFIRMATION TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_REPLY_UPDATE_ERROR TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_RSAP_ACTIVATION_DENIED TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_SAP_DEACTIVATION_FAILED TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_SET_SLAVE_DIAG_FAILED TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_STATE_CONFLICT_AA_SRES TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_STATE_CONFLICT_VS_SRES TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_STATE_CONFLICT_VS_SRES_IND TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_STATE_CONFLICT_VS_WRES TLR_DIAG_E_PROFIBUS_FSPMS_MSAC2S_NO_RSAP_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSAC2S_REPLY_UPDATE_FAILED_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSAC2S_RSAP_ACTIVATION_DENIED TLR_DIAG_E_PROFIBUS_FSPMS_MSAC2S_SAP_DEACTIVATION_FAILED TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_CFG_IND_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_DL_ADD_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_GLOBAL_CONTROL_IND_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_MINTSDR_PACKE TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_NEW_OUTP_IND_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_PRM_IND_PACKE TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_NO_SLAVE_ADD_CHG_IND_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_RETURN_PACKET_FAILED TLR_DIAG_E_PROFIBUS_FSPMS_MSCY1S_SEND_PACKET_FAILED TLR_DIAG_E_PROFIBUS_FSPMS_MSRM2S_FAIL_SAP_CLOSED TLR_DIAG_E_PROFIBUS_FSPMS_MSRM2S_REPLY_UPDATE_FAILED_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSRM2S_RSAP_ACTIVATION_DENIED TLR_DIAG_E_PROFIBUS_FSPMS_
180. _S_OK Negative response A negative response is issued whenever the indicated request cannot be satisfied by the AP Task 3 variables are specifying the type and source of the error in this event For an explanation of the 3 error variables bErrorDecode bErrorCodel and bErrorCode2 refer to section 5 5 1 2 Error Handling ulSta TLR_E_FAIL not 0 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference define PROFIBUS_FSPMS_C2_W Positiv RE RESAROSESIZE Ker respons typedef struct PROFIBUS pac FSP of an 174 238 sizeof PROF IBUS_FSPMS_C2_WRITE RT Om Samly e acyclic read command S_eVNCIg C2 MRE IN RES SEOC ANIE MEREPACKEMERF AD ERS PRORMBUSSHESE S tHead 2_WRITE_R SOS _ Ir ielDieicety PROF IBUS_ESP S PACKET C2 WRITE RES _POSLT PROFIBUS_FSPMS_PACKET WRITE_RES_POS_T Packet Description structure PROFIBUS_FSPMS_ PACKET _C2_ WRITE_RES POS T Type Response Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle of
181. a 008 135 Table 98 PROFIBUS_FSPMS_CMD_CHECK_USER_PRM_RES Response to Indication Command of a Check Configuration PE A E E E A E A 137 Table 99 PROFIBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_IND Indication Command of Extended Parameter Data EE AE R E E E E A E A EE E E 139 Table 100 PROFIBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_RES Response to Indication Command of a Check Configuration PTE A AE E E tesbenersstestety 140 Table 101 PROFIBUS_FSPMS_CMD_C1_READ_IND Indication Command of a Process Data Read Request 142 Table 102 PROFIBUS_FSPMS_CMD_C1_READ_RES_POS Positive Response Command of a Process Data Read 144 Table 103 PROFIBUS_FSPMS_CMD_C1_READ_RES_NEG Negative Response Command of a Process Data Read 145 Table 104 PROFIBUS_FSPMS_CMD_C1_WRITE_IND Indication Command of a Process Data Write Request 147 Table 105 PROFIBUS_FSPMS_CMD_C1_WRITE_RES_POS Positive Response Command of a Process Data write 149 Table 106 PROFIBUS_FSPMS_CMD_C1_WRITE_RES_NEG Negative Response Command of a Process Data write 150 Table 107 PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_REQ Request Command for Alarm Notification 152 Table 108 PROFIBUS DPV1 Possible Alarm TyP s c ccceeseseeeeeeneeeeeeneeeeeeeneeeseaeeeeseaeeeeesaeeesenaeeeeseeeeeeenaeeerenaeees 153 Table 109 PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_CNF Request Command for Alarm Notification 154 Table 110 PROFI
182. a diagnostic block from the slave from which the indication originated This is done subsequently with the PROF IBUS_FSPMM_CMD_GET_SLAVE_DIAG_REQ packet which will be confirmed This section discusses the meaning of the diagnostic information delivered by the PROF IBUS_FSPMM_CMD_GET_SLAVE_DIAG_REQ CNE packets However the diagnostic features of PROFIBUS DP depend on the version VO or V1 While DP VO offers a standard diagnosis DP V1 provides extended diagnostic capabilities 5 3 1 1 Diagnostic Model of PROFIBUS DP VO The Diagnostic model of Profibus DP VO provides diagnostic messages consisting of 6 bytes denominated as octets in the Profibus standard of information on the cyclic data traffic The meaning of these octets is Octet 1 Station Status_1 Bin Description Meaning Cid D7 Master_Lock This bit indicates that the slave has been parameterized by another master so this master is not permitted to control the requested slave An operating slave always sets this bit to 0 Prm_Fault This bit indicates that the last received parameter telegram was defective or incorrect D5 Invalid_Slave_Response_ This bit indicates that the response of the slave was invalid or not plausible An operating slave always sets this bit to 0 D4 Not_Supported This bit indicates that an unknown command has been detected by the slave The requested command is n
183. a hilsclier COMPETENCE IN COMMUNICATION Protocol API PROFIBUS DP Slave V2 7 X X Hilscher Gesellschaft fur Systemautomation mbH www hilscher com DOC050401 API15EN Revision 15 English 2013 09 Released Public Introduction 2 238 Table of Contents 1 PONE CLI CUM oe aatce dtc cnrxntc stance E E E E A E E E 5 1 1 _ADOUE this DOCUMEN serorei renarena aE anka aAA AAEE EERE ANAD KEA KERRE EEE EREKE EEN 5 eE E e a E A E N EE A A E EE P AE E ETE 6 1 3 System Requirement ccccceceeeceeeeeeeeeeeeeeeeeeeeaeeeeaee scenes seas eseaaeegeeeeecaaeeseaaesgeaeeseaeeesaeeseaaeseeneeees 7 1 4 Intend d AUGICNCS ss vecscsictsnccadcccsdesessdaheaviueesevadcansseaessdshsatacustestahdasdadesdutetnes eledateeiastdabultadecdnatesbaliata 7 19 Technical Datars vescaisececeiaecescce cee neteh aventabnsevibesusdeuedasdssavesesteshehvcanitasemndatactaititebsadtesisnaesiedaannaans 8 1 6 Terms Abbreviations and Definitions cece cccccccccccceceeceeeceeeeeeeeeceseeeneneneeeseneneneneneeeneneneness 10 Vef FRETERENCOS N E E A P das IA IET IEA EI E EA A E deeaaieceesbaveiies 11 WB Legal Notesin naaninta ana aiaa aaa daca dh davaetebecastaddctetnadens 12 Aega COPYN ees e e a E a i 12 1 8 2 Important INOS wsicecsdaccsceniess ences cadesdasehenscepceaangeateraacteaeteet E eSEE A Eae asee eare dede SEENE E TEE Eaa esita 12 18 3 Exclusion of Ciabilitysier ene a E E E nine R EEN 13 LE EXDOM E bale saa ohadtadta adogeeesdl nes edb legda be
184. ace of the communication channel In detail it is responsible for the following Handling the communication channels DPM interface Process data exchange channel mailboxes Watchdog Provides Status and diagnostic Handling applications packets all packets described in Protocol Interface Manual Configuration packets Packet Routing Handling stacks indication packets Provide information about connection state Preparation of configuration data PROFIBUS FSPMS task The PROFIBUS FSPMS task is the main part of the Profibus Slave Stack The task is responsible for the following items Cyclic Communication Acyclic Communication DP V1 Class 1 Acyclic Communication DP V1 Class 2 Alarm handling Profibus DL task The Profibus DL task is responsible for the FDL services It provide the following items SAP handling Life List Data transmit services SDA SDN SRD PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 43 238 5 Overview 5 1 Classification of PROFIBUS DP Devices PROFIBUS DP Devices are classified due to their behaviour and their communication capabilities into DP Master Class 1 DP Master Class 2 DP Slave PROFIBUS DP Master Devices are able to control the data traffic on the bus A master may send messages without having to wait for special permission to do so if it has the token for bus access 5 1 1 DP Master Class 1 A DP Master C
185. add an offset of 0x0010 0x0020 or 0x0030 to the address values respectively Finally you can access the communication channel using the addresses you determined previously For more information how to do this please refer to the netX DPM Manual especially section 3 2 Communication Channel PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Fundamentals 21 238 2 4 Client Server Mechanism 2 4 1 Application as Client The host application may send request packets to the netX firmware at any time transition 1 gt 2 Depending on the protocol stack running on the netX parallel packets are not permitted see protocol specific manual for details The netX firmware sends a confirmation packet in return signaling success or failure transition 3 gt 4 while processing the request The host application has to register with the netX firmware in order to receive indication packets transition 5 gt 6 Depending on the protocol stack this is done either implicitly or explicitly if application wants to receive unsolicited DPV1 packets Details on when and how to register for certain events is described in the protocol specific manual Depending on the command code of the indication packet a response packet to the netX firmware may or may not be required transition 7 gt 8 Application netX o 4 7 Figure 4 Transition Chart
186. ag LR_UINT8 bNewSlaveAdd LR_UINT8 abRemSlaveData PROFIBUS_FSPMS_MAX_SE SLAVE_ADD_DATA_SIZE IRONS ISIS Seat SIA An NDID _IEINGB It s define PROFIBUS_FSPMS_SET_SLAVE_ADD_IND_SIZE sizeof PROF IBUS_FSPMS_SET_SLAVE_ADD_IND_T N PROEYTIBUSS SPMSoMAXSSE EES LAVEZADDSDATAL SEIZE typedef struct PROFIBUS_FSPMS_PACKET_SET_SLAVE_ADD_IND_T tag TLR_PACKET_HEADER_T tHead PROPIBUSSRSEMSm SHAT wADD MEN DI Daray PROFIBUS_FSPMS_PACKET_SET_SLAVE_ADD_IND_T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 126 238 structure PROFIBUS_FSPMS_PACKET SET SLAVE ADD _IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulFSPMSOld Source end point identifier specifying the origin of the packet inside the Source Process
187. ail de support hilscher com Subsidiaries China Hilscher Systemautomation Shanghai Co Ltd 200010 Shanghai Phone 86 0 21 6355 5161 E Mail info hilscher cn Support Phone 86 0 21 6355 5161 E Mail cn support hilscher com France Hilscher France S a r l 69500 Bron Phone 33 0 4 72 37 98 40 E Mail info hilscher fr Support Phone 33 0 4 72 37 98 40 E Mail fr support hilscher com India Hilscher India Pvt Ltd New Delhi 110 065 Phone 91 11 26915430 E Mail info hilscher in Italy Hilscher Italia S r l 20090 Vimodrone MI Phone 39 02 25007068 E Mail info hilscher it Support Phone 39 02 25007068 E Mail it support hilscher com PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public 238 238 Japan Hilscher Japan KK Tokyo 160 0022 Phone 81 0 3 5362 0521 E Mail info hilscher jp Support Phone 81 0 3 5362 0521 E Mail jp support hilscher com Korea Hilscher Korea Inc Seongnam Gyeonggi 463 400 Phone 82 0 31 789 3715 E Mail info hilscher kr Switzerland Hilscher Swiss GmbH 4500 Solothurn Phone 41 0 32 623 6633 E Mail info hilscher ch Support Phone 49 0 6190 9907 99 E Mail ch support hilscher com USA Hilscher North America Inc Lisle IL 60532 Phone 1 630 505 5301 E Mail info hilscher us Support Phone 1 630 505 5301 E Mail us support hilscher com Hilscher 2005 2
188. ame profile definition have to use the same Profile Ident Number The Profile Ident number will be taken from the pool of Ident Numbers for vendor specific or authorized profiles The value O indicates the no profile is supported If the requested profile is supported by the AP Task the Profile Ident Number is mirrored in the response If the requested profile is not supported by the AP Task the AP Task has to respond negatively or with the Profile Ident Number the AP Task supports The variable SType this subparameter indicates the presence if TRUE 1 of the optional Network and MAC address in the t SAdadr field The variable bSLen this subparameter indicates the length of the t SAddr subparameter The variable DType this subparameter indicates the presence if TRUE 1 of the optional Network and MAC address in the t DAdadr field The variable bDLen this subparameter indicates the length of the tbDAddr subparameter The field t SAddr contains the following subparameters bAPI This subparameter identifies the application process instance of the source bSCL This subparameter identifies the access level of the source abNetworkAddress This subparameter identifies the network address of the source according to ISO OSI Network addresses This value is only present if SType TRUE abMACAddress This subparameter identifies the MAC Address of the source This value
189. ameterization For more information on cyclic data transfer please see section Cyclic Data Transfer PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 128 238 define PROFIBUS_FSPMS_GLOBAL_CONTROL_NOACTION 0 define PROFIBUS_FSPMS_GLOBAL_CONTROL_SYNC 1 define PROFIBUS_FSPMS_GLOBAL_CONTROL_UNSYNC 2 define PROFIBUS_FSPMS_GLOBAL_CONTROL_FREEZE 1 define PROFIBUS_FSPMS_GLOBAL_CONTROL_UNFREEZE 2 typedef t struct PROFIBUS_FSPMS_GLOBAL_CONTROL_IND_Ttag TLR_BOOLEAN8 fClearCommand LR_UINT8 bSyncCommand LR_UINT8 bFreezeCommand LR_UINT8 bGroupSelect PROFIBUS_FSPMS_GLOBAL_CONTROL_IND_T typedef struct TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_GLOBAL_CONTROL_IND_T tData PROFIBUS_FSPMS_ PACKET _GLOBAL_CONTROL_IND_T Packet Description PROF IBUS_FSPMS_PACKET_GLOBAL_CONTROL_IND_Ttag structure PROFIBUS_FSPMS_ PACKET GLOBAL _CONTROL_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulS
190. amp M unequal I amp MO Slot 0 with the f the slot number and I amp M index are correct the complete I amp M structure has to be copied in the to tData ulLen of IL and the corresponding error must be entered in tData un tError of PROFIBUS_FSPMS_PACKET_IM_READ_RES The data tData tInfo ulSAPIdx tData tInfo ulSlot and tData tInfo ulIM_Index must not be changed The variable tData tInfo ulLen of indication package is not used The PROFIBUS_FSPMS_IM_INDEX_T structure of the response packet looks like Variable Type Value Range Description ulSAPIdx UINT32 SAP Index ulSlot UINT32 Slot ullM_Index UINT32 I amp M Index ulLen UINT32 Length Table 145 PROFIBUS_FSPMS_IM_INDEX_T Structure Packet Structure Reference typedef LR_UIN LR_UIN LR_UIN LR_UIN ROP LBUS FSP ye SZ WULSIN2 TOLY 32 WiLS leis 32 ulIM_Index 32 ulLen SULUCE PROEIBUS SE SPMSauMeaiND EX _Ttag S_IMEEINDEXTT typedef struct PROFIBUS HSE r SAC KE IM READ_IND_Ttag Wiki VNC INE I Tells ANDI IN 1c PROHIBUSSE SP S_IM_IND I Head dp IE PROFIBUS_FSPMS_PACK r CData ak JOM IR EAD _IND_T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface
191. and it is still operational The indication packet itself requires no response packet to be built by the AP task Just using the macro TLR_QUE_RETURNPACKET will return the packet back to the FSPMS task context In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapmsotda value of the request packet referenced in Table 69 PROF IBUS_FSPMS_CMD_INIT_MSO_REQ Request Command for MSO Initialization The value bNewSlaveAdd contains the new station address the DP Master wants to the change the slave s address to The array abRemSlaveAdd conveys the permanent parameter for this slave It contains parameters to be stored permanently and its use is fully user specific This means it is not defined how to behave with this data and what the contents are The service for changing the address is indicated to the AP task only if the corresponding fNoAddChg value is TLR_FALSE 0 This value can be influenced during the initialization sequence described in Table 69 PROFIBUS_FSPMS_CMD_INIT_MSO_REQ Request Command for MSO Initialization or due to the value fNoAddChg that comes along with the Set Slave Address PDU This value is not indicated to the AP task but is saved in the FSPMS task context Packet Structure Reference define PROFIBUS_FSPMS_MAX SET_SLAVE_ADD_DATA_SIZE 240 typedef struct PROFIBUS_FSPMS_SET_SLAVE_ADD_IND_Tt
192. arm Acknowledge service from the master When it is received the device informs the host application of the successful alarm processing by returning an answer message The variable bSlotNumber has to be used in the AP task for addressing which Process Data object in which slot has caused the alarm typically a module For more information see section 5 6 Alarm Processing on page 68 Packet Structure Reference define PROFIBUS_FSPMS_MAX ALARM _USERDATA_SIZE 59 typede struct PROFIBUS_FSPMS_C1_ALARM NOTIFICATION_REO Ttag LR_UINT8 bSlotNumber LR_UINT8 bAlarmType LR_UINT8 bSeqNr TLR_BOOLEAN8 fAddAck LR_UINT8 bAlarmSpecifier LR_UINT8 abAlarmData PROFIBUS_FSPMS_MAX ALARM USERDATA_SIZE PROFIBUS_FSPMS_C1_ALARM NOTIFICATION _REQ_T define PROFIBUS_FSPMS_C1l_ALARM_NOTIFICATION_REQ_SIZE sizeof PROFIBUS_FSPMS_C1_ALARM_NOTIFICATION_REQ_T PROFIBUS_FSPMS_MAX_ ALARM _USERDATA_SIZE Request Packet of an Alarm Notification typedef struct PROFIBUS_FSPMS_PACKET_C1l_ALARM_NOTIFICATION_REQ Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_C1_ALARM_ NOTIFICATION_REQ_T tData PROFIBUS_FSPMS PACKET Cl ALARM NOTIFICATION _REQ T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public
193. art Required flag is set when the channel firmware requests to be restarted This flag is used together with the Restart Required Enable flag below Restarting the channel firmware may become necessary if a new configuration was downloaded from the host application or if a configuration upload via the network took place 6 Restart Required Enable RCX_COMM_COS_RESTART_REQUIRED_ENABLE O 1 The Restart Required Enable flag is used together with the Restart Required flag above If set this flag enables the execution of the Restart Required command in the netX firmware for details on the Enable mechanism see section 2 3 2 of the netX DPM Interface Manual 7 31 Reserved set to 0 Table 25 Meaning of Communication Change of State Flags PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory Communication State All Implementations 32 238 The communication state field contains information regarding the current network status of the communication channel Depending on the implementation all or a subset of the definitions below is supported Value Definition Description 0x00000000 RCX_COMM_STATE_UNKNOWN UNKNOWN 0x00000001 RCX_COMM_STATE_NOT_CONFIGURED NOT_CONFIGURED 0x00000002 RCX_COMM_STATE_STOP STOP 0x00000003 RCX_COMM_STATE_IDLE IDLE 0x00000004 RCX_COMM_STATE_OPERATE OPERATE Table 26 Meaning of C
194. at address 0x0030 Then you should check the hardware assembly options of your netX device They are located within the system information block following offset 0x0010 and stored as data type UINT16 The following table explains the relationship between the offsets and the corresponding xC Ports of the netX device Value Description 0x0010 Hardware Assembly Options for xC Port 0 0x0012 Hardware Assembly Options for xC Port 1 0x0014 Hardware Assembly Options for xC Port 2 0x0016 Hardware Assembly Options for xC Port 3 Table 14 Address Assignment of Hardware Assembly Options Check each of the hardware assembly options whether its value has been set to RCX_HW_ASSEMBLY_ETHERNET 0x0080 If true this denotes that this xC Port is suitable for running the PROFIBUS DP slave protocol stack Otherwise this port is designed for another communication protocol In most cases xC Port 2 will be used for field bus systems while xC Port 0 and xC Port 1 are normally used for Ethernet communication You can find information about the corresponding communication channel 0 3 under the following addresses Value Description 0x0050 Communication Channel 0 0x0050 Communication Channel 0 0x0060 Communication Channel 1 0x0070 Communication Channel 2 0x0080 Communication Channel 3 Table 15 Addressing Communication Channel 0 3 In devices which support on
195. ata read indication the AP task has to respond and deliver the requested data by using the service described in Table 105 PROF IBUS_FSPMS_CMD_C1_WRITE_RES_POS Positive Response Command of a Process Data write or Table 106 PROFIBUS_FSPMS_CMD_C1_WRITE_RES_NEG Negative Response Command of a Process Data write The variable bSlotNumber has to be used in the AP task for addressing the desired Process Data object in the specified slot typically a module The variable b Index has to be used in the AP task for addressing the desired Process Data object itself The variable bLength indicates the number of bytes of the specified Process Data object that has to be read In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapsmsitda value of the request packet referenced in Table 72 PROF IBUS_FSPMS_CMD_INIT_MS1_REQ Request Command for MS1 Initialization for a DP Master Class 1 read For more information see section Acyclic Data Transfer of the DP Master Class 1 on page 61 Packet Structure Reference typedef struct PROFIBUS_FSPMS_C1_READ_IND_Ttag LR_UINT8 bSlotNumber LR_UINT8 bIndex LR_UINT8 bLength PROFIBUS _ FSPMS Ci READ _ IND_T define PROFIBUS_FSPMS_C1_READ_IND_SIZE sizeof PROFIBUS_FSPMS_C1_READ_IND_T typedef struct PROFIBUS_FSPMS_PACKET_C1l_READ_IND_Ttag TLR_PACKET_HEADER_T tHea
196. ata that may be returned cannot exceed 244 bytes As long as no output data has ever been received due to a potentially sending DP Master the MSCY1S state machine will return 0 data as output data block A flag named ClearF lag indicates if the output data block is valid or cleared In the event the flag is set to TLR_FALSE 0 the DP Master that has sent the data is in the state OPERATE In the event the flag is set to TLR_TRUE 1 the DP Master is in the state CLEAR and has forced the MSCY1S state machine to clear the output data block A further flag named fNewF lag indicates if since the previously requested output data block and this newly requested output data block the DP Master has updated it meanwhile If not the Flag is set to TLR_FALSE 0 and the returned output data block will be the same like the previous one To address the correct end point identifier the request command service has to be used in conjunction with the received ulrspmsotd value of the confirmation packet referenced in Table 70 PROF IBUS_FSPMS_CMD_INIT_MSO_CNF Confirmation Command of MSO Initialization Using the Macro TLR_QUE_SEND_PACKET_FIFO will send the packet to the FSPMS task Process Queue For more information on cyclic data transfer see section Cyclic Data Transfer Troubleshooting Hints If you try to get new output data while the slave state is Power_on you will receive an error code TLR_E_PROFIBUS_FSPMS
197. ated in level DP VO The main packets for cyclic data transfer are Section Packet Name 6 2 7 PROF IBUS_FSPMS_CMD_SET_INPUT_REQ CNF Setting the Input Data 6 2 8 PROF IBUS_FSPMS_CMD_GET_OUTPUT_REQ CNF Getting the latest Output Data Table 49 Packets for Cyclic Data Transfer The most important prerequisite for cyclic data transfer is that the operation mode is OPERATE In state CLEAR only a restricted cyclic data transfer is possible in the other states no cyclic data transfer at all is performed Watchdog Timer Cyclic data transfer is supervised by a watchdog timer The Profibus DP Slave s outputs will be switched to a safe state if no regular data transfer happens within in the timer interval of the watchdog timer The Profibus DP Master contains a timer for each DP slave The reaction of the system depends on the value of the Auto_Clear configuration parameter of the Profibus DP Master in the following way Auto_ Clear TRUE If one slave supervised by the DP master fails the outputs of all DP slaves which are supervised by this DP master will be set to the save state This option offers the highest degree of security Auto_Clear FALSE If one slave supervised by the DP master fails the cyclic data transfer is continued and a user specific reaction can occur This option enables the addition and removal of stations during full operation of the Profibus system which mi
198. ation of the acyclic state machine to the application failed service cannot be performed 0xC009001B TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_NO_RSAP_PACKET Getting a packet from the pool to activate the server SAP of the acyclic state machine failed service cannot be performed 0xC009001C TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_RSAP_ACTIVATION_DENIED The activation of a RSAP in the MSAC1S state machine denied by the Data Link Layer 0xC009001D TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_LSDUZERO_NORESPONSE A DP master network frame has been received in the MSAC1S state machine that has a zero length and no response was available O0xC009001E TLR_DIAG_E PROFIBUS _FSPMS_MSAC1S_REPLY_UPDATE_CONFIRMATION A conflict has been detected within the acyclic MSAC1S state machine In state OPEN a reply update confirmation has been received 0xC009001F TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S ALREADY STARTED A conflict has been detected within the acyclic MSAC1S state machine In state OPEN a new request to start has been received 0xC0090020 TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_NO_REPLYUPDATE_PACKET Getting a packet from the pool to update a response buffer failed service cannot be performed 0xC0090021 TLR_DIAG_E PROFIBUS _FSPMS_MSAC1S_REPLY_UPDATE_ERROR Updating a response buffer within the Data Link Layer entity failed Service has been rejected 0xC0090022 TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_STATE_CONFLICT_VS_WRES
199. ber profile is supported fSType BOOL8 0 1 Decides on the presence of the optional source Network MAC address in SAddr in abSAddrDAdadr bSLen UINT8 Length of the Source Address length parameter in abSAddrDAdadr fDType BOOL8 0 1 Decides on the presence of the optional destination Network MAC address in DAddr in abSAddrDAdadr bDLen UINT8 Length of the Destination Address length parameter in abSAddrDAdar abSAddrDAdadr UINT8 Array containing the description of the source and destination address reflected due to 2 structures of the type PROFIBUS_FSPMS_INITIATE_ADDR_T Table 115 PROFIBUS_FSPMS_CMD_C2_INITIATE_RES_POS Positive Response Command of a DP Master Class 2 Connection Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_C2_INITIATE 166 238 ES_NEG Ttag LR_UINT32 ulReference LR_UINT8 bErrorDecode LR_UINT8 bErrorCodel LR_UINT8 bErrorCode2 PROFIBUS_FSPMS_C2_INITIATE_RES_NEG_T Negative response packet of an typedef struct PROP IBUSSEHSP acyclic DP Master Class 2 initialization S_PACKET_C2_INITIATE_RES_NEG Ttag TILIR eVAC Ia Ie _ let ADER_T tHead PROEIBUS EOP SC2Z_ ONIN
200. ble 124 PROF IBUS_FSPMS_CMD_C2_DATA_TRANSPORT_RES_POS Positive Response Command of a Process Data Transport Request or in Table 125 PROF IBUS_FSPMS_CMD_C2_DATA_TRANSPORT_RES_NEG Negative Response Command of a Process Data The indication packet itself may not be used as resource to build the corresponding response packet It has rather to be returned back to the FSPMS Task by using the macro TLR_QUE_RETURNPACKET first before the separated response can built with a free packet from the AP Task s own pool In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapms2ta value of the request packet referenced in Table 74 PROF IBUS_FSPMS_CMD_INIT_MS2_REQ Request Command for MS2 Initialization The variable bSlotNumber has to be used in the AP Task for addressing the desired process data object in the specified slot typically a module The variable bIndex has to be used in the AP Task for addressing the desired process data object itself The variable bLength indicates the number of bytes of the specified process data that are transported in the abData field Within the array abData the transported data is indicated sent by the DP Master Class 2 Packet Structure Reference define PROFIBUS_FSPMS_C2_DATA_TRANSPORT_IND_SIZE sizeof PROFIBUS_FSPMS_C2_DATA_TRANSPORT_IND_T PROP TBUSLE SPMSSMAXSDATAS TRANSPORT DATA SIEAE
201. ce 157 238 The PROFIBUS_FSPMS_C1_ALARM_ACK_IND packet can either have a positive or a negative response In the positive case a PROF IBUS_FSPMS_CMD_C1_ALARM_ACK_RES_POS otherwise a PROF IBUS_FSPMS_CMD_C1_ALARM_ACK_RES_NEG packet is sent bAlarm Type Identifies the alarm type The coding is explained in Table 111 PROFIBUS DPV1 Possible Alarm Types ulSta 0 Negative response A negative response is issued whenever the indicated request cannot be satisfied by the AP task 3 variables are specifying the type and source of the error in this event The applicable error codes of the 3 variables bErrorDecode bErrorCodel bErrorCode2 that are specifying the type and source of the error in this event are explained in section Error Handling on page 61 ulSta lt gt 0 Positive response A positive write response does not have any further parameter data Packet Structure Reference typedef struct PROFIBUS_FSPMS_C1_ALARM ACK_RES_POS_Ttag LR_UINT8 bSlotNumber LR_UINT8 bAlarmType LR_UINT8 bSeqNr PROFIBUS_FSPMS_C1_ALARM_ACK_RES_POS A Positive response packet of an acyclic Alarm Acknowledgement command typedef struct PROFIBUS_FSPMS_PACKET_C1l_ALARM_ACK_RES_POS_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_C1_ALARM_ ACK _RES_POS tata PROFIBUS_FSPMS_PACKET_C1l_ALARM ACK RES POS _T
202. ceaeeeeeeeeeeeetaeeeeeeeeeeenaeees 39 Table 34 Available Baud Rate Values Table 35 Input and Output Data for Remote Device Station with One Occupied Stations Single Setting e 40 Fable 36 Octet 1 Station Status 1 sisi s 2205 6 00 cegescceheiecencvgectens ellis eh ea ea e aa ieee en aie E oeer A ept aroen eia ar airar eeto ae ainiaan ot 48 Table 37 Ocet 2 Station Status 2 sh Be olen ete itil a eb the eee ce evel ae bate 49 Table 38 Octet 3 Station Status Sis sic sceessecgshvseeck es seckd a e ach se laa eas e esti tas Nate hanes wee 49 able 39 Diagnosis Header ri a a aa a a asad iagezdaaesiaatuaceaaticednsasattadessuseehbacessnauaste ceeds stestee AeA aA Aea En ae eiai 50 Table 40 Identification related diagnosis First Data Byte 0 0 eee eeeseeeeeenneeeeeeeeeeeeaeeeeeeaeeeseeneeeeesaeeeneneeeeenneeeeeneeeeee 50 Table 41 Identification related diagnosis Second Data Byte ceeceeeeesseeeeeeeeeeeeeeeeeeseeeeeeeeeseaeeeeeeeseeeseaeeseeeseaeeseaees 51 Table 42 Channel related Diagnosis First Data Byte eeceeccceeeeeeeneeeeeeeeeeeeeeeeessaeeeeeeesaeeeeeeesaeeseeseaeeseaeessaeeseeeseaees 51 Table 43 Channel related Diagnosis Second Data Byte cccceecceseeeeeeeeeceneeseeeeeaeeeeaeeseaeeeeaeeeeaeeseaeeessaeseaeeseaeeseneeseaees 51 Table 44 Octet 1 of Prm_Data Slave Parameter ccccccssccccccccssssseeeceeeeeesssaeeececcceesesaseeeeeeeseseeeeeeecesesesseeseeeeeeseeaaees 52 Table 45
203. ceiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 237 Packet Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task ulCmd UINT32 0x3104 PROF IBUS_APS_CHECK_USER_PRM_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch structure PROFIBUS_APS_ CHECK _USER_PRM_IND_T abUserPrmData PR OF IBUS_APS_MAX_U SER_PRM_DATA_SIZ UINT8I User parameter data Table 59 PROFIBUS_APS_CHECK_USER_PRM_IND Check User Parameter Indication PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_APS_CHECK_USER_PRM_RES_Ttag TLR_BOOLEANS8 PrmOk PROF IBUS_AP S_CHECK USFERERRMEREGA define PROFIBUS_APS 77 238 CHECK_USER_PRM_RES_SIZE sizeof PROFIBUS_APS_CHECK_USER_PRM_RES_T typedef struct PROFIBUS_APS_PACKET_CHECK_USER_PRM_RES_Ttag TLR_PACKET_ HEADER _ tHead PROPEBUSEAr mehr CK
204. cenaaeeeesaeeecscaaeeeseeeeeessaeeeesecneeeseceeeeeseneeeesseeeensneeess 27 3 2 3 Differences between System and Channel Mailboxes ceeeseeeeeeeeeeeeeeeeeeeeeeeeeeeeeseeeetneeeenetens 27 324 Send MA OX ee es 25 casascs da saci ecw ssbsaatadaedessace aa E aE aea Er raa a AE aare E reaa EER EES 27 3 2 95 RECEIVE MalIDOX ssion roteare e eaaa ENERE EAEE E EE eA EE 27 3 2 6 Channel Mailboxes Details of Send and Receive Mailboxes sseessessesssrssressressrssrrerrrsrreerrnsenne 27 S E AE NE N E A AE I A tied A E A E A 29 3 3 1 Common Status cccccccccescccessnceceeseneeeeeaeeeeseaeececseaeeeeceaeeesscaueeeceeeeeescaeeeeseaeeeeceeeeeeseuseeeeaseeensneeess 29 3 3 2 Extended Status 3 cc c ccecesesesesecssccesccscudesecetedocessesseeeeasaiececsdececunvecdsvseuiacetusctssutesteceedaeenstgoedesesteedes 34 SA Control BICK a EEEE EAEE EA EAEE AREER 35 4 Getting started Configuration sssssssenssenneunnennnuennnunnnnnnnnunnnnnnnnnnnnnnnnnnnnnnn ennn nnnn ennenen nenne ennnen ennnen nnna 36 4 1 Overview about Essential Functionality seseeseeeeseeeseneenernetnssrnsstnssnnssrnnsrnnsrnnsrnnsnnnnsnnnsnnnnna 36 4 2 Configuration Procedures ccccceseceeseeeeeeeeeesaeceeneeceeeecaaeeseaaesaaeeceaeeseaaeesneeeeseaeeseaaeseeaeessieeees 37 42 1 USING a eE E A T fuaahenceessecnueususcesecdarsstees 37 4 3 Warmstart Parameters eerscarnoneiinirsnia aiaa i aa eine Ea a ia aaa 38 4 3 1 Behavior when receiving a Set Co
205. choice of the slot of the specified API Only one of these acyclic services can be executed at a time per MSAC_C2 connection 5 5 2 5 Establishing Process of a DP V1 Class 2 Connection The establishment of an MSAC_C2 connection is a process with several stages 1 First the Profibus DP Master class 2 sends a special request Initiate REQ PDU to a special service access point of the Profibus DP Slave On reception of this request the slave determines whether there is a free service access point available and if there is one which one will be used This service access point is then provided to the master class 2 At the same time the PROFIBUS_FSPMS_CMD_C2_INITIATE_IND RES_POS RES_NEG Indicating a Request to establish an acyclic Connection to a DP Master Class 2 page 160 indication is sent from the Profibus DP Slave to the slave application The slave now sends a message RM REQ PDU to the master This message is received at the master The service access point will be stored then The master now acknowledges that it wants to establish a connection using the service access point chosen by the slave In this context you can imagine a service access point as a kind of communication channel The master now waits for the positive or negative reaction of the slave in a polling mode When the slave receives the PROFIBUS_FSPMS_CMD_C2_INITIATE_RES response it will react If a positive reaction is received from the slave the master finally
206. cket ulSta UINT32 TLR_S_OK 0 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0487 PROF IBUS_FSPMS_CMD_C1_WRITE_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_Cl_WRITE_RES_POS_T bSlotNumber UINT8 0 254 Slot number of the Process Data object that has been written bIndex UINT8 0 254 Index of the Process Data object that has been written bLength UINT8 0 240 Number of real written Process Data bytes Table 105 PROFIBUS_FSPMS_CMD_C1_WRITE_RES_POS Positive Response Command of a Process Data write PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 150 238 typedef struct PROFIBUS_FSPMS_C1_WRITE_RES_ NEG Ttag LR_UINT8 bErrorDecode LR_UINT8 bErrorCodel LR_UINT8 bErrorCode2 PROFIBUS FE SPMS Cl WRITE RES NEGIT Negative response packet of an acyclic read command typedef struct PROFIBUS_FSPMS_PACKET_Cl_WRITE_RES_NEG _Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_Cl_READ_RES_NEG_T tData PROFIBUS_FSPMS PACKET _Cl_WRITE_RES NEG T Packet Description structure PROFIBUS_FSPMS_ PACKET _C1_WRITE_RES_ NEG T Type Response
207. cket to the receiving process That way the router can identify the corresponding reply packet and matches the handle from that packet with the one stored earlier Now the router replaces its handles with the original handles and returns the packet to the originating process PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Fundamentals 2 3 3 19 238 Obtaining Information about the Communication Channel A communication channel represents a part of the Dual Port Memory and usually consists of the following elements Output Data Image is used to transfer cyclic process data to the network normal or high priority Input Data Image is used to transfer cyclic process data from the network normal or high priority Send Mailbox is used to transfer non cyclic data to the netX Receive Mailbox is used to transfer non cyclic data from the netX Control Block allows the host system to control certain channel functions Common Status Block holds information common to all protocol stacks Extended Status Block holds protocol specific network status information This section describes a procedure how to obtain useful information for accessing the communication channel s of your netX device and to check if it is ready for correct operation Proceed as follows Start with reading the channel information block within the system channel usually starting
208. col API DOC050401API15EN Revision 15 English 2013 09 Released Public Indication Command of a Global Control Command Hilscher 2005 2013 The Application Interface 129 238 Source Code Example void APS_Global_Control_ind PROFIBUS_APS_RSC_T FAR ptRsc PROFIBUS_APS_PACKET_T FAR ptPckt if ptPckt gt tGlobalControlind tData fClearCommand TLR_TRUE APS_Clear_Outputs ptRsc if ptPckt gt tGlobalControliInd tData bSyncCommand PROFIBUS_FSPMS_GLOBAL_CONTROL_SYNC ptRsc gt tLoc tMscyls fSynched R_TRUE else if ptPckt gt tGlobalControliInd tData bSyncCommand PROFIBUS_FSPMS_GLOBAL_CONTROL_UNSYNC ptRsc gt tLoc tMscyls fSynched R_FALSE f if ptPckt gt tGlobalControlInd tData bFreezeCommand PROFIBUS_FSPMS_GLOBAL_CONTROL_FREEZE ptRsc gt tLoc tMscyls fFreezed RO TRUE else if ptPckt gt tGlobalControliInd tData bFreezeCommand PROFIBUS_FSPMS_GLOBAL_CONTROL_UNFREEZE ptRsc gt tLoc tMscyls fFreezed R_FALSE F ptRsc gt tLoc tMscyls uGrp ptPckt gt tGlobalControlind tData bGroupSelect TLR_QUE_RETURNPACKET ptPckt PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 130 238 6 2 1
209. ction to a DP Master Class 2 This service indicates the AP Task that a connection to a Profibus DP Master Class 2 shall be established To complete the connection initialization the AP Task has to respond and deliver the requested data by using the service PROFIBUS_FSPMS_CMD_C2_INITIATE_RES The indication packet itself may not be used as resource to build the corresponding response packet It has rather to be returned back to the FSPMS Task by using the macro TLR_QUE_RETURNPACKET first before the separated response can built with a free packet from the AP Task s own pool In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapms2tda value of the request packet referenced in Table 74 PROFIBUS_FSPMS_CMD_INIT_MS2_REQ Request Command for MS2 Initialization The bit field tFeaturesSupported informs the AP Task about the requested service functionality The AP Task has the possibility to adjust its functionality to the DP Master s requirements or to reject if it cannot fulfill them The bit field tprofileFeaturesSupported informs the AP Task about the requested service functionality regarding the used profile definition The profile is identified by the Profile Ident number The meaning of the defined bits is profile or vendor specific The variable usProfilelIdentNumber identifies a profile definition uniquely All devices using the s
210. ctions are activated Otherwise DPV1 functions will not be available Bit 1 Sync supported WRMSTRT_FLG_SYNC_SUPP Flag that indicates if set to TLR_TRUE 1 that the slave stack shall support the SYNC command and the SYNC mode is activated Otherwise if set to TLR_FALSE 0 the slave stack will not support the SYNC command Bit 2 Freeze supported wrMstTRT_FLG_FREEZE_SUPP Flag that indicates if set to TLR_TRUE 1 that the slave stack shall support the FREEZE command and the FREEZE mode is activated Otherwise if set to TLR_FALSE 0 the slave stack will not support the FREEZE command Bit 3 Fail safe supported wrMstRT_FLG_FAILSAFE_SUPP Flag that indicates whether Fail safe operation is supported If set FAILSAFE mode is activated Otherwise FAILSAFE mode will not be available Bit 4 Alarm SAP 50 deactivate wrMsTRT_FLG_NO_ALARM_SUPP Flag that indicates if set to TLR_TRUE 1 that the alarm SAP 50 is deactivated If the flag is set to TLR_FALSE 0 the stack supports the alarm SAP 50 Bit 5 I O data swap WRMSTRT_FLG_IO_SWAP Flag that indicates if the I O Data at the Dual Port Memory is shown at Motorola or Intel format PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Getting started Configuration 40 238 Bit 6 Auto configuration waMsTRT_FLG_AUTOCONFIG Flag that indica
211. d PROFIBUS_APS_PACKET_GET_CFG_REQ_T Packet Description structure PROFIBUS_APS_ PACKET _GET_CFG_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 0x20 Destination Queue Handle PB_APS_QUE ulSre UINT32 0 25 1 Source Queue Handle ulDestId UINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task ulCmd UINT32 0x310A PROF IBUS_APS_GET_CFG_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch Table 65 PROFIBUS_APS_GET_CFG_REQ Get Configuration Data Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 84 238 typedef struct PROFIBUS_APS_GET_CFG_CNF_Ttag TLR_UINT8 abCfgData PROFIBUS_APS_MA
212. d PROF IBUS_FSPMS_C1_READ_IND_T tData PROFIBUS_FSPMS_PACKET_C1_READ_IND_T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 142 238 structure PROFIBUS_FSPMS_ PACKET _C1l_READ_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMS 1d Destination end point identifier specifying the final receiver ulAPMS2ld of the packet within the Destination Process ulSrclId UINT32 ulFSPMS1 ld Source end point identifier specifying the origin of the ulFSPMS2ld packet inside the Source Process ulLen UINT32 3 sizeof PROFIBUS_FSPMS_C1_READ_IND_T Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulcmd UINT32 0x0484 PROFIBUS_FSPMS_CMD_C1_READ_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C1l_READ IND T bSlotNumber UINT8 0 254 Slot number of the process data
213. d command cannot be a new Slave Diagnostic command cannot be accepted while a previous one is pending 0xC009001F TLR_E_PROFIBUS_FSPMS_MS1_INIT_WRONG_STATE The acyclic slave state machine cannot be initialized state machine is not in POWER ON state PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 222 238 Hexadecimal Value Definition Description 0xC0090020 TLR_E PROFIBUS FSPMS_ALARM_HANDLER_NOT_STARTED The Alarm Handler state machine isn t started yet an Alarm cannot be notified 0xC0090022 TLR_E PROFIBUS FSPMS_ALARM_HANDLER_NOT_ENABLED The requested Type of Alarm is not enabled this Alarm cannot be notified 0xC0090023 TLR_E PROFIBUS _FSPMS_ALARM_HANDLER_LIMIT_EXPIRED The limit of parallel running alarms is expired this Alarm cannot be notified 0xC0090024 TLR_E PROFIBUS _FSPMS_ALARM_HANDLER_PENDING This requested Type of Alarm is still pending and in operation this is why the Alarm cannot be notified 0x80090025 TLR_W_PROFIBUS_FSPMS_NOTREADY_EXPIRED Application is at not ready state 0xC0090026 TLR_E_PROFIBUS_FSPMS_WATCHDOG_EXPIRED Watchdog error expired Table 161 Error Messages of the FSPMS Task PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 22
214. d described in Table 82 PROF IBUS_FSPMS_CMD_SET_INPUT_REQ Request Command for setting Input Data before This means that it is a pre condition to update the inputs first before the application can be set to ready state Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Note In some cases you can use the registering functionality described in the netX Dual Port Memory Manual instead of this packet RCX_REGISTER_APP_REQ command code 0x2F 10 Packet Structure Reference typedef struct PROFIBUS_FSPMS_PACKET_DP_SLAVE_APPLICATION_READY_REQ_ Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_DP_SLAVE_APPLICATION_READY_REQ T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 123 238 structure PROFIBUS_FSPMS_ PACKET _DP_SLAVE_APPLICATION_READY_REQ T Type Request Area Variable Type Value Range Description Head structure TLR_PACKET_HEADER_T ulDest UINT32 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 297 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 uIFSPMSOld Destination end point ide
215. d point identifier specifying the final receiver of the packet within the Destination Process ulSrclId UINT32 ulFSPMS2Id Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 7 sizeof PROFIBUS_FSPMS_READ_IND_T Packet Data Length in bytes ullId UINT32 O21 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04A4 PROF IBUS_FSPMS_CMD_C2_READ_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_ READ IND T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bSlotNumber UINT8 0 254 Slot number of the Process Data object to be read bIndex UINT8 0 254 Index of the Process Data object to be read bLength UINT8 0 240 belies of bytes to be read in the specified Process Data object Table 117 PROFIBUS_FSPMS_CMD_C2_READ_IND Indication Command of a Process Data Read Request The corresponding response service has to be used by the AP Task in order to confirm a previously FSPMS Task issued Process Data read indication The response is necessary and a must do when having received the indication command declared in Table 117 PROF IBUS_FSPMS_CMD_C2_READ_IND Indication Command of a Process Data Read Request In order to address th
216. d stopped with passing the service response to the application On expiration of the U Timer the slave signals to the master that it is idle F Timer fetch response timer This timer supervises the correct function of the master each timer when a response or a slave idle signal is sent to the master On expiration of this timer the connection is aborted l Timer indication timer This timer supervises the correct function of the master in the following way When the master fetches data this time is started and running until the master either sends the next request or an idle message If this timer expires the connection will be aborted The main mechanisms for controlling the DP V1 Class 2 connection are At the master the use of the R Timer At the slave the use of the I Timer PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 68 238 5 6 Alarm Processing 5 6 1 1 Profibus DP V1 Alarm Concept Alarms are messages from the slave to the server which may for instance be caused by extraordinary events within a specific module slot of the slave and which require processing at the master with high priority and explicite acknowledgement In order to transmit an alarm to the master the PROFIBUS_FSPMM_CMD_ALARM_ACK_REQ packet needs to be sent The reception of the alarm message from the slave will cause an indication at the master The aforementioned ex
217. de the Source Process ulLen UINT32 3 sizeof PROFIBUS_FSPMS_CHECK_CFG_RES_T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section Status Error Codes Overview ulCmd UINT32 0x0415 PROFIBUS_FSPMS_CMD_CHECK_CFG_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_CHECK_CFG_RES_T fCfgOk BOOLEANS_ 0 1 If set to TLR_TRUE 1 the AP task has accepted the Configuration Data If set to TLR_FALSE 0 the Configuration Data are not ok bInputDataLen UINT8 Real length of Application input data maximum PROF IBUS_FSPMS_MAX_INPUT_DATA_SIZE bOutputDataLen UINT8 Real length of Application output data maximum PROF IBUS_FSPMS_MAX_OUTPUT_DATA_SIZE Table 96 PROF IBUS_F SPMS_CMD_CHECK_CFG_RES Response to Indication Command of a Check Configuration PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 134 238 6 2 15 PROFIBUS_FSPMS_CMD CHECK_USER_PRM_IND RES Indicating the Reception of new Parameter Data This service indicates the AP task that a Parameterization Command has been received This service is sent by a DP Master to a DP Slave right before the I O communication is
218. ding a configuration packet to the Profibus DP Slave This will lead to the reception of a indication see sections PROFIBUS_FSPMS_CMD_CHECK_CFG_IND RES Indicating the Request for Validation of the assumed I O Configuration Data on page 130 and Configuration of Inputs and Outputs on page 54 for detailed information Full operability in this state means 1 The slave cyclically receives outputs 2 The slave cyclically delivers inputs PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Ovemipw eS 3 The slave cyclically receives diagnostic requests in order to check whether the slave has accepted the parameter set and the configuration Address changes are not possible in this state In case of an error the slave will fall back into power on reset state i e initialization parameterization and configuration will completely have to be repeated The illustration below explains the different states and their relations and the transitions between them Possible States of Profibus DP Slave Power On DP Watchdog Configuration not ok Correct Parameter Telegram received from DP Master Correct Configuration Telegram received from DP Master Configuration not ok Parameterization not ok Incorrect output length used Unlock Figure 7 States of Profibus DP Slave PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 E
219. e If you try to check extended user parameterization data while new parameterization data have been received you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_NEW_PARAMETER along with the confirmation packet The comparison of assumed and real configuration data has a negative result The master should react to this event in a suitable way PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference define PROFIB USZE SPMSSMAXSEXT AUS ER _PRM_ DATA 139 238 SIZE 244 PROEEB US mHoOPMSmCr EGK ER typedef struct EXTEUS PRM_IND_Ttag TLR_UINT8 abExtUserPrmData PROF IBUS_FSPMS_MAX EXT_USER_PRM_DATA_SIZE PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_IND_T typedef struct PROFIBUS_FSPMS_PACKET_CHECK_EXT_USER_PRM_IND_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_CHECK_EXT_USER_PRM_IND_T tData PROFIBUS_FSPMS_ PACKET CHECK _EXT_USER_PRM_IND_T Packet Description structure PROFIBUS_FSPMS_PACKET CHECK_EXT_USER_PRM_IND_T Type Indication Variable Type Value Ran
220. e Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 186 238 TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_RSAP_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_SAP_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_SAPDEACTIVATE_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_NO_START_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_RETURN_PACKET_FAILED TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_RSAP_ACTIVATION_DENIED TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_SAP_ACTIVATION_DENIED TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_SAP_DEACTIVATION_DENIED TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_SEND_PACKET_FAILED TLR_DIAG_E_PROFIBUS_FSPMS_DMPMS_SETVALUE_FAILED_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_FSPMS_NO_ALARM_ACK_IND_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_FSPMS_NO_STARTED_IND_PACKET TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_ALARM_RES_UNEXPECTED TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_ALREADY_STARTED TLR_DIAG_E_PROFIBUS_FSPMS_MSAC1S_NO
221. e See the table below for further explanations D7 D6 D5 D4 D3 D2 D1 DO Reserved Alarm_Specifier The bAlarmSpecitf fier bits D1 and DO contain the following information Alarm_Specifier Bits D1 and DO D1 DO Error and slot status 0 0 No further differentiation 0 1 Error appears and slot disturbed 1 0 Error disappears and slot is okay 1 1 Error disappears and slot is still disturbed PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface The This alarm requires a separate user fAddAck contains the following information acknowledge additionally to 154 238 the state machine MSAL1M_ALARM_RES This can be done for instance by means of a write service With this packet the slave confirms that it has previously been notified about an alarm by a PROF I BUS_FSPMS_CMD_C1_ALARM_NOTIF ICATION_REQ packet Packet Structure Reference typedef struct PROFIBUS_FSPMS_C1_ALARM _NOTIFICATION_CNF_Ttag LR_UIN LR_UIN LR_UIN 8 bSlotNumber 8 bAlarmType 8 bSeqNr PROFIBUS _FSPMS_Cl_ALARM NOTIFICATION_CNF_T Confirmation Packet of an Alarm Notification typedef struct PROFIBUS_FSPMS_PACKET_C1_ALARM_NOTIFICATION_CNF_Ttag WILIR JOVANI TEHE ADER_T t
222. e 137 PROFIBUS_FSPMS_CMD_IND_SETTING_CNF Confirmation for deactivating the Output Indication 191 Table 138 PROFIBUS_FSPMS_CMD_STARTED_IND Start Indication 0 ceceeeeeeeeeeeeeeeeeteeeeeeeeteaeeseaeeteaeeteaeeteaeeteaeenias 192 Table 139 PROFIBUS_FSPMS_CMD_SET_STAT_DIAG_REQ Set Static Diagnostic Request ccceeeeeeteeeereeeees 193 Table 140 PROFIBUS_FSPMS_CMD_SET_STAT_DIAG_CNF Configuration of Set Static Diagnostic Request 194 Table 141 Meaning of Bits o Table 142 Structure tIMO y Table 143 PROFIBUS_FSPMS_CMD_SET_IMO_REQ Change I amp MO Parameter Settings Request eceeeeee 198 Table 144 PROFIBUS_FSPMS_CMD_SET_IMO_CNF Confirmation to Change I amp M0 Parameter Settings Request 199 Table 145 PROFIBUS_FSPMS_IM_INDEX_T Structure 0 00 ccceeeeeceeeeeeeeeeeeeeeneeeeeeeeeaeeesaeeeeaeeesaeeeeaeeeeeeseeeeeaeeseneensas 200 Table 146 PROFIBUS_FSPMS_CMD_IM_READ_IND I amp M Read Indication ecceeceeeeeeeeneeeeeeeeeaeeeeaeeteaeeeeaeeneas 201 Table 147 PROFIBUS_FSPMS_CMD_IM_READ_RES I amp M Read Response c cecceeeeeeeeteeeeeeeteneeteaeeteeeeeeerias 202 Table 148 PROFIBUS_FSPMS_IM_INDEX_T Structure ececececeeseeeeseeeeseeeseeeeeseeeeeeeeeeeseaeeseeesaeeseeeesaeeeeeeetsaeenseeenea 203 Table 149 PROFIBUS_FSPMS_IM_ERROR_T Structure ecccessceeeseeeeeeeeeseeeeseeeeseeeeaaeeeseeeeeaeeeeeessaeseeeesaeeeseeesaeenseeenea 203 Table 150 PROFIBUS_FSP
223. e CLEAR and the AP task should set its output data to a safe state The variable bSyncCommand indicates the type of Sync Operation PROF IBUS_FSPMS_GLOBAL_CONTROL_NOACTION No synchronization action is initiated PROF IBUS_FSPMS_GLOBAL_CONTROL_SYNC Outputs has been synchronized once PROF IBUS_FSPMS_GLOBAL_CONTROL_UNSYNC Outputs are not synchronized A reaction of the AP task based on the value of bSyncCommand is in most cases basically not necessary The MSCY1S state machine itself has automatically done all necessary reactions The variable bF reezeCommand indicates the type of Freeze Operation PROF IBUS_FSPMS_GLOBAL_CONTROL_NOACTION No synchronization action is initiated PROF IBUS_FSPMS_GLOBAL_CONTROL_FREEZE Inputs are freezed PROF IBUS_FSPMS_GLOBAL_CONTROL_UNFREEZE Inputs are no longer freezed A reaction of the AP task based on the value of bFreezeCommand is in most cases basically not necessary The MSCY1S state machine itself has automatically done all necessary reactions The variable bGroupSelect determines what group s of assigned slaves is addressed due to the Global Control command in the network There is no reaction of the AP task needed depending on the indicated value The MSCY1S state machine itself has automatically done all necessary reactions Note Addressing of groups can be accomplished during par
224. e correct end point identifier the response command service has to be used in conjunction with the received ulrspMsiId ulrspMs2td value of the confirmation packet referenced in Table 75 PROFIBUS_FSPMS_CMD_INIT_MS2_CNF Confirmation Command of MS2 Initialization for a DP Master Class 2 connection The type of connection the response has to be sent to can be distinguished within the AP Task via the value ulDestId of the indication command itself declared in Table 117 PROFIBUS_FSPMS_CMD_C2_READ_IND Indication Command of a Process Data Read Request The response is generally distinguished into two types Positive response The variable bLength defines how many bytes are read and returned to the FSPMS Task The indicated length and the returned length may differ It is allowed for example that the indication service requests more data bytes to be read than physically can be returned In this case the response service just returns the maximum number of bytes that are really returned Within the array abDatal the AP Task returns the current process data object s data ulSta shall be TLR_S_ OK 0 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 169 238 Negative response A negative response is issued whenever the indicated request cannot be satisfied by the AP Task 3 variables are specifying the type and source of the error in this
225. e supported service functionality regarding the used profile definition The profile is identified by the Profile Ident number The meaning of the defined bits is profile or vendor specific In the variable usProfileIdentNumber the AP Task returns the supported Profile Ident Number If not Profile is not supported a value of 0 has to be returned The variable SType this subparameter indicates the presence if TRUE 1 of the optional Network and MAC address in the t SAdadr field The variable bSLen this subparameter indicates the length of the t SAddr subparameter The variable DType this subparameter indicates the presence if TRUE 1 of the optional Network and MAC address in the t DAdar field The variable bDLen this subparameter indicates the length of the tbDAddr subparameter The field t SAddr contains the following subparameters bAPI This subparameter identifies the application process instance of the source bSCL This subparameter identifies the access level of the source abNetworkAddress This subparameter identifies the network address of the source according to ISO OSI Network addresses This value is only present if SType TRUE abMACAddress This subparameter identifies the MAC Address of the source This value is only present if SType TRUE The field tDAddr contains the following subparameters bAPI This subparameter identifies the application process instance of
226. eader tIOL PROFIBUS_ FSPMS_IOL _HEADER_T 1O Link header ablOLData 236 UINT8I IO Link data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 214 238 typedef struct PROFIBUS_FSPMS_IM_ERROR_Ttag LR_UINT8 bErrorDecode LR_UINT8 bErrorCodel LR_UINT8 bErrorCode2 PROFIBUS_FSPMS_IM_ERROR_T typedef struct PROFIBUS_FSPMS_IOL_CALL_RES_NEG_Ttag PROF IBUS_FSPMS_ACYCLIC_INFO_HEADER_T tAcyc PROF IBUS_FSPMS_IM_ERROR_T tError PROFIBUS_FSPMS_IOL_CALL_RES_NEG_T typedef struct PROFIBUS_FSPMS_PACKET_IOL_CALL_RES_NEG_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_IOL_CALL_RES_NEG_T tData PROFIBUS_FSPMS_PACKET_IOL_CALL_RES_NEG_T Packet Description structure PROFIBUS_FSPMS_PACKET_IOL_CALL_RES_NEG T Type Negative Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ae UINT32 Destination Queue Handle utig UINT32 Source Queue Handle ulpgstid UINT32 ulFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initializa
227. eceaaeeeseaeeesacaaeeeseeesecsaeeesseneeeessnneess 222 Table 162 Diagnostic Messages of the FSPMS Task csccecsssecceeeeeeeeecnceeeeseneeeeseaeeeescaeeeeeseneeesseaeeeessaeeeesenseeessnneess 225 Table 163 Error Messages of the DL Task ccccsscccceeseeeeeeeeeeeeacececeneeeecaeeeeesaaeceseaneesecaeeesaeneeesseseeesseaeeessenseeessnneess 227 Table 164 Diagnostic Messages of the DL Task ccccesccccceeeeeeeeneeeeeeeeeeeeaaeeeeeeeeeceaaaaeeeeeeeeseceaaeeeeesesecueeeeeeeeteeneiaaees 228 Table 165 Error Messages of the APS Task ccccsssceceeeeeeeeeseneeeeceaeeeeesaaeeeeseaaeeeseaaeeeseaeeesseaeeeeseaeeesseaeeesseseeesenneees 229 Table 166 Diagnostic Messages of the APS TaSk ceccceeseeeeeeeeeeeeteeeeeaeeceaeeeaeeseaeeeaeeseaeeecaeeesaaeseaeesiaeeseeeesnaeeeeeeensas 230 Table 167 General Error Codes according to CIP Standard 0 ceccseceeeeceeceneeeeeeeeeaeeeeaeeseaeeeeaeeseaeeseaeeeeneeeeneessaeeseaeenaas 233 8 2 List of Figures Figure 1 The 3 different ways to access a Protocol Stack running on a netX SYStOM eceeeceeeeeeeeneeeeeeeeeeeeesteeeeneeeeaees 14 Figure 2 Use of ulDest in Channel and System Mailbox ecccecceeeseseneeeeeeeeeeeeeeeceaeeseaeesaeeeeaeesaeeseaeesaeeseaeeseaeeseeeseaees 16 Figure 3 UsingiulSte and USTe daaa a an aa a a raa a a a aa a a A aaae haaraa ranee a aanaeio aiats 17 Figure 4 Transition Chart Application as Client eceeecceeeeeeeneeeeeeeeeneeeeeee
228. ection discusses diagnostic messages Alarm messages are discussed in a separate section due to their importance and their separate handling Status messages are not relevant in the context of this manual While diagnostic messages and status messages are buffered in the Profibus DP system alarms are queued in order to prevent them from being overwritten If the Ext_Diag bit has been set within octet 1 there is more than 6 bytes of diagnostic data available according to the DP V1 standard PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 50 238 The diagnostic data area may contain additionally to the mandatory 6 octets Alarm PDU see section Contents and Structure of the Alarm Message on page 69 Status PDU not discussed here Device related diagnosis Identification related diagnosis Channel related diagnosis Revision number For diagnostic blocks the following general rules apply 1 Each of these diagnostic blocks consists of a 1 byte header determining type and length of the diagnostic block and the data part of the block The length of one block is limited to 64 bytes including the header the length of all blocks together to 238 bytes 1 The first byte of each block is header byte Its first two most significant bits code the type of diagnostic block 2 The rest of contains the length of the alarm message in bytes up to 63 bytes are available
229. ed Public Hilscher 2005 2013 The Application Interface 138 238 6 2 16 PROFIBUS_FSPMS_CMD_ CHECK EXT _USER_PRM_IND RES Indicating new Extended Parameter Data This service indicates the AP task that an extended Parameterization Command has been received This service is sent by a DP Master to a DP Slave between sending the standard parameter data and the configuration information The AP task has to check the received Parameter Dataset if it is consistent and valid to use it finally in the positive case as extended parameterization The indication packet itself requires no response packet to be built by the AP task Just using the macro TLR_QUE_RETURNPACKET will return the packet back to the FSPMS task context In order to address the correct end point identifier the indication command service is used in conjunction with the received ulapmsorda value of the request packet referenced in Table 69 PROF IBUS_FSPMS_CMD_INIT_MSO_REQ Request Command for MSO Initialization The corresponding response packet has to be used by the AP task in order to confirm a previously FSPMS task issued extended Parameter Data The confirmation is required and a must do when having received the indication command declared in Table 99 PROFIBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_IND Indication Command of Extended Parameter Data The flag amp xtPrmoOk indicates if the previously indicated extended Parameter Data Block is valid and
230. ed ulRout UINT32 xX Routing do not touch structure RCX_SET_HW_SWITCH_VALUES_CNF_DATA_T x Data Table 160 RCX_SET_HW_SWITCH_VALUES_CNF Confirmation to Set Hardware Switch Values Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 220 238 7 Status Error Codes Overview 7 1 Error Codes of the FSPMS Task Hexadecimal Value Definition Description 0x0000 0xC0000001 TLR_S OK Status ok TLR_E_ FAIL Common error detailed error information optionally present in the data area of packet 0xC 0090001 TLR_E_ PROFIBUS FSPMS_COMMAND_INVALID Invalid command received 0xC 0090002 TLR_E_PROFIBUS_FSPMS_MAX_EXT_DIAG_SIZE_EXCEEDED Setting the slave diagnostic failed because the limit of the maximum number of 238 extended diagnostic bytes is exceeded 0xC0090003 TLR_E_PROFIBUS_FSPMS_MAX_CFG_DATA_SIZE_EXCEEDED Setting the slave s configuration data failed because the limit of the maximum number of 244 configuration bytes is exceeded 0xC0090004 TLR_E_PROFIBUS_FSPMS_MS0_INIT_WRONG_STATE The cyclic slave state machine cannot be initialized state machine is not in POWER ON state 0xC 0090005 TLR_E_PROFIBUS_FSPMS_SLAVE_DIAG_POWER_ON Setting the Slave Diagnostic Data cannot be performed because slave state machine isn t initialized yet 0xC 009000
231. ed in the AP task for addressing which process data object in which slot has caused the alarm typically a module For more information see section Alarm Processing on page 68 Packet Structure Reference typedef struct PROFIBUS_FSPMS_C1_ALARM_ACK_IND_Ttag LR_UINT8 bSlotNumber LR_UINT8 bAlarmType LR_UINT8 bSeqNr PROFIBUS_FSPMS_C1_ALARM_ACK_IND_T typedef struct PROFIBUS_FSPMS_PACKET_C1_ALARM_ACK_IND_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_C1_ALARM_ACK_IND_T tData PROF IBUS_FSPMS_PACKET_Ci_ALARM_ ACK _IND_T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 156 238 structure PROFIBUS_FSPMS_PACKET_C1_ALARM_ACK_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 3 sizeof PROFIB
232. eesaeeseeeeaeeeseeeesaeeeeaeeeeaeeseaeeseaeeseaeeseeeseneeeeaees 21 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Appendix 237 238 Figure 5 Transition Chart Application aS S rvel cceecceeeceeeeeeeeneeeeneeeeeeeeaeeeeaeeseaaeeeaeeeseeeeeaaeeseeeeesaeseaeeseaeeseaeessaeeseeeeeaees 22 Figure 6 Internal Structure of PROFIBUS DP Slave Firmwatre ccccccecsceeeeeeeeeeeeeneeeeeeeeeeeeeeeeeeaeeseaeeseaeeeaeeseaeeseaeeseaees 41 Fig re 7 States of Profibus DP Slave ae ra a a a aae aar T aae a a a aa a Aa aaraa Aaa Sera araa S aaaea R aE SaS 46 Figure 8 Initialization Sequence of Commands for Profibus DP Slave cecceeseseeeeeeeeeseeeeeeeeeeaeeseeeeeeeeeeeseeeseeeeeaees 47 Figure 9 Initialization Sequence of DP V1 Class 2 COnmnection ceccceesceeeeeeeeneeeeeeeeeeeeeeeeeeeeeeeseeeseeesaeeseaeeseeeseeeenaees 65 Figure 10 Flow Diagram of Start up Process eccceeeseeeeneeseceeseeeeeeeeeeaeeeeeeceaeeeeeeecaeeseeesaeeeeeeseeseaeessaeeseaeessaeeeeaeesaas 216 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Appendix 8 3 Contacts Headquarters Germany Hilscher Gesellschaft f r Systemautomation mbH Rheinstrasse 15 65795 Hattersheim Phone 49 0 6190 9907 0 Fax 49 0 6190 9907 50 E Mail info hilscher com Support Phone 49 0 6190 9907 99 E M
233. eeseeneeeeseeeseesneeessneeeessneeeeee 15 Table 12 Meaning of Destination Parameter UID St ccccceeeeeeeeceeeeeeeeeeeeeaeeeeeeeeeecaaeeeeeeeeeecceaaeeeeeeeeecceeeeeeeeteeeeaaees 17 Table 13 Example for correct Use of Source and Destination related Parameters cccssceceeeseeeeeeeneeeeeseeeeeseteeeeees 18 Table 14 Address Assignment of Hardware Assembly Options cccceeeceeeeceeeeeeeeeeeeeaeeeeaeeeeeeeseaeeeeaeeseeeeseeeneeeseeeteaees 19 Table 15 Addressing Communication Channel 0 3 cccscsccceeseeeeeeeeeeeeeneeeeeseeeeeceeeeeeecaeeeseeeeeeeseaeesseeeeesseeeeeseieeesea 19 Table 16 Address Assignment of Communication Channels demonstrated at Communication Channel 0 0 20 Table 17 Input Data Image Default memory SIZE cess ee eeeeeeteneeeeeeeaeeetenaeeeetenaeeeeeeaeeeeeaeeeeseaeeeeeneeesenaeeeeneaeeeeee 23 Table 18 Input Data Image for netX devices with 8 kByte Dual port Memory cc eeeeeeeenceeeeeeeeeeeeneeeeeeeaeeetesaeeeeeneeeeeed 24 Table 19 Output Data Image Default memory SIZE eee eee eee cent eteteeeeeeeteaeeeeaeeeeaeeeeaeeeeaeeseaeeseseeeeaeeseaeeseaeeseeeseeeeeaees 24 Table 20 Output Data Image for netX devices with 8 kByte Dual port M MOTY eecceeeeeeeeeeeeeeeeeeeeeeneeeeeeeeneeseaeeteaees 24 Table 21 General Structure of Packets for non cyclic Data Exchange cccceeseeseseeeeeeeeeneeseeeeeeeeeeaeeseaeeeneeseaeeseeeteaees 25 Table 22 Channel Mailb
234. ence typedef struct PROFIBUS_FSPMS_CMD_RESET_REQ Ttag PROFIBUS_FSPMS_CMD_RESET_REQ_T define PROFIBUS_FSPMS_CMD_RESET_REQ_ SIZE 0 Request Packet for the deactivating the output indication typedef struct PROFIBUS_FSPMS_PACKET_CMD_RESET_REQ Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_CMD_RESET_ REQ T Packet Description structure PROFIBUS_FSPMS_ PACKET CMD RESET_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER T ulDest UINT32 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSrc UINT32 0 2 7 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSreId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 G21 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulcmd UINT32 0x044E PROF IBUS_FSPMS_CMD_RESET_REQ_SIZE Command ulExt UINT32 0 Extens
235. eption positively and has returned low priority data in the response 0xC0060087 TLR_E PROFIBUS _DL_ACK_DL The remote station the service has been sent to confirms its reception positively and has returned high priority data in the response 0xC0060088 TLR_E_PROFIBUS_DL_ACK_NA The remote station the service has been sent to shows no or no plausible reaction at all 0xC0060089 TLR_E PROFIBUS_DL_ACK_UNKNOWN The remote station the service has been sent has returned an unknown acknowledgement code 0xC006008A TLR_E_PROFIBUS_DL_ACK_LS The requested service is not activated within the local SAP configuration 0xC006008B TLR_E PROFIBUS _DL_ACK_LR The local resources needed to execute the requested service are not available or not sufficient 0xC006008C TLR_E PROFIBUS DL_ACK_DS The local data link layer is not in the logical token ring or disconnected from the network 0xC006008D TLR_E_PROFIBUS_DL_ACK_IV Invalid parameter detected in the requested service O0xC006008E TLR_E_PROFIBUS_DL_ACK_NO The local SAP is not activated because it has been activated already or resources are not sufficient 0xC006008F TLR_E_PROFIBUS DL_ACK_NO_ SET The variable to be set does not exist 0xC0060090 TLR_E_PROFIBUS_DL_ACK_RE Format error of the telegram 0xC0060091 TLR_E PROFIBUS _DL_TSET_INVALID The specified parameter TSET is out of range 1 255 Table 163 Error M
236. erated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x044C PROF IBUS_FSPMS_CMD_IND_SETTING_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_IND_ SETTING_REQ T fOutputIndDeact BOOLEANS 0 1 Flag indicating whether the output indication has been deactivated 1 or not 0 Table 136 PROFIBUS_FSPMS_CMD_IND_SETTING_REQ Request for deactivating the Output Indication PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 191 238 This packet confirms the deactivation of the output indication Packet Structure Reference typedef struct PROFIBUS_FSPMS_I f PB define PROFIBUS FSPMS_ Recusar Pan typedef struct aR B IER ROFE USSRSPMS ANDES EEMINEAG the star US_FSPMS ket for PROFIB SETTING C T D ma IND_SETTING_CNF_SIZE D Wire i sizeof PROF IBUS_FSPMS_IND_SETTING_CNF_T E ting the Mas ter Slave cyclic state machine PACKEMEENDES R_PACK ET HE ADER_T tHead ROE Ui Sm Hoe ROE IBUSTHSP S IND SETTING C In EDENE e SSPACKEINEINDESE Packet Description TTING _CNF_T ETTING_CNF_Ttag
237. erface 136 238 Source Code Example void APS _Check_User_Prm_ind PROFIBUS_APS_RSC_T FAR ptRsc INO INOS A S ANC IRENE 1 IayNRe joie l2eleic Just some fault test parameter to deny IGA ENA oe hesan OEE Oats Oncesr Omari Oxcicic jh 6 TLR_BOOLEAN fPrmOk FALSE LR_UINT uUsrPrmLen ptPckt gt tChkUsrPrmind tHead ulLen if uUsrPrmLen lt ptRsc gt tLoc tMscyls uUsrPrmDataSize if uUsrPrmLen sizeof abFltPrm if MEMCMP amp ptPckt gt tChkUsrPrmiInd tData abUserPrmData abF1ltPrm sizeof abFltPrm 0 PrmOk TRUE TLR_QUE_RETURNPACKET ptPckt APS_Check_User_Prm_Result_regq ptRsc fPrmOk PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 137 238 typedef struct TLR_BOOLEAN8 PROFIBUS FSP PrmOk S_CHECK USE RSERMEREGENE PROF IBUS_FSPMS_CHECK_USER_PRM_RES_Ttag CHECK_USER_PRM_RES_Trag typedef struct PROFIBUS_FSPMS_PACKET TLR_PACKET_HEADER_T tHead PROP TBUS IF SPMS CHECK USER PRM ORES 7 cDatla PROFIBUS _FSPMS_ PACKET CHECK USER PRM REST Packet Description structure PROFIBUS_FSPMS_ PACKET _CHECK_USER_PRM_RES T Type Response
238. essages of the DL Task PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 228 238 7 2 1 Diagnostic Codes of the DL Task Hexadecimal Value Definition Description 0x0000 TLR_S OK Status ok 0xC0060001 TLR_DIAG_E_PROFIBUS_DL_DATA_ACK_RES Invalid Data Ack SDA response packet received Response does not match to internally reserved communication block 0xC0060002 TLR_DIAG_E_PROFIBUS_DL_DATA_RES Invalid Data SDN response packet received Response does not match to internally reserved communication block 0xC0060003 TLR_DIAG_E_PROFIBUS_DL_DATA_REPLY_RES Invalid Data Reply SRD response packet received Response does not match to internally reserved communication block Table 164 Diagnostic Messages of the DL Task PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 7 3 Error Codes of the APS Task 229 238 Module configuration consists invalid length Hexadecimal Value Definition Description 0x00000000 TLR_S OK Status ok 0xC01D0002 TLR_E PROFIBUS APS ALREADY _CONFIGURED Device is already configured The new configuration is discarded 0xC01D0003 TLR_E PROFIBUS _APS_NO_CONFIG_DBM No database available 0xC01D0004L TLR_E PROFIBUS _APS_C
239. event For an explanation of the 3 error variables bErrorDecode bErrorCodel and bErrorCode2 refer to section 5 5 1 2 Error Handling ulSta shall be TLR_E_FATL not 0 CI Packet Structure Reference define PROFIBUS_FSPMS_C2_READ_RES_POS_SIZE sizeof PROFIBUS_FSPMS_C2_READ_RES_POS_T PROF IBUS_FSPMS_MAX_READ_DATA_SIZE typedef struct PROFIBUS_FSPMS_C2_READ_RES_POS_Ttag LR_UINT32 ulReference LR_UINT8 bSlotNumber LR_UINT8 bIndex LR_UINT8 bLength LR_UINT8 abData PROFIBUS_FSPMS_MAX READ _DATA_SIZE TPINOU IUEIUKS JESI2MIS MOP MREADARESS ROSAE typedef struct PROFIBUS_FSPMS_PACKET_C2_READ_RES_POS_Ttag TLR_PACKET_HEADER_T tHead PROM IWS SIMS C2 IRN IRS PO S AL iciDeieeis PROFIBUS_FSPMS_PACKET_C2_ READ RES POS_T Packet Description structure PROFIBUS_FSPMS_ PACKET _C2_ READ RES POS T Type Response Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle of FSPMS Task Process Queue ulSre UINT32 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulFSPMS2Id Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMS2ld Source end point identifier
240. f packages that can be accepted 3 2 5 Receive Mailbox The receive mailbox area is used by protocols utilizing a non cyclic data exchange mechanism Another use of the mailbox system is to provide access to the firmware running on the netX chip itself The receive mailbox is used to transfer non cyclic data from the network or from the protocol stack The size is 1596 bytes for the receive mailbox in the default memory layout The mailbox is accompanied by counters that hold the number of waiting packages for the receive mailbox 3 2 6 Channel Mailboxes Details of Send and Receive Mailboxes Master Status Offset Type Name Description 0x0200 UINT16 usPackagesAccepted Packages Accepted Number of packages that can be accepted 0x0202 UINT16 usReserved Reserved Set to 0 0x0204 UINT8 abSendMbx 1596 Send Mailbox Non cyclic data to the network or to the protocol stack 0x0840 UINT16 usWaitingPackages Packages waiting Counter of packages that are waiting to be processed 0x0842 UINT16 usReserved Reserved Set to 0 0x0844 UINT8 abRecvMbx 1596 Receive Mailbox Non cyclic data from the network or from the protocol stack Table 22 Channel Mailboxes PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 28 238 Channel Mailboxes Structure typedef struct tagNETX_SEND_MATLBOX_BLOCK UINT
241. f the alarm The allowed range here goes from 0 to 254 The value 255 is declared as reserved in the DPV1 norm description bAlarmType UINT8 0 127 Alarm type See below bSeqNr UINT8 0 31 Sequence number for the distinction of alarms that are active at the same time Table 112 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_RES Alarm Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public POS Positive Response to Indication Command of an Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struc 159 238 t PROFIBUS_FSPMS_C1_ALARM_ACK_RE S_N EG Ttag EG Ttag LR_UINT8 bErrorDecode LR_UINT8 bErrorCodel LR_UINT8 bErrorCode2 PROFIBUS_FSPMS_C1_ALARM ACK_RES_NEG_T Negative response packet of an acyclic alarm acknowledgement command typedef struct PROFIBUS_FSPMS_PACKET_C1_ALARM_ACK_RES_N TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_C1_ALARM_ACK_RES_NEG tlacay PROFIBUS_FSPMS_ PACKET_Cl_ALARM ACK RES NEG T Packet Description structure PROFIBUS_FSPMS_PACKET_C1_ALARM_ACK_RES_NEG_T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Q
242. fication untouched ulSta UINT32 See chapter Error Codes of the APS Task ulCmd UINT32 0x3103 PROFIBUS_APS_SET_CONFIGURATION_CNF Reply ulExt UINT32 0 Extension untouched ulRout UINT32 x Routing do not touch Table 58 PROFIBUS_APS_SET_CONFIGURATION_CNF Confirmation for Setting Warmstart Parameters PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 75 238 6 1 2 PROFIBUS_APS_ CHECK _USER_PRM_IND RES Check User Parameter Data This service indicates the AP task that a check of parameterization is necessary The AP task has to check the received Parameter Data Set whether it is consistent and valid to use it finally in the positive case as parameterization For more information also see section Parameterization on page 52 There you can also find a description of the data format valid for parameter data which also applies for the abUserPrmData parameter of this packet This indication will only be sent if the following conditions are fulfilled 1 The application has registered itself at the Profibus DP protocol stack formerly 2 Auto configuration mode has been enabled by setting the auto config flag bit 6 in the warmstart parameters see there Note If the auto configuration mode is enabled flag WRMSTRT_FLG_AUTOCONFIG and the application is NOT registered then the requests of the PROFIBUS D
243. ge Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulFSPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 n n number of bytes in extended User Parameter Data block abExtUserPrmData Packet Data Length in bytes ullId UINT32 0 29 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0438 PROFIBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_CHECK_EXT_USER_PRM_IND_T abExtUserPrmData UINT8 Parameter data to be validated and accepted scl Table 99 PROFIBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_IND Indication Command of Extended Parameter Data Source Code Example void APS _Check_Ext_User_Prm_ind PROFIBUS_APS_RSC_T FAR ptRsc PINON INS NES INC IEE Il INR O ECKE TLR_BOOLEAN fExtPrmO0k TO DOLL y Check here the received User Parameter data fExtPrmOk TRUE TLR_QUE_RETURNPACKET
244. ght be desirable in many cases Global Control Cyclic data transfer can also partially or totally be influenced by the reception of a global control indication packet see section PROFIBUS_FSPMS_CMD_GLOBAL_CONTROL_IND Indicating a Global Control Command on page 127 This contains the synchronization bits Sync and Freeze forcing synchronization of inputs and outputs either individually or in a combined manner Synchronization of Inputs Sending a Freeze command to a DP slave will cause reading the inputs and freezing them This means all following read attempts of this input will deliver the value read at the time of the freeze command as long as the freeze command has not been suspended Suspending the freeze command is possible either by an unfreeze command or by a subsequent freeze command Sending an Unfreeze command to a DP slave will cause normal operation of the cyclic inputs again PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 60 238 Synchronization of Outputs Sending a Sync command to a DP slave will cause the current output values to be frozen These values will be used until the sync command is suspended This can be accomplished either by sending an unfreeze command or another sync command Sending an Unsync command to a DP slave will cause nor
245. gth in bytes PROFIBUS_FSPMS_IOL_CALL_IND_SIZE bytes to write ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 0 TLR_S_Ok See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0428 PROF IBUS_FSPMS_CMD_IOL_CALL_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_IOL_CALL_IND_T tAcyc PROFIBUS_ FSPMS_ACY CLIC_INFO_ HEADER_T Acyclic header tCall PROFIBUS_ FSPMS_CAL L HEADER Call header tlOL PROFIBUS __ FSPMS_IOL _HEADER_T 10 Link header ablOLData 236 UINTS IO Link data Table 157 PROFIBUS_FSPMS_CMD_IOL_CALL_IND PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public 1O Link Call Indication t Hilscher 2005 2013 Packet Structure Reference 213 238 The Application Interface typedef struct PROFIBUS_FSPMS_TOL_CALL_RES_POS_Ttag PROFIBUS_FSPMS_ACYCLIC_INFO_HEADER_T tAcyc PROFIBUS_FSPMS_CALL_ HEADER_T tCall PROP IBUS FSPMS TOL BRADER i CIOL TLR_UINT8 ablOLData PROFIBUS_FSPMS_IOL_CALL_ MAX DATA PROFIBUS_FSPMS_IOL_CALL_RES_POS_T typedef struct PROFIBUS_FSPMS_PACKET_IOL_CALL_RES_POS_Ttag
246. h for input data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 35 238 3 4 Control Block A control block is always present within the communication channel In some respects control and status block are used together in order to exchange information between host application and netX firmware The control block is written by the application whereas the application reads a status block Both control and status block have registers that use the Change of State mechanism see also section 2 2 1 of the netX Dual Port Memory Manual The following gives an example of the use of control and status block The host application wishes to lock the configuration settings of a communication channel to protect them against changes The application sets the Lock Configuration flag in the control block to the communication channel firmware As a result the channel firmware sets the Configuration Locked flag in the status block see below indicating that the current configuration settings cannot be deleted altered overwritten or otherwise changed The control block of a dual port memory features a watchdog function to allow the operating system running on the netX supervise the host application and vice versa The control area is always present in the dual port memory Control Block Offset Type Name Description 0x0008 UINT32 ulApplicationCO
247. he netX Send Mailbox Packet transfer from host system to netX firmware Receive Mailbox Packet transfer from netX firmware to host system For more details about acyclic data transfer via mailboxes see section 3 2 Acyclic Data Mailboxes in this context is described in detail in section 3 2 1 General Structure of Messages or Packets for Non Cyclic Data Exchange while the possible codes that may appear are listed in section 3 2 2 Status amp Error Codes However this section concentrates on correct addressing the mailboxes 2 3 2 Using Source and Destination Variables correctly How to use ulDest for Addressing rcX and the netX Protocol Stack by the System and Channel Mailbox The preferred way to address the netX operating system rcX is through the system mailbox the preferred way to address a protocol stack is through its channel mailbox All mailboxes however have a mechanism to route packets to a communication channel or the system channel respectively Therefore the destination identifier ulDest in a packet tHeader has to be filled in according to the targeted receiver See the following example 0x01 0x02 0x20 0x00 0x02 0x20 0x01 0x02 ulDest 0x00 0x ulDest ulDest ulDest ulDest ulDest ulDest ulDest ulDest Channel 0 Mainibox Figure 2 Use of ulDest in Channel and System Mailbox PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hi
248. he packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 O22 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0421 PROF IBUS_FSPMS_CMD_SET_IMO_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 xX Routing do not touch Table 144 PROFIBUS_FSPMS_CMD_SET_IMO_CNF Confirmation to Change I amp M0 Parameter Settings Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 6 2 32 PROFIBUS_FSPMS_CMD IM READ IND RES Indication Response A PROFIBUS_FSPMS_CMD_OM_RI has send a I amp M call get request tData un abData PROF IBUS_FSPMS_CMD_SET_IMO_REQ request field and the length has BUS_FSPMS_PACKET_IM_READ_RES PROF I If the verification is invalid be tHead ulSta has to be set to TLR_E_ set in FA 200 238 I amp M Read EAD_IND indication is sent by the FSPMS task if a PROFIBUS DP Master and the Application has registered an I
249. he ulSrcId variable of each Confirmation Packet and in the ulDestId variable for Indication Packets sent to the AP task context from now on This covers packets like those used for read write and alarm services The FSPMS task returns its end pointer reference in the confirmation packet of the initialization packet The AP task has to use this returned value as ulDestId value from now on in all request and response packets that are sent to the FSPMS task context Using the Macro TLR_QUE_SENDPACKET_FIFO will send the packet to the FSPMS task process queue The bAlarmModeSlave parameter indicates the maximum number of active alarms that can be handled by the Profibus DP Master The table below explains the applied coding Coding of the bAlarmModeSlave parameter Value Meaning 0 1 alarm of each type possible 1 2 alarms in total 4 alarms in total 8 alarms in total 12 alarms in total 16 alarms in total 24 alarms in total NN OD oOo JOJN 32 alarms in total Table 71 Coding of the bAlarmModeSlave Parameter 4 Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 94 238 The bits of the bAlarmsSupported
250. heck User Parameter Data ccceeseeeeees 75 6 1 3 PROFIBUS_APS_CHECK_CFG_IND RES Check Configuration Data cccceseeeseeeeeeteteeeeeeees 78 6 1 4 PROFIBUS_APS_GET_USER_PRM_REQ CNF Request User Parameter Data eeseeeeeees 81 6 1 5 PROFIBUS_APS_GET_CFG_REQ CNF Request Config Data cccccceeeeeeeteeeeeeteneeeeneeteneeeeeens 83 6 2 The FSPMS RaSK a lentes a ar A aa a a Aa le a aE aE aaae O Se losacds eee 85 6 2 1 PROFIBUS_FSPMS_CMD_INI SO_REQ CNF Initializing the MSCY1S State Machine 88 6 2 2 PROFIBUS_FSPMS_CMD_INI S1_REQ CNF Initializing the MSAC1S State Machine 93 6 2 3 PROFIBUS_FSPMS_CMD_INI S2_REQ CNF Initializing the MSAC2S State Machine 98 6 2 4 PROFIBUS_FSPMS_CMD_ABORT_REQ CNF Send an Abort Signal cscceseceeseeeseeseieeeenees 102 6 2 5 PROFIBUS_FSPMS_CMD_SET_CFG_REQ CNF Setting new I O Is Configuration Data 104 6 2 6 PROFIBUS_FSPMS_CMD_SET_SLAVE_DIAG_REQ CNF Transmitting Diagnostic Data 108 6 2 7 PROFIBUS_FSPMS_CMD_SET_INPUT_REQ CNF Setting the Input Data eeeeeeeeeeeeees 112 6 2 8 PROFIBUS_FSPMS_CMD_GET_OUTPUT_REQ CNF Getting the latest Output Data 115 6 2 9 PROFIBUS_FSPMS_CMD_NEW_OUTPUT_IND Indicating the Reception of new cyclic Output Data118 6 2 10 PROFIBUS_FSPMS_CMD_RESET_REQ CNF Request for resetting the Slave ccseeeeeee 120 6 2 11 PROFIBUS_FSPMS_CMD_A
251. her 2005 2013 The Application Interface 151 238 6 2 19 PROFIBUS_FSPMS_CMD_Cl1_ ALARM NOTIFICATION_REQ CNF Request Command for Alarm Notification Using this command a slave indicates an alarm to the Profibus master the alarm notification will be send to the master which will acknowledge its receipt by a PROF IBUS_FSPMM_CMD_ALARM_ACK_REQ packet which will in turn lead to a subsequent PROF IBUS_FSPMS_CMD_C1_ALARM_ACK_IND indication at the slave The slot number of the slot reporting the alarm should be filled into the variable bSlotNumber The variable bSeqNr holds a sequence number that is used to distinct alarms that are active at the same time Thus the sequence number must be unique to each alarm The alarm type should be written to the variable bAlarmType The alarm specifier should be specified in the variable bAlarmSpecifier The additional acknowledgement flag should be specified in the variable fAddAck User specific alarm data should be filled into the data area The variable bSeqNr holding the number of user specific alarm data should be set accordingly The device supports up to 59 bytes of user specific alarm data For a more detailed description of all alarm parameter please refer to the PROFIBUS DPV1 specification All parameter will be checked by the device In case of an error the alarm will be rejected and an error message will be returned to the host application Else the alarm will be sent and the device waits for the Al
252. iBatch database or via packet interface SET_CONFIGURATION_REQ or RCX_SET_HW_SWITCH_VALUE_REQ See section 6 3 1 RCX_SET_HW_SWITCH_VALUES_REQ CNF Set the values of the Hardware Switch Enabling and disabling Address and Baudrate Switching On database files and SET _CONFIGURATION_REQ evaluating the switches can be activated or deactivated This information is located at the SystemFlags Also see section 6 1 1 PROFIBUS_APS_SET_CONFIGURATION_REQ CNF Set Configuration Parameters Behavior at Start up In general the firmware stack can be configured in different ways Only one type of configuration can be active at a certain time These are evaluated at start up in the following order SYCON net database iniBatch database via netX Configuration Tool Warmstart Request packet compatibility Set Configuration Request packet After a Restart the stack will first search for the SYCON net database files config nxd If these are found all other configuration methods will not be accepted If no SYCON net database exists but an iniBatch database exists its configuration will be used and configuration packets will be not accepted If no database is found the stack is unconfigured until the receipt of the first configuration packet In this case the firmware waits for the SET CONFIGURATION_REQ or WARMSTART_REQ packet Once one of these packets i e SET _
253. iagReq tData abExtDiagData 0 pabDiagData PROF IBUS_FSPM_MAX_DIAG DATA_SIZE else ptPck gt tSetSlaveDiagReq tHead ullLen PROFIBUS_FSPMS_SET_SLAVE_DIAG_REQ_ SIZE uDiagLen ptPck gt tSetSlaveDiagReq tData fExtDiagOverflow TLR_FALSE MEMCPY void amp ptPck gt tSetSlaveDiagReq tData abExtDiagData 0 pabDiagData uDiagLen ptPck gt tSetSlaveDiagReq tData fExtDiagFlag fExtDiagFlag TLR_QUE_SENDPACKET_FIFO ptRsc gt tLoc tMscyls tLnkDst ptPck TLR_INFINITI else ProfibusApsFaultind ptRsc TLR_DIAG_E_PROFIBUS_APS_NO_SLAVE_DIAG_ PACKET Ea PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_PACKET_SET_SLAVE DIAG _CNF_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_SET_SLAVE_DIAG CNF_T Packet Description 111 238 structure PROFIBUS_FSPMS_PACKET_SET_SLAVE_DIAG_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle unto
254. ic data If you try to set new diagnostic data with a too large data area more ee 244 bytes you will receive an error code TLR_E_PROFIBUS_FSPMS_MAX_EXT_DIAG_SIZE_EXCEEDED along with the confirmation packet you will then have to shorten your diagnosis data or to divide them to separate packets If you try to set new diagnostic data while a similar request already issued earlier is still processed you will receive an error code TLR_E_PROFIBUS_FSPMS_SLAVE_DIAG_PENDING In this case you will have to wait until the processing of the pending diagnosis request has finished and then your new request will be processed correctly ee PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 109 238 Packet Structure Reference define PROFIBUS_FSPMS_MAX DIAG DATA_SIZE 238 typedef struct PROFIBUS_FSPMS_SET_SLAVE_DIAG REQ Ttag TLR_BOOLEANS8 fExtDiagOverflow TLR_BOOLEANS8 fExtDiagFlag LR_UINT8 abExtDiagData PROFIBUS_FSPMS MAX DIAG DATA_SIZE PROFIBUS FSPMS SET SLAVE DEAG REO LT TT ra define PROFIBUS_FSPMS_SET_SLAVE_DIAG_REQ_SIZE sizeof PROF IBUS_FSPMS_SET_SLAVE_DIAG_REQ_T PROF IBUS_FSPMS_MAX_ DIAG _DATA_SIZE
255. ication in a packet queue This queue has limited space and may fill up so new packets maybe lost To avoid these data loss situations it is strongly recommended to empty the mailbox frequently even if packets are not expected by the host application Unexpected command packets should be returned to the sender with an Unknown Command in the status field unexpected reply messages can be discarded PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 25 238 3 2 1 General Structure of Messages or Packets for Non Cyclic Data Exchange The non cyclic packets through the netX mailbox have the following structure Structure Information Type of packet Variable Type Value Range Description tHead Structure Information ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 Destination Queue Reference ulSrcld UINT32 Source Queue Reference ulLen UINT32 Packet Data Length In Bytes ulld UINT32 Packet Identification As Unique Number ulSta UINT32 Status Error Code ulCmd UINT32 Command Response ulExt UINT32 Reserved ulRout UINT32 Routing Information tData Structure Information User Data Specific To The Command Table 21 General Structure of Packets for non cyclic Data Exchange Some of the fields are mandatory some are conditional othe
256. ifier specifying the origin of the packet inside the Source Process ulLen UINT32 12 Packet Data Length in bytes ullId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0448 PROFIBUS_FSPMS_CMD_STATE_CHANGED_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_STATE_CHANGED_IND_T ulState UINT32 1 2 3 4 State of operation ulError UINT32 1 0 or diag Error code nostic error number ulReason UINT32 Usually 0 Reason code Table 133 PROFIBUS_FSPMS_CMD_STATE_CHANGED_IND Indication for Change of State PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 188 238 6 2 27 PROFIBUS_FSPMS_CMD_REGISTER_DIAG STRUCT_REQ CNF Request for Registration of Diagnostic Structure This request is used to register the diagnostic structure gt Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Packet Structure Reference typedef struct PROFIBUS_FSPMS_REGISTER_DIAG_STRUCT_REQ_Ttag THUR TIN pbDiagArea TLR_UINT32 ulLength PROFIBUS_FSPMS_REGISTER_DIAG STRUCT_REQ_T
257. ilscher 2005 2013 The Application Interface 209 238 6 2 35 PROFIBUS_FSPMS_CMD IOL CALL IND RES_POS RES_NEG 10 Link Call Indication If on a previously registered slot index an lO Link call is requested the command PROF IBUS_FSPMS_CMD_IOL_CALL_IND is sent by the stack The indication contains the full data which is sent on bus Useful data for application is tData tAcyc bSlot Slot TOSHK Call tData tAcyc bIndex index of I0 Link call EDstca ceCaull OM MEIEVPOIrE EMEILES7 jOOIWE Oi WO iIbaimlk lt eli tData tIOL bControl Ozak eall icwineicieim2 Q Cancel Release 1 Taie 2 Writ Data 3 Read Data tData tIOL usIOLIndex cos S2767 IO Link device data index 65536 port function invocation tData tIOL bIOLSubindex IO Link device data subindex or port function The data in tData tAcyc must not be changed because it contains the reference for stack to handle IO Link call Structure PROFIBUS_FSPMS_ACYCLIC_INFO_HEADER_T structure PROFIBUS_FSPMS_ACYCLIC_INFO_HEADER_T Variable Type Value Range Description bSAP Idx UINT8 SAP Index bSlot UINT8 0 254 Slot bIndex UINT8 0 255 Index Table 154 PROFIBUS_FSPMS_ACYCLIC_INFO_HEADER_T Structure Structure PROFIBUS_FSPMS_CALL_HEADER_T structure PROFIBUS_FSPMS_CALL_HEADER_T Variable Type Value Range Description bFunction UINT8 8 Extended function number CALL bEntityPort UINT8
258. ing do not touch structure PROFIBUS_FSPMS_SET_SLAVE_DIAG REQ T fExtDiagOverflow BOOL8 0 1 This flag may be set to TLR_TRUE 1 if more than PROFIBUS_FSPMS_MAX_DIAG_ DATA_SIZE bytes are available as diagnostic data fExtDiagFlag BOOL8 0 1 This flag may be set to TLR_TRUE 1 if the passed diagnostic block is declared as extended diagnostic abExtDiagData UINT8 Diagnostic data block to be transferred Table 80 PROF IBUS_FSPMS_CMD_SET_SLAVE_DIAG_REQ Request Command for sending Diagnosis Data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 110 238 Source Code Example void APS _Set_Slave_Diag_regq PROFIBUS_APS_RSC_T FAR ptRsc TLR_BOOLEAN f ExtDiagFlag LR_UINT uDiagLen LR_UINT8 FAR pabDiagData PROFIBUS_APS_PACKET_T ptPck if TLR_POOL_PACKET_GET ptRsc gt tLoc hPool amp ptPck TLR_S_OK ptPck gt tSetSlaveDiagReq tHead ulCmd PROFIBUS_FSPMS_CMD_SET_SLAVE_DIAG_REQ TiRwOULMOENK SE la PACKHTESR i ELC ptnse BLOC MEMS Cy ESA EERS EN if uDiagLen gt PROFIBUS_FSPM_ MAX DIAG DATA_SIZE ptPck gt tSetSlaveDiagReq tHead ulLen sizeof PROFIBUS_FSPMS_SET_SLAVE_DIAG_REQ_T ptPck gt tSetSlaveDiagReq tData fExtDiagOverflow TLR_TRUE MEMCPY void amp ptPck gt tSetSlaveD
259. ion not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 87 PROFIBUS_FSPMS_CMD_RESET_REQ Request for resetting the Slave PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 121 238 typedef struct PROFIBUS_FSPMS_CMD_RESET_CNF_Ttag PROFIBUS_FSPMS_CMD_RESET_CNF_T define PROFIBUS_FSPMS_CMD_RESET_CNF_SIZE 0 Request Packet for the deactivating the output indication typedef struct PROFIBUS_FSPMS_PACKET_CMD_RESET_CNF_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_CMD_RESET_CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET_CMD_RESET_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPM
260. irmation to Get Configuration Data Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 85 238 6 2 The FSPMS Task Within the Profibus DP Slave Stack the FSPMS task coordinates the underlying DP Slave state machines used for processing of the various services It consists of the MSCY1S the MSAC1S and DMPMS defined in the Chapter 6 3 of the 61158 6 IEC 2003 E Furthermore it is responsible for all application interactions and represents the counterpart of the AP task within the existent DP Slave Stack implementation To get the handle of the process queue of the FSPMS task the Macro TLR_QUE_IDENTIFY has to be used in conjunction with the following ASClIl Queue name ASCII Queue Name Description PB_FSPMS_ QUE Name of the FSPMS task process queue Table 67 FSPMS task Process Queue The returned handle has to be used as value ulDest in all initiator packets the AP task intends to send to the FSPMS task This handle is the same handle that has to be used in conjunction with the macros like TLR_QUE_SENDPACKET_FIFO LIFO for sending a packet to the FSPMS task PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013
261. is limited to cases of intent or grossly negligent violation of significant contractual obligations Indemnity claims for the violation of significant contractual obligations are limited to damages that are foreseeable and typical for this type of contract It is strictly prohibited to use the software in the following areas for military purposes or in weapon systems for the design construction maintenance or operation of nuclear facilities in air traffic control systems air traffic or air traffic communication systems in life support systems in systems in which failures in the software could lead to personal injury or injuries leading to death We inform you that the software was not developed for use in dangerous environments requiring fail proof control mechanisms Use of the software in such an environment occurs at your own risk No liability is assumed for damages or losses due to unauthorized use 1 8 4 Export The delivered product including the technical data is subject to export or import laws as well as the associated regulations of different counters in particular those of Germany and the USA The software may not be exported to countries where this is prohibited by the United States Export Administration Act and its additional provisions You are obligated to comply with the regulations at your personal responsibility We wish to inform you that you may require permission from state authorities to export re export or impor
262. l evedebiceploethayileees Waaudelsedecesfizeeodewieece 13 2 Fundamentals 5 scsi cis co ccc scenes soeewed scone aR sua door EANA raaa E ENAERE 14 2 1 General Access Mechanisms on netX Systems 0 cccccceececeeeeeeeee scenes ceaaeeeeeeeseeeeeseaeeesaeeseneeees 14 2 2 Accessing the Protocol Stack by Programming the AP Task s Queue 15 2 2 1 Getting the Receiver Task Handle of the Process Queue eesceeeeeeeeeeeeeeeteeeeeeeeeteneeeneeeteaeeenatens 15 2 2 2 Meaning of Source and Destination related ParameterS ccscceeseeeeseeeeeeeteneeseeeteeeseeeteeeeeeees 15 2 3 Accessing the Protocol Stack via the Dual Port Memory Interface 16 2 3 1 Communication via MailDOX S ccccccsceceessneeeeeeneeeeeeaeeesecaneeeceeeeeecaeeeeseaeeeeseeaeesseseeesesneeeeseneess 16 2 3 2 Using Source and Destination Variables COrreCtly ecccesceeeeeeeeeeeeeeeeeeeeeeeneeeeeeseneeesieeeeneeeeieeeeneees 16 2 3 3 Obtaining Information abo nnel 19 2 4 Client Server Mechanism DPS_ACYCLIC_ 2 4 1 Application as Client DATA_Ttag 2 4 2 Application as Server 3 Dual Port Memory cccseeeeeees 3 1 Cyclic Data Input Output Data 3 1 1 Input Process Data 3 1 2 Output Process Data 3 2 Acyclic Data Mailboxes 3 2 1 General Structure of Messages or Packets for Non Cyclic Data Exchange ccseeeceeeeeeeerees 25 3 2 2 Status amp Error Codes 0 ccccccceesscceeseeeeeeeneeeeeseaeee
263. lFSPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet yrsrerd UINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 12 Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0426 PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_IOL_CALL_REGISTER_REQ T ulSlot UINT32 0 254 Slot for IO Link call ullndex UINT32 0 255 Index for IO Link call ulUnregister UINT32 PROFIBUS_FSPMS_TIOL_CALL EGISTER IO Link call is registered PROF IBUS_FSPMS_IOL_CALL U EGISTER IO Link call is unregistered PROF IBUS_FSPMS_IOL_CALL U EGISTER_ALL All IO Link calls are unregistered Table 152 PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_REQ Register IO Link Call Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 208 238 Packet Structure Reference
264. lReference LR_UINT8 bErrorDecode LR_UINT8 bErrorCodel LR_UINT8 bErrorCode2 PROFIBUS _ BSPMS_ 2_READ_RES_NEG_ Ty PROF IBUS_FSPMS_PACKET_ 2_RE typedef struct AD RES_NEG Ttag TLR_PACKET_HEADER_T tHead PROFIBUS _FSPMS_ 2_READ_RES NEG T tData PROFIBUS_FSPMS PACKET _C2_ READ RES NEG T Packet Description structure PROFIBUS_FSPMM PACKET SET _MODE_RES Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS Task Process Queue ulSre UINT32 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulFSPMS2Id Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulAPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 7 sizeof PROFIBUS_FSPMS_C2_READ_RES_NEG_T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04A5 PROF IBUS_FSPMS_CMD_C2_READ_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons
265. lass 1 For instance programming devices engineering tools or diagnostic devices can typically act as a DP master class 2 5 1 3 DP Slave A slave is a Profibus device offering at least one of the two functionalities Reading input data Supplying output data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview S OB A slave is a passive participant on the network as it will not initiate communication it will only react to commands of the master and send requested data or acknowledge received data For instance counters sensors or actuators may typically act as a DP slave 5 2 Operation Modes This section discusses the operation modes of both the PROFIBUS DP Master and the PROFIBUS DP Slave To discuss even the master s operation mode here makes sense because The slave is part of a complete system whose behaviour primarily depends on the master and its configuration The fail safe mechanism of the slave depends directly on the operation mode of the master see description of flag Fail safe supported in section Warmstart Parameters on page 38 5 2 1 Operation Modes of PROFIBUS DP Masters A PROFIBUS DP Master can be in one of four different states which are called the operation modes and have a different degree of allowed functionality These states and their symbolic names are OFFLINE USIF_OFFLINE STOP USIF_STOP CLEAR USIF_CLEAR OP
266. lass 1 is a central control regularly exchanging information with other slave stations on the net in a fixed manner at fixed times This data exchange is denominated as cyclic data exchange Besides its main task the cyclic data exchange the DP Master Class 1 offers the following functionality Acquisition and storage of diagnostic information about the state of the slaves within the Profibus network Configuration and parameterization of the DP slaves Controlling DP slaves with control commands For instance such devices as PLCs CNCs and RCs can typically act as a DP master class 1 5 1 2 DP Master Class 2 A DP Master Class 2 can act like a DP Master Class 1 offering the full functionality described above Additionally it has special capabilities when communicating with slaves such as Reading the configuration data of the DP slave Reading the input and output data but no write access possible Address assignment to slaves Class 2 masters are used for commissioning the network and for maintenance and diagnostic purposes and may be removed when the system is working correctly A DP Master Class 2 may also communicate with a DP Master Class 1 The following functionality is available for this type of communication Upload and download of data Transfer of stored slave diagnostics from master class 1 to master class 2 Activation of bus parameter set Activation and deactivation of slaves Influence on the operation mode of the master c
267. le void APS_SInitMs0O_regq PROFIBUS_APS_RSC_T FAR ptRsc 91 238 EO SIZE t PRORTBUS MARS EPA CKE I EESK if TLR_POOL_PACKET_GET ptRsc gt tLoc hPool amp ptPck TLR_S_OK ptPck gt tInitMs0Req tHead ulCmd PROFIBUS_FSPMS_CMD_INIT_MSO_REQ Tine OURMOENK SE la PACKHTESR i ELC npenseG BLOC mes Cy Sm E ENR SEN ptPck gt tInitMs0OReq tHead ulLen PROFIBUS_FSPMS_INIT_MSO_R ptRsc gt tLoc tMscyls uCfgDataSize ptPck gt tInitMsO0OReq tData fSyncSupported TRUE ptPck gt tInitMsO0OReq tData fFreezeSupported TRUE ptPck gt tInitMsO0OReq tData fNoAddChg FALSE ptPck gt tInitMsO0OReq tData usIdentNumber TLR_UINT16 ptRsc gt tLoc tMscyls ulIdentNumber MEMCPY void amp ptPck gt tInitMs0Req tData abRealCfgData 0 amp ptRsc gt tLoc tMscyls abCfgData 0 ptRsc gt tLoc tMscyls uCfgDataSize TLR_QUE_SENDPACKET_FIFO ptRsc gt tLoc tMscyls tLnkDst ptPck TLR_INFINITE else ProfibusApsFaultind ptRsc TLR_DIAG_E_PROFIBUS_APS_NO_MSO_PACKET PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Applicatio Packet Struct n Interface ure Reference 92 238 typedef struct PROFIBUS_FSPMS_INIT_MSO_CNF_Ttag T3 D R UT RERA Ze ULE SRPMS Oma ERNOUTPEU THB
268. le packet For a sequence of packets the identifier field is incremented by one for every new packet Status Error Code The u State field is used in response or confirmation packets It informs the originator of the packet about success or failure of the execution of the command The field may be also used to hold status information in a request packet Command Response The ulCmd field holds the command code or the response code respectively The command response is specific to the receiving task If a task is not able to execute certain commands it will return the packet with an error indication A command is always even the least significant bit is zero In the response packet the command code is incremented by one indicating a confirmation to the request packet Extension The extension field u Ext is used for controlling packets that are sent in a sequenced manner The extension field indicates the first last or a packet of a sequence If sequencing is not required the extension field is not used and set to zero Routing Information The ulRout field is used internally by the netX firmware only It has no meaning to a driver type application and therefore set to zero User Data Field This field contains data related to the command specified in u Cmd field Depending on the command a packet may or may not have a data field The length of the data field is given in the ulLen field PROFIBUS DP Slave Protocol API DOC050
269. le way PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Interface 131 238 The Application Packet Structure Reference define PROFIBUS_FS typedef struct PROFIBUS_FSPMS_CH TLR_UINT8 abCfgDa IIROUMILIEUIS _Ie S12 PMS IMU CNG IVA IS AL ZA E 244 Sm Crit Chan Cr Cain male ta PROFIBUS_FSP ECK_CFG_IND_Ttag S MAX CFG DATA SIZE typedef struct PROF ITBUS_ESPMS_PACKE T CHECK CEG IND Ttag ABIL EVANC IE IE ave ADER_T tHead PROHIBUSm Hoe SCRIBE WNIDL I REDRE PROFIBUS_FSPMS_PACKET CHECK CFG_IND_T Packet Description structure PROFIBUS_FSPMS_ PACKET CHECK_CFG_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of AP task Process Queue ulSre UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulFSPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 n n number of bytes in Configuration Data block abCfgData Packet
270. lemented Data exchange broadcast not implemented Configuration by database not implemented yet I amp M LR services other than Call REQ RES are not supported yet Table 7 Technical Data Limitations PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 1 6 Terms Abbreviations and Definitions 10 238 Term Description AP Application on top of the Stack AREP Application Reference end point MSO Master to Slave cyclic communication MS1 Master class1 to Slave acyclic communication MS2 Master class2 to Slave acyclic communication DL Data Link Layer DMPMS Data Link Layer Protocol Machine Slave DP Decentralized Periphery DPM Dual Port Memory FSPMS Fieldbus Service Protocol Machine Slave I amp M Identification amp Maintenance LSB Least Significant Byte MSAC1S Master Class1 to Slave acyclic State Machine MSAC2S Master Class2 to Slave acyclic State Machine MSB Most Significant Byte MSCY1S Master slave cyclic state machine PDU Protocol Data Unit PLC Programmable Logic Controller PROFIBUS Process Fieldbus RM Resource Manager Table 8 Terms Abbreviations and Definitions All variables parameters and data used in this manual have the LSB MSB Intel data format This corresponds to the convention of the Microsoft C Compiler PRO
271. level of the source destination is also given by an 8 bit number in the range from 0 to 255 The optional values network address and MAC address of the source or destination respectively are only present when the source type or destination type have the value 1 The network address must be a valid 6 byte network address according to ISO OSI rules The MAC address is a string according to the rules for MAC addresses PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 67 238 5 5 2 7 Connection Supervision by Timers The DP V1 Class 2 connection is monitored in order to detect the failure of the communication partner The monitoring concept is based on the following elements Various monitoring timers The exchange of idle process data units between the communicating partners which retrigger those timers There are various timers both in the master class 2 and in the slave U F Timer I Timer for supervision of the various aspects of the connection The master provides S Timer send timer This timer is used to determine whether the master is idle R Timer receive timer This timer supervises both the slave and the FDL OSI model layer 2 parts of the master The Profibus DP Slave provides U Timer user response timer The user response timer monitors the slave application It is started with passing the service indication to the application an
272. lic ET FIFO ptRsc gt tLoc tMscyls tLinkDst ptPck TLR_INFI PROF IBUS_FSPMS_CMD_APPLICATION_READY_RE TLR_S_OK Q AORC Disha PERS C EOC r EMS CyS RE LAKROS AE TIR E EF _PROFIBUS_APS_NO_APPLICATION_READY_PACKET Hilscher 2005 2013 The Application Interface 124 238 Packet Structure Reference typedef struct PROFIBUS_FSPMS_PACKET_DP_SLAVE_APPLICATION_READY_CNF_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_DP_SLAVE_APPLICATION_READY_CNF_T Packet Description structure PROFIBUS_FSPMS_ PACKET _DP_SLAVE_APPLICATION_READY_CNF_T Type Confirmation Area Variable Type Value Range Description Head structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 uIFSPMSOld Destination end point identifier untouched ulSrcId UINT32 uIAPMSOld Source end point identifier untouched ulLen UINT32 O Packet Data Length in bytes ulld UINT32 0 22 1 Packet Identification untouched ulSta UINT32 See Table 92 PROF IBUS_FSPMS_CMD_APPLICATION_READY_CNF Packet Status Error ulCmd UINT32 0x0413 PROFIBUS_FSPMS_CMD_APPLICATION_READY_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 x Routing do not touch Table 91 PROFIBUS_FSPMS_CMD_APPLI
273. ling is transparent and reported to the requesting DP Master without any change 5 5 2 Acyclic Data Transfer of the DP Master Class 2 5 5 2 1 Class 2 Masters Class 2 masters have special capabilities when communicating with slaves such as Reading the configuration data of the DP slave Reading the input and output data but no write access possible Address assignment to slaves They are used for commissioning the network and for maintenance and diagnostic purposes and may be removed when the system is working correctly Class 2 masters acyclically communicate with slaves over a class 2 connection also called MSAC_C2 connection relationship This class 2 connection must explicitly be set up 5 5 2 2 Extended Addressing Mechanism Principally DP Vi Class 2 uses the same addressing mechanism as DP V1 Class 1 described above but with an important extension As an additional layer a DP master class 2 may contain different application process instance APIs each consisting of slots and indexes for which the same rules apply as for the DP master class 1 5 5 2 3 Basic Services for Connection Maintenance There are two services defined in the Profibus DP Extensions between a Profibus DP Master class 2 and a Profibus DP Slave for handling a class 2 connection MSAC2_Initiate service This service is used by the DP master class 2 in order to set up a DP V1 Class 2 connection to the DP slave The DP slave then receives a PROFIBUS_FSPMS_CMD_C2_IN
274. lock_Req Bits 5 3 2 2 Octets 2 and 3 WD_Fact1 and WD _Fact2 These octets may have values between 1 and 255 Both values represent factors for setting the watchdog control time Twp If the master fails and subsequently the chosen watchdog time expires the output data will fall into the safe state The watchdog time can be computed in units of multiples of 10 milliseconds 0 01 seconds by simply multiplying WD_Fact1 with WD_Fact2 Thus values between 10 milliseconds and approximately 650 seconds are selectable for the watchdog time Note Watchdog control is switched on and off using bit D3 of octet 1 refer to above 5 3 2 3 Octet 4 Minimum Station Delay Responder minTspr This is the minimum time a DP slave will wait until it will send the response frame to the master In case of a pure DP system this is a value in the range between 0 and the value maxT spr In mixed systems the upper limit is 255 times Topi 5 3 2 4 Octet 5 6 Ident_Number In these bytes the master transmits the identification number so the slave will accept the telegram only in case it is equal to its own one 5 3 2 5 Octet 7 Group Ident_Number This byte may be used as a special identifier for setting up groups 5 3 2 6 Octet 8 32 User_Prm_Data Slave specific parameter This is an extended diagnostic buffer PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 5
275. lom o_o mansnower see dew ro aa Peau P 14 Manufacturer specific data of the ean specified in the hetfollowing byte s follow these should be equal to those in Real_Cfg_Data omitted In case of Check_Cfg No manufacturer specific data follow verification may be Table 47 Special Identifier Format of Identifier Byte according to IEC 61158 EN 50170 Specification PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 58 238 5 3 3 4 Length Byte The length bytes following the special identifier format bytes are organized as described in the table below Structure of Length Byte in the Special Identifier Format of the Identifier Byte according to IEC 61158 EN 50170 Specification Bi Name vae Description o O D7 Consistency race extends over o_o or word 1 Whole length Length of data o 1 Byte Word 2 Bytes Words 64 Bytes Words Table 48 Structure of Length Byte in the Special Identifier Format of the Identifier Byte according to IEC 61158 EN 50170 Specification Length format Length format met Byte structure 1 Word structure structure D5 DO PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 59 238 5 4 Cyclic Data Transfer Cyclic data transfer is the main work of a field bus system In Profibus DP this functionality is loc
276. lows Subnet Variable Value Meaning 0 NO 1 SUBNET LOCAL 2 SUBNET REMOTE 3 255 Reserved Table 126 Allowed Values of Subnet Variable The protocol instance variable ul Instance causing the abort is specified here Possible values are FDL USER MSAC_C2 The coding is as follows Instance Codes and their Meaning D7 D6 D5 D4 Protocol Instance causing Abort 0 0 0 0 FDL o Jo 0 1 MSAC_C2 o Jo 1 0 USER Table 127 Instance Codes and their Meaning Bits 0 to 3 are always 0 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 182 238 The reason code is a 4 bit value between 0 and 15 whose meaning depends from the instance It contains information of the cause why the MSAC_C2 connection is to be aborted It indicates the reason for the abort according to the table below If the abort has been caused by FDL Available Reason Codes The Application Interface D7 D6 D5 D4 D3 Instance Reason Description DO Code 0 0 1 FDL UE User Error 2 RR No FDL resource 3 RS Reject FDL service 9 NR No FDL response data 10 DH Data Reply High 11 LR see EN 50170 Part 2 12 RDL see EN 50170 Part 2 z 13 RDH see EN 50170 Part 2 5 5 14 DS Master is not in the logical ring 2 2 15 NA No response from remote FDL
277. lscher 2005 2013 Fundamentals 17 238 For use in the destination queue handle the tasks have been assigned to hexadecimal numerical values as described in the following table ulDest Description 0x00000000 Packet is passed to the netX operating system rcX 0x00000001 Packet is passed to communication channel 0 0x00000002 Packet is passed to communication channel 1 0x00000003 Packet is passed to communication channel 2 0x00000004 Packet is passed to communication channel 3 0x00000020 Packet is passed to communication channel of the mailbox else Reserved do not use Table 12 Meaning of Destination Parameter ulDest The figure and the table above both show the use of the destination identifier u Dest A remark on the special channel identifier 0x00000020 Channel Token The Channel Token is valid for any mailbox That way the application uses the same identifier for all packets without actually knowing which mailbox or communication channel is applied The packet stays local The system mailbox is a little bit different because it is used to communicate to the netX operating system rcX The rcX has its own range of valid commands codes and differs from a communication channel Unless there is a reply packet the netX operating system returns it to the same mailbox the request packet went through Consequently the host application has to return its reply packet to the
278. ly one communication system which is usually the case either a single field bus system or a single standard for Industrial Ethernet communication always PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Fundamentals 20 238 communication channel 0 will be used In devices supporting more than one communication system you should also check the other communication channels There you can find such information as the ID containing channel number and port number of the communication channel the size and the location of the handshake cells the overall number of blocks within the communication channel and the size of the channel in bytes Evaluate this information precisely in order to access the communication channel correctly The information is delivered as follows Address Data Type Description 0x0050 UINT8 Channel Type COMMUNICATION must have the fixed value define RCX_CHANNEL_TYPE_COMMUNICATION 0x05 0x0051 UINT8 ID Channel Number Port Number 0x0052 UINT8 Size Position Of Handshake Cells 0x0053 UINT8 Total Number Of Blocks Of This Channel 0x0054 UINT32 Size Of Channel In Bytes 0x0058 UINT8 8 Reserved set to zero Table 16 Address Assignment of Communication Channels demonstrated at Communication Channel 0 These addresses correspond to communication channel 0 for communication channels 1 2 and 3 you have to
279. m The allowed range here goes from 0 to 254 The value 255 is declared as reserved in the DPV1 specification bAlarmType UINT8 0 127 Alarm type See below bSeqNr UINT8 0 31 Sequence number for the distinction of alarms that are active at the same time fAddAck BOOLEANS8 0 1 The additional acknowledgement flag should be specified in the variable fAddAck bAlarmSpecifier UINT8 See below The alarm specifier should be specified in the variable bAlarmSpecifier abAlarmData UINT8 This area contains alarm specific data Table 107 PROFIBUS_FSPMS_CMD_C1_ALARM_NOTIFICATION_REQ Request Command for Alarm Notification PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 153 238 bAlarm_Type identifies the alarm type The coding is explained in the table below Alarm_Type Alarm_Type value explanation 0 Reserved 1 Diagnostic_Alarm 2 Process_Alarm 3 Pull_Alarm 4 Plug_Alarm 5 Status_Alarm 6 Update_Alarm 7 31 reserved 32 126 manufacturer specific 127 reserved Table 108 PROFIBUS DPV1 Possible Alarm Types The bAlarmSpecii additional user ackn Alarm_Spec_Ack fier Alarm_Spec_Ack parameter gives additional alarm information e g an alarm appears disappears or no further differentiation is not possible or if the alarm requires an owledg
280. mailbox the request was received from How to use ulSrc and ulSrcId Generally a netX protocol stack can be addressed through its communication channel mailbox The example below shows how a host application addresses a protocol stack running in the context of a netX chip The application is identified by a number 444 in this example The application consists of three processes identified by the numbers 11 22 and 33 These processes communicate through the channel mailbox with the AP task of the protocol stack Have a look at the following figure Process 11 Process 22 Process 33 Application 444 Channel Mainbox netX Protocol stack AP Task 1 Figure 3 Using ulSrc and ulSrcld PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Fundamentals 18 238 Example This example applies to command messages initiated by a process in the context of the host application If the process 22 sends a packet through the channel mailbox to the AP task the packet tHeader has to be filled in as follows Object Variable Numeric Description Name Value Destination ulDest 32 This value needs always to be set to 0x00000020 the channel Queue Handle 0x00000020 token when accessing the protocol stack via the local communication channel mailbox Source Queue ulSrc 444 Denotes the host application 444 Handle Destination ulDestld 0 In thi
281. mal operation of the cyclic outputs again Also all outputs can be set to the safe state by the master using the Clear_Data option For more information see section PROFIBUS_FSPMS_CMD_GLOBAL_CONTROL_IND Indicating a Global Control Command on page 127 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 61 238 5 5 Acyclic Data Transfer Acyclic data transfer only happens on request and not periodically in cycles as the cyclic data transfer 5 5 1 Acyclic Data Transfer of the DP Master Class 1 In Profibus DP acyclic data transfer is supported by level DP V1 but not by the lowest level DP VO This means it is necessary that the slave to read from or write to supports the DP V1 extensions to the Profibus standard The acyclic data transfer happens with lower priority than the cyclic data transfer does as it uses gaps i e available remaining times of the bus cycles which have not been required for cyclic data exchange The main packets for acyclic data transfer are Section Packet Name 6 2 17 PROF IBUS_FSPMS_CMD_C1_READ_IND RES_POS RES_NEG Indicating an acyclic read Request to a specific Process Data Object 6 2 18 PROFIBUS_FSPMS_CMD_C1_WRITE_IND RES_POS RES_NEG Indicating an acyclic write Request to a specific Process Data Object Table 50 Packets for Acyclic Data Transfer
282. mode 0xC0060080 TLR_E_PROFIBUS_DL_ACK_UE The remote station the service has been sent to indicates a User Error as service acknowledgement 0xC0060081 TLR_E PROFIBUS _DL_ACK_RR The remote station the service has been sent to indicates a Resource Error as service acknowledgement 0xC0060081 TLR_E PROFIBUS _DL_ACK_RR The remote station the service has been sent to indicates a Resource Error as service acknowledgement 0xC0060082 TLR_E_PROFIBUS_DL_ACK_RS The remote station the service has been sent to indicates a Service Access Point Error as service acknowledgement 0xC0060083 TLR_E PROFIBUS _DL_ACK_NR The remote station the service has been sent to confirms its positive reception but has no data to confirm PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 227 238 Hexadecimal Value Definition Description 0xC0060084 TLR_E PROFIBUS_DL_ACK_RDH The remote station the service has been sent to confirms its reception negatively but has returned low priority data in the response 0xC0060085 TLR_E PROFIBUS _DL_ACK_RDL The remote station the service has been sent to confirms its reception negatively but has returned high priority data in the response 0xC0060086 TLR_E_PROFIBUS_DL_ACK_DH The remote station the service has been sent to confirms its rec
283. mory It is always available in the default memory map see section 3 2 1 of netX Dual Port Memory Manual Extended Status Block Offset Type Name Description 0x0300 UINT8 abExtendedStatus 432 Extended Status Area Protocol Stack Specific Status Area Table 30 Extended Status Block Extended Status Block Structure typedef struct NETX_EXTENDED_STATUS_BLOCK_Ttag UINT8 abExtendedStatus 432 NETX_EXTENDED_STATUS_BLOCK_T For the Profibus DP Slave protocol implementation the Extended Status Area is structured as follows typedef struct FSPMS_EXTENDED_DIAG Ttag UINT32 ulBusAddresse UINT32 ulIdentNumber UINT32 ulBaudrate UINT16 usOutputLength UINT16 usInputLength FSPMS_EXTENDED_DIAG_T The meaning of these parameters is ulBusAddresse This value contains the own address of the Hilscher Profibus DP Slave device The allowed range extends from 0 to 126 uliIdentNumber This value contains a PROFIBUS system specific identification number The value is 0x0A12 indicating a netX based system ulBaudrate This value contains the baud rate of PROFIBUS connection The coding is the one described in Table 34 Available Baud Rate Values The default value is Auto detect usOutputLength This value contains the available length for output data usInputLength This value contains the available lengt
284. n Process Set to 0 for the Initialization Packet ulorcta UINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 19 Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0425 PROF IBUS_FSPMS_CMD_IM_WRITE_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_IM_WRITE_RES_T tInfo PROFIBUS_ Index structure see above FSPMS_IM_l NDEX_T tError PROFIBUS_ Error structure see above FSPMS_IM_ ERROR_T Table 151 PROFIBUS_FSPMS_CMD_IM_WRITE_RES I amp M Write Response PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 206 238 6 2 34 PROFIBUS _FSPMS CMD IOL CALL REGISTER REQ CNF Register IO Link Call To enable the lO Link Call feature in the stack the command PROFIBUS_FSPMS_CMD_IOL_CALL_REGISTER_REQ has to be sent to the FSPMS Task If a IO Link Call is received on the registered slot index the handling is completely done by the stack On a registered slot index no other acyclic read write is possible except for I amp M calls if set up by PROFIBUS_FSPMS_CMD SET_I
285. n of CIP standard 25 Key failure in path The key segment i e the first segment in the path does not match the destination module More information about which part of the key check failed can be derived from the object specific status 26 Path size Invalid Path cannot be routed to an object due to lacking information or too much routing data have been included 27 Unexpected attribute It has been attempted to set an attribute which may not be set in the in list current situation 28 Invalid member ID The Member ID specified in the request is not available within the specified class instance or attribute 29 Member cannot be A request to modify a member which cannot be modified has occurred set 2A Group 2 only server This DeviceNet specific error cannot occur in EtherNet IP general failure 2B CF Reserved Reserved for future extension of CIP standard PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 233 238 General Status Status Name Description Code specified hexadecimally DO FF Reserved for object An object class specific error has occurred class and service errors Table 167 General Error Codes according to CIP Standard PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Appendix 234 238 8 Appendix 8
286. nd point identifier untouched ulSrcId UINT32 0 Source end point identifier untouched ulLen UINT32 4 sizeof PROFIBUS_FSPMS_INIT_MS2_CNF_T Packet Data Length in bytes ulld UINT32 Oe Packet Identification untouched ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulcmd UINT32 0x0407 PROF IBUS_FSPMS_CMD_INIT_MS2_CNF Command ulExt UINT32 0 Extension untouched ulDest UINT32 x Routing do not touch structure PROFIBUS_FSPMS_INIT_MS2_CNF_T ulFSPMS2Id UINT32 Reference to locally generated Reference End Point of the FSPMS Task for the MS2 context Table 75 PROFIBUS_FSPMS_CMD_INIT_MS2_CNF Confirmation Command of MS2 Initialization Source Code Example void APS SinitMs2_cnf PROFIBUS_APS RSC_T FAR ptRsc INO INOS N2 Ss JUNC Ia IE INR Jone PE KRE iR_QUE_LINK_SET_NEW_DESTID ptRsc gt tLoc tMsac2s tLnkDst ptPckt gt tInitMs2Cnf tData ulFSPMSOId THIER I2XO Ob JEN Il IRIDMLIVAYS IO joe RSS SAC Ikyoye Inleoyeull joie 2XONeIc E PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 102 238 6 2 4 PROFIBUS_FSPMS_CMD ABORT_REQ CNF Send an Abort Signal In order to request an abort signal for the MSAC_C2 connection to the Profibus DP Master class 2 you can use the prorIBUS_FSPMS_CMD_ABORT_REQ packet A pROoFIBUS_FS
287. nfiguration Warmstart Command eeceeeeeeeeeeteteeteneeeenees 40 44 Pro ess Data Input and OUtpUt sssiissiriisaininiinsnianiinenaiianaiii aaa aaa aa a iaai 40 4 5 Task Structure of the PROFIBUS DP Slave Stack cecccccceeeeeeseeeeee sees eeeeee scenes seaeeeeeeeeeeeees 41 5 OVEN VIEW osian E EEEa 43 5 1 Classification of PROFIBUS DP Devices 0 0 c ceccecceceeeeceeeeeeeeeeeeseeeeeeeseneeeesseneeeeeesseeaeeseseeaeess 43 514 DP M ster Class Mirer en ea a edee Ne E aa ete S ENR dA 43 51 2 DP Master Glass 2 aa aree arae a r a ra aaar A r aA E P Ea A EAA Aa E EE A aA AAE Ena A Eaa Eaa 43 cse Ee a D nake E AE E E EE E E E E E A ET 43 5 2 Operation MOAGS a cicc caseictedcceched ebdiseceatadees ieveveects deine AEE ae aa E 44 5 2 1 Operation Modes of PROFIBUS DP Masters cceeecceeeeeeeneeeeeeeeeeeeeeeeeeaeeeeaeeseaeeeeeeseneeeeieeeeeees 44 5 2 2 Operation Modes of Profibus DP Slaves eecceceeceeeeeeceneeeeeeseaeeeeeeeseaeeseaeeseaeeseaeeseaeeseaeeseeeenanees 44 5 3 COMMISSIONING aiana ee a eed ac 47 5 321 DIAGNOSIS s rchiiess ier ies titictiiesces a ae EO iawn eh nnd ier ele 48 5 3 2 Parameterization ar a a a a E E a ar aa a aa Eas 52 5 3 3 Configuration of Inputs and OUTPUTS cece eee eeeeeeeeeeeeeaeeeeaeeseaeeseaeeseaeeseaeeseaeeseaeeseaeeseeeseaeeseaeee 54 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introducti
288. nfiguration of Inputs and Outputs on page 54 abCfgData 1 UINT8 Depending on the format of abCfgData 0 Unused if abCfgData 0 contains an identifier byte Length byte for the Special Identifier Byte Format SIF if abCfgData 0 contains a Special Identifier Byte Format abCfgData UINT8 Like abCfgData 0 see above abCfgData UINT8 Like abCfgData 1 see above abCfgData 242 UINT8 Like abCfgData 0 see above abCfgData 243 UINT8 Like abCfgData 1 see above Table 57 PROFIBUS_APS_SET_CONFIGURATION_REQ Set Warmstart Parameters PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 74 238 typedef struct PROFIBUS_APS_PACKET_SET_CONFIGURATION_CNF_Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_APS_ PACKET_SET_CONFIGURATION_CNF_T Packet Description structure PROFIBUS_APS PACKET SET _CONFIGURATION_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle untouched ulSre UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 0 Packet Data Length in Bytes ulId UINT32 0 25 1 Packet Identi
289. nglish 2013 09 Released Public Hilscher 2005 2013 Overview 47 238 5 3 Commissioning In order to get the slave operative a sequence of steps needs to be performed These steps are displayed in the illustration below Initialization Sequence of Profibus DP Slave MS0 Connection DP Master DP Slave Get Diagnostics Request Get Diagnostics Confirmation Set Parameters Request Set Parameters Confirmation Check Configuration Request Check Configuration Confirmation Get Diagnostics Request Get Diagnostics Confirmation Data Exchange Request Data Exchange Confirmation Figure 8 Initialization Sequence of Commands for Profibus DP Slave In this context the following topics need to be discussed in a more detailed manner Diagnosis Parameterization Configuration of Inputs and Outputs PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 8A 5 3 1 Diagnosis The PROFIBUS DP Master firmware offers two functions for making diagnostic information from the slaves available at the server PROFIBUS FSPMM CMD _NEW_SLAVE_DIAG_IND Indicate new Slave Diagnostic PROFIBUS FSPMM_CMD_GET_SLAVE_DIAG_REQ CNF Request a Slave Diagnostic If a new diagnostic is available the PROFIBUS_FSPMM_CMD_NEW_SLAVE_DIAG_IND indication will inform the master about this fact and the master can decide whether and when to request
290. ntifier specifying the final receiver of the packet within the Destination Process ulSrclId UINT32 uIAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 297 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See Table 90 PROF IBUS_FSPMS_CMD_APPLICATION_READY_REQ Packet Status Error ulCmd UINT32 0x0412 PROFIBUS_FSPMS_CMD_APPLICATION_READY_REQ Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 89 PROFIBUS_FSPMS_CMD_APPLICATION_READY_REQ Request Command for setting the Application to ready state Packet Status Error Definition Value Description TLR_S OK Status ok 0x0000 Table 90 PROFIBUS_FSPMS_CMD_APPLICATION_READY_REQ Packet Status Error Source Code Example void APS_Application_Ready_regq PROFIBUS_APS_RSC_T FAR ptRsc PROHTEUS ANS ERAOCKE I I joie Peles if TLR_POOL_PACKET_GET ptRsc gt tLoc hPool amp ptPck ptPck gt tAppRdyReq tHead ulCmd TOR OURS TANK SE PACK ptPck gt tAppRdyReq tHead ulLen 0 TLR_QUE_SENDPACK else ProfibusApsFaultind ptRsc TLR_DIAG _ PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Pub
291. o be written bLength UINT8 n n Number of bytes to be written into the specified Process Data object abDatal UINT8 Process Data object data intended to be written Table 120 PROFIBUS PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public FSPMS_CMD_C2_WRITE_IND Indication Command of a Process Data Write Request Hilscher 2005 2013 The Application Interface 173 238 This service has to be used by the AP Task in order to confirm a previously FSPMS Task issued Process Data write indication The response is required and a must do when having received the indication command declared in Table 120 PROFTBUS_FSPMS_CMD_C2_WRITE_IND Indication Command of a Process Data Write Request In order to address the correct AREP the response command service has to be used in conjunction with the received uirspms2id value of the confirmation packet referenced in Table 75 PROF IBUS_FSPMS_CMD_INIT_MS2_CNF Confirmation Command of MS2 Initialization for a DP Master Class 2 connection The type of connection itself can be distinguished in the AP Task via the value ulDestId of the indication command itself declared in Table 120 PROFIBUS_FSPMS_CMD_C2_WRITE_IND Indication Command of a Process Data Write Request The response is generally distinguished into two types Positive response A positive write response does not have any additional parameter data ulSta TLR
292. o zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure PROFIBUS_FSPMS_STARTED_IND_T bActualEnabledAl UINT8 0 255 This variable contains the currently enabled alarms arms fAlarmSequence BOOLE 0 1 Alarm Sequence AN8 bAlarmLimit UINT8 0 255 Alarm Limit Table 138 PROFIBUS_FSPMS_CMD_STARTED_IND Start Indication PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 193 238 6 2 30 PROFIBUS_FSPMS_ CMD SET STAT DIAG REQ CNF Set Static Diagnostic This packet is used for requesting or releasing a static diagnostic If this packet is sent the diagnostic data are taken and will remain valid until the packet is sent again 4 Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Packet Structure Reference typedef struct PROFIBUS_FSPMS_SET_STAT_DIAG REQ Ttag TLR_BOOLEANS fStatDiag PROFIBUS_FSPMS_SET_STAT_DIAG REQ T define PROFIBUS_FSPMS_SET_STAT_DIAG_REQ_ SIZE sizeof PROFIBUS_FSPMS_SET_STAT_DIAG_REQ_T Request Packet to set a slave diagnostic typedef struct PROFIBUS_FSPMS_PACKET_SET_STAT_DIAG REQ Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_SET_STAT_DIAG_REO EData PROFIBUS_
293. object to be read bIndex UINT8 0 254 Index of the process data object to be read bLength UINT8 0 240 Number of bytes to be read in the specified process data object Table 101 PROFIBUS_FSPMS_CMD_C1_READ_IND Indication Command of a Process Data Read Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 143 238 The PROFIBUS_FSPMS_CMD_C1_READ_RES_ service has to be used by the AP task in order to confirm a previously FSPMS task issued Process Data read indication The response is required and a must do when having received the indication command declared in Table 101 PROF IBUS_FSPMS_CMD_C1_READ_IND Indication Command of a Process Data Read Request In order to address the correct end point identifier the response command service has to be used in conjunction with the received ulrspmsita value of the confirmation packet referenced in Table 73 PROFIBUS_FSPMS_CMD_INIT_MS1_CNF Confirmation Command of MS1 Initialization for a DP Master Class 1 connection The type of connection the response has to be sent to can be distinguished within the AP task via the value ulDest ID of the indication command itself declared in Table 101 PROFIBUS_FSPMS_CMD_C1_READ_IND Indication Command of a Process Data Read Request The response can generally be distinguished into two types Positive resp
294. of a Change Slave Address Request on page 122 In this state and all higher states the slave will receive diagnostic messages from the Profibus DP Master in order to be checked for its presence and degree of operability This state can be left by successful parameterization leading to the parameterized state however even in case of an error during parameterization the slave will sometimes not fall back into the power on reset state depending on the kind of error having occurred Parameterized State By successful parameterization the Profibus DP Slave reaches the parameterized state also denominated as WCFG State indicating the slave is now waiting for configuration Parameterization is done by the master sending a parameterization packet to the Profibus DP Slave As this state is not yet configured the lengths for input and output data are not known and therefore still no cyclic data transfer is possible Changing the slave address is not possible in this state This state can be left in case of successful configuration to the data exchange DXCHG state and in case of errors to the power on reset state Data Exchange DXCHG State Configured State By successful configuration the Profibus DP Slave reaches the configured state often denominated as data exchange DXCHG state indicating the slave is now fully operational and will participate in cyclic data exchange Configuration can be accomplished by the master sen
295. of a Process Data Transport Request In order to address the correct End Point Identifier the response command service has to be used in conjunction with the received uirspms21a value of the confirmation packet referenced in Table 75 PROFIBUS_FSPMS_CMD_INIT_MS2_CNF Confirmation Command of MS2 Initialization for a DP Master Class 2 connection The response can generally distinguished into two types Positive response The variable bLength defines how many bytes are transported back to the FSPMS Task Within the array abData_ the AP Task returns the current Process Data object s transport data ulSta TLR_S_OK Negative response A negative response is issued whenever the indicated request cannot be satisfied by the AP Task 3 variables are specifying the type and source of the error in this event For an explanation of the 3 error variables bErrorDecode bErrorCodel and bErrorCode2 refer to section 5 5 1 2 Error Handling ulSta TLR_E_FAIL not 0 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference RTS IOS OTA 179 238 SRESUr OS f RANSPORT_DATA SIZE 7 define PROFIBUS_FSPMS_C2_DATA_TRANSPOR sizeof PROFIBUS_FSPMS_C2_DATA_TRANSPOR PROFIBUS_FSPMS_MAX DATA _TRANSPOR
296. of the parameter and ranges of allowed values 38 238 Parameter Meaning Range of Value Value Bus Startup The start of the device can be performed either application controlled or automatically Automatic Network connections are opened automatically without taking care of the state of the host application Application controlled The channel firmware is forced to wait for the host application to set the Application Ready flag in the communication change of state register see section 3 2 5 1 of the netX DPM Interface Manual For more information concerning this topic see section 4 4 1 Controlled or Automatic Start of the netX DPM Interface Manual Application controlled 1 Automatic 0 Default Automatic 0 I O Status not yet supported This parameter is represented by bits 1 and 2 of the system flags Using this parameter you can set the status of the input or the output data For each input and output date the following status information in byte is stored in the dual port memory The bits have the following meaning Bit 1 I O Status Enable 0 Status disabled 1 Status enabled not yet supported Bit 2 I O Status 8 32Bit 0 1 Byte mode not yet supported 1 4 Byte mode not yet supported Address Switch This parameter is represented by bit 4 of the system flags It should be set when hardware address switch is used and there is no TAG present 0 off 1
297. ommunication State Communication Channel Error All Implementations This field holds the current error code of the communication channel If the cause of error is resolved the communication error field is set to zero RCX_SYS_SUCCESS again Not all of the error codes are supported in every implementation Protocol stacks may use a subset of the error codes below Value Definition Description 0x00000000 RCX_SYS_SUCCESS SUCCESS Runtime Failures 0xC000000C RCX_E_WATCHDOG_TIMEOUT WATCHDOG TIMEOUT Initialization Failures 0xC0000100 RCX_E_INIT_FAULT General INITIALIZATION FAULT 0xC0000101 RCX_E_DATABASE_ACCESS_FAILED DATABASE ACCESS FAILED Configuration Failures 0xC0000119 RCX_E_NOT_CONFIGURED NOT CONFIGURED 0xC0000120 RCX_E_CONFIGURATION_FAULT General CONFIGURATION FAULT 0xC0000121 RCX_E_INCONSISTENT_DATA_SET INCONSISTENT DATA SET 0xC0000122 RCX_E_DATA_SET_MISMATCH DATA SET MISMATCH 0xC0000123 RCX_E_INSUFFICIENT_LICENSE INSUFFICIENT LICENSE 0xC0000124 RCX_E_PARAMETER_ERROR PARAMETER ERROR 0xC0000125 RCX_E_INVALID_NETWORK_ADDRESS INVALID NETWORK ADDRESS 0xC0000126 RCX_E_NO_SECURITY_MEMORY NO SECURITY MEMORY Table 27 Meaning of Communication Channel Error Network Failures Value Definition Description 0xC0000140 RCX_COMM_NETWORK_FAULT General NETWORK FAULT 0xC0000141 RCX_COMM_CONNECTION_CLOSED CONNECTION CLOSED 0xC0000142
298. on 3 238 5 45 sCyclic Data TransSter css est hcl feeisce teeth ceed tai teeta lis Geena odin ngs 59 5 5 vAcyclic Data Transter nnair iaaa eaea te om i gtee tettias ane by Wa aaa aa ader iaioa aar Taa Aaina 61 5 5 1 Acyclic Data Transfer of the DP Master Class 1 0 eecceceeeeeseeeeneeeeneeeeeeeeeeeeaeeeeaeeeseeseneeeeeeeeaeees 61 5 5 2 Acyclic Data Transfer of the DP Master Class 2 ceccceseeeeeeeeeneeeeeeeeeeeeeaeeeeaeeeeaeeseeeeeneeeeieeeeeees 63 5 6 Alarm Pr essing minnini niria Ae fied ct i a Pile oe eet sales tsa Veale Set aiia avy 68 6 The Application Interface cccesccsseeeseeeeeeeeeeeeeseseeeeneeeeeeeeeesaesasneeeneeeessaesesaaeeeneeeeseaesaseaeeeaeseneeaeees 70 Gili THE AP Stak ao E EAE nates shiedaecdee accues qceasasade E vezeascavodaaade EE EE 70 6 1 1 PROFIBUS_APS_SET_CONFIGURATION_REQ CNF Set Configuration Parameters 000 71 6 1 2 PROFIBUS_APS_CHECK_USER_PRM_IND RES C
299. on Status _ 1 Octet 1 of Prm_Data Slave Parameter Bit Name Value Description o D7 Lock_Req The lock request bit together with the unlock request bit governs how the DP slave will be locked or unlocked see table below Unlock_Req The unlock request bit together with the lock request bit governs how the DP slave will be locked or unlocked see table below D5 Sync_Req Forces operation in SYNC mode if supported by the slave and delivered by the Global_Control function D4 Freeze Req Forces operation in FREEZE mode if supported by the slave and delivered by the Global_Control function D3 WD_On E wees control eres control is deactivated 1 Watchdog control is activated SS Table 44 Octet 1 of Prm_Data Slave Parameter PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 53 238 The possible combinations of the Lock_Req bit and the Unlock_Regq bit have the following meaning Lock_Req bit Unlock_Req bit Meaning 0 0 It is only possible to change the parameter Tspr all other parameters cannot be changed 0 1 The DP slave will be unlocked for accesses by other masters 1 0 The DP slave is locked for accesses from other masters All parameters are accepted except minTspr will be set to 0 1 1 The DP slave is unlocked for accesses by other masters Table 45 Meaning of Combinations of Lock_Req and Un
300. on or remote access Furthermore manufacturer specific alarms may be defined These are denominated as the alarm types represented by the ulAlarm_Type variable of all alarm related packets PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 69 238 5 6 1 3 Conditions for Alarm Indication The following conditions need to be fulfilled in order to cause an alarm indication at the DP master The slave must be ready for cyclic data exchange DATA EXCH mode An acyclic connection MSAC_C1 connection must have been activated DPV1_Enable TRUE The corresponding alarm type has been enabled The maximum number of pending alarms has not been exceeded This maximum number can be dined either as a limit of totally allowed alarms independently from the alarm type or there is only one alarm of each specified type permitted 5 6 1 4 Contents and Structure of the Alarm Message According to the Profibus DP standard the content of the alarm message is a diagnostic message It can consist by one multiple or all of the following items Alarm PDU Status PDU not discussed here Identification related diagnosis Channel related diagnosis Revision number At least one item is required to be chosen The Alarm PDU is set up as a block of up to 64 bytes including a 4 byte header The first byte of this block is header byte Its first two most significant bytes
301. onse The variable bLength defines how many bytes are read and returned to the FSPMS task The indicated length and the returned length may differ It is allowed for example that the indication service requests more data bytes to be read than physically can be returned In this case the response service just returns the maximum number of bytes that are really returned Within the array abData the AP task returns the current Process Data object s data A positive response is send when ulSta TLR_S_OK Negative response A negative response is issued whenever the indicated request cannot be satisfied by the AP task The applicable error codes of the 3 variables that are specifying the type and source of the error in this event are explained in section Error Handling page 61 A negative response is send when ulSta lt gt TLR_S_OK By default TLR_E_FAIL PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_Cl1_READ_RES_POS_Ttag 144 238 LR_UINT8 bSlotNumber LR_UINT8 bIndex LR_UINT8 bLength LR_UINT8 abData PROFIBUS_FSPMS_MAX_RI EAD DATA SIZE PROP LEBUSSE SEMSEGISREADE RMSE POSE define PROFIBUS_FSP PROF IBUS_FSPMS_MAX_R S_C1_READ_RES_POS_SIZE Positiv re
302. ort Memory Manual Input Data Image Offset Type Name Description 0x2680 UINT8 abPdOInput 5760 Input Data Image Cyclic Data From The Network Table 17 Input Data Image Default memory size PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 24 238 For netX devices with 8 kByte Dual port Memory the size of the input data image is 1536 byte Input Data Image Offset Type Name Description 0x1600 UINT8 abPdOInput 1536 Input Data Image Cyclic Data From The Network Table 18 Input Data Image for netX devices with 8 kByte Dual port Memory 3 1 2 Output Process Data The output data block is used by Fieldbus and industrial Ethernet protocols that utilize a cyclic data exchange mechanism The output data Image is used to send cyclic data from the host to the network The default size of the output data image is 5760 byte However not all available space is actually used by the protocol stack Depending on the specific protocol the area actually available for user data might be much smaller than 5760 byte An output data block may or may not be available in the dual port memory It is always available in the default memory map see the netX DPM Manual Output Data Image Offset Type Name Description 0x1000 UINT8 abPdO0Output 5760 Output Data Image Cyclic Data To The Network Table 19
303. ort the packet too large service 1B Routing failure The service response packet was too large for transmission on a response network in the path from the destination The routing device was forced packet too large to abort the service 1C Missing attribute list The service did not supply an attribute in a list of attributes that was entry needed by the service to perform the requested behavior data 1D Invalid attribute value The service returns the list of attributes containing status information for list invalid attributes 1E Embedded service An embedded service caused an error error 1F Vendor specific error A vendor specific error has occurred This error should only occur when none of the other general error codes can correctly be applied 20 Invalid parameter A parameter which was associated with the request was invalid The parameter does not meet the requirements of the CIP specification and or the requirements defined in the specification of an application object 21 Write once value or An attempt was made to write to a write once medium for the second medium already time or to modify a value that cannot be changed after being written established once 22 Invalid reply received An invalid reply is received Possible causes can for instance be among others a reply service code not matching the request service code or a reply message shorter than the expectable minimum size 23 24 Reserved Reserved for future extensio
304. ot supported by the slave D3 Ext_Diag This bit indicates the area Ext_Diag is used for extended diagnostic according to the Profibus DP V1 extensions More than the 6 octets of standard diagnostic data contain valid and relevant diagnostic data For interpretation see section Diagnostic Model of PROFIBUS DP V1 on page 49 D2 Cfg_Fault This bit indicates a configuration fault the slave has been parameterized wrongly The slave s internal configuration data differ from those the master has sent to the slave Station_Not_Ready This bit indicates that the slave is not ready for cyclic data transfer Station_Non_Existent This bit indicates that the slave does not exist or is not responding An operating slave always sets this bit to 0 Table 36 Octet 1 Station Status_1 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 49 238 Octet 2 Station Status_2 Bit Description Meaning o O D7 Deactivated The slave has not been projected and therefore deactivated by the master A projected slave always sets this bit to 0 De Reseved si This bit is reserved by the DP standard Sync_Mode This bit indicates that the slave has received a Sync command and since then no Unsync command D4 Freeze Mode This bit indicates that the slave has received a Freeze command and since then no Unfreeze command This bit indicates tha
305. other activities which have been predefined earlier PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 89 238 FailSafe not supported Cyclic data transmission is not reduced as described above in case of master state CLEAR but all output bytes are set to the value 0 independently of their actual values The flag named Dpv1lEnabled indicates whether DPV1 is supported or not DPV1 supported The slave behaves according to the Technical Guideline PROFIBUS DP Extensions to EN 50170 Version 2 0 April 1998 Profibus document 2 082 DPV1 not supported The slave behaves according to the Profibus specification IEC 61158 EN 50170 also see Profibus document 0 032 The functionality described in PROFIBUS DP Extensions to EN 50170 Version 2 0 April 1998 Profibus document 2 082 is not available The value usIdentNumber reflects the ident number of the slave that is reported to the DP Master This number is unique for each slave device as it is uniquely assigned by the Profibus Trade Organization The coding of the abrealcfgData has to meet the specification 61158 6 IEC 2003 E page 525 chapter Coding section related to the configuration PDU and configures the number of input and output process data bytes the DP Slave Stack shall operate with This structure is also described in detail in section Configuration of Inputs and O
306. ource End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 1 Packet Data Length in bytes ullId UINT32 0 29 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter Error Codes of the APS Task ulCmd UINT32 0x3107 PROFIBUS_APS_CHECK_CFG_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch structure PROFIBUS_APS_CHECK_CFG_RES_T fCfgOk BOOLEAN8 This Boolean variable indicates whether the configuration data are ok or not Table 62 PROFIBUS_APS_CHECK_CFG_RES Response to Check Configuration Indication PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 81 238 6 1 4 PROFIBUS_APS GET _USER_PRM_REQ CNF Request User Parameter Data This packet is used to request current user parameter data of the Profibus DP slave The request packet does not have any parameters The confirmation packet contains the requested user parameter data which are returned in parameter abUserPrmData Their length is limited to 237 bytes The contents is not defined in the Profibus DP specification also see section Parameterization on page 52 Note Use this packet only when working with loadable firmware It has not been designed for usage in the context
307. parameter have the following meaning Bit 7 Enable_Pull_Plug_Alarm This bit is set by the DPV1 Master Class 1 to enable the transmission of the Alarm_Type Pull_Plug_Alarm Bit 6 Enable Process Alarm This bit is set by the DPV1 Master Class 1 to enable the transmission of the Alarm_Type Process Alarm Bit 5 Enable_Diagnostic_Alarm This bit is set by the DPV1 Master Class 1 to enable the transmission of the Alarm_Type Diagnostic_Alarm Bit 4 Enable_Manufacturer_Specific_Alarm This bit is set by the DPV1 Master Class 1 to enable the transmission of all manufacturer specifc alarms Bit 3 Enable Status Alarm This bit is set by the DPV1 Master Class 1 to enable the transmission of the Alarm_Type Status_Alarm Bit 2 Enable _Update_Alarm This bit is set by the DPV1 Master Class 1 to enable the transmission of the Alarm_Type Update_Alarm Bit 1 Reserved Bit 0 Check_Cfg_Mode By means of this bit the DP Master is able to influence the reaction to the Check_Cfg service If this bit is zero the check of the configuration data is done as described in ISO 61158 EN 50170 If the bit is set the check of the configuration data might be done in a different user specific way For example a temporary not plugged module might be accepted even if the configuration data contains the respective configuration identifier PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The A
308. plicite acknowledgement must be sent from the master to the slave which subsequently will receive the PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_IND alarm request indication The importance of this explicite acknowledgement results from the intention to securely avoid overwriting of alarms As no unacknowledged alarm may be cleared overwriting of pending alarms is prohibited In addition the alarm indication is stored within an internal queue at the DP master From this queue it may be removed when the alarm has been acknowledged Technologically alarms work similarly as diagnostic messages where status information and alarm specific information is stored in the area which otherwise has been reserved for manufacturer specific data Alarms in Profibus DP V1 may only be processed by Profibus Class 1 masters 5 6 1 2 Alarm Types The following kinds of alarms are available Diagnostic_Alarm Indicates a special event such like short circuit over temperature Process Alarm Indicates a special event in the supervised process such as reaching a critical limit of a supervised value Pull_Alarm Indicates that a specific module has been pulled out Plug_ Alarm Indicates that a specific module has been plugged in Status Alarm Indicates a change of state of a specific module such as run stop or ready for instance Update Alarm Indicates the value of a parameter in a module has been changed by a local operat
309. pplication Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_PACK TLR_PACKE HEADER_T tHead 95 238 ET_INIT_MS1_REQ_Ttag LR_UI LR_UI 8 bAlarmModeSlave 8 bAlarmsSupported PROFIBUS_FSPMS_ PACKET _INIT_MS1_ REQ T Packet Description structure PROFIBUS_FSPMS_ PACKET INIT_MS1_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 2 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulAPMS1d Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 0 Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulcmd UINT32 0x0404 PROF IBUS_FSPMS_CMD_INIT_MS1_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulDest UINT32 x Routing do not touch structure PROFIBUS_FSPMS_INIT_MS1_REQ T bAlarmModeSlave UINT8 0 7 Specifies
310. r Codes of the FSPMS Task ulCmd UINT32 0x0420 PROF IBUS_FSPMS_CMD_SET_IMO_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure FSPMS_IM_T tIMO FSPMS_IMO_T I amp MO structure as explained above in Table 142 Structure tIMO fProfSpecSupp TLR_BOOLEAN Indicates whether Profile Specific 1 amp Ms are supported fManuSpecSupp TLR_BOOLEAN Indicates whether Manufacturer Specific 1 amp Ms are supported ulSlotsNotZeroSupp TLR_UINT32 Indicates whether there are slots other than zero supported Table 143 PROFIBUS_FSPMS_CMD_SET_IMO_REQ Change I amp MO Parameter Settings Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struct PROFIBUS_FSPMS_PACKE n 199 238 ET _IMO_CNF_Ttag TLR_PACKET_HEADER_T tHead PROF TBUS_FSPMS_PACKET_S ET _IMO_CNF_T Packet Description structure PROFIBUS_FSPMS_PACKET_SET_IMO_CNF_T Type Confirmation Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulSre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of t
311. r has to be used in the AP Task for addressing the desired Process Data object in the specified slot typically a module The variable bIndex has to be used in the AP Task for addressing the desired Process Data object itself The variable bLength indicates the number of bytes of the specified Process Data object that has to be read Packet Structure Reference typedef struct PROFIBUS_FSPMS_C2_READ_IND_Ttag LR_UINT32 ulReference LR_UINT8 bSlotNumber LR_UINT8 bIndex LR_UINT8 bLength PROFIBUS _FSPMS C2 READ _IND_T define PROFIBUS_FSPMS_C2_READ_IND_SIZE sizeof PROFIBUS_FSPMS_C2_READ_IND_T typedef struct PROFIBUS_FSPMS_PACKET_C2_READ_IND_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS_C2_READ_IND_T tData PROFIBUS_FSPMS_PACKET_C2_ READ _IND_T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 168 238 Packet Description structure PROFIBUS_FSPMS_PACKET_C2_ READ IND _T Type Indication Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 Destination Queue Handle of AP Task Process Queue ulSre UINT32 Source Queue Handle of FSPMS Task Process Queue ulDestId UINT32 ulAPMS2ld Destination en
312. rated by the Source Process of the Packet ulSta UINT32 TLR_S_OK 0 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04A9 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_ DATA TRANSPORT_RES_ POS T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bSlotNumber UINT8 0 254 Slot number of the process data object to be written bIndex UINT8 0 254 Index of the Process Data object to be written bLength UINT8 n n Number of transported data bytes abData UINT8 Process Data object data that are transported Table 124 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_RES_POS Positive Response Command of a Process Data Transport Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 180 238 typedef struct PROFIBUS_FSPMS_C2_DATA_TRANSPORT_RES_NEG Ttag PROFIBUS _FSPMS_C2_ DATA _TRANSPORT_RES_NEG_ LR_UINT32 ulReference LR_UINT8 bErrorDecode LR_UINT8 bErrorCodel LR_UINT8 bErrorCode2 Negative respons packet of an acyclic read command typedef struct PROFIBUS_FSPMS_PACKET_C2_DATA_TRANSPORT_RES_NEG Ttag
313. rce end point identifier specifying the origin of the packet inside the source process ulLen UINT32 Packet data length in bytes ullId UINT32 02 Packet identification as unique number generated by the Source process of the packet ulSta UINT32 See section Status Error Codes Overview ulCmd UINT32 0x0423 PROF IBUS_FSPMM_CMD_MODE_CHANGE_CNF_T Command ulExt UINT32 0 Extension unchanged ulRout UINT32 x Routing do not change structure PROFIBUS_FSPMS_IM READ RES T tInfo PROFIBUS _ Index structure see above FSPMS_IM_ NDEX_T un union Contains read data in case of success and error structure in case of failure Table 147 PROFIBUS_FSPMS_CMD_IM_READ_RES I amp M Read Response PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 6 2 33 PROFIBUS_FSPMS_CMD_ IM WRITE_IND RES Indication Response A PROFIBUS_FSPMS_CMD_IM_WRIT 203 238 Ii amp M Write E_IND indication is sent by the FSPMS task if a PROFIBUS DP Master has send a I amp M call set request and the Application has registered an I amp M unequal I amp MO Slot O with the PROF IBUS_FSPMS_CMD_SET_IMO_REQ request If the slot number I amp M index or data are incorrect tdHead ulSta has to be set to TLR_E_FAIL and the corre
314. re UINT32 Source Queue Handle of FSPMS task Process Queue ulDestId UINT32 ulAPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulFSPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 sizeof PROFIBUS_FSPMS_GLOBAL_CONTROL_IND_T Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0418 PROFIBUS_FSPMS_CMD_GLOBAL_CONTROL_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_GLOBAL_CONTROL_IND_T f ClearCommand BOOL8 0 1 Flag that indicates if set to TLR_FALSE 0 that the Master is in OPERATE mode If set to TLR_TRUE 1 the Master is in CLEAR mode and the outputs needs to be set to a safe state bSyncCommand UINT8 0 PROFIBUS_FSPMS_ GLOBAL _CONTROL_NOACTIO 1 PROF IBUS_FSPMS_GLOBAL_CONTROL_SYNC 2 PROF IBUS_FSPMS_GLOBAL_CONTROL_UNSYNC bFreezeCommand UINT8 0 PROFIBUS_FSPMS_GLOBAL_CONTROL_NOACTIO 1 PROFIBUS_FSPMS_GLOBAL_CONTROL_FREEZE 2 PROFIBUS_FSPMS_GLOBAL_CONTROL_UNFREEZE bGroupSelect UINT8 0 All slaves are addressed 1 255 Specific slave groups are addressed Table 94 PROFIBUS_FSPMS_CMD_GLOBAL_CONTROL_IND PROFIBUS DP Slave Proto
315. res of the type PROFIBUS_FSPMS_INITIATE_ADDR_T Table 114 PROFIBUS_FSPMS_CMD_C2_INITIATE_IND Indication Command of a Request to establish a DP Master Class 2 Connection This service has to be used by the AP Task in order to confirm a previously FSPMS Task issued DP Master Class 2 initialization indication The response is required and a must do when having received the indication command declared in Table 114 PROF IBUS_FSPMS_CMD_C2_INITIATE_IND Indication Command of a Request to establish a DP Master Class 2 Connection In order to address the correct AREP the response command service has to be used in conjunction with the received uirspms2ta value of the confirmation packet referenced in Table 75 PROFIBUS_FSPMS_CMD_INIT_MS2_CNF Confirmation Command of MS2 Initialization for a DP Master Class 2 connection The response is generally distinguished into two types PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 163 238 Positive response The parameter bMaxLenDataUnit reflects the maximum number of bytes that are supported by the AP Task and that can be transferred via the DP Master Class 2 connection The value has a range of 1 to 240 In the bit field tFeaturesSupported the AP Task informs about the supported service functionality In the bit field tprofileFeaturesSupported the AP Task informs about th
316. rs are optional However the size of a packet is always at least 10 double words or 40 bytes Depending on the command a packet may or may not have a data field If present the content of the data field is specific to the command respectively the reply Destination Queue Handle The ulDest field identifies a task queue in the context of the netX firmware The task queue represents the final receiver of the packet and is assigned to a protocol stack The u Dest field has to be filled out in any case Otherwise the netX operating system cannot route the packet This field is mandatory Source Queue Handle The ulSrc field identifies the sender of the packet In the context of the netX firmware inter task communication this field holds the identifier of the sending task Usually a driver uses this field for its own handle but it can hold any handle of the sending process Using this field is mandatory The receiving task does not evaluate this field and passes it back unchanged to the originator of the packet Destination Identifier The ulDestid field identifies the destination of an unsolicited packet from the netX firmware to the host system It can hold any handle that helps to identify the receiver Therefore its use is mandatory for unsolicited packets The receiver of unsolicited packets has to register for this PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 200
317. s example it is not necessary to use the destination identifier Identifier Source Identifier ulSrcld 22 Denotes the process number of the process within the host application and needs therefore to be supplied by the programmer of the host application Table 13 Example for correct Use of Source and Destination related Parameters For packets through the channel mailbox the application uses 32 0x20 Channel Token for the destination queue handler u Dest The source queue handler u Src and the source identifier u Srcld are used to identify the originator of a packet The destination identifier u Destid can be used to address certain resources in the protocol stack It is not used in this example The source queue handler u Src has to be filled in Therefore its use is mandatory the use of u Srcid is optional The netX operating system passes the request packet to the protocol stack s AP task The protocol stack then builds a reply to the packet and returns it to the mailbox The application has to make sure that the packet finds its way back to the originator process 22 in the example How to Route rcX Packets To route an rcX packet the source identifier u Srcid and the source queues handler u Src in the packet tHeader hold the identification of the originating process The router saves the original handle from ulSrcid and ulSrc The router uses a handle of its own choices for u Srcld and ulSrc before it sends the pa
318. s own internally saved one In detail it is possible to specify here Input data and their size Output data and their size Manufacturer specific data and their size The amount of consistency to apply Note Consistency in this context means whether the whole data need to be interpreted as an entity or each byte word may separately be interpreted by the Profibus DP Master The parameter block consists of An identifier byte either in the general or in the special identifier format see below A length byte The length of the complete check configuration data block must not exceed 244 bytes however it is recommended not to exceed an amount of 32 bytes otherwise some restrictions apply see the IEC 61158 or EN 50170 specification PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 56 238 5 3 3 2 Identifier Byte for the General Format The identifier byte can be specified in the general also called compact format or the special format In the general format the meaning of the single bits is defined as follows General Identifier Format of Identifier Byte according to IEC 61158 EN 50170 Specification Bi Name vae Description o O D7 Consistency Consistency extends over o Byeorword SSS S S a ween SSS Length format Length format 0 Byte structure o O D E C a o o This combination signifies tne special denier format see bow o
319. s set to TLR_TRUE 1 the slave will support the service The next flag named f FreezeSupported indicates if the slave stack shall support the FREEZE mechanism This mechanism defines the capability to synchronize input data of different slaves For this the DP Master uses a DP broadcast service that instructs all FREEZE supporting slaves to read in their inputs at the time this service is incoming If the flag is set to TLR_FALSE 0 the slave will not support this service and will reject such a DP Master request In case the flag is set to TLR_TRUE 1 the slave will support the service The flag NoAddChg decides on the capability to change the slave s DP address during runtime Normally a slave is configured in its address only once but if the flag is set to TLR_FALSE 0 then the slave stack does not reject the Set Slave Address DP Master command any more and changing is also allowed during runtime The flag named fFailSafeSupp indicates whether FAILSAFE mode is available or not The fail safe mode defines the reaction to a possible state change of the Profibus DP Master state see section Operation Modes of PROFIBUS DP Masters on page 44 from OPERATE to CLEAR There are possibilities that might occur FailSafe supported Cyclic data transmission is reduced to sending zero length data telegrams in case of master state CLEAR As a reaction the slave will set substitute values of its own or starts
320. s that the host system has some sort of problem and shuts down all network connections For details on the watchdog function refer to section 4 13 of the netX DPM Interface Manual Error Count All Implementations This field holds the total number of errors detected since power up respectively after reset The protocol stack counts all sorts of errors in this field no matter if they were network related or caused internally Error Log Indicator All Implementations Not supported yet The error log indicator field holds the number of entries in the internal error log If all entries are read from the log the field is set to zero Master Implementation In addition to the common status block as outlined in the previous section a master firmware maintains the additional structures for the administration of all slaves which are connected to the master These are not discussed here as they are not relevant for the slave Slave Implementation The slave firmware uses only the common structure as outlined in section 3 2 5 1 of the netx DPM Interface Manual This is true for all protocol stacks PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Dual Port Memory 34 238 3 3 2 Extended Status The content of the channel specific extended status block depends on the implementation Depending on the protocol a status area may or may not be present in the dual port me
321. sifying the error 5 5 1 2 bErrorCodel UINT8 See section Detailed error code 5 5 1 2 bErrorCode2 UINT8 See section User specific error code 5 5 1 2 Table 125 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_RES_NEG Negative Response Command of a Process Data Transport Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 181 238 6 2 25 PROFIBUS_FSPMS_CMD C2 ABORT_IND RES Indicating the Abort of Class 2 Connection The Profibus DP Master Class 2 may send an abort request for the MSAC_C2 connection to the Profibus DP Slave If such a request arrives at the Profibus DP Slave this indication is received The variable ulReference should contain the communication reference uniquely identifying the MSAC_C2 connection to be aborted In order to address the correct end point identifier the indication command service is used in conjunction with the received u1apsms2ia value of the request packet referenced in Table 74 PROFIBUS_FSPMS_CMD_INIT_MS2_REQ Request Command for MS2 Initialization for a DP Master Class 2 read Assign this end point identifier to ulReference The ulLocal variable indicates whether the abort is local or not The ulSubnet variable indicates the source of the abort i e whether it originates from the local or a remote subnet or no specific source information should be given The coding is as fol
322. soon as the protocol stack is started properly Then the protocol stack is awaiting a configuration As soon as the protocol stack is configured properly the Running flag is set too 1 Running RCX_COMM_COS_RUN O 1 The Running flag is set when the protocol stack has been configured properly Then the protocol stack is awaiting a network connection Now both the Ready flag and the Running flag are set 2 Bus On RCX_COMM_COS_BUS_ON O 1 The Bus On flag is set to indicate to the host system whether or not the protocol stack has the permission to open network connections If set the protocol stack has the permission to communicate on the network if cleared the permission was denied and the protocol stack will not open network connections 3 Configuration Locked RCX_COMM_COS_CONFIG_LOCKED O 1 The Configuration Locked flag is set if the communication channel firmware has locked the configuration database against being overwritten Re initializing the channel is not allowed in this state To unlock the database the application has to clear the Lock Configuration flag in the control block see page 35 4 Configuration New RCX_COMM_COS_CONFIG_NEW O 1 The Configuration New flag is set by the protocol stack to indicate that a new configuration became available which has not been activated This flag may be set together with the Restart Required flag 5 Restart Required RCX_COMM_COS_RESTART_REQUIRED O 1 The Rest
323. sor of the set configuration command was present showing up the following deviations from the behavior described above 1 For the first time the stack receives a warmstart set configuration packet the stack will start up automatically 2 On every further received warmstart set configuration packet the stack waits for a channel init to be performed until reconfiguration takes place 3 Registration of the application at the protocol stack is also done automatically 4 4 Process Data Input and Output The input and output data area is divided into the following sections Input and Output Data for PROFIBUS DP Slave 1 O Offset Area Length Byte Type 0x1000 Output block 244 Read Write 0x2680 Input block 244 Read Table 35 Input and Output Data for Remote Device Station with One Occupied Stations Single Setting For more information about the configuration of inputs and outputs refer to section Configuration of Inputs and Outputs on page 54 PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Getting started Configuration 41 238 4 5 Task Structure of the PROFIBUS DP Slave Stack The illustration below displays the internal structure of the tasks which together represent the PROFIBUS DP Slave Stack
324. sponding error must be entered in tData tError of PROF IBUS_FSPMS_PACKET_IM_READ_RES The data tData tInfo ulSAPIdx tData tInfo ulSlot and tData tInfo ulIM_Index must not be changed The PROFIBUS_FSPMS_IM_INDEX_T structure used in both the indication and the response packet looks like Variable Type Value Range Description ulSAPIdx UINT32 SAP Index ulSlot UINT32 Slot ullM_Index UINT32 I amp M Index ulLen UINT32 Length Table 148 PROFIBUS_FSPMS IM_INDEX_T Structure The PROFIBUS_FSPMS_IM_ERROR_T structure used in the response packet looks like Variable Type Value Range Description bErrorDecode UINT8 Error Decode bErrorCode1 UINT8 Error Code 1 bErrorCode2 UINT8 Error Code 2 Table 149 PROFIBUS_FSPMS_IM_ERROR_T Structure For more information about these 3 values see section 5 5 1 2 Error Handling PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 204 238 typedef struct PROFIBUS_FSPMS_IM_INDEX_Ttag LR_UINT32 ulSAPIdx HR IULEINGIS 2 wl Sloe LR_UINT32 ulIM_Index LR_UINT32 ulLen PROFIBUS FSPMS Si INDEX _T typede struct PROFIBUS_FSPMS_IM_WRITE_IND_Ttag PROP LBUS FSPMS si INDEX EEO TLR_UINT8 abData
325. spons typedef struct PROFIB pack EAD _DATA_SIZE sizeof PROF IBUS_FSPMS_C1_READ_RES_POS_T oikani acy elhe read Connan d EA USSRSEPMSMEACKENECIMREADERES SPO SMIGA TLR_PACKET_HE ADER_T tHead PROHLIBUS FSP SOC READ RES PDS ar ober ay PROFIBUS_FSPMS PACKET _C1_READ RES POS _ T Packet Description structure PROFIBUS_FSPMS_ PACKET _Cl_READ RES POS T Type Response Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle of FSPMS task Process Queue ulSre UINT32 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMS1 ld Destination end point identifier specifying the final receiver ulFSPMS2ld of the packet within the Destination Process ulSrcId UINT32 ulAPMS1Id Source end point identifier specifying the origin of the ulAPMS2ld packet inside the Source Process ulLen UINT32 3 n PROFIBUS_FSPMS_C1_READ_RES_POS_SIZE n number of bytes in read data block extended abData Packet Data Length in bytes ulId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 0 TLR_S_OK See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x0485 PROFIBUS_FSPMS_CMD_C1_READ_RES Command ulEx
326. t UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C1_READ RES POS T bSlotNumber UINT8 0 254 Slot number of the Process Data Object that has been read bIndex UINT8 0 254 Index of the Process Data object that has been read bLength UINT8 N n Number of data bytes read from the specified Process Data Object abData_l UINT8 Process Data object data that has been read Table 102 PROFIBUS_FSPMS_CMD_C1_READ_RES_POS Positive Response Command of a Process Data Read PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference typedef struc PA PINOQWINBUS Je Si2wis Cal Rue 145 238 AD NEG_Ttag LR_UINT8 bErrorDecode LR_UINT8 bErrorCodel LR_UINT8 bErrorCode2 PROFIBUS_FSPMS_Cl1_READ_RES NE Gael Negativ typedef struc spons packet of an acyclic read command EAD_RES_NEG_Ttag WIR VAC IN I EFADER_T tHead PROF IBUS_FS T CE EROETBUSSRSEPMSAPACKETECIMR H PMS_Cl_READ_RES_NEG_T tData PROFIBUS_FSPMS PACKET _Cl_READ RES NEG T Packet Description structure PROFIBUS_FSPMS_ PACKET _Cl_READ RES NEG T Type Response
327. t data 244 Bytes Maximum number of cyclic output data 244 Bytes Maximum number of acyclic read write 240 Bytes Configuration data Max 244 bytes Parameter data 237 bytes application specific parameters Acyclic communication DP V1 Class 1 Read Write DP V1 Class 1 Alarm DP V1 Class 2 Read Write Data Transport Baud rate Fixed values ranging from 9 6 kBits s to 12 MBit s Automatic baud rate detection is supported Data transport layer PROFIBUS FDL Table 3 Technical Data Protocol Stack Firmware stack available for netX netX Available netX 10 yes netX 50 yes netX 51 yes netX 100 netX 500 yes Table 4 Technical Data Available for netX PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Introduction 9 238 PCI DMA Features Parameter DMA Support for PCI targets yes Table 5 Technical Data PCI DMA Slot Number Features Devices Slot number supported for CIFX 50 DP Table 6 Technical Data Slot Number Configuration Configuration by packets to transfer warm start parameters or by using SYCON net configuration database Diagnostic Firmware supports common and extended diagnostic in the dual port memory for loadable firmware Limitations Limitations SSCY1S Slave to slave communication state machine not imp
328. t has not been designed for usage in the context of loadable firmware Packet Structure Reference typedef struct PROFIBUS_FSPMS_IND_SETTING_REQ_ Ttag TLR_BOOLEANS8 fOutputIndDeact deactivate the output indication PROFIBUS_FSPMS_IND_SETTING_REQ_ T define PROFIBUS_FSPMS_IND_SETTING_REQ_SIZE sizeof PROFIBUS_FSPMS_IND_SETTING_REQ_T Request Packet for deactivating the output indication typedef struct PROFIBUS_FSPMS_PACKET_IND_SETTING_REQ_ Ttag TLR_PACKET_HEADER_T tHead PROFIBUS FSPMS IND SETTING REO T tData PROFIBUS_FSPMS_PACKET_IND_SETTING_REQ_T Packet Description structure PROFIBUS_FSPMS_ PACKET _IND_ SETTING _REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_ HEADER T ulDest UINT32 PB_ Destination Queue Handle of FSPMS task Process Queue FSPMS_QUE ulSre UINT32 0 25 1 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSreId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 1 Packet Data Length in bytes ulId UINT32 0 27 1 Packet Identification as unique number gen
329. t the product PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Fundamentals 14 238 2 Fundamentals 2 1 General Access Mechanisms on netX Systems This chapter explains the possible ways to access a Protocol Stack running on a netX system 1 By accessing the Dual Port Memory Interface directly or via a driver 2 By accessing the Dual Port Memory Interface via a shared memory 3 By interfacing with the Stack Task of the Protocol Stack The picture below visualizes these three ways AP Task s Network Abstraction Layer Network Figure 1 The 3 different ways to access a Protocol Stack running on a netX System This chapter explains how to program the stack alternative 3 correctly while the next chapter describes accessing the protocol stack via the dual port memory interface according to alternative 1 and 2 if the user application is executed on the netX chip in the context of the rcX operating system and uses the shared DPM Finally chapter The Application Interface on 70 page describes the entire interface to the protocol stack in detail Depending on you choose the stack oriented approach or the Dual Port Memory based approach you will need either the information given in this chapter or those of the next chapter to be able to work with the set of functions described in chapter The Application Interface on page 70 All of those functions use the
330. t the watchdog timer supervision mechanism for the slaves is activated Always set to 1 This bit is always set to the value 1 indicating DP V1 operation Stat_Diag This bit indicates that the master needs to fetch diagnostic information from slave until this bit is released statistical diagnosis If the slave is not able to deliver valid output data it will set this bit Prm_Req This bit indicates that the slave requires new parameterization and configuration As long as a new parameterization has not been performed this bit remains set to the value 1 Table 37 Octet 2 Station Status_2 Octet 3 Station Status_3 Bi Description Meaning S Ext Diag_Overflow This bit indicates that the slave has more diagnostic data available than it can send D6 DO These bits are reserved Table 38 Octet 3 Station Status_3 Octet 4 Master_Add This byte contains the master address from the master which has done the parameterization of the slave If a slave has not been parameterized this value is set to 255 Octet 5 6 Ident_Number In these bytes the slave station reports its identification number which has been assigned to it by the manufacturer 5 3 1 2 Diagnostic Model of PROFIBUS DP V1 The diagnostic model of PROFIBUS DP V1 is an extension to that of DP VO It provides three kinds of messages informing the master about the situation of the slaves Diagnostic messages Status messages Alarm messages This s
331. t to the positive response length plus error PDU data length If the IO Link call request needs more time an error response with IO Link busy must be sent The error codes to be applied are tData tError bErrorDecode 0x80 tData tHError bErrorCodel 0xC2 tData tHError bErrorCode2 0x00 The length is set to negative response length and the status to TLR_E_FATIL On the next update request from the profibus master the complete IO Link call indication to the application is repeated If the 1O Link call request is wrong on Application Access Resource level the appropriate error codes has to be used The length is set to negative response length and the status to TLR_E_FAIL PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 211 238 Packet Structure Reference typedef struct PROFIBUS_FSPMS_ACYCLIC_INFO_HEADER_Ttag LR_UINT8 bSAPIdx DR ONTE loyShilone LR_UINT8 bIndex LR_UINTS8 bRes PROFIBUS_FSPMS_ACYCLIC_INFO_HEADER_T typedef struct PROFIBUS_FSPMS_CALL_HEADER_Ttag LR_UINT8 bFunction LR_UINT8 bEntityPort LR_UINT16 usFIIndex PROFIBUS_FSPMS_CALL_HEADER_T typedef struct PROFIBUS_FSPMS_IOL_HEADER_Ttag LR_UINT8 bControl LR_UINT16 usIOLIndex LR_UINT8 bIOLSubinde
332. t value specified by each process in order to associate incoming and address outgoing packets to the correct communication end point The AP task has to specify its end point identifier in the ulSrctid of the initializing request packet In case of a successful initialization the FSPMS task uses this specified value in the ulSrciId variable of each Confirmation Packet and in the ulDestId variable for indication packets sent to the AP task context from now on For instance this covers packets like those used for parameterization configuration diagnostic cyclic and acyclic data exchange and the global control command The FSPMS task returns its end pointer reference in the confirmation packet of the initialization Packet The AP task has to use this returned value as ulDest Id value from now on in all request and response Packets that are sent to the FSPMS task context Using the Macro TLR_QUE_SENDPACKET_FIFO will send the packet to the FSPMS task process queue A flag named SyncSupported indicates if the slave stack shall support the SYNC mechanism This mechanism defines the capability to synchronize output data of different slaves For this the DP Master uses a DP broadcast service that instructs all SYNC supporting slaves to update their outputs only at the time this service is incoming In the event the flag is set to TLR_FALSE 0 the slave will not support this service and would reject such a DP Master request In the event the flag i
333. ted functionality of each other This gives the slave the opportunity to adjust its functionality to the masters requirement or to reject the request if it cannot fulfill them Profile Features supported DP master class 2 and DP slave communicate about the supported profile features The meaning of the bits of these two bytes depends on the profile or vendor Profile Ident No This number allows the unique identification of a profile This number is assigned by the PNO All device using the same profile definition have to use the same Profile Ident No The value 0 indicates that no profile is supported The profile ident number is a 16 bit number Additional Address Parameter The additional address parameter consists of two parts containing information about the source and the destination For both the following information is stored within the additional address parameter Additional address information Presence Type 1 or absence Type 0 of network MAC address Length of additional address information The additional address information contains the following information The application process instance API of the source destination Access level of the source destination Network address optional MAC address optional For these values the following rules apply The application process instance API of the source destination is characterized by an 8 bit number The range of possible values extends from 0 to 255 The access
334. temautomation mbH All rights reserved The images photographs and texts in the accompanying material user manual accompanying texts documentation etc are protected by German and international copyright law as well as international trade and protection provisions You are not authorized to duplicate these in whole or in part using technical or mechanical methods printing photocopying or other methods to manipulate or transfer using electronic systems without prior written consent You are not permitted to make changes to copyright notices markings trademarks or ownership declarations The included diagrams do not take the patent situation into account The company names and product descriptions included in this document may be trademarks or brands of the respective owners and may be trademarked or patented Any form of further use requires the explicit consent of the respective rights owner 1 8 2 Important Notes The user manual accompanying texts and the documentation were created for the use of the products by qualified experts however errors cannot be ruled out For this reason no guarantee can be made and neither juristic responsibility for erroneous information nor any liability can be assumed Descriptions accompanying texts and documentation included in the user manual do not present a guarantee nor any information about proper use as stipulated in the contract or a warranted feature It cannot be ruled out that the user manual
335. ter s configuration has to follow in order to harmonize both data The coding of the abcfgDatal has to meet the specification 61158 6 IEC 2003 E page 525 chapter Coding section ee to the configuration PDU For detailed information see section Configuration of Inputs and Outputs on page 54 Troubleshooting Hints If you try to set new I O Is Configuration data while the slave state is Power_on you will receive an error code TLR_E_PROFIBUS_FSPMS_SET_CFG_POWER_ON along with the confirmation packet You will then have to initialize the slave in order to be able to set configuration data If you try to set new I O Is Configuration data with a too large data area more mon 244 bytes you will receive an error code TLR_E_PROFIBUS_FSPMS_MAX_CFG_DATA_SIZE_EXCEEDED along with the confirmation packet You will then have to shorten your configuration data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference define PROFIBUS_FSPMS_MAX_CFG_DATA_SIZE 244 105 238 typedef struct PROFIBUS_FSPMS_SET_CFG_REQ Ttag TLR_UINT8 abCfgData PROFIBUS_FSP SIMA ONG IS TAEI ES be PROEEBU SME SPMSCM SH ICH Gant lik typedef struct PROF TIBUS_FSPMS_PACKET _SET_CFG_REQ Ttag
336. tes if set to TLR_TRUE 1 that the slave stack requests the host application for check configuration and user parameter data If set to TLR_FALSE 0 the stack handles configuration and parameter data Bit 7 Address change not allowed wrmMstRT_FLG_NO_ADDR_CHANGE Flag that indicates if set to TLR_TRUE 1 that the slave stack does not support the Set Slave Address command If set to TLR_FALSE 0 changing the bus address via the master is activated and the slave stack does support the Set Slave Address command 4 3 1 Behavior when receiving a Set Configuration Warmstart Command The following rules apply for the behavior of the PROFIBUS DP Slave protocol stack when receiving a set configuration command The configuration packets name is PROFIBUS APS SET CONFIGURATION_REQ for the request and PROFIBUS_APS_ SET CONFIGURATION _CNF for the confirmation The configuration data are checked for consistency and integrity In case of failure all data are rejected In case of success the configuration parameters are stored internally within the RAM The parameterized data will be activated only after a channel init has been performed No automatic registration of the application at the stack happens The confirmation packet PROFIBUS APS SET CONFIGURATION _CNF only transfers simple status information but does not repeat the whole parameter set For all former versions up to firmware version V2 0 12 1 only the warmstart command the predeces
337. tes in data transport data block abData Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04A8 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_ DATA TRANSPORT_IND_T ulReference UINT32 See above Reference number of DP V1 Class 2 connection bSlotNumber UINT8 0 254 Slot number of the Process Data object to be addressed bIndex UINT8 0 254 Index of the Process Data object to be addressed bLength UINT8 n Number of bytes to be transported in the specified Process Data object abData UINT8 Process data object data that is transported in the request Table 123 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_IND Indication Command of a Process Data Transport Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 178 238 This service has to be used by the AP Task in order to confirm a previously FSPMS Task issued Process Data transport indication The response is required and a must do when having received the indication command declared in Table 123 PROFIBUS_FSPMS_CMD_C2_DATA_TRANSPORT_IND Indication Command
338. the _ indication PROF IBUS_FSPMS_CMD_STATE_CHANGED_IND Indication for Change of State see page 185 5 2 2 Operation Modes of Profibus DP Slaves The Profibus DP Slave can be in one of four different states Power On Reset State This is the lowest level The Profibus DP Slave is in this state when it is switched on or after a state change such as PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 45 238 1 A reset 2 Occurrence of a watchdog failure 3 Configuration fault 4 Parameterization fault 5 Output length mismatch 6 Unlock Changing the slave address is not possible in this state This state can only be left by initialization Initialized State WPRM State By successful initialization the Profibus DP Slave reaches the initialized state also denominated as WPRM State indicating the slave is now waiting for parameterization Initialization can be accomplished by the PROFIBUS_FSPMS_CMD_INIT_MSO_REQ packet see section PROFIBUS_FSPMS_CMD_INIT_MSO_REQ CNF Initializing the MSCY1S State Machine on page 88 This state is the only state allowing changes of the slave address A Set Slave Address command will only be executed successfully in this mode For more information about setting slave addresses see section PROFIBUS_FSPMS_CMD_SET_SLAVE_ADD_IND Indicating the Reception
339. the received ulrspmsotd value of the confirmation packet referenced in Table 70 PROF IBUS_FSPMS_CMD_INIT_MSO_CNF Confirmation Command of MSO Initialization The macro TLR_QUE_SEND_PACKET_FIFO has to be used to send the packet to the FSPMS task process queue For more information on cyclic data transfer see section Cyclic Data Transfer Troubleshooting Hints If you try to set new input data while the slave state is Power_on you will receive an error code TLR_E_PROFIBUS_FSPMS_SET_INPUT_POWER_ON along with the confirmation packet You will then have to initialize the slave in order to be able to set new input data If you try to set new input data while the slave state is WAIT PRM you will receive an error code TLR_E_PROFIBUS_FSPMS_SET_INPUT_WAIT_PRM along with the confirmation packet You will then have to parameterize and configure the slave in order to be able to set new input data If you try to set new input data while no new input data are available you will receive an error code TLR_E_PROFIBUS_FSPMS_SET_INPUT_NOT_PEND along with the confirmation packet You will then have to wait until you can proceed Packet Structure Reference define PROFIBUS_FSPMS_MAX_INPUT_DATA_SIZE 244 typedef struct PROFIBUS_FSPMS_SET_INPUT_REO Ttag TLR_UINT8 abInputData PROFIBUS_FSPMS_ MAX _INPUT_DATA_SIZE PROFIBUS_FSPMS_
340. tion Packet ulSreid VINT32 ulAPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 12 n Packet Data Length in bytes PROFIBUS_FSPMS_IOL_CALL_RES_POS_SIZE bytes read io link error PDU ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 00000001 See chapter 7 1 Error Codes of the FSPMS Task TLR_E_FAIL ulCmd UINT32 0x0429 PROFIBUS_FSPMS_CMD_IOL_CALL_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_IOL_CALL_RES POS T tAcyc PROFIBUS _ Acyclic header FSPMS_ACY CLIC_INFO_ HEADER_T tError PROFIBUS _ Error structure FSPMS_IM_ ERROR_T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 215 238 6 3 Hardware Switches for the Adjustment of Slave Address and Baudrate For handling address and baud rate switches on a netX device the firmware must be enabled to evaluate the switch values from the hardware This can be done by setting a special TAG via the Tag List Editor tool In this case the values which are configured via database or packet interface will be ignored If the hardware switch function is not enabled via TAG then the firmware uses the values set either via NXD or In
341. tion of Inputs and Outputs on page 54 The following applies Configuration parameters will be stored internally In case of any error no data will be stored at all A channel init is required to activate the parameterized data This packet does not perform any registration at the stack automatically Registering must be performed with a separate packet such as the registration packet described in the netX Dual Port Memory Manual RCX_REGISTER_APP_REQ code 0x2F10 This request will be denied if the configuration lock flag is set for more information on this topic see section Common Status on page 29 gt Note Use this packet only when working with loadable firmware It has not been designed for usage in the context of linkable object modules Packet Structure Reference typedef struct PROFIBUS_APS_SET_CONFIGURATION_REQ Ttag LR_UINT32 ulSystemFlags System flags LR_UINT32 ulWdgTime 6 usIdentNumber bBusAddr bBaudRate bFlags bRes 2 bCfglen abCfgData 244 US_APS_SET_CONFIGURATION_REQ_T 00 00 00 00 00 ort i I i i UT i i B PROF typedef struct PROFIBUS_APS_PACKET_SET_CONFIGURATION_REO_ Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_APS_SET_CONF IGURATION_REQ T tData PROFIBUS_APS_ PACKET SET _CONFIGURATION_REQ T PROFIBUS DP Slave Protocol API DOC050401A
342. tted in the response buffer requires more space than the size of the allocated response buffer 12 Fragmentation ofa The service specified an operation that is going to fragment a primitive primitive value data value i e half a REAL data type 13 Not enough data The service did not supply all required data to perform the specified operation 14 Attribute not An unsupported attribute has been specified in the request supported 15 Too much data More data than was expected were supplied by the service 16 Object does not exist The specified object does not exist in the device 17 Service Fragmentation sequence for this service is not currently active for this fragmentation sequence not in progress data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Status Error Codes Overview 232 238 General Status Code specified hexadecimally Status Name Description 18 No stored attribute data The attribute data of this object has not been saved prior to the requested service 19 Store operation The attribute data of this object could not be saved due to a failure failure during the storage attempt 1A Routing failure The service request packet was too large for transmission on a network request in the path to the destination The routing device was forced to ab
343. uched ulDestId UINT32 ulAPMSOld Destination end point identifier untouched ulSrcId UINT32 ulFSPMSOld Source end point identifier untouched ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 O24 Packet Identification untouched ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x040F PROF IBUS_FSPMS_CMD_SET_SLAVE_DIAG_CNF Command ulExt UINT32 0 Extension untouched ulDest UINT32 x Routing do not touch Table 81 PROFIBUS_FSPMS_CMD_SET_SLAVE_DIAG_CNF Confirmation Command of sending the Diagnostic data PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 112 238 6 2 7 PROFIBUS_FSPMS_CMD SET _INPUT_REQ CNF Setting the Input Data This service has to be used by the AP task in order to activate the input data the first time after initialization or to update the input data during runtime within the underlying MSCY1S state machine The input data are written into the field abInputData They will transparently be transferred via the Profibus network The maximum number of input data that may be passed cannot exceed 244 bytes As long as no input data has ever been set the MSCY1S state machine sends data set to zero to a potentially requesting DP Master To address the correct end point identifier the request command service has to be used in conjunction with
344. ueue Handle of FSPMS task Process Queue ulSre UINT32 Source Queue Handle of AP task Process Queue ulDestid UINT32 ulFSPMSOld Destination end point identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPMSOld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 3 sizeof PROFIBUS_FSPMS_C1l_ALARM ACK_RES_NEG T Packet Data Length in bytes ulId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 TLR_E_FAIL See chapter 7 1 Error Codes of the FSPMS Task not 0 ulCmd UINT32 0x0483 PROF IBUS_FSPMS_CMD_C1_ALARM_ACK_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 X Routing do not touch structure PROFIBUS_FSPMS_C1_ALARM_ACK_RES_NEG_T bErrorDecode UINT8 Error decode value classifying the error bErrorCode1 UINT8 Detailed error code bErrorCode2 UINT8 User specific error code Table 113 PROFIBUS_FSPMS_CMD_C1_ALARM_ACK_RES Alarm Request PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public NEG Negative Response to Indication Command of an Hilscher 2005 2013 The Application Interface 160 238 6 2 21 PROFIBUS FSPMS CMD C2 INITIATE IND RES POS RES NEG Indicating a Request to establish an acyclic Conne
345. urce Destination Data block abSAddrDAdadr Packet Data Length in bytes ullId UINT32 0 27 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04A2 PROFIBUS_FSPMS_CMD_C2_INITIATE_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_INITIATE_IND_T ulReference UINT32 See above Reference number of DP V1 Class 2 connection tFeaturesSupport UINT16 Bit mask Requested features of the DP Master Class 2 connection ed tProfileFeatures UINT16 Bit mask Requested profile features of the DP Master Class 2 Supported connection usProfileIdentNu UINT16 Bit mask Corresponding Profile Ident Number 0 indicates that no mber profile is in use f SType BOOL8 0 1 Decides on the presence of the optional source Network MAC address in SAddr in abSAddrDAdadr bSLen UINT8 Length of the Source Address length parameter in abSAddrDAdadr fDType BOOL8 0 1 Decides on the presence of the optional destination Network MAC address in DAddr in abSAddrDAdadr bDLen UINT8 Length of the Destination Address length parameter in abSAddrDAdar abSAddrDAdadr UINT8 Array the contains the description of the source and destination address reflected due to 2 structu
346. usProfileIdentNumber identifies a profile definition uniquely All devices using the same profile definition have to use the same Profile Ident Number The Profile Ident number will be taken from the pool of Ident Numbers for vendor specific or authorized profiles The value O indicates no profile is supported If the requested profile is not supported by the AP Task the AP Task has to respond negatively or with the Profile Ident Number the AP Task supports PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 99 238 The field abAdd_Addr_Param consists of two parts namely it contains the additional address information about the source and the destination The address information consists of The API Application Process Instance This item is mandatory The SCL This item is mandatory The network address This item is optional The MAC address This item is optional For more details on the structure of the field abAdd_Addr_Param see section Acyclic Data Transfer of the DP Master Class 2 4 Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Packet Structure Reference typedef struct PROFIBUS_FSPMS_PACKET_INIT_MS2_REOQ Ttag TLR_PACKET_HEADER_T tHead PROFIBUS_FSPMS_PACKET_INI
347. utputs on page 54 Besides the aforementioned end pointer reference the confirmation packet returns two handles to triple buffers for input and output which should be stored for facilitating access later Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Packet Structure Reference typede struct PROFIBUS_FSPMS_INIT_MSO_REO Ttag TLR_BOOLEANS8 fSyncSupported TLR_BOOLEANS fFreezeSupported TLR_BOOLEAN8 fNoAddChg TLR_BOOLEANS fFailSafeSupp TLR_BOOLEANS8 fDpvlEnabled LR_UINT16 usIdentNumber LR_UINT8 bSlaveAddr b a I LR_UINT8 DataRate LR_UINT8 bRealCfgData PROFIBUS_FSPMS_MAX_CFG_DATA_SIZE PROFIBUS_FSPMS_INIT_MSO_REQ_T aS typede struct PROFIBUS_FSPMS_PACKET_INIT_MSO_REOQ Ttag TLR_PACKET_HEADER __ tHead PROFIBUS_FSPMS_INIT_MSO_REQ_T tData PROFIBUS_FSPMS_PACKET_INIT_MSO_ REQ T PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 90 238 structure PROFIBUS_FSPMS_ PACKET INIT_MSO_REQ T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER T
348. ve to be set by the AP task within the response packet Both values are reflecting the real data length in bytes of the current application s input data and the output data For more information see section Configuration of Inputs and Outputs There you can also find a description of the data format valid for configuration data which also applies for the abCfgDatal parameter of this packet Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Troubleshooting Hints If you try to check configuration data while the slave state is Power_on you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_CFG_POWER_ON along with the confirmation packet You will then have to initialize the slave in order to be able to get configuration data If you try to check configuration data while no new input data are available you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_CFG_NOT_PENDING along with the confirmation packet You will then have to wait until new configuration data are available If you try to check configuration data while new slave configuration data have been received you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_CFG_NEW_CONFIGURATION along with the confirmation packet The comparison of assumed and real configuration data has a negative result The master should react to this event in a suitab
349. with the received ulapsms2i1a value of the request packet referenced in Table 74 PROF IBUS_FSPMS_CMD_INIT_MS2_REQ Request Command for MS2 Initialization for a DP Master Class 2 read Assign this end point identifier to ulReference The variable bSlotNumber has to be used in the AP Task for addressing the desired Process Data object in the specified slot typically a module The variable bIndex has to be used in the AP Task for addressing the desired Process Data object itself The variable bLength indicates the number of bytes of the specified Process Data object that has to be written Within the array abData the FSPMS Task indicates the new Process Data to be written PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 172 238 sizeof PROF IBUS_FSPMS_C2_WRITE_IND_T E_DATA_SIZE define PROFIBUS_FSPMS_C2_WRITE_IND_SIZE PROFIBUS_FSPMS_MAX WRITE_DATA_SIZE typedef struct PROFIBUS_FSPMS_C2_WRITE_IND_Ttag LR_UINT32 ulReference LR_UINT8 bSlotNumber LR_UINT8 bIndex LR_UINT8 bLength LR_UINT8 abData PROFIBUS_FSPMS_MAX_ WRI IPINOM IWS Ia SIMS SMCA AWENE IEINID _ ane PROF IBUS_FESPMS_PACKET_C2_WRI typedef struct m LND teas i TLR_PACKET_HEADER_T tHead PROEHEBU SE SOEMSe C
350. within the Destination Process ulSrcId UINT32 ulAPMS2ld Source end point identifier specifying the origin of the packet inside the Source Process ulLen UINT32 Packet Data Length in bytes ullId UINT32 0 25 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See chapter 7 1 Error Codes of the FSPMS Task ulCmd UINT32 0x04AB PROF IBUS_FSPMS_CMD_C2_ABORT_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch structure PROFIBUS_FSPMS_C2_ABORT_RES_T ulReference UINT32 See above Reference number of DP V1 Class 2 connection Table 132 PROFIBUS_FSPMS_PACKET_C2_ABORT_RES Confirmation to Sending an Abort Signal PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface 185 238 6 2 26 PROFIBUS FSPMS CMD STATE CHANGED IND Indication for Change of State This indication is sent to the slave when the state of the Profibus DP Master has been changed It will be answered by the AP task by sending a TLR_Return packet for returning the resources The ulstate variable can have one of the following values Value Meaning 2 RCX_COMM_STATE_STOP 3 RCX_COMM_STATE_IDLE 4 RCX_COMM_STATE_OPERATE 1 Timeout or fatal error occurred depending on value
351. x PROFIBUS_FSPMS_TOL_HEADER_T typedef struct PROFIBUS_FSPMS_TOL_CALL_IND_Ttag PROFIBUS_FSPMS_ACYCLIC_INFO_HEADER_T tAcyc ROFIBUS_FSPMS_CALL_HEADER_T tCall ROF IBUS_FSPMS_IOL_HEADER_T SIOA LR_UINT8 ablIOLData PROFIBUS_FSPMS_IOL_CALL_MAX DATA ROHIBUSM HOP MS mi Olm CAT ian Naa B B Ir E typedef struc TLR_PACKET PROPIBUS 25 PROFIBUS_FS PROFIBUS_FSPMS_PACKET_IOL_CALL_IND_Ttag EADER_T tHead So fOh CAL TNT e Daea S_PACKET TOL CALL IND_T i Be gare ee PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Description 212 238 structure PROFIBUS_FSPMS_PACKET IOL_CALL_IND_T Type Indication Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination Queue Handle ulsre UINT32 Source Queue Handle ulDestId UINT32 ulAPMSOld Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet MLS ue UINT32 ulFSPMSOld Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 12 n Packet Data Len
352. xceeded 3 Upper voltage limit exceeded 4 Upper power limit exceeded 5 Upper temperature limit exceeded 6 Connection broken 7 Lower limit exceeded 8 Upper limit exceeded 9 Error 10 15 Reserved 16 31 Manufacturer specific Table 43 Channel related Diagnosis Second Data Byte PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 Overview 52 238 5 3 2 Parameterization This section contains a description of the parameter data block received from the Profibus DP Master During its start up procedure a slave station will receive such a parameter block when the PROFIBUS DP command Set Parameter is performed For instance this is the case when one of the following indications is received PROF IBUS_FSPMS_CMD_CHECK_USER_PRM_IND RES Indicating the Reception of new Parameter Data PROF IBUS_FSPMS_CMD_CHECK_EXT_USER_PRM_IND RES Indicating new Extended Parameter Data The parameter block consists of 7 bytes called octets in this context of norm specific parameters and a field for storing extended user specific data if necessary The length of these together must not exceed 244 bytes however it is recommended not to exceed an amount of 32 bytes otherwise some restrictions apply see the IEC 61158 EN 50170 specification The 7 octets are structured as follows 5 3 2 1 Octet 1 Stati
353. ze the slave in order to be able to get input data If you try to check user parameterization data while no new user parameterization data are available you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_USER_PRM_NOT_PENDING along with the confirmation packet You will then have to wait until new parameter data are available If you try to check user parameterization data while new parameterization data have been received you will receive an error code TLR_E_PROFIBUS_FSPMS_CHECK_USER_PRM_NEW_PARAMETER along with the confirmation packet The comparison of assumed and real configuration data has a negative result The master should react to this event in a suitable way PROFIBUS DP Slave Protocol API DOC050401API15EN Revision 15 English 2013 09 Released Public Hilscher 2005 2013 The Application Interface Packet Structure Reference 135 238 define PROFIBUS_FSPMS_MAX_USER_PRM_DATA_SIZE 237 typedef struct PROFIBUS_FSPMS_CHECK_USER_PRM_IND_Ttag TLR_UINT8 abUserPrmData PROFIBUS_FSPMS_MAX_USER_PRM_DATA_SIZE PROFIBUS_FSPMS_CHECK_USER_PRM_IND_T typedef t struct PROFIBUS_FSPMS_PACKET_CHECK_USER_PRM_IND_Ttag TLR_PACKET_HEADER_T tHead PROF IBUS_FSPMS
Download Pdf Manuals
Related Search
Related Contents
精 度 セ ン サ S USER MANUAL MANUEL D`INSTALLATION ET D`UTILISATION Swingline GBC Breakaway Lanyard Crop Module: Beans (Runner) dispositions generales du leasing Instruction Manual RP10K - Support PJ-622/PJ-623/ PJ-662/PJ-663 Impresora portátil Copyright © All rights reserved.
Failed to retrieve file