Program Structure and Events |
Function |
Return Type |
Description |
Example |
GOOSE Publisher:
enableGoosePublisherOnPort(portName) |
bool |
Enables GOOSE publisher on portName |
var publisher = new GoosePublisher();
publisher.enableGoosePublisherOnPort('FastEthernet0');
|
GOOSE Publisher:
addPublisherValue(value) |
N/A |
Adds a value to be published to the subscribers. Up to 8 values can be added to a GOOSE message. |
publisher.addPublisherValue(1); |
GOOSE Publisher:
updatePublisherValue(index, value) |
N/A |
Updates the value at the index and publishes to the subscribers. |
publisher.updatePublisherValue(0, i); |
GOOSE Publisher:
init(true) |
N/A |
Starts GOOSE publishing |
publisher.init(true); |
GOOSE Subscriber:
enableGooseSubscriberOnPort(portName) |
bool |
Enables GOOSE subscriber on portName. |
var subscriber = new GooseSubscriber();
subscriber.enableGooseSubscriberOnPort('FastEthernet0'); |
GOOSE Subscriber:
onSubscribed() |
N/A |
Sets the callback for when published data are received. |
subscriber.onSubscribed = function() {}; |
GOOSE Subscriber:
processReceivedData(src, data) |
N/A |
Sets the callback for when published data are received. |
subscriber.processReceivedData = function(src, data) {}; |
MMS Client:
enableIec61850() |
N/A |
Enables MMS features on the device. |
var client = new MMSClient();
client.enableIec61850(); |
MMS Client:
connect(ip) |
bool |
Opens a TCP connection to the server. |
client.connect("1.1.1.1"); |
MMS Client:
disconnect() |
N/A |
Closes the connection to the server. |
client.close(); |
MMS Client:
getData(modelName, dataName) |
N/A |
Gets data from the server based on the model name and the data name. |
client.getData("model", "data1"); |
MMS Client:
onConnectionEstablished() |
N/A |
Sets the callback for when the connection to the server is established. |
client.onConnectionEstablished = function() {}; |
MMS Client:
onConnectionClosed() |
N/A |
Sets the callback for when the connection to the server is closed. |
client.onConnectionClosed = function() {}; |
MMS Client:
processReceivedData(srcIp, dataObject, dataValue) |
N/A |
Sets the callback for when the requested data are received. |
client.processReceivedData = function(srcIp, dataObject, dataValue) {}; |
MMS Server:
setup() |
N/A |
Enables MMS server functionalities on the device. |
MMSServer.setup(); |
MMS Server:
createDataModel(model, dataName) |
bool |
Creates a data model with the given data name. |
MMSServer.createDataModel("model", "data1"); |
MMS Server:
addDataObject(dataName); |
N/A |
Adds a new datum to the existing model. |
MMSServer.addDataObject("data2"); |
MMS Server:
setDataObject(dataName, dataValue) |
N/A |
Sets the data value to the given data name. |
MMSServer.setDataObject("data1", "123.45"); |
MMS Server:
start(true) |
N/A |
Starts the MMS Server process. |
MMSServer.start(true); |
SV Publisher:
enableSvPublisherOnPort(portName) |
bool |
Enables SV publisher on portName |
var publisher = new SvPublisher();
publisher.enableSvPublisherOnPort('FastEthernet0');
|
SV Publisher:
addPublisherValue(value) |
N/A |
Adds a value to be published to the subscribers. There is no limit on how many values can be added to the SV message. |
publisher.addPublisherValue(1); |
SV Publisher:
updatePublisherValue(index, value) |
N/A |
Updates the value at the index and publishes to the subscribers. |
publisher.updatePublisherValue(0, i); |
SV Publisher:
init(true) |
N/A |
Starts SV publishing |
publisher.init(true); |
SV Subscriber:
enableSvSubscriberOnPort(portName) |
bool |
Enables SV subscriber on portName. |
var subscriber = new SvSubscriber();
subscriber.enableSvSubscriberOnPort('FastEthernet0'); |
SV Subscriber:
onSubscribed() |
N/A |
Sets the callback for when published data are received. |
subscriber.onSubscribed = function() {}; |
SV Subscriber:
processReceivedData(src, data) |
N/A |
Sets the callback for when published data are received. |
subscriber.processReceivedData = function(src, data) {}; |