57
Removes all tags for given alias.
grp.settags(alias, tags)
Overwrites all tags for given alias. Tags parameter can be either a string (single tags) or
Lua table consisting of strings (multiple tags)
Object creation and modification
grp.setcomment(alias, comment)
Sets comment field for given alias
grp.create(config)
Creates a new or overwrites an existing object based on provided config, which must be
a Lua table. Returns object ID on success, nil plus error message otherwise.
Config fields:
• datatype required, object data type. Can be either a string
dt table (dt.bool, dt.scale, dt.uint32)
• name optional, unique object name. If an object with the same name already
exists, numeric prefix will be added
• comment optional, object comment (string)
• units optional, object units/suffix (string)
• address optional, object group address (string). If not set the first free address
from configured range will be used
• tags optional, object tags, can be either a string (single tags) or Lua table
consisting of strings (multiple tags)
If an object with the same group address already exists, only units, datatype and
comment fields will be changed. All other properties will be kept unchanged.
Examples
Create new object with known address
address = grp.create({
datatype = dt.float16,
address = '1/1/1',
name = 'My first object',
comment = 'This is my new object',
units = 'W',
tags = { 'My tag A', 'My tag B' },
})
Create new object with automatic address assignment