NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading fileGlobals variable error at run time in TestStand using C#.NET

Hi, All

Please correct the code. The problem is in reading FileGloabals values at run Tiime

exeObj1 = ObjEngine.NewExecution(stepSeqFile,objStepSeq.Name,stepSeqFile,

false,ExecutionTypeMask.ExecTypeMask_Normal,System.Reflection.Missing.Value,

System.Reflection.

Missing.Value,System.Reflection.Missing.Value);

TSth1 = exeObj1.GetThread(0);

nCallStkSize1 = TSth1.CallStackSize;

for (int nContextIndx = 0; nContextIndx < nCallStkSize1; nContextIndx++)

{

objContext1 = TSth1.GetSequenceContext(nContextIndx,

out nFrameID);

ptrSequence1 = objContext1.Sequence;

bool value = false;

int nStepCount = ptrSequence1.GetNumSteps(StepGroups.StepGroup_Main);

objPropertyObj = objContext1.FileGlobals;

while (value == false)

{

//TSth1.WaitForEnd(-1, true, null, null);

//objPropertyObj = TSth1.AsPropertyObject();

exeObj1.WaitForEndEx(-1,

true, null, objContext1);

strOutPutValue = objPropertyObj.GetValString(

"FileGlobals.Output", 0); // Getting error. Errror to access item "FileGlobals.Output"

}

0 Kudos
Message 1 of 3
(3,196 Views)

rkk,

Haven't you already got a thread running on this?

http://forums.ni.com/ni/board/message?board.id=330&thread.id=18398

Ray

Regards
Ray Farmer
0 Kudos
Message 2 of 3
(3,193 Views)

rkk,

You are using a reference to FileGlobals "objPropertyObj" therefore the lookup string is not "FileGlobals.Outputs" but "Outputs".

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 3 of 3
(3,192 Views)