Update Profinet Variables via .udt file
Applies a changed Profinet Variable definition to the TIA project.
Steps
- Import the
RobCo_Profinet_Variables.udtexactly as described in Import .udt in a TIA project. It will overwrite the existingRobCo_Profinet_Variables.udtfile, which is correct — the mapping is therefore updated in the following compilation process. - Right-click the
FB_RobCo_Controllerand compile the software changes, so the mapping of the Variables is updated correctly.
note
Step 2 is easy to miss. Without recompiling the function block, the mapping in the project still reflects the previous Variable definition.
Afterward you can use the aux_variables struct from the corresponding DB instance
to read and manipulate the Profinet Variables — see
Profinet Variables.
warning
Never write directly to the AuxRegisters if you want to modify Profinet Variables
from the PLC, because this would break the state consistency. Instead, modify the
Variables directly in AuxVariables.