![]()
Contents
Cirrus Link Resources
Cirrus Link Website![]()
Contact Us (Sales/Support)![]()
Forum![]()
Cirrus Link Modules Docs for Ignition 7.9.x![]()
Inductive Resources
Ignition User Manual![]()
Knowledge Base Articles![]()
Inductive University![]()
Forum![]()
The following API calls are available for the MQTT Engine Module and can be executed within any of the Ignition Designer Script Consoleavailable Ignition scopes.
There are sample API scripts available for each API call.
APIsAnchor publish publish
system.cirruslink.engine.publish(mqttServerName, topic, payload, qos, retained) → void
ParametersString mqttServerNameThe name of the server connection to use in the MQTT Engine Server configuration. This must match an existing server name in the configuration.String topicThe MQTT topic to publish on. This must be a valid MQTT topicbyte[] payloadAn array of bytes representing the MQTT payloadint qosThe MQTT 'Quality of Service' to use. This must be either 0, 1, or 2boolean retainedWhether or not to publish this message with the retained flag setReturn ValueNoneAnchor createConfig createConfig
system.cirruslink.engine.createConfig(type, props) → voidParametersString typeThe type of configuration to create with valid options:
Cert FilesServersSetsDef Namespace FiltersDef NamespaceCust NamespaceMap propsDictionary of properties making up the configuration with the following keys and datatypes:Cert FilesId (long)
Name (str)
FileContents (str)
Description (str)
ServersId (long)
Name (str)
Enabled (bool)
Url (str)
ServerSetId (long)Username (str)
Password (str)
CaCertFileId (long)
ClientCertFileId (long)
ClientPrivateKeyFileId (long)
ClientKeyPassword (str)
HostnameVerification (bool)
TlsAlpnExtensions (str)ClientId (str)
CleanSession (bool)
KeepAlive (int)
FilteredNamespaces (str)
EnableLegacyStateMessages (bool)LegacyStateUsername (str)LegacyStatePassword (str)LegacyStateClientId (str)LegacyStateCaCertFileId (long)LegacyStateClientCertFileId (long)LegacyStateClientPrivateKeyFileId (long)LegacyStateClientKeyPassword (str)LegacyStateHostnameVerification (bool)LegacyStateTlsAlpnExtensions (str)SetsId (long)(added 4.0.22)Name (str)(added 4.0.22)Description (str)(added 4.0.22)PrimaryHostEnabled (bool)(added 4.0.22)PrimaryHostId (str)(added 4.0.22)Def Namespace FiltersId (long)
NamespaceId (long)
GroupId (str)
EdgeNodeId (str)
Def NamespaceId (long)
Name (str) "Elecsys", "Sparkplug A", Sparkplug B", or "Xirgo"
Enabled (bool)
Cust NamespaceId (long)
Name (str)
Subscription (str)
QoS1 (bool)
RootFolder (str)
TagName (str)
JsonPayload (bool)
Charset (str)
WritableTags (bool)
Return ValueNoneA map representing the newly created configuration after it has been written to the database. (added 4.0.16)Anchor readConfig readConfig
system.cirruslink.engine.readConfig(type) → List ParametersString typeThe type of configuration to read with valid options:
GeneralCert FilesServersSetsDef Namespace FilesDef Namespace FiltersDef NamespaceCust NamespaceReturn ValueA List of Dictionaries of properties making up the configurations with the following keys and datatypes:GeneralId (long)
Enabled (bool)
PrimaryHostEnabled (bool)(deprecated 4.0.22)
PrimaryHostId (str)(deprecated 4.0.22)
BlockNodeCommands (bool)
BlockDeviceCommands (bool)
BlockTagPropertyChanges (bool)
StoreHistoricalEvents (bool)
EnableLatching (bool)
LatchTimeout (long)
LatchTagList (str)
FilteredProperties (str)
EnableBdSeqChecking (bool)
CustomProperties (str)
MetricTimestampValidation (bool)IncludeSecurityContext (bool)SecurityContextHashingAlgorithm (str) "SHA_1", "SHA_224", "SHA_256", "SHA_384" or "SHA_512"SecurityContextHashingPassword (str)PrimaryHostControlTagList (str)ReorderingTimeout (long)Cert FilesId (long)
Name (str)
FileContents (str)
Description (str)
ServersId (long)
Name (str)
Enabled (bool)
Url (str)
ServerSetId (long)Username (str)
Password (str)
CaCertFileId (long)
ClientCertFileId (long)
ClientPrivateKeyFileId (long)
ClientKeyPassword (str)
HostnameVerification (bool)
TlsAlpnExtensions (str)ClientId (str)
CleanSession (bool)
KeepAlive (int)
FilteredNamespaces (str)
EnableLegacyStateMessages (bool)LegacyStateUsername (str)LegacyStatePassword (str)LegacyStateClientId (str)LegacyStateCaCertFileId (long)LegacyStateClientCertFileId (long)LegacyStateClientPrivateKeyFileId (long)LegacyStateClientKeyPassword (str)LegacyStateHostnameVerification (bool)LegacyStateTlsAlpnExtensions (str)SetsId (long)(added 4.0.22)Name (str)(added 4.0.22)Description (str)(added 4.0.22)PrimaryHostEnabled (bool)(added 4.0.22)PrimaryHostId (str)(added 4.0.22)Def Namespace FilesId (long)
IgnoreFiles (bool)
FileHostType (str) "ACTIVE" or "PASSIVE"
BaseFileDirectory (str)
AddTopicTokens (bool)
FileStoringPolicy (str)
Def Namespace FiltersId (long)
NamespaceId (long)
GroupId (str)
EdgeNodeId (str)
Def NamespaceId (long)
Name (str) "Elecsys", "Sparkplug A", Sparkplug B", or "Xirgo"
Enabled (bool)
Cust NamespaceId (long)
Name (str)
Subscription (str)
QoS1 (bool)
RootFolder (str)
TagName (str)
JsonPayload (bool)
Charset (str)
WritableTags (bool)
Anchor updateConfig updateConfig
system.cirruslink.engine.updateConfig(type, id, collisionPolicy, props) → voidParametersString typeThe type of configuration to update with valid options:
GeneralCert FilesServersSetsDef Namespace FilesDef Namespace FiltersDef NamespaceCust NamespaceLong idThe ID of the record to updateString collisionPolicy"MergeOverwrite" or "Overwrite""MergeOverwrite" will replace the existing properties in the record ID with only those included in the call"Overwrite" will replace all properties in the record ID with those in the callMap propsDictionary of properties making up the configuration with the following keys and datatypes: GeneralId (long)
Enabled (bool)
PrimaryHostEnabled (bool)(deprecated 4.0.22)
PrimaryHostId (str)(deprecated 4.0.22)
BlockNodeCommands (bool)
BlockDeviceCommands (bool)
BlockTagPropertyChanges (bool)
StoreHistoricalEvents (bool)
EnableLatching (bool)
LatchTimeout (long)
LatchTagList (str)
FilteredProperties (str)
EnableBdSeqChecking (bool)
CustomProperties (str)
EnablePrimaryHostSubscriptions (bool)
MetricTimestampValidation (bool)IncludeSecurityContext (bool)SecurityContextHashingAlgorithm (str) "SHA_1", "SHA_224", "SHA_256", "SHA_384" or "SHA_512"SecurityContextHashingPassword (str)PrimaryHostControlTagList (str)ReorderingTimeout (long)Cert FilesId (long)
Name (str)
FileContents (str)
Description (str)
ServersId (long)
Name (str)
Enabled (bool)
Url (str)
Username (str)
Password (str)
CaCertFileId (long)
ClientCertFileId (long)
ClientPrivateKeyFileId (long)
ClientKeyPassword (str)
HostnameVerification (bool)
TlsAlpnExtensions (str)ClientId (str)
CleanSession (bool)
KeepAlive (int)
FilteredNamespaces (str)
EnableLegacyStateMessages (bool)LegacyStateUsername (str)LegacyStatePassword (str)LegacyStateClientId (str)LegacyStateCaCertFileId (long)LegacyStateClientCertFileId (long)LegacyStateClientPrivateKeyFileId (long)LegacyStateClientKeyPassword (str)LegacyStateHostnameVerification (bool)LegacyStateTlsAlpnExtensions (str)SetsId (long)(added 4.0.22)Name (str)(added 4.0.22)Description (str)(added 4.0.22)PrimaryHostEnabled (bool)(added 4.0.22)PrimaryHostId (str)(added 4.0.22)Def Namespace FilesId (long)
IgnoreFiles (bool)
FileHostType (str) "ACTIVE" or "PASSIVE"
BaseFileDirectory (str)
AddTopicTokens (bool)
FileStoringPolicy (str)
Def Namespace FiltersId (long)
NamespaceId (long)
GroupId (str)
EdgeNodeId (str)
Def NamespaceId (long)
Name (str) "Elecsys", "Sparkplug A", Sparkplug B", or "Xirgo"
Enabled (bool)
Cust NamespaceId (long)
Name (str)
Subscription (str)
QoS1 (bool)
RootFolder (str)
TagName (str)
JsonPayload (bool)
Charset (str)
WritableTags (bool)
Return ValueNoneA map representing the updated configuration after it has been written to the database. (added 4.0.16)Anchor deleteConfig deleteConfig
system.cirruslink.engine.deleteConfig(type, id) → voidParametersString typeThe type of configuration to delete with valid options:
Cert FilesServersSetsDef Namespace FiltersDef NamespaceCust NamespaceLong idThe ID of the record to deleteReturn ValueNoneTrue if the record was successfully deleted otherwise False is returned (added 4.0.16)| Anchor | ||||
|---|---|---|---|---|
|
| Warning |
|---|
| Cirrus Link provides these scripts as examples only, they are not supported or guaranteed to meet any particular functionality. Cirrus Link cannot provide any assistance to modify these scripts to meet a particular need. |
| Code Block | ||
|---|---|---|
| ||
# Cirrus Link provides these scripts as examples only, they are not supported or guaranteed to meet any particular functionality. Cirrus Link cannot provide any assistance to modify these scripts to meet a particular need.
# MQTT Transmission Create Transmitter
# Create new server
serverProps = {}
serverProps["Name"] = "My Server"
serverProps["Enabled"] = True
serverProps["Url"] = "ssl://192.0.2.1:8883"
serverProps["Username"] = "MyUserName"
serverProps["Password"] = "MyPassword"
serverProps["KeepAlive"] = "30"
system.cirruslink.engine.createConfig("Servers", serverProps)
# Read server configuration
savedServers = system.cirruslink.engine.readConfig("Servers")
# Find server Id
for config in savedServers:
if config ["Name"] == "My Server":
serverId = config["id"]
# Update server properties using MergeOverwrite
serverProps = {}
serverProps["KeepAlive"] = "60"
system.cirruslink.engine.createConfig("Servers", serverId, "MergeOverwrite", serverProps)
# Delete server
system.cirruslink.engine.deleteConfig("Servers", serverId) |