FUNCTION_BLOCK FB_Write_IuM_EL6631_0010

This function block writes I&M1, I&M2, I&M3 and I&M4 (Identification & Maintenance) data according to ProfiNET specification over EtherCAT as a string to the ProfiNET device.
VAR_INPUT
VAR_INPUT
bWrite : BOOL;
NETID : STRING; (* AMS NET ID EtherCAT Master *)
PORT : WORD; (* EtherCAT Slave address *)
byState : BYTE; (* Bit 0 -> I&M1 || Bit 1 -> I&M2 || Bit 2 -> I&M3 || Bit 3 -> I&M4*)
iNumber : INT:=0; (* "0"=EL6631-0010 or "1"=vitual EL6631-0010*)
st_IM_TagFunction : STRING; (* I&M1 byState.0=TRUE*)
st_IM_TagLocation : STRING; (* I&M1 byState.0=TRUE*)
st_IM_Date : STRING; (* I&M2 byState.1=TRUE*)
st_IM_Descriptor : STRING; (* I&M3 byState.2=TRUE*)
st_IM_Signature : STRING; (* I&M4 byState.3=TRUE*)END_VAR
bWrite: A rising edge on this input activates the function block and the I&M data is written to the ProfiNET device.
NETID: AMS Net ID of the controller
PORT: Port via which the controller communicates with the device (port = Device ID + 1000hex)
byState: This byte can be used to select which I&M data is to be written.
iNumber: Two ProfiNET devices can be mapped with one terminal. iNumber ("0" or "1") is used to select the device for which the I&M data is to be written.
st_IM_TagFunction: Label for the function of the device is written to the device.
st_IM_Taglocation: Label for the installation site of the device is written to the device.
st_IM_Date: Date of the installation of the device is written to the device.
st_IM_Descriptor: Description of the manufacturer is written to the device.
st_IM_Signature: Description of the manufacturer is written to the device.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
iErrorID : DINT;
END_VAR
bBusy: When the function block is activated this output is set. It remains set until a feedback is received. While Busy = TRUE, no new command will be accepted at the inputs.
bError: In the event of an error during the command transfer, this output is set once the bBusy output has been reset.
iErrorID: Supplies an ADS error number when the output bError is set.
Development environment | Target platform | PLC libraries to be linked |
---|---|---|
TwinCAT v2.11.0 R3 | PC or CX (x86, ARM) | TcProfinetDiag.Lib |