NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the new CVI adapter not put the contextCVI parameter?

Hi,

With good old 2.0 prototype you could not specify arguments and you always used the parameters tTestData and tTestError. Now, with the TS3.x the recommended prototype is the new one.

If I specify the standard prototype it puts some arguments which the sequence context is not one of them.

The question is why?

1) Don't you always need it? Is there a way to get the context from within the CVI code? Isn't the idea of the context argument is to be able to get/set information from the TS variables?

2) I read the manuals but didn't see exact instructions how to specify the context as an argument. Can anybody show me how to do it? Do I need to specify it by value or by reference?

3) Isn't there a check box to include the context in the same fashion as it was in TS2.x?

4) I specify the context parameter with every TS step. Is that the proper way? Can I modify the standard prototype so it will automatically be inserted along with the other argument?

Thanks
Rafi
0 Kudos
Message 1 of 2
(2,863 Views)
Hello Rafi -

I think the Action steptype will always give you a seqContextCVI pointer, but I agree that the default templates for the other steps don't. Certainly you don't 'always' need it. Especially if all you're doing is talking to hardware, doing some calculation and returning a measurement value, but it's very nice to have for various chores in TestStand.

I think in TS 3.0 rather expect you to specify it manually.It's not too hard to do once you see the trick. I looked at the Action step's default arguements before I saw how it was done, but here's the simple breakdown.

(1) create new arguement, on the right-hand side of the screen name it whatever you like.
(2) The category is 'Object, the Type is 'CVI ActiveX Automation Handle' and the Pass is 'By Value'.
(3) on the left-hand side of the screen, assign it the value 'ThisContext' as usual, and you're all set.

If you build your functions manually in CVI you'll just include the parameter "CAObjHandle seqContextCVI" and use it just like you used to.

Other options might be... I know there's still a button on the Module tab of CVI steps to allow you to create a TS 2.0 style prototype with TestData and TestError...

Or, Yes, you can also modify the default template that comes with TestStand, but the software will likely complain at you for changing the settings on a NI steptype. If you want to explore this route, you need to add your seqContextCVI parameter in two places. Once to the actual template file at (TestStand Root dir)\CodeTemplates\User\NumericLimitCVI, and once to the type definition of the step you want to change. For example, use the Type Palette to find the Numeric Limit type and right click on it to alter it's properties. The tab you'll want to investigate is 'Code Templates'and then the template for CVI.

I hope this helps!

Cheers,

Elaine R.
www.bloomy.com
Cheers,
Elaine R.
www.bloomy.com
0 Kudos
Message 2 of 2
(2,854 Views)