A device in the .hwl.json file consists of one or more modules.
- A module can be defined in one of the following 3 different ways:
- as part of the device node.
- at the document level and included in the device using a module reference.
- By defining a module template and applying that template in a device's module list
These three approaches can be combined in the same .hwl.json file or within a single device.
You can specify a module's type using the TypeIdentifier setting.
There are two kinds of type identifiers you can use:
- For supported Siemens modules, the type can be specified using the
OrderNumberandVersionof the module. All controllers are like this. - For IO devices from any manufacturer for which a "General Station Description" (GSD) file was installed, the type can be specified using the
FileNameandGsdIdproperties. For details, see Usage of GSD Devices/Modules.
Note that you cannot combine modules based on a GSD file with modules identified by order number and version in the same device. Further, when using modules based on GSD files, all modules in a device must be based on the same GSD file.
The following example shows aforementioned 3 different ways of defining modules:
- The device "Device1" consists of three modules
- The "PLC_1" module is defined inline in the device's modules list.
- The "DI" module is defined in the document's modules list.
- The "DI" module is added to "Device1" by including a reference specifying the module's name to the device's module list (
{ "Ref" : "DI" }).
- The "DI" module is added to "Device1" by including a reference specifying the module's name to the device's module list (
- The "DQ" module is defined in the document's templates list.
- The "DQ" module is added to "Device1" by applying the defined "DQ_Template" template in the device's module list (
{ "Apply": { "TemplateName": "DQ_Template" } }).
- The "DQ" module is added to "Device1" by applying the defined "DQ_Template" template in the device's module list (
{
"Devices": [
{
"Name": "Device1",
"Modules": [
{
"Name": "PLC_1",
"TypeIdentifier": {
"OrderNumber": "6ES7 516-3AN01-0AB0",
"Version": "V2.9"
},
"AccessProtection": {
"AccessLevel": "NoAccess"
},
"Parameters": {
"IPv4ForwardingActive": true
},
"Interfaces": [
{
"Name": "Interface1",
"Label": "X1",
"Addresses": {
"Configured": [
{ "IPv4": "192.168.0.10/24" }
]
}
}
]
},
{ "Ref": "DI" },
{
"Apply": {
"TemplateName": "DQ_Template"
}
}
]
}
],
"Modules": [
{
"Name": "DI",
"TypeIdentifier": {
"OrderNumber": "6ES7 521-1BL00-0AB0",
"Version": "V2.2"
},
"IoConfiguration": {
"InputAddress": "9"
}
}
],
"Templates": {
"Modules": [
{
"Name": "DQ_Template",
"Content": {
"Name": "DQ",
"TypeIdentifier": {
"OrderNumber": "6ES7 522-1BL01-0AB0",
"Version": "V1.1"
},
"IoConfiguration": {
"OutputAddress": "32"
}
}
}
]
}
}