IOF_SER_IDN_Write
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.
Inputs
VAR_INPUT
sNetId : T_AmsNetId;
nIDN : UINT; (* S: 0******* ********, P: 1******* ******** *)
bExecute : BOOL;
nPort : UINT;
nAttrib : DWORD;
cbLen : UDINT;
dwSrcAddr : PVOID;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
Name | Type | Description |
---|---|---|
sNetId | T_AmsNetID | The network address of the TwinCAT computer on which the ADS command is to be executed can be specified here. For the local computer an empty string may be specified. |
nIDN | UINT | 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 | BOOL | The function block is enabled by a positive edge at this input. |
nPort | UINT | The port number nPort is assigned by the TwinCAT system during the hardware configuration. |
nAttrib | DWORD | 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 | UDINT | Length of the data buffer containing the value. |
dwDestAddr | PVOID | Address of the data buffer containing the value. |
tTimeout | TIME | Specifies the time-out period that must not be exceeded when the command is executed. |
Outputs
VAR_OUTPUT
nAttribRd : DWORD;
sAttrib : ST_SercosParamAttrib;
bBusy : BOOL;
bError : BOOL;
nErrId : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
nAttribRd | DWORD | Attribute of the parameter; can be saved for the next access (nAttrib) to the parameter. |
sAttrib | Contains the nAttribRd attribute of the Sercos parameter broken down into individual variables. | |
bBusy | BOOL | When the function block is enabled, this output is set and remains set until a feedback is received. |
bError | BOOL | If an error should occur during the transfer of the command, then this output is set once the bBusy output was reset. |
nErrId | UDINT | Returns the ADS error number or the specific function block error number if the ERR output is set. |
Requirements
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; |
Tc2_IoFunctions (IO) |