CreateSym3

Create the sym3.js API object – most functions in this documentation (other than the ones in the “Functions” section) are called through an instance of the object returned by this function.

sym3.js will try to make a connection to the specified server with no further interaction than calling this function. Note that most functions will only have an effect if the project is loaded. Use SetOnProjectInitialised to detect when you can start calling the other functions.

Function

CreateSym3(port: int, serverName: string, webSocketSecure: bool)

Parameters:

  • port (int): the port number to connect to the Sym3 Operator server with.
  • serverName (string): the server name to connect to. If not supplied, defaults to location.hostname.
  • webSocketSecure (bool): use a secure WebSocket connection (wss) to connect to the server. Requires that the server has a TLS certificate set up correctly. If not supplied, defaults to false.

Return Value

The instantiated Sym3 API object.

Example

Create the API object to wss://localhost:2345 and call a member function.

let SYM3 = CreateSym3(2345, "localhost", true);
SYM3.GetState();