NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically Assigning Step Type Properties

I have developed several COM instrument drivers in Visual Basic 6.0 which I can call from TestStand using the ActiveX/COM adapter. However, I would like to be able to create a custom step type for each of these ActiveX servers. Each server provides several creatable classes and a number of interfaces. Ideally I'd like to create a custom step type that references the GUID of my server but have the ability to programatically assign the step properties such as Interface ID and CoClass ID to use the classes and interfaces of my server that I want need to access.

I have noticed that it is possible to create a step type (IEngine.NewStepType method) and set the Automation Adpater. Then I can programatically access its hidden properties (e.g.TS.SData.Call.CoClass). However, I am unsure of how to save and/or access this newly created step type. Where is it stored and how can I insert steps using of the new step type?

I have attached a sequence I've been working on. This has dependencies on a Station global and a server unique to my system but illustrates what I've been trying to do. Do you have any advice of what I need to do next or have any examples available where this sort of thing has been done in the past.

Thanks.
0 Kudos
Message 1 of 9
(3,936 Views)
Hi David,

Your example doesn't appear to be attached?

What Teststand version are you working with?

Regards
Regards
Ray Farmer
0 Kudos
Message 2 of 9
(3,935 Views)
Hello Ray.

I'm using TestStand 3.1. I've just discovered that *.seq is not a valid extension so cannot attach my sequence. Here is a description of the example I tried posting:-

(1) Create a new step type using the IEngine.NewStepType method and store this in an StepType object variable.
(2) I am then setting the Name and IconName properties of the StepType class on this object variable.
(3) I am then calling the ChangeDesignatedAdapter method of the StepType class specifying the "Automation Adapter."
(4) I am then using the property object SetValString and SetValNumber methods to change several of the step type's hidden properties under the TS.Data.Call container (e.g. CoClassName, Interface, server).

These steps execute without any errors. However, I am at a loss as to how to access and use my newly created step type in a sequence. Any help would be much appreciated.

David
0 Kudos
Message 3 of 9
(3,917 Views)
Hi David,

You just need to zip up your file. Bit of a pain.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 4 of 9
(3,915 Views)
Ray -
FYI, I have requested that .seq be attachable as is, as well as other CVI and MFC source files. This should be in affect soon.
Scott Richardson
https://testeract.com
Message 5 of 9
(3,897 Views)
Hi David,

Here is some steps for saving your Step types.

You will need to create a type palette Ini file to hold your step types.

Get a PropertyObjectFile reference by calling Engine.NewPropertyObjectFile(FileType_TypePaletteFile).

Set the path of the ini file with PropertyObjectFile(Path).

Get a TypeUserList reference by calling PropertyObjectFile.TypeUsageList().

Get a count of the number of Types in the TypeUsageList by calling TypeUsageList.NumTypes().

This point create your Step types (as you have done). You will need a PropertyObject reference to your steptypes for use with the TypeUsageList.InsertType().

Using each steptype PorpertyObject reference.

Insert the Type into the TypeUsageList by calling TypeUsageList.InsertType(step type propertyobject ref, index (which will be your count), typeCategoryParam = TypeCategory_StepType)

Call the PropertyObjectFile.IncChangeCount() to indicate file changed.

Increment the count and repeat Insert for each of your step types.

save the ini file PropertyObjectFile.SaveFileIfModified(prompt = TRUE).

Tidy up by releasing references etc.

I know this works for TestStand 2.0.1f1 and hopefully it will work for 3.1. Unfortunately I haven't got 3.x installed on a PC to try it.

Hope this gets you started.
Regards
Ray Farmer
Regards
Ray Farmer
Message 6 of 9
(3,893 Views)
Hi Scott,

Thanks for the info, that will make life a bit easier

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 7 of 9
(3,882 Views)
Hello Ray.

Thanks very much for your assistance. Following your instructions I was able to create a step type customised to my ActiveX component in TestStand 3.1 and insert a step of that type into my sequence.

Regards,

David
0 Kudos
Message 8 of 9
(3,870 Views)
Hi David,

Thats great.

Regards
Ray Farme
Regards
Ray Farmer
0 Kudos
Message 9 of 9
(3,862 Views)