I am working with an Operator Interface written in LabWindows/CVI 7.1. I need this program to be able to access station globals and local variables in TestStand 3.1. This Operator Interface was originally written for TestStand 2 and uses the older functions like TS_NewEngine, TS_EngineSetProperty, TS_PropertyGetValString, etc. This has caused some problems when I try to use these functions with TestStand 3.1. I can run the code fine in the debugger, but my executable just quits as soon as it encounters one of these older testStand functions (I can't tell which one). I have been trying to incorportate the Application Manager, Sequence File View Manager, and Execution View Manager into the existing code without altering the GUI's appearence (keeping with the standard LabWindows text boxes and not using ActiveX controls). I cannot figure out how to access variables in testStand using the Managers. Here is the code I am using so far:
//Define Panel Handles and ActiveX Control Handles
typedef struct
{
//panel handles
int m_pnMain;
int m_pnExecute;
// ActiveX control handles:
CAObjHandle applicationMgr; // invisible control, manages Startup/Shutdown, and other application functions
CAObjHandle sequenceFileViewMgr; // invisible control, manages a SequenceView control that displays loaded sequence files
CAObjHandle executionViewMgr; // invisible control, manages a SequenceView control that displays executing sequences
CAObjHandle m_oEngine;
} ApplicationWindow;
static ApplicationWindow gMainWindow; // this application only has one window
// load the panels for the main window from the .UIR file
errChk( gMainWindow.m_pnMain = LoadPanelEx (0, "Symtx Operator Console.uir", PN_MAIN, __CVIUserHInst));
errChk( gMainWindow.m_pnExecute = LoadPanelEx (gMainWindow.m_pnMain, "Symtx Operator Console.uir", PN_EXECUTE, __CVIUserHInst));
// prepare to use the TestStand ActiveX controls
errChk( GetActiveXControlHandles());
tsErrChk( TSUI_ApplicationMgrGetApplicationWillExitOnStart(gMainWindow.applicationMgr, &errorInfo, &appWillExitOnStart));
if (!appWillExitOnStart)
{
// show a splash screen while starting up
errChk( splashPanel = LoadPanelEx(0, "Symtx Operator Console.uir", SPLASH, __CVIUserHInst));
errChk( InstallPopup(splashPanel));
}
// make TS engine conveniently accessible
tsErrChk( TSUI_ApplicationMgrGetEngine(gMainWindow.applicationMgr, &errorInfo, &gMainWindow.m_oEngine));
The code shown above works fine. I tried to add the following lines to access the station globals:
// Get station globals
m_oGlobals = gMainWindow.m_oEngine.NewPropertyObject( 3, False, "", 0);
m_oGlobals = gMainWindow.m_oEngine.Globals;
and got the following error when I compiled:
290, 39 Left operand of . has incompatible type 'CAObjHandle'.
which referred to
m_oGlobals = gMainWindow.m_oEngine.NewPropertyObject( 3, False, "", 0);
If anyone can help I'd greatly appreciate it.