Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In addition to several LUA functions, the NXA LUA library also provides several event callbacks that are invoked by the server at specific points in time. Within these callbacks, the user can integrate LUA scripts that are execute whenever the server invokes the corresponding callback. Using this way, control functionality can be implemented
that shall be available for dedicated points in time. <file name="OnInitEvent">
<h1>Description</h1>
<h1>Signature</h1>

Description

Signature

OnInitEvent () <p>This

This callback is invoked the during initialization of the server.
Within this callback, initialization task (e.g. creating Custom Items) can be performed.</p>
<h1>Parameters</h1>

Parameters

None.

Return

<h1>Return</h1> None. </file>
<file name="OnStartEvent">
<h1>Description</h1>
<h1>Signature</h1>

Description

Signature

OnStartEvent () <p>This

This callback is invoked during server start up. Since "OnStartEvent" is called after "OnInitEvent", all items are already available and can be accessed through LUA scripts.</p>
<h1>Parameters</h1>

Parameters

None.

Return

<h1>Return</h1> None. </file>
<file name="OnStopEvent">
<h1>Description</h1>
<h1>Signature</h1>

Description

Signature

OnStopEvent () <p>This

This callback is invoked during the shutdown process of the server.</p>
<h1>Parameters</h1>

Parameters

None.

Return

<h1>Return</h1> None. </file>
<file name="OnSecondTimerEvent">
<h1>Description</h1>
<h1>Signature</h1>

Description

Signature

OnSecondTimerEvent () <p>This

This callback is invoked every second. It can be used to implement functionality that has to be triggered every second.</p>
<h1>Parameters</h1>

Parameters

None. <h1>Return</h1>

Return

None. </file>
<file name="OnMinuteTimerEvent">
<h1>Description</h1>
<h1>Signature</h1>

Description

Signature

OnMinuteTimerEvent () <p>This

This callback is invoked every minute. It can be used to implement functionality that has to be triggered every minute. </p>
<h1>Parameters</h1>

Parameters

None.

Return

<h1>Return</h1> None. </file>
<file name="OnHourTimerEvent">
<h1>Description</h1>
<h1>Signature</h1>

Description

Signature

OnHourTimerEvent () <p>This

This callback is invoked every hour. It can be used to implement functionality that has to be triggered every hour. </p>
<h1>Parameters</h1>

Parameters

None.

Return

<h1>Return</h1> None. </file>
<file name="OnKNXGatewayConnectedEvent">
<h1>Description</h1>
<h1>Signature</h1>

Description

Signature

OnKNXGatewayConnectedEvent (string) <p>This

This callback is invoked every time a KNX gateway has been connected. The parameter can be used to determine the connected gateway.</p> <h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>IP address of the KNX gateway</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="OnKNXGatewayDisconnectedEvent">
<h1>Description</h1>
<h1>Signature</h1>
OnKNXGatewayDisconnectedEvent (string) <p>This

Parameters

NameTypeMandatory/OptionalDescription
 stringMIP address of the KNX gateway

Return

None.

Description

Signature

OnKNXGatewayDisconnectedEvent (string)

This callback is invoked every time a KNX gateway has been disconnected. The parameter can be used to determine the disconnected gateway.</p> <h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th> <th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>IP address of the KNX gateway</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="OnClientConnectedEvent">
<h1>Description</h1>
<h1>Signature</h1>

Parameters

NameTypeMandatory/OptionalDescription
 stringMIP address of the KNX gateway

Return

None.

Description

Signature

OnClientConnectedEvent (clientType, clientName, source, IPAddress, user, (projectName)) <p>This

This function is invoked when a client is connected to the NETx BMS Core Server. </p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>clientType</td><td>M</td><td>client

Parameters

NameTypeMandatory/OptionalDescription
 clientTypeMclient type (WEB, VNET, or OPC)

...

 clientNameMclient name
 sourceMclient source (e.g. Voyager.5.0, OPC Client name or IP address of BMS Client)

...

 IPAddressMip address of client
 userMuser that is currently online
 (projectName)Moptional name of the visualization

...

project

Return

None. </file>
<file name="OnClientDisconnectedEvent">
<h1>Description</h1>
<h1>Signature</h1>

Description

Signature

OnClientDisconnectedEvent (clientType, clientName, source, IPAddress, user) <p>This

This function is invoked when a client is disconnected from the NETx BMS Core Server.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th> <th>Description</th>
</tr>
<tr><td></td><td>clientType</td><td>M</td><td>client

Parameters

NameTypeMandatory/OptionalDescription
 clientTypeMclient type (WEB, VNET, or OPC)

...

 clientNameMclient name
 sourceMclient source (e.g. Voyager.5.0, OPC Client name or IP address of BMS Client)

...

 IPAddressMip address of client
 userMuser that is currently online

Return

None.

Description

Signature

OnConnectedEvent ()

This function is invoked when an XCON connection has been established. Create a function for each connection to monitor and name it accordingly, e.g. for connection socket1 create the function socket1_OnConnectedEv <h1>Parameters</h1>

Parameters

None. <h1>Return</h1>

Return

None. </file>
<file name="<connection_handle>_OnDisconnectedEvent">
<h1>Description</h1>
<h1>Signature</h1>
<connection_handle>_

Description

Signature

OnDisconnectedEvent () <p>This

This function is invoked when an XCON connection has been established. Create a function for each connection to monitor and name it accordingly, e.g. for connection socket1 create the function socket1_OnDisconnecte <h1>Parameters</h1>

Parameters

None. <h1>Return</h1>

Return

None. </file>
<file name="<connection_handle>_OnDoneEvent">
<h1>Description</h1>
<h1>Signature</h1>
<connection_handle>_

Description

Signature

OnDoneEvent (string, string) <p>This

This function is invoked when an FTP connection completed a transfer. Create a function for each connection to monitor and name it accordingly, e.g. for connection ftp1 create the function ftp1_OnDoneEvent

Parameters

...

Name

...

Type

...

Mandatory/OptionalDescription
 stringMsource file name
 stringMdestination file name

Return

None.

Description

Signature

OnReceiveEvent (string, number, string, number) <p>This

This function is invoked when an XCON connection received data. Create a function for each connection to monitor and name it accordingly, e.g. for connection socket1 create the function socket1_OnReceiveEvent.</p> <h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>data string</td></tr>
<tr><td></td><td>number</td><td>M</td><td>data size</td></tr>
<tr><td></td><td>string</td><td>M</td><td>IP address of sender</td></tr>
<tr><td></td><td>number</td><td>M</td><td>port number of sender</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="<connection_handle>_OnErrorEvent">
<h1>Description</h1>
<h1>Signature</h1>
<connection_handle>_OnErrorEvent (string) <p>This

Parameters

NameTypeMandatory/OptionalDescription
 stringMdata string
 numberMdata size
 stringMIP address of sender
 numberMport number of sender

Return

None.

Description

Signature

OnErrorEvent (string)

This function is invoked when an error occurs on an XCON connection. Create a function for each connection to monitor and name it accordingly, e.g. for connection ftp1 create the function ftp1_OnErrorEvent.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th> <th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>error message</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>

Parameters

NameTypeMandatory/OptionalDescription
 stringMerror message

Return

None.