NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

sequencefile name

Hi,

I'am a first time user of Teststand with a problem.
In CVI I want to read the name of the sequencefile im in at that moment. I have tried this

ERRORINFO errorInfo;
static char *CommentString;
static CAObjHandle objhFile, File;

TS_SeqContextGetProperty (testData->seqContextCVI, &errorInfo,TS_SeqContextSequenceFile, CAVT_OBJHANDLE,&File);
TS_SeqFileAsPropertyObject (File, NULL, &objhFile);
TS_SequenceGetProperty (objhFile, &errorInfo, TS_SequenceName,CAVT_CSTRING, &CommentString);


But this doesn't work.
Also, I want the name of the sequence file one level higher (when I call a seq. file out of a seq file).
0 Kudos
Message 1 of 6
(3,918 Views)
SoftToon,

In your code above, you are actually referencing the sequence instead of the sequence file in your last API call. I have included some code that should get you the correct results.

Hope this helps!

static char *seqFileNameStr;
static TSObj_Property seqFileName;
static CAObjHandle seqFilePropObj;
static TSObj_SeqFile seqFile;

TS_SeqContextGetProperty (testData->seqContextCVI, NULL,TS_SeqContextSequenceFile, CAVT_OBJHANDLE, &seqFile);

TS_SeqFileAsPropertyObjectFile (seqFile, NULL, &seqFilePropObj);

TS_PropertyObjectFileGetProperty (seqFilePropObj, NULL,
TS_PropertyObjectFilePath, CAVT_CSTRING, &seqFileNameStr);

MessagePopup ("Sequence File Name", seqFileNameStr);

Shannon Rariden
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,918 Views)

Hi Shannon,

 

this is interesting.

but i could not get the same sequencefile name programatically in my sequence.

 

how can i get this?

 

I have used NameOf(Runstate.SequenceFile). It returns Empty string.

0 Kudos
Message 3 of 6
(3,549 Views)

NameOf(RunState.SequenceFile) doesn't work because there isn't a Name property for SequenceFile. Checkout the TestStand Help for SequenceFile to find it's valid Properties.

 

Follow the example given by Shannon.

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 6
(3,542 Views)

Hi Ray,

 

nice to see your quick reply.

Yes. i have seen the properties and found that "name is not among them"

 

But i just blindly followed the below link

http://digital.ni.com/public.nsf/allkb/AC5008A6FC55616F86256BBC005B61D8

 

where a solution says it is possible to get the Sequence file Name.

Still i can figureout the expression to get this. Can u help me with that?

 

0 Kudos
Message 5 of 6
(3,538 Views)

Hi,

 

Locals.name = RunState.SequenceFile.AsPropertyObjectFile.DisplayName

 

This should return the filename part of SequenceFile.Path which is the full path including filename of the current sequence file.

 

Regards

Ray Farmer

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