Skip to main content

Update Profinet Variables via .udt file

Applies a changed Profinet Variable definition to the TIA project.

Steps

  1. Import the RobCo_Profinet_Variables.udt exactly as described in Import .udt in a TIA project. It will overwrite the existing RobCo_Profinet_Variables.udt file, which is correct — the mapping is therefore updated in the following compilation process.
  2. Right-click the FB_RobCo_Controller and 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.