NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the API to configure a Sequence Call Module (TS 3.1)

Hi,

I try to configure dynamically a sequence call module using TS 3.1 and CVI 7.1.1 :

I use a Custom StepType :
- Sequence Call Adapter
- Custom substep called "Edit"

I want that the "Edit" context menu calls a cvi dll to configure the Sequence Call Module of the current step.

The SequenceContext is the only parameter of my function (except Error parameters).

1/ I get the Step object
2/ I get the Module object
3/ I set the flag SpecifyByExpression to True (SequenceCallModule object)
4/ I call the SetSequenceFilePath method

Here is my problem : the SetSequenceFilePath method returns an error (-17300, Invalid sequence file path).

I check my expression and there is no error.
I try to set the expression manually in the properties of the step I want to edit. I call the GetSequenceFilePath in my function. I get the right expression. Then I call the SetSequenceFilePath method with the resulting string, and I still get an error (with the expression returned from TS).

What is the syntax of the Expression argument of the SetSequenceFilePath method ?

Bruno
0 Kudos
Message 1 of 4
(3,248 Views)
Hi,

I did some investigations...

If I use 2 string variables to set the path of the sequence file :
- Locals.Directory
- Locals.Filename

1st case :
        Locals.Directory = C:\temp\
        Locals.Filename = toto.seq
        I call the SetSequenceFilePath method with the following argument value : "Locals.Directory + Locals.Filename"
       It works ! The resulting Sequence File Path expression is :
Locals.Directory + Locals.Filename

2nd case :
        Locals.Directory = C:\temp
        Locals.Filename = toto.seq
        I call the SetSequenceFilePath method with the following argument value : "Locals.Directory + \"\\\\\" + Locals.Filename"
        It doesn't work !
       The error message indicates that the expression is invalid but the expression displayed in the error message is exactly what I want :
        Locals.Directory + "\\" + Locals.Filename 
(this expression is valid if you write it directly in the specify module dialog box)

NB : The expressions that I want to use are quite more complicated.

Bruno
0 Kudos
Message 2 of 4
(3,238 Views)
Unfortunately, TestStand 3.1 (and 3.5) does not provide a way to set the SequenceFilePath property as an expression. 
 
To work around this bug, you can use the PropertyObject API to set the property directly. From the Module object, use AsPropertyObject to get a property object reference. Then call SetValString("SFPathExpr", 0, <put your expression here> ) on the property object to set the property value.  Also, don't forget to set the SpecifyByExpression property to true on the sequence call module.
 
-Erik

Message Edited by Erik Crank on 01-04-2006 09:34 AM

Message 3 of 4
(3,233 Views)
Hi,
It's the way I have used for a few years.
The new classes of the API could simplify my source code (no hard coded property names, source code easier to understand and to update). So I wanted to use them.
I'm disappointed because I can't use the api. But I'm happy that you tell me it is a bug.

Thanks
Bruno
0 Kudos
Message 4 of 4
(3,203 Views)