The following API modules calls are available for the MQTT Transmission Module and can be executed within any of the available Ignition Designer Script Console scopes.
There are sample API scripts available for each API call.
APIs
system.cirruslink.transmission.publish(mqttServerName, topic, payload, qos, retained) → void
ParametersString mqttServerNameThe name of the server connection to use in the MQTT Transmission 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 topic
byte[] payloadAn array of bytes representing the MQTT payload
int qosThe MQTT 'Quality of Service' to use. This must be either 0, 1, or 2
boolean retainedWhether or not to publish this message with the retained flag set
Return Value
system.cirruslink.transmission.createConfig(type, props) → void
ParametersString typeMap propsDictionary of properties making up the configuration with the following keys and datatypes:
readConfig | system.cirruslink.transmission.readConfig(type) → List
ParametersReturn ValueA List of Dictionaries of properties making up the configurations with the following keys and datatypes:History StoresHistory Stores
Id (long)
Name (str)
Enabled (bool)
TransmissionHistoryStoreType (str) "In-MemoryIN_MEMORY" or "Disk-BackedDISK_BACKED"
EdgeNodeTagCapacity (int)(deprecated 4.0.19)
DeviceTagCapacity (int)FlushQuantity (deprecated 4.0.19)
HistoryMaxSize (int)FlushPeriod (long)
Cert FilesId (long)
Name (str)
FileContents (str)
Description (str)
(added 4.0.22)HistoryMaxAge (int) (added 4.0.19)FlushQuantity (int)
FlushPeriod
ServersId (long)Name
RollingHistoryBufferEnabled (strboo)Url (str(added 4.0.17)ServerSetId RollingHistoryMaxAge (strint) (added 4.0.17)RollingHistoryPruneInterval (int)(added 4.0.17)H2dbPort (int)(added 4.0.22)
Cert FilesId
Username (str)
Password (str)
CaCertFileId (long)
ClientCertFileId (long)
ClientPrivateKeyFileId (long)
ClientKeyPassword Name (str)
HostnameVerification FileContents (boolstr)
ClientId Description (str)
ServersId KeepAlive (intlong)
RandomStartupDelay Name (str)
ReconnectDelay Url (longstr)
AutoReconnectRpcClient ServerSetId (boolstr) DataFormatTypeWrapper (str) "Sparkplug_B_v1_0_Protobuf" or "Sparkplug_B_v1_0_JSON"
SetsTransmittersId ClientPrivateKeyFileId (long)
Name ClientKeyPassword (str)
Enabled HostnameVerification (bool)TagProvider
TlsAlpnExtensions (str)TagPath ClientId (str)
TagPacingPeriod KeepAlive (longint)
ServerSetId RandomStartupDelay (longstr)
DiscoveryDelay ReconnectDelay (long)
AliasedTags DataFormatTypeWrapper (boolstr)
CompressionTypeWrapper (long) "NONE" "DEFLATE" or "GZIP"
"Sparkplug_B_v1_0_Protobuf" or "Sparkplug_B_v1_0_JSON"
AutoReconnectRpcClient BlockCommands (bool)ConvertUdts RpcClientKeyPassword (boolstr) PublishUdtDefinitions (bool(added 4.0.18)- OptimizeUdts
RpcClientEnabled (bool) CacheBirthsEnabled (bool(added 4.0.18) - HistoryStoreId
RpcClientPrivateKeyFileId (long) EnableStoreForwardByDefault (bool(added 4.0.18)InOrderHistory RpcTlsAlpnExtensions (boolstr) GroupId (str(added 4.0.18)EdgeNodeId RpcHostnameVerification (strbool) DeviceId (str(added 4.0.18)- FilteredProperties
RpcUsername (str) RebirthDebounceDelay (long)
Records(added 4.0.18)RpcClientId (str) (added 4.0.18)RpcClientCertFileId (long) (added 4.0.18)RpcPassword (str) (added 4.0.18)RpcCaCertFileId (long) (added 4.0.18)
SetsFilesTransmittersFileScanRate Id (intlong)
GroupId Name (str)
Enabled (bool)
TagProvider EdgeNodeId (str)
DeviceId TagPath (str)
MessageSize TagPacingPeriod (intlong)
MessagePacingPeriod (intServerSetId (long) (must be included)
MessageAckTimeout DiscoveryDelay (intlong)
Return Value
| Anchor |
|---|
readConfig | AliasedTags (bool)
CompressionTypeWrapper (long) "NONE" "DEFLATE" or "GZIP"
BlockCommands (bool)
ConvertUdts (bool)
PublishUdtDefinitions (bool)
OptimizeUdts (bool)
CacheBirthsEnabled (bool)
HistoryStoreId (long)
EnableStoreForwardByDefault (bool)
InOrderHistory (bool)
GroupId (str)
EdgeNodeId (str)
DeviceId (str)
FilteredProperties (str)
RebirthDebounceDelay (long)
Records
ServersGeneralCert FilesId (long)
Name (str)
FileContents (str)
Description (str)
- Name Url ServerSetId strUsername strPassword CaCertFileId longClientKeyPassword (
ClientCertFileId (long)
ClientPrivateKeyFileId (long)
- HostnameVerification boolClientId strKeepAlive
RandomStartupDelay (str)
ReconnectDelay (long)
AutoReconnectRpcClient (bool)
DataFormatTypeWrapper (str) "Sparkplug_B_v1_0_Protobuf" or "Sparkplug_B_v1_0_JSON"
Return ValueA map representing the newly created configuration after it has been written to the database. (added 4.0.16)
system.cirruslink.transmission.readConfig(type) → List
ParametersReturn ValueA List of Dictionaries of properties making up the configurations with the following keys and datatypes:History Stores
SetsId (long)
Name (str)
Description (str)
PrimaryHostId (str)
TransmittersId (long)
Name (str)
Enabled (bool)
TagProvider TransmissionHistoryStoreType (str)
TagPath (str)
TagPacingPeriod (long)
ServerSetId (long)
DiscoveryDelay (long)
AliasedTags (bool)
CompressionTypeWrapper (long) "NONE" "DEFLATE" or "GZIP"
BlockCommands (bool)
ConvertUdts (bool)
PublishUdtDefinitions (bool)
OptimizeUdts (bool)
CacheBirthsEnabled (bool)
HistoryStoreId (long)
EnableStoreForwardByDefault (bool)
InOrderHistory (bool)
GroupId (str)
EdgeNodeId (str)
DeviceId (str)
FilteredProperties (str)
RebirthDebounceDelay (long)
RecordsFiles"In-Memory" or "Disk-Backed"
EdgeNodeTagCapacity (int)(deprecated 4.0.19)
DeviceTagCapacity (int)(deprecated 4.0.19)
HistoryMaxSize (int)(added 4.0.22)HistoryMaxAge (int)(added 4.0.19)FlushQuantity (int)
FlushPeriod (long)
RollingHistoryBufferEnabled (bool)(added 4.0.17)RollingHistoryMaxAge (int)(added 4.0.17)RollingHistoryPruneInterval (int)(added 4.0.17)H2dbPort (int)(added 4.0.22)
GeneralId (long)
Enabled (bool)
AuditProfileRecordId (long)(added 4.0.16)
Cert FilesId (long)
Name (str)
FileContents (str)
Description (str)
ServersId (long)
Name (str)
Url (str)
ServerSetId (str)
Username (str)
Password (str)
CaCertFileId (long)
ClientCertFileId (long)
ClientPrivateKeyFileId (long)
ClientKeyPassword (str)
HostnameVerification (bool)
ClientId (str)
KeepAlive (int)
RandomStartupDelay (str)
ReconnectDelay (long)
DataFormatTypeWrapper (str) "Sparkplug_B_v1_0_Protobuf" or "Sparkplug_B_v1_0_JSON"
AutoReconnectRpcClient (bool)RpcClientKeyPassword (str) (added 4.0.18)RpcClientEnabled (bool) (added 4.0.18)RpcClientPrivateKeyFileId (long) (added 4.0.18)RpcTlsAlpnExtensions (str) (added 4.0.18)RpcHostnameVerification (bool) (added 4.0.18)RpcUsername (str) (added 4.0.18)RpcClientId (str) (added 4.0.18)RpcClientCertFileId (long) (added 4.0.18)RpcPassword (str) (added 4.0.18)RpcCaCertFileId (long) (added 4.0.18)
SetsId (long)
Name (str)
Description (str)
PrimaryHostId (str)
TransmittersId (long)
Name (str)
Enabled (bool)
TagProvider (str)
TagPath (str)
TagPacingPeriod (long)
ServerSetId (long)
DiscoveryDelay (long)
AliasedTags (bool)
CompressionTypeWrapper (long) "NONE" "DEFLATE" or "GZIP"
BlockCommands (bool)
ConvertUdts (bool)
PublishUdtDefinitions (bool)
OptimizeUdts (bool)
CacheBirthsEnabled (bool)
HistoryStoreId (long)
EnableStoreForwardByDefault (bool)
InOrderHistory (bool)
GroupId (str)
EdgeNodeId (str)
DeviceId (str)
FilteredProperties (str)
RebirthDebounceDelay (long)
RecordsFiles
system.cirruslink.transmission.updateConfig(type, id, collisionPolicy, props) → voidParametersString typeLong idThe ID of the record to update
String 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 call
Map propsDictionary of properties making up the configuration with the following keys and datatypes:History Stores
Id (long)
Name (str)
Enabled (bool)
TransmissionHistoryStoreType (str) "IN-MEMORY" or "DISK_BACKED"
EdgeNodeTagCapacity (int)(deprecated 4.0.19)
DeviceTagCapacity (int)(deprecated 4.0.19)
HistoryMaxSize (int)(added 4.0.22)HistoryMaxAge (int)(added 4.0.19)FlushQuantity (int)
FlushPeriod (long)
RollingHistoryBufferEnabled (bool)(added 4.0.17)RollingHistoryMaxAge (int)(added 4.0.17)RollingHistoryPruneInterval (int)(added 4.0.17)H2dbPort (int)(added 4.0.22)
GeneralId (long)
Enabled (bool)
AuditProfileRecordId (long)(added 4.0.16)
Cert FilesId (long)
Name (str)
FileContents (str)
Description (str)
ServersId (long)
Name (str)
Url (str)
ServerSetId (str)
Username (str)
Password (str)
CaCertFileId (long)
ClientCertFileId (long)
ClientPrivateKeyFileId (long)
ClientKeyPassword (str)
HostnameVerification (bool)
ClientId (str)
KeepAlive (int)
RandomStartupDelay (str)
ReconnectDelay (long)
DataFormatTypeWrapper (str) "Sparkplug_B_v1_0_Protobuf" or "Sparkplug_B_v1_0_JSON"
AutoReconnectRpcClient (bool)RpcClientKeyPassword (str) (added 4.0.18)RpcClientEnabled (bool) (added 4.0.18)RpcClientPrivateKeyFileId (long) (added 4.0.18)RpcTlsAlpnExtensions (str) (added 4.0.18)RpcHostnameVerification (bool) (added 4.0.18)RpcUsername (str) (added 4.0.18)RpcClientId (str) (added 4.0.18)RpcClientCertFileId (long) (added 4.0.18)RpcPassword (str) (added 4.0.18)RpcCaCertFileId (long) (added 4.0.18)
SetsId (long)
Name (str)
Description (str)
PrimaryHostId (str)
TransmittersId (long)
Name (str)
Enabled (bool)
TagProvider (str)
TagPath (str)
TagPacingPeriod (long)
ServerSetId (long)
DiscoveryDelay (long)
AliasedTags (bool)
CompressionTypeWrapper (long) "NONE" "DEFLATE" or "GZIP"
BlockCommands (bool)
ConvertUdts (bool)
PublishUdtDefinitions (bool)
OptimizeUdts (bool)
CacheBirthsEnabled (bool)
HistoryStoreId (long)
EnableStoreForwardByDefault (bool)
InOrderHistory (bool)
GroupId (str)
EdgeNodeId (str)
DeviceId (str)
FilteredProperties (str)
RebirthDebounceDelay (long)
RecordsFiles
| Anchor |
|---|
updateConfig | updateConfig | system.cirruslink.transmission.updateConfig(type, id, collisionPolicy, props) → voidParametersString typeLong idThe ID of the record to update
String 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 call
Map propsDictionary of properties making up the configuration with the following keys and datatypes:History Stores
GeneralCert FilesId (long)
Name (str)
FileContents (str)
Description (str)
ServersId (long)
Name (str)
Url (str)
ServerSetId (str)
Username (str)
Password (str)
CaCertFileId (long)
ClientCertFileId (long)
ClientPrivateKeyFileId (long)
ClientKeyPassword (str)
HostnameVerification (bool)
ClientId (str)
KeepAlive (int)
RandomStartupDelay (str)
ReconnectDelay (long)
AutoReconnectRpcClient (bool)
DataFormatTypeWrapper (str) "Sparkplug_B_v1_0_Protobuf" or "Sparkplug_B_v1_0_JSON"
SetsId (long)
Name (str)
Description (str)
PrimaryHostId (str)
TransmittersId (long)
Name (str)
Enabled (bool)
TagProvider (str)
TagPath (str)
TagPacingPeriod (long)
ServerSetId (long)
DiscoveryDelay (long)
AliasedTags (bool)
CompressionTypeWrapper (long) "NONE" "DEFLATE" or "GZIP"
BlockCommands (bool)
ConvertUdts (bool)
PublishUdtDefinitions (bool)
OptimizeUdts (bool)
CacheBirthsEnabled (bool)
HistoryStoreId (long)
EnableStoreForwardByDefault (bool)
InOrderHistory (bool)
GroupId (str)
EdgeNodeId (str)
DeviceId (str)
FilteredProperties (str)
RebirthDebounceDelay (long)
RecordsFiles
Return Value
| Anchor |
|---|
deleteConfig | deleteConfig | system.cirruslink.transmission.deleteConfig(type, id) → void
ParametersString typeLong idThe ID of the record to delete
Return Value
Sample Script
Return ValueA map representing the updated configuration after it has been written to the database. (added 4.0.16)
system.cirruslink.transmission.deleteConfig(type, id) → void
ParametersString typeLong idThe ID of the record to delete
Return ValueTrue if the record is successfully deleted otherwise False is returned (added 4.0.16)
| Anchor |
|---|
| SampleScripts |
|---|
| SampleScripts |
|---|
|
Sample Script
| 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.
|
| Code Block |
|---|
|
# MQTT Transmission Create Transmitter
logger = system.util.logger("com.cirruslink.examples.transmitter.customtransmitters")
# Get the Default Set ID
sets = system.cirruslink.transmission.readConfig("Sets")
for config in sets:
if config["Name"] == "Default":
setId = config["Id"]
logger.debug("New Set ID: " + str(setId))
# Create Transmitter One
transmitterProps = {}
transmitterProps["Name"] = "Custom One"
transmitterProps["Enabled"] = True
transmitterProps["TagProvider"] = "default"
transmitterProps["TagPath"] = ""
transmitterProps["TagPacingPeriod"] = 1000
transmitterProps["ServerSetId"] = setId
transmitterProps["DiscoveryDelay"] = 0
transmitterProps["AliasedTags"] = False
transmitterProps["CompressionTypeWrapper"] = "NONE"
transmitterProps["BlockCommands"] = False
transmitterProps["ConvertUdts"] = True
transmitterProps["PublishUdtDefinitions"] = True
transmitterProps["OptimizeUdts"] = True
transmitterProps["CacheBirthsEnabled"] = False
#transmitterProps["HistoryStore"] = None
transmitterProps["EnableStoreForwardByDefault"] = True
transmitterProps["InOrderHistory"] = False
transmitterProps["GroupId"] = "Test1G"
transmitterProps["EdgeNodeId"] = "Test1E"
transmitterProps["DeviceId"] = None
transmitterProps["FilteredProperties"] = "accessRights;clampMode;deadband;deadbandMode;formatString;historicalDeadband;historicalDeadbandMode;historicalDeadbandStyle;historyEnabled;historyMaxAge;historyMaxAgeUnits;historyProvider;historySampleRate;historySampleRateUnits;historyTagGroup;historyTimeDeadband;historyTimeDeadbandUnits;opcItemPath;opcServer;permissionModel;rawHigh;rawLow;sampleMode;scaleFactor;scaleMode;scaledHigh;scaledLow;tagGroup;valueSource;expression;expressionType;ConfiguredTagPath;eventScripts;readPermissions;writePermissions;eventScripts"
transmitterProps["RebirthDebounceDelay"] = 5000
system.cirruslink.transmission.createConfig("Transmitters", transmitterProps)
# Read Config
savedTransmitters = system.cirruslink.transmission.readConfig("Transmitters")
for config in savedTransmitters:
if config["Name"] == "Custom One":
logger.info("Transmitter Config: " + str(config))
customOneId = config["Id"]
# Update Config using MergeOverwrite
transmitterProps = {}
transmitterProps["GroupId"] = "Test2G"
transmitterProps["EdgeNodeId"] = "Test2E"
system.cirruslink.transmission.updateConfig(“Transmitters”, customOneId, “MergeOverwrite”, transmitterProps)
# Update Config using Overwrite
transmitterProps = {}
transmitterProps["Name"] = "Custom One"
transmitterProps["Enabled"] = True
transmitterProps["TagProvider"] = "default"
transmitterProps["TagPath"] = ""
transmitterProps["TagPacingPeriod"] = 1000
transmitterProps["ServerSetId"] = setId
transmitterProps["DiscoveryDelay"] = 0
transmitterProps["AliasedTags"] = False
transmitterProps["CompressionTypeWrapper"] = "NONE"
transmitterProps["BlockCommands"] = False
transmitterProps["ConvertUdts"] = True
transmitterProps["PublishUdtDefinitions"] = True
transmitterProps["OptimizeUdts"] = True
transmitterProps["CacheBirthsEnabled"] = False
#transmitterProps["HistoryStore"] = None
transmitterProps["EnableStoreForwardByDefault"] = True
transmitterProps["InOrderHistory"] = False
transmitterProps["GroupId"] = "Test2G"
transmitterProps["EdgeNodeId"] = "Test2E"
transmitterProps["DeviceId"] = None
transmitterProps["FilteredProperties"] = "accessRights;clampMode;deadband;deadbandMode;formatString;historicalDeadband;historicalDeadbandMode;historicalDeadbandStyle;historyEnabled;historyMaxAge;historyMaxAgeUnits;historyProvider;historySampleRate;historySampleRateUnits;historyTagGroup;historyTimeDeadband;historyTimeDeadbandUnits;opcItemPath;opcServer;permissionModel;rawHigh;rawLow;sampleMode;scaleFactor;scaleMode;scaledHigh;scaledLow;tagGroup;valueSource;expression;expressionType;ConfiguredTagPath;eventScripts;readPermissions;writePermissions;eventScripts"
transmitterProps["RebirthDebounceDelay"] = 5000
system.cirruslink.transmission.updateConfig(“Transmitters”, customOneId, “Overwrite”, transmitterProps)
# Delete Config
#systemsystem.cirruslink.transmission.deleteConfig("Transmitters", customOneId) |
...