Enum Class
packages\node-opcua-enum\src\enum.js:91
Constructor
Enum
-
key
-
value
Parameters:
-
key
StringThe Enum key.
-
value
NumberThe 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)
- sameDataValue
- start_simple_server
- toJSON
- toString
- valueOf
Methods
addTestUAAnalogItem
-
parentNode
add a fake analog data item for testing
Parameters:
-
parentNode
Object
build_client_server_session
-
done
Parameters:
-
done
Object
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:
-
options
Options-
[add_simulation= false]
Boolean optionaladd the simulation nodes in the server
-
-
done
Callback
Returns:
createHVACSystem
-
addressSpace
Parameters:
-
addressSpace
Object
Returns:
get
-
key
Returns the appropriate EnumItem.
Parameters:
-
key
EnumItem | | 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:
-
min
Object -
max
Object
Returns:
has
-
value
Checks if the flagged EnumItem has the passing object.
Parameters:
-
value
EnumItem | String | NumberThe object to check with.
Returns:
The check result.
is
-
item
Checks if the EnumItem is the same as the passing object.
Parameters:
-
item
EnumItem | String | NumberThe object to check with.
Returns:
The check result.
make_debugLog
-
scripFullpath:string
Parameters:
-
scripFullpath:string
Object
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:
-
client
Object -
endpointUrl
String -
func
Function-
session
Sessionthe done callback to call when operation is completed
-
done
Functionthe done callback to call when operation is completed
-
[err]
Error optionalan optional error to pass if the function has failed
-
-
-
done_func
Function-
[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:
-
client
OPCUAClientBase -
endpointUrl
String -
do_func
Function-
session
Sessionthe done callback to call when operation is completed
-
done
Functionthe done callback to call when operation is completed
-
-
done_func
Function-
[err]
Error optional
-
sameDataValue
-
v1
-
v2
-
[timestampsToReturn]
Parameters:
-
v1
DataValue -
v2
DataValue -
[timestampsToReturn]
TimestampsToReturn optional
Returns:
true if data values are identical
start_simple_server
-
options
-
callback
Parameters:
-
options
Object-
env
-
[server_sourcefile="./bin/simple_server"]
String optional -
[port= 2223]
String optional
-
-
callback
Function-
error
Error | 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.