NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand's container type from LabVIEW

Hi,

 

With a LabVIEW's VI, I'd would like to set a TestStand cointainer as a TDMS file properties.

So i tried to get all the elements of my container using PropertyObject Class (ThisContext.AsPropertyObject)

with this method :PropertyObject.GetValVariant ( lookupString, options)


But i get an error because of Set TDMSproperty method doesn't accept the variant type i got.

 

So I'd like to get the type (string, number....) of each elements of this container to setting them as TDMS properties one by one through a for loop.

 

How can i do that?

 

Alex

0 Kudos
Message 1 of 6
(5,306 Views)

Hello,

 

When you said that, do you mean get a container in a station globals? Or you want to use a code module (a sequence which call a VI)?


Regards;

Nacer M. | Certified LabVIEW Architecte

0 Kudos
Message 2 of 6
(5,283 Views)

I have a TestStand sequence. In this sequence i have defined a container (filesGlobals) who contains some results of the current Sequence execution. At the end of the sequence execution (in the cleanup) i want to get all the container's values to set them in a TDMS file.

So i have made a VI who gets all these datas using ActiveX properties. This VI will be called as a TS step.

But i don't know what are the types (string, number, boolean, array of...) of the varaibles of my container, so i use a method to get Variant. When i want to set my TDMS with this variant an error appears because the variant type is not allowed for TDMS files. So i need to make a VI who could get the type of each variable of my container to convert it in this type and so send it in my TDMS.

 

TestStand  FileGlobals                                                                             LabVIEW

 

MyContainer{}                                                       TabName                  TabValue                        TabType

    Name (string)                                                        (0) Name                  (0) AlexString                  String

    Reference (Number)                     ==>>                  (1) Reference            (1) 1003214                     Number

    ResultOfTest (Boolean)                                          (2) ResultOfTest        (2) True                           Boolean

    Errors (Arrays of string)                                          (3) Errors                  (3)                                  String

    ....                                                                             [0]                            ErrorA

                                                                                     [1]                            ErrorB

                                                                                     ...

 

With this 3 tabs i could send each varaibles of my TS container elements by elements usisng a for loop as define here:

 

for (i=0, i++, i<sizeof(TabName))

{

     if (Tabtype(i) == String)

          {TabValue(i) = getStringVal}

     if (Tabtype(i) == Number)

          {TabValue(i) = getStringVal}

     if (Tabtype(i) == Boolean)

          {TabValue(i) = getStringVal}

     Set TDMSNameProperty

     Set TDMSValue

}

 

So i need to get the type of all my container's varaibles.

Like that i will not obliged to get only Variant and could get the correct type to send to the TMDS...

 

 

Alex

0 Kudos
Message 3 of 6
(5,269 Views)

Hello,

 

There is something that i don't understand, if you did a VI which will set the TDMS file, why note create in LabVIEW a cluster which is similar to your container  and add it in the connector of the VI, in teststand thanks to the code module you can associate the container to the cluster input that you made.

Then in LabVIEW you can easily decode the cluster and write all information in a TDMS file.

I really don't understand why you want absolutely use the Teststand API, which is not very necessary for me for this.

Regards,

Nacer M. | Certified LabVIEW Architecte

0 Kudos
Message 4 of 6
(5,253 Views)

I agree, why are you using the API when you can pass the data in from Teststand  to the LV Code Module via the VI connector pane.

 

Regards
Ray Farmer
0 Kudos
Message 5 of 6
(5,250 Views)

The size of my container could change. So i want to make a modular VI using TestStand API.

But you might be right, i will test to use a cluster that i will connect to the connector pane.

 

Thanks

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