The following example illustrates how the hardware identifier lock file works.
A simple hardware declaration Example.hwl.json may look like this:
{
"Devices": [
{
"Name": "Device1",
"Modules": [
{
"Name": "PLC_1",
"TypeIdentifier": {
"OrderNumber": "6ES7 516-3AN01-0AB0",
"Version": "V2.9"
},
"AccessProtection": {
"AccessLevel": "NoAccess"
}
}
]
}
]
}
To generate the Hardware Identifier lock file, run
apax hwc compile --input "Example.hwl.json" --output "output/"
A hardware identifier lock file named PLC_1.HardwareIdentifiers.json will be generated.
It contains a list of hardware identifiers with their respective names, e.g.:
{
"Version": 1,
"HardwareIdentifiers": [
{
"Name": "Device1~PLC_1",
"Value": 48
},
{
"Name": "Device1~PLC_1~CPU display_1",
"Value": 54
},
{
"Name": "Device1~PLC_1~CPU exec unit_1",
"Value": 52
},
{
"Name": "Device1~PLC_1~CPU general_1",
"Value": 50
},
{
"Name": "Device1~PLC_1~CPU proxy_1",
"Value": 49
},
{
"Name": "Device1~PLC_1~Card reader/writer_1",
"Value": 51
},
{
"Name": "Device1~PLC_1~DP interface_1",
"Value": 60
},
{
"Name": "Device1~PLC_1~LicenseManager_1",
"Value": 42
},
{
"Name": "Device1~PLC_1~OPC UA_1",
"Value": 117
},
{
"Name": "Device1~PLC_1~PROFINET interface_1",
"Value": 64
},
{
"Name": "Device1~PLC_1~PROFINET interface_1~Port_1",
"Value": 65
},
{
"Name": "Device1~PLC_1~PROFINET interface_1~Port_2",
"Value": 66
},
{
"Name": "Device1~PLC_1~PROFINET interface_2~Port_1",
"Value": 73
},
{
"Name": "Device1~Rail_0",
"Value": 256
}
]
}
The names of the device and module from Example.hwl.json are reflected in the names of the hardware identifiers.
If a hardware object has no corresponding entry in the hardware declaration, the name will be chosen automatically.
If a hardware identifier lock file was generated once, there will be no changes in the hardware identifier lock file when running apax hwc compile, as long as the composition of modules in the hardware declaration is not changed.
WARNING
The Hardware Identifier lock file shown above is intended as an example.
Do not rely on the values shown here in your program. Depending on the content of your concrete hardware declaration, other values may be assigned to the individual hardware objects.