ConnectClient
- Last UpdatedFeb 19, 2025
- 3 minute read
The ConnectClient node lets you manage AVEVA Connect™ login and logout from script.
The node cannot instanced from script and a unique ConnectClient instance named connectClient is automatically created by the XR engine at startup.
Note:: The doLogin and doLogout fields are prevented when the application is started using LAAS, because the user token is bound to the application licensing.
Platform support
This node is supported on XR-Windows platform only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
No support |
No support |
No support |
No support |
|
|
|
|
|
|
States and actions
The field state represents the state of the connection with AVEVA™ Connect. Actions are restricted to specific states:
-
doLogin can be invoked only when the state is not_connected or error. After invoking, the state moves to connecting and then to connected or error.
-
doLogout can be invoked only when the state is connected. After invoking, the state moves to disconnecting and then to not_connected or error.
When the state is set to error, you can find details about the issue in the errorMessage field.
Code example
This is a code example for the ConnectClient node.
<Coroutine name="crt_doLogin">
<return condition="[@connectClient.state]!=not_connected" />
<log text="Performing login" />
<set name="connectClient.doLogin" />
<wait condition="[@crt_doLogin.timeFromWait]<0.001" />
<wait condition="[@connectClient.state]==connected" />
<log text="Login completed" />
</Coroutine>
Node fields
These are the fields for the ConnectClient node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > ConnectClient
|
Field |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
doLogin |
sevent |
Optional |
Empty |
Triggers the login request. If a token has been stored, the login form will not be spawned. |
|
doLogout |
sevent |
Optional |
Empty |
Triggers the logout request. |
|
environment |
senumg |
Optional |
capdev |
Sets the environment for authentication and authorization. Can be set to capdev, test, preprod, or prod. |
|
errorMessage |
sstring |
Read Only |
Internally calculated |
When state field is set to error, this field contains information about the issue |
|
isUsingLAAS |
sbool |
Read Only |
Internally calculated |
Sets to true if application was started using LAAS. When isUsingLAAS is true, the actions doLogin and doLogout are forbidden. |
|
state |
senum |
Read Only |
Internally calculated |
Represents the state of the connection. Possible states are not_connected, connecting, connected, disconnecting, error. |