Skip to main content
InSource Solutions

TN MES107 Example API Call to Start a MES Client Session

insource logo large.jpg



The following article from InSource demonstrates shows how to start a Wonderware MES Client Session. 


  • Author: Michael Walker
  • Published: 09/25/2015
  • Applies to: Wonderware MES 2015




In the example below note that the me.<Attribute> relative references need to be defined for the script to function. 


Dim aaResult As aaMES.Result;
Dim SessionID As Integer ;
Dim ClientType As Integer ;
SessionID = Me.SessionID;
ClientType = aaMES.Core.aaClientTypes.clientOperator;
aaResult = aaMES.Core.aaSession.StartSession(ClientTypes, SessionID);
If aaResult.Success Then
    me.resultText    = "StartSession PASSED " + SessionID;
    me.resultText    = "StartSession Failed: " + aaResult.Exception.Message;