Call EES from External Applications
The Professional license (Version 12.131 or newer) can be called from other applications using the FindWindow and SendMessage commands in the Windows Operating System. Examples of programs that can call EES are Python, Excel, Matlab and LabView. The commands needed to interact with EES are summarized here.
EES will respond to a SendMessage command, which has the following format.
Result=SendMessage(hWnd, wm_RunEES, em_Command, xtra)
where
hWnd is the window handle of an open EES program. The window handle can be found by a call to the FindWindow command as follows:
hWnd = FindWindow('TEES_D','')
wm_RunEES is an integer message type that EES is programmed to recognize. It must be set to 32777
em_Command is one of the following integers.
0: (em_DeleteLog) Delete the log file that is normally maintained in the EESFolder\EESCallFormApp.log
1: (em_LogOff) Turn off logging of commands to file EESFolder\EESCallFormApp.log
2: (em_LogOn) Create log file EESFolder\EESCallFormApp.log if it does not exist and start logging to this file
10: (em_Solve) Solve the file in an open EES application
11: (em_SolveTable) Solve the Parametric table with tab number provided in xtra in an open EES application
20: (em_RunMacroTab) Run the macro file with tab number provided in xtra in an open EES application
30: (em_RunMacroName) Run the macro that has file name provided in EESFolder\EESMacroName.txt. Start an EES application if it is not already open.
xtra is an integer that indicates the tab number for em_commands 11 and 20. Otherwise it is should be set to zero.
Example of this capability using Python.