When running apax hwc compile, a hardware identifier will automatically be generated for all supported hardware objects.
The values will be saved to the "Hardware Identifier Lock file" under the hwc.gen folder.
A separate lock file is generated for each PLC defined in the hardware declaration and is placed next to the hardware declaration.
It is a JSON file and will be named <PLC NAME>.HardwareIdentifiers.json.
If the lock file already exists, apax hwc compile will overwrite the file with the updated list of identifiers.
The hardware identifier lock file serves two purposes:
- You can view the list of available hardware identifiers and their values for use in an ST program.
- The lock file is used to make sure the same identifiers are assigned to the same hardware objects each time you run
apax hwc compile.
Note
To make sure, the same hardware identifiers are assigned to the hardware objects, it is recommended to check hardware identifier lock files into source control alongside the hardware declaration.
Each hardware identifier is associated with a name that indicates which hardware object can be addressed using this identifier.
Each name consists of one or more object names separated by ~ that describe the location of the hardware object.
For example, the hardware identifier DeviceName~PLC_1~PROFINET_interface_1~Port_1 designates Port 1 of the PROFINET interface 1 of the CPU named PLC_1.
Note
The name of the lock file and the hardware identifier names in the file are generated from the names of the devices, modules and interfaces in the hardware declaration. If you rename any object, it is considered a new entry in the hardware identifier lock file, and it might be assigned a different hardware identifier value.
Because the name of the lock file is generated from the name of the PLC module, a new lock file will be generated if the name of the PLC has been changed. The existing lock file will not be deleted automatically.