Enum Class
packages\node-opcua-enum\src\enum.js:91
Constructor
Enum
-
key -
value
Parameters:
-
keyStringThe Enum key.
-
valueNumberThe Enum value.
Item Index
Methods
- addTestUAAnalogItem
- build_client_server_session
- build_server_with_temperature_device create and start a fake OPCUA Server that exposes a temperature set point variable. the SetPoint temperature can be set on the server side by accessing the 'set_point_temperature' of the return server object. the SetPoint temperature can be accessed as a Read/Write variable by a opcua client as "Root/MyDevices/SetPointTemperature". The node id of this variable is stored into the 'temperatureVariableId' of the server object.
- createHVACSystem
- get
- getRandomInt
- has
- is
- make_debugLog
- perform_operation_on_client_session simple wrapper that operates on a freshly created opcua session. The wrapper: - connects to the server, - creates a session - calls your **callback** method (func) with the session object - closes the session - disconnects the client - finally call the final **callback** (done_func)
- perform_operation_on_subscription simple wrapper that operates on a freshly created subscription. - connects to the server,and create a session - create a new subscription with a publish interval of 100 ms - calls your **callback** method (do_func) with the subscription object - delete the subscription - close the session and disconnect from the server - finally call the final **callback** (done_func)
- redirectToFile
- sameDataValue
- start_simple_server
- toJSON
- toString
- valueOf
Methods
addTestUAAnalogItem
-
parentNode
add a fake analog data item for testing
Parameters:
-
parentNodeObject
build_client_server_session
-
done
Parameters:
-
doneObject
Returns:
}
Example:
before(function (done) { client_server = build_client_server_session(server_options,function (err) { if (!err) { g_session = client_server.g_session; } done(err); });
}); after(function (done) { client_server.shutdown(done); });
build_server_with_temperature_device
create and start a fake OPCUA Server that exposes a temperature set point variable.
the SetPoint temperature can be set on the server side by accessing the
'set_point_temperature' of the return server object.
the SetPoint temperature can be accessed as a Read/Write variable by a opcua client
as "Root/MyDevices/SetPointTemperature". The node id of this variable is stored into
the 'temperatureVariableId' of the server object.
-
options -
done
Parameters:
-
optionsOptions-
[add_simulation= false]Boolean optionaladd the simulation nodes in the server
-
-
doneCallback
Returns:
createHVACSystem
-
addressSpace
Parameters:
-
addressSpaceObject
Returns:
get
-
key
Returns the appropriate EnumItem.
Parameters:
-
keyEnumItem | | String | | NumberThe object to get with.
Returns:
The get result.
getRandomInt
-
min -
max
return a random integer value in the range of min inclusive and max exclusive
Parameters:
-
minObject -
maxObject
Returns:
has
-
value
Checks if the flagged EnumItem has the passing object.
Parameters:
-
valueEnumItem | String | NumberThe object to check with.
Returns:
The check result.
is
-
item
Checks if the EnumItem is the same as the passing object.
Parameters:
-
itemEnumItem | String | NumberThe object to check with.
Returns:
The check result.
make_debugLog
-
script_fullpath
Parameters:
-
script_fullpathObject
Returns:
returns a debugLog function that will write message to the console if the DEBUG environment variable indicates that the provided source file shall display debug trace
perform_operation_on_client_session
simple wrapper that operates on a freshly created opcua session.
The wrapper:
- connects to the server,
- creates a session
- calls your **callback** method (func) with the session object
- closes the session
- disconnects the client
- finally call the final **callback** (done_func)
-
client -
endpointUrl -
func -
done_func
Parameters:
-
clientObject -
endpointUrlString -
funcFunction-
sessionSessionthe done callback to call when operation is completed
-
doneFunctionthe done callback to call when operation is completed
-
[err]Error optionalan optional error to pass if the function has failed
-
-
-
done_funcFunction-
[err]Error optionalan optional error to pass if the function has failed
-
perform_operation_on_subscription
simple wrapper that operates on a freshly created subscription.
- connects to the server,and create a session
- create a new subscription with a publish interval of 100 ms
- calls your **callback** method (do_func) with the subscription object
- delete the subscription
- close the session and disconnect from the server
- finally call the final **callback** (done_func)
-
client -
endpointUrl -
do_func -
done_func
Parameters:
-
clientOPCUAClientBase -
endpointUrlString -
do_funcFunction-
sessionSessionthe done callback to call when operation is completed
-
doneFunctionthe done callback to call when operation is completed
-
-
done_funcFunction-
[err]Error optional
-
redirectToFile
-
tmpfile -
action_func -
callback
Parameters:
-
tmpfileStringlog file name to redirect console output.
-
action_funcFunction- the inner function to execute
-
callbackObject
sameDataValue
-
v1 -
v2 -
[timestampsToReturn]
Parameters:
-
v1DataValue -
v2DataValue -
[timestampsToReturn]TimestampsToReturn optional
Returns:
true if data values are identical
start_simple_server
-
options -
callback
Parameters:
-
optionsObject-
env -
[server_sourcefile="./bin/simple_server"]String optional -
[port= 2223]String optional
-
-
callbackFunction-
errorError | Null -
data-
process -
endpointurl -
serverCertificate
-
-
toJSON
()
String
Returns JSON object representation of this EnumItem.
Returns:
JSON object representation of this EnumItem.
toString
()
String
Returns String representation of this EnumItem.
Returns:
String representation of this EnumItem.
valueOf
()
String
Returns the value to compare with.
Returns:
The value to compare with.
The NodeOPCUA API