File

src/api/interface/parametersServices.ts

Extends

EventEmitter

Index

Methods

Constructor

constructor(hmiComm: CommHmiNodeServer, route: string)
Parameters :
Name Type Optional
hmiComm CommHmiNodeServer No
route string No

Methods

Public backupData
backupData(type: string, folder: string, cncNodeIndex: number)

Backups specified user table(s) to folder

Returns a promise. This promise is fulfilled with reply object ServiceResponse

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

Parameters :
Name Type Optional Default value Description
type string No

Type of parameter

folder string No

Path of the folder where backup will be stored

cncNodeIndex number No 0
Public cleanAllCommonParameterComments
cleanAllCommonParameterComments(cncNodeIndex: number)

Clean all common parameters' comments at once

Returns a promise. This promise is fulfilled with reply object ServiceResponse or is rejected with CncServiceOperationException when something goes wrong.

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

Parameters :
Name Type Optional Default value
cncNodeIndex number No 0
Public getAllCommonParametersRangeData
getAllCommonParametersRangeData(index: number, range: number, live, refresh: number, cncNodeIndex: number)

Gets all the common parameters within a range

if parameter live is set to true :

Returns a liveStream with the parameterized range of common parameter data updated according to refresh time It calls to CommHmiNodeServer to call appropiate REST API route.

if live is undefined or false:

Shortcut for read a range of common parameters of a route.

Returns a promise. This promise is fulfilled with reply object ServiceResponse or is rejected with CncServiceOperationException when something goes wrong.

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

The return object if the request has been succesful is an array with parameter data CommonParData

Parameters :
Name Type Optional Default value Description
index number No

Index of the first common paramerte to be read

range number No

Number of parameters to be read beginning from index

live No false
refresh number No 2000

Refresh time in miliseconds

if parameter live is set to true :

Returns a liveStream with the parameterized range of common parameter data updated according to refresh time It calls to CommHmiNodeServer.createLiveStreamClient to call appropiate REST API route.

cncNodeIndex number No 0
Returns : Promise | LiveStream
Public getCommonParameterData
getCommonParameterData(idArray: string[], cncNodeIndex: number)

Reads common parameters passed by argument by channel.

Returns a promise. This promise is fulfilled with reply object ServiceResponse or is rejected with CncServiceOperationException when something goes wrong.

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

The return object if the request has been succesful is an array with parameter data PairNameValue { 'name': '100' 'value': 0.092 }

Parameters :
Name Type Optional Default value Description
idArray string[] No null

Array with ids of the common parametes to be read.

cncNodeIndex number No 0
Public getGlobalsAllParRangeData
getGlobalsAllParRangeData(index: number, range: number, live, refresh: number, cncNodeIndex: number)

Gets all the global parameters within a range

If the parameter live is true

Returns a liveStream with the parameterized global parameter data updated according to refresh time It calls to CommHmiNodeServer to call appropiate REST API route.

if live is false

Returns a promise. This promise is fulfilled with reply object ServiceResponse

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

Parameters :
Name Type Optional Default value Description
index number No

Index of the first common paramerte to be read

range number No

Number of parameters to be read beginning from index

live No false
refresh number No 2000

Refresh time in miliseconds

If the parameter live is true

Returns a liveStream with the parameterized global parameter data updated according to refresh time It calls to CommHmiNodeServer.createLiveStreamClient to call appropiate REST API route.

if live is false

Returns a promise. This promise is fulfilled with reply object ServiceResponse

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

cncNodeIndex number No 0
Returns : Promise | LiveStream
Public getParInfo
getParInfo(type: "commons" | "globals" | "locals", cncNodeIndex: number)

Get global, local or common parameters limits

Returns a promise. This promise is fulfilled with reply object ServiceResponse

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

type : globals | It returns an object with global parameters: { "minLimit": number "maxLimit": number "minReadOnlyLimit": number "maxReadOnlyLimit": number }

and this one in the others { "minLimit": number "maxLimit": number }

Parameters :
Name Type Optional Default value
type "commons" | "globals" | "locals" No 'commons'
cncNodeIndex number No 0
Public restoreData
restoreData(type: string, folder: string, cncNodeIndex: number)

Restores specified user table(s) from folder

Returns a promise. This promise is fulfilled with reply object ServiceResponse o

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

Parameters :
Name Type Optional Default value Description
type string No

Type of parameter

folder string No

Path of the folder frome where data will be read

cncNodeIndex number No 0
Public setAllCommonParameterComment
setAllCommonParameterComment(value: string, cncNodeIndex: number)

Set all the common parameters' comments with given string.

Returns a promise. This promise is fulfilled with reply object ServiceResponse

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

Parameters :
Name Type Optional Default value
value string No ""
cncNodeIndex number No 0
Public setAllCommonParameterData
setAllCommonParameterData(value: number, cncNodeIndex: number)

Set all the common parameters with given value.

Returns a promise. This promise is fulfilled with reply object ServiceResponse

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

Parameters :
Name Type Optional Default value
value number No 0
cncNodeIndex number No 0
Public setCommonParameterData
setCommonParameterData(idValueArray: PairNameValue[], cncNodeIndex: number)

Sets the common parameter values specified by ids.

Returns a promise. This promise is fulfilled with reply object ServiceResponse

return object will contain the returnCode, if value is 0 everything went well, if not data will have the explanation of the error.

Parameters :
Name Type Optional Default value Description
idValueArray PairNameValue[] No

Array with name,value format object: {name: '100', value: 0.9}

cncNodeIndex number No 0

results matching ""

    No results matching ""