3. Create a new variable in the MAIN function block.
4. Create a new function block for the machine.
5. Declare the following variables including attributes in the main and machine function block.
PROGRAM MAIN VAR {attribute 'TcHmiSystemEng.Parameter.Name' := 'Machine'} _fbMachine : FB_Machine; END_VAR
FUNCTION_BLOCK FB_Machine VAR {attribute 'TcHmiSystemEng.Parameter.Name' := 'Machine name'} {attribute 'TcHmiSystemEng.Parameter.Info' := 'Define the name of the machine'} _machineName : STRING; END_VAR
6. Activate your PLC project.
You have completed the configuration of the PLC so far.
Creating a new HMI project
1. Create a new TwinCAT HMI project
2. Install the following NuGet packages Beckhoff.TwinCAT.HMI.SystemEngineering and Beckhoff.TwinCAT.HMI.SystemEngineeringUtils.
If the packages are not available, install the corresponding TcPkg packages to obtain the NuGet packages (TwinCAT.HMI.SystemEngineering and TwinCAT.HMI.SystemEngineeringUtils).
3. Add the Parameters and Functions control to the corresponding View or Content. (The default configuration of the control accesses the default configuration of the extension directly).
You have now completed the configuration of the HMI project.