Installing the Stateful API Wrapper
- Last UpdatedNov 06, 2025
- 2 minute read
The Stateful API is a set of DLLs used by the MES client controls and other custom client applications, to interface with, and access the MES middleware. These DLLs maintain the current state of each session for the client application, allowing convenient access to things such as the current user, the current entity and the current job, etc. You cannot use these API directly within the System Platform scripting either in an Application Object or an InTouch View Application script. You must install the wrapper before using the scripting interface for this API. The Stateful API wrapper is contained in a set of DLL files. You can install the Stateful API wrapper by importing an aaSLIB file from the installation image.
When you try to log on to the ClientSession using the FactMES.aaSLIB script library file, the access is denied and the following error message is displayed:
User does not have the required privilege to run this application
Though the OCO only uses the Stateless API, it also uses the ClientSession.Getinstance() method from the Stateful API to retrieve the session ID. The OCO uses the session ID to track the session and send the request to the database. The error message is displayed because the UCO\OCO may create a session with the Client type UCO that denies an operator to log on to the System Platform IDE.
To install the Stateful API Wrapper
-
Open the System Platform IDE.
-
Select the Galaxy menu, point to Import, and then Script Function Library. The Import Script Function Library dialog box appears.
-
Browse to the \Program Files\Wonderware\MES\Controls folder on your local hard drive. In the Files of type list, click Script Library Files (*.aaSLIB).
Note: If you selected to install the .NET Controls during your installation the aaFactMES.aaSLIB file will be copied into your local hard drive. You can also browse onto the Installation CD and copy the file manually from the \MES\Controls directory.
Note: MES adds new registry settings for referencing DLLs associated with the selected feature. These registry settings are present in the Global Assembly Cache (GAC) in Visual Studio.
-
Select the aaFactMES.aaSLIB file and click Open. The script library is imported and a success message appears.
-
Click OK.