Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


GLOSSARY


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.

Description

Send a message to a message handler within the same session.

The Scope Parameter

It is important to be mindful of the scope parameter when calling this function. It is possible to have multiple instances of a view open in a single page, thus invoking the function with a value of "page" for the scope parameter (or omitting the parameter) will invoke the message handlers on all valid message types. This advice is also applicable when the scope parameter is passed "session", as all instances of the matching message type in the whole session will be called.

Syntax

system.perspective.sendMessage(messageType, payload [, scope, sessionId, pageId])

  • Parameters

String messageType - The message type that will be invoked. Message handlers configured within the project are listening for messages of a specific messageType.

Dictionary payload - A python dictionary representing any parameters that will be passed to the message handler.

String scope - The scope that the message should be delivered to. Valid values are "session", "page", or "view". If omitted, "page" will be used. [optional]

String sessionId - Identifier of the Session to target. If omitted, the current Session will be used automatically. When targeting a different session, then the pageId parameter must be included in the call. [optional]

String pageId - Identifier of the page to target. If omitted, the current page will be used. [optional]

  • Returns

None

  • Scope

Perspective Session

Code Examples
Code Snippet
# Sends a message to all Message Handlers configured on the current view, indicating that a new item has been added to a list.
system.perspective.sendMessage("NewItem", payload = {"itemName":"banana","itemQuantity":6}, scope = "view")
Keywords

system perspective sendMessage, perspective.sendMessage

  • No labels