09-23-2019 11:25 AM
Good day community, I'm new in using TestStand with Labwindows/CVI.
I've got an error using TestStand API triying to open a sequence file from an absolute path.
Further I want to use some UI Teststand controls, what is the correct way to use thems, and what I need to do to use thems.
Thank you, best regards.
09-23-2019
12:00 PM
- last edited on
11-04-2024
04:29 PM
by
Content Cleaner
Hello,
The control that is visible needs to be connected to the Application Manager. I guess it is not connected to anything ? Do not hesitate to attach a code snippet with your post, that allow other users to reproduce your issue.
A good starting point are the Example User Interfaces that are shipped with TestStand. There are proposed for 5 differents developpement languages, C++, C#, LabVIEW, LabWindows/CVI and VB .Net.
There is also ressources on the NI website :
Hope this helps,
09-24-2019 12:50 PM
Hello Mathieu thanks for your repply, it was very helpul!.
Now I got a new error triying to shutdown the application manager, I attached my main code as you suggested to me:
/* Main code */
int main(int argc, char *argv[])
{
int error = 0;
long exitCode = 0;
nullChk( InitCVIRTE(0, argv, 0)); // initialize CVI runtime engine
// load the panel for the main window from the .UIR file
errChk( gMainWindow.panel = LoadPanelEx (0, "TestExec.uir", MAINPANEL, __CVIUserHInst));
// get ActiveX ctrl handles, register ActiveX event callbacks, and connect TestStand controls
errChk( SetupActiveXControls());
errChk( InstallMainCallback(MainCallback, 0, 0));
// make a handle to engine conveniently accessible
tsErrChk( TSUI_ApplicationMgrGetEngine(gMainWindow.applicationMgr, &errorInfo, &gMainWindow.engine));
// start up the TestStand User Interface Components. this also logs in the user
tsErrChk( TSUI_ApplicationMgrStart(gMainWindow.applicationMgr, &errorInfo));
// open sequence file
tsErrChk( TSUI_ApplicationMgrOpenSequenceFile(gMainWindow.applicationMgr, &errorInfo, ".\\sequences\\callingStringStdOut.seq", &file));
// entrypoint execution
tsErrChk( TSUI_SequenceFileViewMgrGetExecutionEntryPoints(gMainWindow.sequenceFileViewMgr, &errorInfo, &EntryPoints));
tsErrChk( TSUI_EntryPointsGetItem(EntryPoints, &errorInfo, CA_VariantULong(0), &EntryPoint));
tsErrChk( TSUI_EntryPointRun(EntryPoint, &errorInfo, CA_DEFAULT_VAL, &EntryPointExecution));
// display window and process user input until application exits
errChk( DisplayPanel(gMainWindow.panel));
errChk( RunUserInterface());
errChk( TSUI_ApplicationMgrGetExitCode(gMainWindow.applicationMgr, &errorInfo, &exitCode));
Error:
if (gMainWindow.panel > 0)
DiscardPanel(gMainWindow.panel);
DisplayError(error);
return exitCode;
}
/*Close application */
static int ExitApplication(void)
{
int error = 0;
VBOOL canExitNow;
tsErrChk( TSUI_ApplicationMgrShutdown(gMainWindow.applicationMgr, &errorInfo, &canExitNow));
if (canExitNow)
QuitUserInterface(0);
Error:
DisplayError(error);
return canExitNow ? TRUE : FALSE;
}
This message occurs when I close my application:
References to PropertyObjects were not released properly.
Total number of objects: 4274
Number of top-level objects: 91
Note: Some top-level objects may be included if they are referenced by
an incorrectly released top-level object. For example, an unreleased
SequenceContext object references a SequenceFile object.
The following top-level objects were not released:
Executions [1 object(s) not released]
Files [1 object(s) not released]
SequenceFile #1:
Path: c:\Users\Emmanuel.VECRANDD04\OneDrive\OneDrive - Vectralis\Escritorio\TestStand UI\sequences\callingStringStdOut.seq
Type Definitions [27 object(s) not released]
Type Definition #1:
Name: NI_PythonParameter
Type Definition #2:
Name: NoneStepAdditions
Type Definition #3:
Name: StepTypeSubstepsArray
Type Definition #4:
Name: StepTypeNIData
Type Definition #5:
Name: NI_PropertyObjectType
Type Definition #6:
Name: NI_ArrayDimensions
Type Definition #7:
Name: PythonStepAdditions
Type Definition #8:
Name: NI_CustomResult
Type Definition #9:
Name: EditSubstep
Type Definition #10:
Name: CommonResults
Type Definition #11:
Name: Expression
Type Definition #12:
Name: FCParameter
Type Definition #13:
Name: Path
Type Definition #14:
Name: FlexCStepAdditions
Type Definition #15:
Name: PostSubstep
Type Definition #16:
Name: NI_MsgBoxFontData
Type Definition #17:
Name: NI_CommonCParameterResult
Type Definition #18:
Name: Error
Type Definition #19:
Name: Action
Type Definition #20:
Name: MessagePopup
Type Definition #21:
Name: NumericLimitTest
Type Definition #22:
Name: NI_PythonParameterResult
Type Definition #23:
Name: TEInf
Type Definition #24:
Name: NI_MsgBoxFileData
Type Definition #25:
Name: CallExecutable
Type Definition #26:
Name: StepTypeMenu
Type Definition #27:
Name: PassFailTest
PropertyObjects [59 object(s) not released]
PropertyObject #1:
Type: Number
Value: 0
PropertyObject #2:
Type: Array of Containers
PropertyObject #3:
Type: Number
Value: 6
PropertyObject #4:
Type: Boolean
Value: False
PropertyObject #5:
Type: String
Value: "Passed"
PropertyObject #6:
Type: String
Value: "Step.Result.PassFail"
PropertyObject #7:
Type: Obj
PropertyObject #8:
Type: String
Value: ""
PropertyObject #9:
Type: String
Value: "NUMERIC_LIMIT_DESCRIPTION_NAME"
PropertyObject #10:
Type: String
Value: ""
PropertyObject #11:
Type: String
Value: ", "
PropertyObject #12:
Type: String
Value: ""
PropertyObject #13:
Type: String
Value: "NI_STEPTYPES"
PropertyObject #14:
Type: String
Value: "NI_SUBSTEPS"
PropertyObject #15:
Type: String
Value: "_EX"
PropertyObject #16:
Type: String
Value: "%hs"
PropertyObject #17:
Type: String
Value: ", numLimTest(Step.Result.Numeric)
[Module: c:\Users\Emmanuel.VE..."
PropertyObject #18:
Type: String
Value: "NI_STEPTYPES"
PropertyObject #19:
Type: String
Value: "PASSFAIL_DESCRIPTION_NAME"
PropertyObject #20:
Type: String
Value: "%hi"
PropertyObject #21:
Type: String
Value: "+"
PropertyObject #22:
Type: String
Value: "%ls"
PropertyObject #23:
Type: Number
Value: 0
PropertyObject #24:
Type: Number
Value: 0
PropertyObject #25:
Type: String
Value: "%low"
PropertyObject #26:
Type: String
Value: ""
PropertyObject #27:
Type: String
Value: "-"
PropertyObject #28:
Type: String
Value: ""
PropertyObject #29:
Type: String
Value: "percentage"
PropertyObject #30:
Type: String
Value: ""
PropertyObject #31:
Type: String
Value: "numLimTest(Step.Result.Numeric)
[Module: c:\Users\Emmanuel.VECR..."
PropertyObject #32:
Type: String
Value: "%tre"
PropertyObject #33:
Type: String
Value: "%nom"
PropertyObject #34:
Type: String
Value: ""
PropertyObject #35:
Type: String
Value: "%"
PropertyObject #36:
Type: String
Value: ""
PropertyObject #37:
Type: String
Value: ""
PropertyObject #38:
Type: Boolean
Value: False
PropertyObject #39:
Type: Number
Value: 0
PropertyObject #40:
Type: String
Value: "Step.Result.Numeric"
PropertyObject #41:
Type: Boolean
Value: True
PropertyObject #42:
Type: Boolean
Value: False
PropertyObject #43:
Type: String
Value: ""
PropertyObject #44:
Type: String
Value: "passFailTest(Step.Result.PassFail)
[Module: c:\Users\Emmanuel.V..."
PropertyObject #45:
Type: String
Value: ", passFailTest(Step.Result.PassFail)
[Module: c:\Users\Emmanue..."
PropertyObject #46:
Type: Array of Containers
PropertyObject #47:
Type: String
Value: ""
PropertyObject #48:
Type: String
Value: ""
PropertyObject #49:
Type: String
Value: """"
PropertyObject #50:
Type: String
Value: "NI_STEPTYPES"
PropertyObject #51:
Type: String
Value: "outString(Locals.getString)
[Module: c:\Users\Emmanuel.VECRANDD..."
PropertyObject #52:
Type: String
Value: ""
PropertyObject #53:
Type: Boolean
Value: False
PropertyObject #54:
Type: String
Value: "ACTION_DESCRIPTION_NAME"
PropertyObject #55:
Type: String
Value: ""
PropertyObject #56:
Type: String
Value: ", outString(Locals.getString)
[Module: c:\Users\Emmanuel.VECRA..."
PropertyObject #57:
Type: String
Value: "{"
PropertyObject #58:
Type: String
Value: "}, "
PropertyObject #59:
Type: Array of Containers
And the following uncategorized objects:
Report
EditArgs
TypeUsageList
Again, thank you very much.
Best Regards.