LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

TX_GetSeqAttribute (Sequence_Id?, , TXATTR_IS_TOP_LEVEL, );

I'm using CVI Test Executive version 2.0 and LabWindows/CVI
Measurement Studio version 6

I would like to write a test function that a sequence file can call to
find out if it is a top level sequence. My idea is to have a test
that looks something like this...

/****************************************************************************/
void TX_TEST IsTopLevelSeq(tTestData *data,tTestError *error)
{
int seqID;
int TopLevelState;
seqID = ? /*Sequence ID of the sequence that calls this test. Where
do I get the sequence ID?*/
TX_GetSeqAttribute (seqID, -1, TXATTR_IS_TOP_LEVEL, &TopLevelState);
if(TopLevelState == TOPLEVEL)
{
data->result = PASS;
return;
}
data->result = FAIL;
return;
}
/*****************
***********************************************************/

How do I obtain the sequence ID of the sequence that calls this test?

Thanks
0 Kudos
Message 1 of 3
(2,595 Views)
hi kevin,
i'm not sure that will help you, but i'm willing to try.

- In your "UserOpenSequence" function, you will find:
TX_OpenSequence (fileName, USE_SEQ_LOAD_SPEC, 0, &newSeqId);
if (newSeqId > 0) gTopLevelSeqId = newSeqId;

this will give you the id of the top level sequence. If you want, you can store it in a global variable each time you open a sequence in order to keep track of each sequence.

- go to your "StartSeqTest" function. you will find there:
TX_RunSeqOrTest(gTopLevelSeqId, TXRT_LOOP_SEQ, 1, -1, NULL);

so your test will be a part of "gTopLevelSeqId".
this is the Seq id I believe you should give to your GetSeqAttribute.
But since (according to this) the running sequence is top level, i'm not completely sure it is usefull to make such
a test here.

Anyway, I hope this helps you a little.
good luck, flo.
0 Kudos
Message 2 of 3
(2,595 Views)
Perhaps my understanding of the term "toplevel" is incorrect. Anyway
what I'm trying to accomplish is to provide a way a sequence can
figure out if it was started directly by the human user starting it or
if another sequence started it. If the user started it then I'm
calling that a "toplevel" sequence. I don't want to modify Test
Executive. I want to add a function to the Lib file the sequence file
tells Test Executive to use to perform the test.


"florent.d" wrote in message news:<506500000005000000D5C50000-1042324653000@exchange.ni.com>...
> hi kevin,
> i'm not sure that will help you, but i'm willing to try.
>
> - In your "UserOpenSequence" function, you will find:
> TX_OpenSequence (fileName, USE_SEQ_LOAD_SPEC, 0, &newSeqId);
> if
(newSeqId > 0) gTopLevelSeqId = newSeqId;
>
> this will give you the id of the top level sequence. If you want, you
> can store it in a global variable each time you open a sequence in
> order to keep track of each sequence.
>
> - go to your "StartSeqTest" function. you will find there:
> TX_RunSeqOrTest(gTopLevelSeqId, TXRT_LOOP_SEQ, 1, -1, NULL);
>
> so your test will be a part of "gTopLevelSeqId".
> this is the Seq id I believe you should give to your GetSeqAttribute.
> But since (according to this) the running sequence is top level, i'm
> not completely sure it is usefull to make such a test here.
>
> Anyway, I hope this helps you a little.
> good luck, flo.
0 Kudos
Message 3 of 3
(2,595 Views)