MC_AxAdsWriteDecoder_BkPlcMc (from V3.0)
The function block decodes ADS write accesses. The ADS codes are listed in the Knowledge Base.
Inputs
VAR_INPUT
nFirstAxisIndex: INT;
nLastAxisIndex: INT;
bReset: BOOL;
bValid: BOOL;
sNetId: STRING(80);
nPort: UINT;
nInvokeId: UDINT;
nIdxGroup: UDINT;
nIdxOffs: UDINT;
cbWriteLen: UDINT;
pWriteBuff: DWORD;
pAxItf: POINTER TO AXIS_REF_BkPlcMc:=0;
END_VAR
Name | Type | Description |
---|---|---|
nFirstAxisIndex | INT | The dimensions of the AXIS_REF_BkPlcMc array must be specified here. An incorrect specification at this point excludes some of the axes from the communication or results in a crash of the PLC application by triggering serious runtime errors (Page Fault Exception). |
nLastAxisIndex | INT | |
bReset | BOOL | The signals are used to co-ordinate the decoder with the ADS server. |
bValid | BOOL | |
sNetId | STRING | These values are required in order to generate the ADS response. They are supplied by an ADS server's ADS indication function block. |
nPort | UINT | |
nInvokeId | UDINT | |
nIdxGroup | UDINT | These values are required in order to decode the access. They are supplied by an ADS server's ADS indication function block. |
nIdxOffs | UDINT | |
cbWriteLen | UDINT | |
pWriteBuff | DWORD | |
pAxItf | POINTER | Here, the address of a variable or an array of variables of type AXIS_REF_BkPlcMc should be transferred. |
Inputs/outputs
VAR_IN_OUT
DeadManCount: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
DeadManCount | UDINT | Counter for function block calls without ADS indication |
Outputs
VAR_OUTPUT
bClear: BOOL;
bPending: BOOL;
PlcMcManOffline: BOOL;
END_VAR
Name | Type | Description |
---|---|---|
bClear | BOOL | Indicates that an ADS access indicated with bValid should be acknowledged. |
bPending | BOOL | Indicates that an ADS access indicated with bValid is being processed. |
PlcMcManOffline | BOOL | Indicates that the connection to the PlcMcManager is not available. |
Behavior of the function block
If the function block signals neither bClear nor bPending when the bValid signal is present, it has not decoded the combination of nIdxGroup and nIdxOffs and no response has been generated. In such a case, the ADS server (if there is one) must call another decoder, or must generate a response with the appropriate error code.