Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
host_connection_status [2021/09/08 14:21] wikiadmin |
host_connection_status [2025/03/14 16:30] (current) wikiadmin |
||
---|---|---|---|
Line 23: | Line 23: | ||
====JavaScript Example for MIStudio/ | ====JavaScript Example for MIStudio/ | ||
- | This code example is run from a StartupTrigger script in TransSECS (or a script triggered by the StartupTrigger in MIStudio) to set up the ConnetionStatusListener. For MIStudio, this script pushes data to two BroadcastServers (StatusListenerCommand and StatusListenerValue) whenever there is a connection status change. | + | This code example is run from a StartupTrigger script in TransSECS (or a script triggered by the StartupTrigger in MIStudio) to set up the ConnectionStatusListener. For MIStudio, this script pushes data to two BroadcastServers (StatusListenerCommand and StatusListenerValue) whenever there is a connection status change. |
<code javascript> | <code javascript> | ||
Line 40: | Line 40: | ||
} | } | ||
- | | + | |
| | ||
Line 58: | Line 58: | ||
function waitForHost() { | function waitForHost() { | ||
print(" | print(" | ||
- | host=TransSecsController.findController(" | + | host=TransSecsController.getSingleController(); //get the host controller |
while (host==null) { | while (host==null) { | ||
// | // | ||
Thread.sleep(50); | Thread.sleep(50); | ||
- | host=TransSecsController.findController(" | + | host=TransSecsController.getSingleController(); |
} | } | ||
- | host=TransSecsController.findController(" | + | host=TransSecsController.getSingleController(); |
// print(" | // print(" | ||
var connectionStatusListener = new ConnectionStatusListener() { | var connectionStatusListener = new ConnectionStatusListener() { | ||
Line 70: | Line 70: | ||
connectionStatusChanged : function (connectionStatus, | connectionStatusChanged : function (connectionStatus, | ||
// | // | ||
- | // | + | // |
StatusListenerComment-> | StatusListenerComment-> | ||
StatusListenerValue-> | StatusListenerValue-> |