NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Could we pass through the ActiveX Adapter a c structure ?

Hi,

Today, in my ActiveX methods, I pass 3 arguments in order to process errors in TestStand. Here are :
             short *errorOccured
             long *errorCode
             char **errorMsg

In TestStand, I am using the 3 following variables :
             Step>Result>Error>Code
             Step>Result>Error>Msg
             Step>Result>Error>Occured

For each method, I have to pass this 3 arguments. It's quite long and boring so is it possible to pass a c structure ?

To avoid this 3 arguments, I would like to pass a c structure with this 3 arguments and so in TestStand I would like to pass the following c structure :
             Step>Result>Error

Thanks




0 Kudos
Message 1 of 7
(4,016 Views)

Hello Lilie,

You can find, in the links below, a response to you question:

http://digital.ni.com/public.nsf/websearch/129785F0AFABB90A8625686E005AE407?OpenDocument
http://digital.ni.com/public.nsf/websearch/AC5008A6FC55616F86256BBC005B61D8?OpenDocument

Hope this help

Regards

Sanaa T
National Instruments

Sanaa T.
National Instruments France

0 Kudos
Message 2 of 7
(4,005 Views)

I did not find a direct answer to the question in those links.

The answer is:

The ActiveX adapter supports Automation compatible types.  This does not include language specific types such as C structures (although the DLL adapter does support C structures).

 

For ActiveX, you can pass Step.Result.Error as a single PropertyObject parameter, and then use PropertyObject api to access the sub-fields in your code module.  If you need help doing this, please specify the ADE you use for creating your server (ie. LabWindows/CVI, VisualStudio/C++, ..).

 

 

0 Kudos
Message 3 of 7
(3,995 Views)
Thanks James,

I am using LabWindows/CVI 6.0 with TestStand 2.0 for the moment.

Your answer interests me much.

See you

Lilie
0 Kudos
Message 4 of 7
(3,965 Views)

In your CVI code, you will need to convert the error parameter to a CAObjHandle.  The following code sets the appropriate values.

TS_PropertySetValNumber (errorObj, NULL, "Code", 0, -15);
TS_PropertySetValString (errorObj, NULL, "Msg", 0, "A very bad error");
TS_PropertySetValBoolean (errorObj, NULL, "Occurred", 0, VTRUE);

Allen P.

NI

0 Kudos
Message 5 of 7
(3,950 Views)

Hi,

In the following link: http://digital.ni.com/public.nsf/websearch/AC5008A6FC55616F86256BBC005B61D8?opendocument&Submitted&&...

There seems to be a small error in the text on line: -  "Calling Sequence:  RunState.Caller.RunState.SequenceFile"

I think this should be : -  "Calling Sequence:  RunState.Caller.RunState.Sequence"

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 7
(3,940 Views)
Hi everybody,

I know there is a long time, I asked my question. When I do this, it was by curiosity, but today I really need this.
So I tried what James had advised.

But it seems to do not work. I probably forget something. In order to understand me rapidly, I sent my CVI application sample (a ActiveX server application) and a sequence file (TestStand 2) which call my activeX server.

Thanks

Lilie

PS : I think, I do not use the right type for my errorObj...
0 Kudos
Message 7 of 7
(3,820 Views)