Last updated
Last updated
Understanding the following articles is recommended before reading this article:
This article includes information on the following nodes:
All nodes are part of the Node-RED package. All the nodes require a connection to the MobiusFlow Engine.
The MobiusFlow inject node injects MobiusFlow objects into the flows based on when there is a change of value within that object. The object range the MobiusFlow inject node covers is specified as a list of included / excluded URIs or wildcard URIs.
The node allows a list of subscriptions to be specified in the subscriptions table. These subscriptions tell the node which objects to subscribe to change of value events from. As such, this table is specified as a list of URIs or URI wildcards.
The add button at the bottom of the table can used to add more subscription rows
Each subscription can be specified as an include or an exclude. This will either include or exclude that subscription group from the object selection respectively.
In the config window screenshot above, the 1st subscription row is used to select everything on service 022. The 2nd subscription row is then used to exclude specifically instance 000001/022/000B/0001 from the selection.
The flow below is used to demonstrate the out of the MobiusFlow inject node:
Following a COV event, the debug window showed the following output:
The full JSON response is copyable in the code block below:
The get Multi-Object node gets multiple objects based on a defined set of object URIs.
The Get-Multi Object requires a list of object URIs to be specified within the objects table. Each row will point to a single object URI.
More URI rows can be added using the add button at the bottom left of the Objects table. The following screenshot shows an example node's config populated with 3 object URIs:
Any input message can trigger the node.
The node outputs an array of MobiusFlow objects. The following code block is a copyable JSON response example:
The get Multi-Resource node returns multiple resources based on a specified set of resource URIs.
The node requires of one or more resource URIs to be defined in the resources table.
The use of URI Wildcards is NOT valid here.
Additionally, the send property allows control of how the resources are outputted.
Any input message can trigger the node.
The format of outputted resources can be switched between simply showing the resource values, or including the resources name and URI with each resource. Example JSON outputs are as follows:
Simple array of PVs, one for each resource defined in the nodes config:
Object keyed by URI, one key for each resource defined in the node's config. Each containing resources PV and name:
The discover node returns a list of children of a given Hub, Service, Profile or Instance, specified by URI. The following table shows the return type based on which level the URI is specified to.
The node allows the discovery URI to be specified via the configuration window.
Specifying the discovery URI within the configuration window is not required. This is because it is also possible to specify the discovery URI dynamically via the input topic. If a valid URI is found in both the input topic and the node's configuration, the node's configuration takes precedence.
Any input message can trigger the node. It also possible to define the discovery URI in the topic of the input message. This allows the discovery URI to be dynamically changed. If a valid URI is found in both the input topic, and the node's configuration, the node's configuration takes precedence.
The output type of the discover node varies depending on which level the discovery is made. For all types, the data is packaged within data sub property of the response property of the output payload. See the following screenshot as an example:
Here are example copyable JSON responses at all discovery levels:
The discover object list node returns a list of MobiusFlow objects based on a URI or URIs (including wildcards).
The node takes the following config properties:
The node can be triggered by any input message.
Depending on the setting of the output property in the node's configuration, the node will either send whole MobiusFlow objects, or just their URIs. Below are copyable example JSON responses in both cases, based on the following example:
The node type also allows the output to be in the form of a single message, or a message for each discovered object. This is controlled by the send configuration property. The screenshots below show this action via use of the following flow:
The Filter By Rid Value node returns a list of object URIs on a specified service, filtered by a user defined filtering function. This filtering function is applied to a user specified resource on each object and is written in Javascript.
The node takes the following configuration properties:
The node is triggered via any input message.
The node will return a list of resources matching the criteria specified in the configuration.
The following is a simple flow to trigger the Filter By Rid Value node and display the output in the debug window.
In this example, the config of the Filter By Rid Value node is set to the following:
The filtering function is also shown in the following code block:
The node has been setup to search on MobiusFlow Hub 000001, service 02A. The search has been specified to only cover PID 0201. Resource 40 has been selected as the resource to which the filtering function will be applied.
In this example, the filtering functional itself has been coded to return a true result if the resource's value is greater than 0.
Triggering flow yields the following in the debug panel:
The results is the URIs of the objects which passed the filtering function when applied to resource 40 on each object.
The clear resource node clears the value of a resource at a specified priority.
The node takes the following configuration:
The node is triggered via any input message. The URI of the resource to be cleared can be specified in the topic of the input message. This allows the target resource of the node to become dynamic.
If the target URI is defined both in the node config and the topic of the input message, the node will use URI specified in the config.
Following the use of this node, the node will output the new value of the resource. If priority 15 was cleared, this will likely be the falling back value residing in priority slot 16.
The use of URI Wildcards is NOT valid here. For this feature, consider using the node
Hub
000001
List of service of the specified hub
Service
000001/022
List of profiles on the specified service
Profile
000001/022/000B
List of instances on the specified profile
Instance
000001/022/000B/0001
The specified instances and all its resources
HID
The MobiusFlow hub to discover on (in most cases 000001).
Output
Controls if the output should be MobiusFlow objects or just the URIs of the objects.
Send
Decides if the output is sent as an array packaged in one message or a set of individual messages.
Discover
Allows listing of the discovery URIs. If URIs are specified to hub, service or profile level, URI wildcarding should be used e.g. 000001/#. Each URI can be specified as an include or an exclude. This will either include or exclude that URI group from the object selection respectively.
URI
URI of the MobiusFlow service to search in (HID/SID)
PIDs
An JSON array of profile IDs the search will cover. Suppose IDs 0258 and 0259 were to be covered, this field would be written as ["0258", "0259"].
RID
The resource ID of the resource on each object the filtering function will evaluate.
Limit
Maximum number of results to return from search.
Function
Filtering function written in Javascript taking a parameter v, representing the value to apply the filtering function to.
URI
URI of resource value to be cleared. This can left blank because this can also by specified in the input topic.
Priority
Priority level within priority array to be cleared, default 15. (If you do not understand this leave this at 15)
This article explains how to use some of more advanced MobiusFlow nodes used for data transfer to and from the MobiusFlow Engine.