When running apax hwc compile, IO addresses of all modules will be saved to the "IO Address 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>.IoAddresses.json.
If the lock file already exists, apax hwc compile will overwrite the file with the updated list of addresses.
The lock file serves two purposes:
- You can view the list of addresses and their values for use in an ST program.
- The lock file is used to make sure the same addresses are assigned to the same modules each time you run
apax hwc compile.
For each module, the lock file provides the following information:
StartAddress: The start address(es) of the module's input and/or output values as configured in the hardware declaration. The value ofStartAddressis the first address that belongs to the module's address space.EndAddress: The end address(es) of the module's input and/or output values. The value ofEndAddressis the last occupied address of the module's address space.Length: The length of the module's address space in bits (i.e., the number of bits betweenStartAddressandEndAddress)Source: Specifies where the address value originates from:- A value of
UserDefinedindicates that the address was specified in the hardware declaration file. - If the address was assigned automatically, the source will be
AutoAssigned.
- A value of
Note
To make sure, the same addresses are assigned in every compile, it is recommended to check IO address lock files into source control alongside the hardware declaration.
Note
The name of the lock file and the "Ref" values in the file are generated from the names of the devices and modules in the hardware declaration. If you rename any object, it is considered a new entry in the lock file.
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.