API. SIGNAL

This class provides a set of interfaces for managing and interacting with signals on the controller. It includes methods for creating, retrieving, and updating signal configurations, subscribing to signal changes, and searching for signals based on various filters. This class simplifies signal management and enables seamless integration with the controller's configuration and runtime environment.

Properties
NameTypeDescription
SignalAPI.SIGNAL.Signal

Classes

Signal

Methods

createSignal(name, attr) → {Promise.<API.SIGNAL.Signal>}

Creates a new signal in the configuration database if there is no one existed. If there is an existing one, the attributes of the new signal will inherit from those of the existing one.

Parameters:
NameTypeDescription
namestring

Signal name.

attr*

Signal attributes.

Returns:
Type: 
Promise.<API.SIGNAL.Signal>
Example
await API.SIGNAL.createSignal("TestDO2",{SignalType:"DO", Access:'All'})

getSignal(name, network, device) → {Promise.<object>}

Gets an instance of API.CONFIG.Signal connected to an existing signal . If no existing signal is found, a Promise.reject is returned

Parameters:
NameTypeDescription
namestring

The signal name.

networkstring

The network name.

devicestring

The device name.

Returns:

await API.SIGNAL.getSignal("TestDO1")

Type: 
Promise.<object>

Searches for available signals in the controller.

Parameters:
NameTypeDescription
filterAPI.SIGNAL.filterSignalSearch

The result can be filtered by using an object with the following possible elements:
 (string) name signal name
 (string) device device name
 (string) network network name
 (string) category category string
 (string) category-pon
 (string) type type of signal, valid values: 'DI', 'DO', 'AI', 'AO', 'GI' or 'GO'
 (boolean) blocked blocked signals

Searches the system for signals that meet the filter conditions. The signal name can be a fuzzy matching, which means that the name of any signal containing a filter value will be returned. The filter type can contain multiple types by using the values within '[', ']' and separated by ',', e.g. '["DI","DO"]'.

Example: var filter = { name: 'TestDI', }

Returns:
  • List of API.CONFIG.SIGNAL.Signal instances
Type: 
Promise.<(Array.<object>|Array.<string>)>