IOF_SER_IDN_Write 1:

The “IOF_SER_IDN_Write” function block allows a value to be written to an S- or P-parameter of a Sercos drive. Data type and size are determined automatically on the basis of the attribute.


    sNetId    : T_AmsNetId;
    nIDN      : UINT; (* S: 0******* ********, P: 1******* ******** *)
    bExecute  : BOOL;
    nPort     : UINT;
    nAttrib   : DWORD;
    cbLen     : UDINT;
    dwSrcAddr : PVOID;
    tTimeout  : TIME := DEFAULT_ADS_TIMEOUT;

sNetId: The network address of the TwinCAT computer on which the ADS command is to be executed can be entered here (type: T_AmsNetId). If it is to be run on the local computer, an empty string can be entered.

nIDN: contains the Sercos parameter number to be accessed for writing. nIDN must lie between 0 and 32767 for S-parameters and between 32768 and 65535 for P-parameters.

bExecute: the block is activated by a positive edge at this input.

nPort: The port number nPort is assigned by the TwinCAT system during the hardware configuration.

nAttrib: Attribute of the parameter, if known. If nAttrib = 0, IOF_SER_IDN_Write first reads the parameter attribute of the drive before the value is written to the parameter of the drive.

cbLen: Length of the data buffer containing the value.

dwSrcAddr: Address of the data buffer containing the value.

tTimeout: States the length of the timeout that may not be exceeded during execution of the command.


    nAttribRd : DWORD;
    sAttrib   : ST_SercosParamAttrib;
    bBusy     : BOOL;
    bError    : BOOL;
    nErrId    : UDINT;

nAttribRd: Attribute of the parameter; can be saved for the next access (nAttrib) to the parameter.

sAttrib: contains the attribute nAttribRd of the Sercos parameter, broken down into individual variables (type: ST_SercosParamAttrib).

bBusy: When the function block is activated this output is set. It remains set until a feedback is received.

bError: If an error should occur during the transfer of the command, then this output is set once the bBusy output was reset.

nErrId: Supplies the ADS error number when the ERR output is set.


Development environment

Target platform

IO hardware

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC (x86)

Sercans SCS-P ISA; Sercans SCS-P PCI;
Beckhoff FC750x PCI

Tc2_IoFunctions (IO)