EMConnect

Opens a conversation with the BlueZone Display session. The EMConnect command must be called before any other BlueZone Script Host methods that access data in the host screen.

EMConnect auto-connects to the BlueZone session that launched Script Host or it searches for the first available session if launched from BlueZone desktop when no short name session identifier is specified.
Parameters
SessionShortName
Uniquely identifies the BlueZone Display session. The Session Name corresponds to the HLLAPI Short Name Session Identifier configured in the Options API settings in BlueZone Display.

If the SessionShortName parameter is omitted, you must include empty quotes (EMConnect"") to launch the first available session. If you do not include the empty quotes, you receive an error.

Returns
0 for success; or a non-zero error code. Refer to Error codes for a complete listing of error code descriptions.
Remarks
The script can only be connected to one display session at a time. When connecting to multiple sessions, any previously connected session is automatically disconnected.
Example
UserId = "John"
Password = "Smith"
 
ResultCode = EMConnect( "A" )
 
If ( ResultCode = 0 ) Then
   EMWriteScreen Userid, 5, 63
   EMWriteScreen Password, 6, 63
   SendKey "@E"
   EMWaitReady 10, 1
End If