Function code
The function code (FC) in the telegram header identifies the telegram type, such as Request telegram (Request or Send/Request) and Acknowledgement or Response telegram (Acknowledgement frame, Response frame). In addition the function code contains the actual transmission function and control information that prevent loss and duplication of messages, or the station type with FDL status.
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
FC: Function Code Request |
|
1 |
|
|
|
|
|
|
Request Telegramm |
|
|
|
X |
|
|
|
|
FCV = Alternating bit switched on |
|
|
X |
|
|
|
|
|
href=»http://profibus.felser.ch/en/funktionscode.htm#aufruffolgebit»>FCB = Alternating bit (from frame count) |
1 |
|
|
|
0 (0x0) |
CV = Clock Value (Clock synchronization) |
1 |
|
|
|
other |
Reserved |
0 |
|
|
|
0 (0x0) |
TE = Time Event (Clock synchronization) |
0 |
|
|
|
3 (0x3) |
SDA_LOW = Send Data Acknowledged — low priority |
0 |
|
|
|
4 (0x4) |
SDN_LOW = Send Data Not acknowledged — low priority |
0 |
|
|
|
5 (0x5) |
SDA_HIGH = Send Data Acknowledged — high priority |
0 |
|
|
|
6 (0x6) |
SDN_HIGH = Send Data Not acknowledged |
0 |
|
|
|
7 (0x7) |
MSRD = Send Request Data with Multicast Reply |
0 |
|
|
|
9 (0x9) |
Request FDL Status |
0 |
|
|
|
12(0xC) |
SRD low = Send and Request Data |
0 |
|
|
|
13(0xD) |
SRD high = Send and Request Data |
0 |
|
|
|
14(0xE) |
Request Ident with reply |
0 |
|
|
|
15 (0xF) |
Request LSAP Status with reply 1) |
0 |
|
|
|
other |
Reserved |
1) this value is in the last version of the standard not defined anymore but only reserved
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
FC : Function Code Response |
|
0 |
|
|
|
|
|
|
Response telegram |
0 |
|
|
|
|
|
|
|
Reserved |
|
|
0 |
0 |
|
|
|
|
Slave |
|
|
0 |
1 |
|
|
|
|
Master not ready |
|
|
1 |
0 |
|
|
|
|
Master ready, without token |
|
|
1 |
1 |
|
|
|
|
Master ready, in token ring |
|
|
|
|
0 (0x0) |
OK |
|
|
|
|
1 (0x1) |
UE = User Error |
|
|
|
|
2 (0x2) |
RR = No resources |
|
|
|
|
3 (0x3) |
RS = SAP not enabled |
|
|
|
|
8 (0x8) |
DL = Data Low (normal case with DP) |
|
|
|
|
9 (0x9) |
NR = No response data ready |
|
|
|
|
10(0xA) |
DH = Data High (DP diagnosis pending) |
|
|
|
|
12(0xC) |
RDL = Data not received and Data Low |
|
|
|
|
13(0xD) |
RDH = Data not received and Data High |
|
|
|
|
other |
Reserved |
Frame Count Bit The frame count bit FCB (b5) prevents message duplication by the acknowledging or responding station(responder) and any loss by the calling station (initiator). Excluded from this are requests without acknowledgement (SDN) and FDL Status, Ident and LSAP Status requests.
For the security sequence, the initiator must carry an FCB for each responder. When a Request telegram (Request or Send/Request) is sent to a responder for the first time, or if it is re-sent to a responder currently marked as non-operational, the FCB must be set as defined in the responder. The initiator achieves this in a Request telegram with FCV=0 and FCB=1. The responder must assess a telegram of this kind as the first message cycle and store the FCB=1 together with the initiator’s address (SA) (see following table). This message cycle will not be repeated by the initiator. In subsequent Request telegrams to the same responder, the initiator must set FCV=1 and change the FCB with each new Request telegram. Any responder that receives a Request telegram addressed to it with FCV=1 must evaluate the FCB. If the FCB has changed when compared with the last Request telegram from the same initiator (same SA), this is valid confirmation that the preceding message cycle was concluded properly. If the Request telegram originates from a different initiator (different SA), evaluation of the FCB is no longer necessary. In both cases, the responder must save the FCB with the source SA until receipt of a new telegram addressed to it. In the case of a lost or impaired acknowledgement or response telegram, the FCB must not be changed by the initiator in the request retry: this will indicate that the previous message cycle was faulty. If the responder receives a Request telegram with FCV=1 and the same FCB as the last Request telegram from the same initiator (same SA), this will indicate a request retry. The responder must in turn retransmit the acknowledgement or response telegram held in readiness. Until the above-mentioned confirmation or receipt of a telegram with a different address (SA or DA) that is not acknowledged (Send Data with No Acknowledge, SDN) the responder must hold the last acknowledgement or response telegram in readiness for any possible request retry. In the case of Request telegrams that are not acknowledged and with Request FDL Status, Ident, and LSAP Status, FCV=0 and FCB=0; evaluation by the responder is no longer necessary.
b5 |
b4 |
Bit position |
FCB |
FCV |
Condition |
Meaning |
Action |
0 |
0 |
DA = TS/127 |
Request without acknowledgement Request FDL Status/ Ident/ LSAP Status |
Delete last acknowledgement |
0/1 |
0/1 |
DA # TS |
Request to another responder |
Delete last acknowledgement / response |
1 |
0 |
DA = TS |
First request |
FCBM := 1 SAM := SA Delete last acknowledgement / response |
0/1 |
1 |
DA = TS SA = SAM FCB # FCBM |
New Request |
Delete last acknowledgement / response FCBM := FCB Hold acknowledgement / response in readiness for retry |
0/1 |
1 |
DA = TS SA = SAM FCB = FCBM |
Retry Request |
FCBM := FCB Repeat acknowledgement / response and continue to hold in readiness |
0/1 |
1 |
DA = TS SA # SAM |
New initiator |
FCBM := FCB SAM := SA Hold acknowledgement / response in readiness for retry |
FCBM stored FCB in memory SAM stored SA in memory