From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i query the module object for the interface of the module-specific interface I require

Solved!
Go to solution

Hi there.

 

Currently using LabVIEW 2012/TestStand 2012.

 

I am attempting to edit the LabVIEW Text Sequence Translator, and in the CreateStep.vi I am trying to create a step that is of type WIS_Sequence_Call (a custom version of NI_Types.ini-->SequenceCall).

 

I need to set the file pathname, sequence name and parameter values in the step.  I believe I need to get access to the SequenceCallModule class to do this.

 

This help file SequenceCallModule states in the description: "To access the properties and methods of a specific module class, query the Module object for the interface of the module-specific interface you want to acquire.".

 

What exactly is meant by "query" here?  It looks like "Specify" might be what I am after, but I want this done programmatically, ie no dialog boxes.

 

See my snippet below.

createstep.png

 

Thanks.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 1 of 9
(5,646 Views)

Christopher,

 

To get to the SequenceCallModule class you will need to follow the appropriate call chain.  Take a look at the TestStand API Reference Poster.  It will be in a directory similar to C:\Program Files (x86)\National Instruments\TestStand 2014\Doc\Manuals.  SequenceCallModule is in the Adapter-Specific Classes.  You will need to follow the PropertyObject -> Module -> SequenceCallModule call chain.

0 Kudos
Message 2 of 9
(5,609 Views)

Thanks for the reply Charles.

 

I have been using the 2012 version of the poster.

 

I can get access to the Module class from the Step Class as shown in the snippet above, but I can't see how to get to SequenceCallModule? The "To more specific class" VI doesn't seem to work for TS refs. Is there no way to derive the SequenceCallModule from this?

 

Also I can use the TSAdp.SequenceCallModule reference, but I need to link this to the relevant step that I've just created.  Can NI please provide me with a link to any examples on this?

 

Thanks

tsadp.sequencecallmodule.png

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 3 of 9
(5,595 Views)
Solution
Accepted by topic author Ozfarmboy

Use the Connectivity->ActiveX->Variant To Data node. Set the type to SequenceCallModule, give it the Module interface as input. You need to close both the Module and SequenceCallModule interfaces when you are done with them.

 

What this does is call QueryInterface on the input. The Module COM object implements both the Module and SequenceCallModule interfaces in this use case.

 

Hope this helps,

-Doug

Message 4 of 9
(5,565 Views)

Thanks Doug!

 

I never knew that the Variant to Data VI had an ActiveX purpose also!  So obvious now!

 

Cheers, really appreciate it.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 5 of 9
(5,554 Views)

Hello,

 

I ran into the same problem, and came to the same solution posted here. However, variant to data throws an error for me, and I cannot figure out why.

See attached screenshot. I am 100% sure that the step reference passed in is valid. Please let me know if I'm missing something, or if there is possibly something wrong with my install. 

 

I have tried it with "To Variant" prior to variant to data, and it also throws an error. 

 

Thanks,

 

Jon

0 Kudos
Message 6 of 9
(5,246 Views)

Hi Jon,

 

I am pretty much doing the same thing, except I used a control for the TSAdp.SequenceCallModule reference, rather than a constant:

 

works.png

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

Message 7 of 9
(5,223 Views)

Christopher, 

 

Thank you for your reply, from your picture I found my error. 

 

When creating my steps, I was using the "NoneAdapterKeyName" instead of the "SequenceAdapterKeyName" which entirely explains my problem. It was very difficult to debug though, because I was able to do virtually everything else with the step other than the SequenceCallModule cast. 

 

-Jon

0 Kudos
Message 8 of 9
(5,192 Views)

Awesome!

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 9 of 9
(5,179 Views)