Skip to main content

mapping

The mapping: section connects the devices to the address space. Each mapping entry names one variable in node: and one source of its value. The source is a link to a device (s7:, modbus:, ethernetIp:), a calculation (value:), or a file or folder on the disk of the gateway. You declare the devices in brownfieldDevices:. The variable must already exist: make it with instances:.

Example​

brownfieldDevices:
modbus:
- name: M1
type: TCP
address: 192.168.1.40
port: 502
points:
- name: InletTemp
at: holding:10
type: int16
scale: 0.1
- name: OutletTemp
at: holding:11
type: int16
scale: 0.1

mapping:
- node: /ua:Objects/own:Plant/own:InletTemperature
modbus: M1:InletTemp
- node: /ua:Objects/own:Plant/own:DeltaT
value: $outlet.value - $inlet.value
inputs:
inlet: M1:InletTemp
outlet: M1:OutletTemp
poll: 1000

The value​

mapping: is a list. Each entry is a mapping entry.

A mapping entry​

Connects one OPC UA variable to one source of values: a device, a calculation, a file or a folder.

KeyWhat it doesValueRequired
nodeThe OPC UA variable that this entry gives a value to. Use a browse path or a node id, for example /ua:Objects/di:DeviceSet/own:Pump1/own:Temperature or ns=1;s=MyVariable.textyes
s7Reads one address of an S7 connection: <connection>:<address>, for example plc1:DB1,INT12. This key takes no poll:: the S7 connection sends the changes.text
modbusReads one Modbus value. Use a declared point: <connection>:<point>, for example M1:SupplyAirTemperature. A raw address such as M1:holding:12,float32 also works, but a point keeps its scale and access.text
ethernetIpReads one tag of an EtherNet/IP connection: <connection>:<tag>, for example eip0:MyTag.text
valueCalculates the value with a JSONata expression, for example $outlet.value - $inlet.value. Each entry of inputs: is a variable of the expression. The result is a value, or { value, statusCode } to set the quality.text
fileThe path of a file on the disk of the gateway. The gateway publishes it with the OPC UA file transfer methods. The node must be of the type FileType.text
folderThe path of a folder on the disk of the gateway. The gateway publishes it as a FileDirectoryType Object.text
scaleA multiplier for the raw value: engineering = raw * scale + offset. The default is 1. The value must not be 0, and the node must be numeric. Do not use it on a modbus: link: set scale: on the point.number
offsetA number that the gateway adds after the multiplication by scale: engineering = raw * scale + offset. The default is 0.number
directionThe direction of the data. The gateway reads devices only. With write or both, the gateway does not start and shows DIR-E004.read, write, both
pollHow often the gateway reads the source, in ms. The default is 1000. on-demand reads the source each time an OPC UA client reads the variable. An s7: link does not accept poll:.number or on-demand
inverseA reverse expression for a calculation. It belongs to writing, and the gateway does not write to devices today.text
inputsThe values that the expression of value: uses. Each input has a name and a source: <connection>:<point or address>, for example inlet: M1:InletTemp. In the expression, write $inlet.a map
mimeTypeThe MIME type that the gateway gives for the file, for example text/plain. The default is application/octet-stream.text (a fixed list)
accessWhich roles can read, write, create and delete in a published folder. Only with folder:. Without access:, every OPC UA client can do every operation. The page "File and folder mapping" gives the procedure.Folder access
ignoreThe files and sub-folders that the scan of a published folder skips, as a list of patterns: ["*.part", ".*"]. Only with folder:. A pattern must match the full path inside the folder, and ! before a pattern keeps what it matches. The page "File and folder mapping" gives all the rules.list of text

Folder access​

The roles that can do each operation in a published folder. Each key is a list of roles. The rules apply to every sub-folder and file.

KeyWhat it doesValueRequired
browseThe roles that can see the folders and the files. If you omit the key, every role can see them. A role in another key of access: can always see them.list of text
readThe roles that can open a file and read its content. If you omit the key, every role that can see the folder can read.list of text
writeThe roles that can open a file for writing and change its content. These roles can also read the file. If you omit the key, no client can write.list of text
createFileThe roles that can call CreateFile. If you omit the key or give [], no client can add a file: the files come from the disk only.list of text
createDirectoryThe roles that can call CreateDirectory. If you omit the key or give [], no client can add a folder.list of text
deleteThe roles that can call Delete on a file or a sub-folder. If you omit the key or give [], no client can delete.list of text