Assign the Function Block Parameters
-
Create a call for the function block (within the main object block (OB1)).
-
Assign a name for the function block’s instance data block (DB).
-
The function block call is created.
-
For the acyclic data call, the parameter i_hwSubmHWID is required. This parameter refers to the Acyclic sub-module of an avatar or a device. The hardware ID for the acyclic sub-module is located under Properties in the System constants pane in the Device overview of the sub-module.
The Siemens® TIA Portal automatically generates names for the hardware IDs of each sub-module. Type the bus coupler name → module name →submodule name in the interface of the function block (in this example, tesysisland_Profinet~AvTwoDirection03~Acyclic_submodule). Alternatively, the Hardware Identification (HWID) can be assigned to a user defined variable and provided to the function block.
-
For the cyclic data call, the parameters i_hwStartAddress and iq_hwQWAddress are required. The StartAddress parameter is needed for the function block to find the input data associated with the avatar. To create the i_hwStartAddress parameter, configure a PLC tag (a Boolean data type) with an address at the beginning of the I address range of the cyclic input sub-module and assign it to the interface of the function block.
-
The QWAddress is associated with the Q address of the cyclic output sub-module. To create the “i_hwQWAddress parameter, configure a word-sized PLC tag with the address of the cyclic output sub-module and assign it to the interface of the function block.
-
All parameters for data transfer are configured. The other parameters can be assigned as needed to the control logic of your PLC program.
-
Function blocks with the functionality to acyclically write data have an input parameter to specify the data to be written. For example, the System Write commands function block has the input i_udtAcyclicWriteCmds parameter that, in conjunction with i_uiNoConfAvatar parameter, can be used to specify the data to be transferred to the bus coupler.