NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass an array of type to a subsequence using parameters?

I have a Main Sequence. In that I have an array of type. Type is a container of boolean. I want to pass this array to a Sub sequence using parameters. How do I do this?

 

I have attached my Main sequence and Sub sequence. The Main Sequence is done and it has the array in Locals. The Sub Sequence is also attached.

0 Kudos
Message 1 of 10
(4,075 Views)

Sorry..missed the attachment last time.

Download All
0 Kudos
Message 2 of 10
(4,074 Views)

Hi,

 

I can not look at your attachments at the moment, but all you do is assign an arary to the array in the Parameter List as you do another other variable. eg Locals.MyArray -> Parameters.MyArray.

 

 

Regards
Ray Farmer
0 Kudos
Message 3 of 10
(4,070 Views)

But the problem is my array element is a type. When I aasign the array to the parameter it is giving type conflict. (Type is same but the names are different. TestStand dose'nt allow to create two types with the same name even in different sequences)

0 Kudos
Message 4 of 10
(4,067 Views)

Then change the type of the parameter to match the type of the local...

CTA, CLA, MTFBWY
0 Kudos
Message 5 of 10
(4,057 Views)

@LabVIEWan wrote:

But the problem is my array element is a type. When I aasign the array to the parameter it is giving type conflict. (Type is same but the names are different. TestStand dose'nt allow to create two types with the same name even in different sequences)


You are misunderstanding how types work. You should put them same type in both files (you can copy and paste it from one file to the other). Or better yet, put your type in a type palette file (such as mytypes.ini) in order to avoid issues with types getting out of date in one file or the other.

 

All you have to do to pass the parameter is create a parameter of the same kind and type in the subsequence's parameter object. There is nothing special or different for this case other than you should be using the same type in both files.

 

Hope this helps,

-Doug

0 Kudos
Message 6 of 10
(4,053 Views)

I got it working, by going with Doug's solution, by creating the type under "Mytypes.ini". It becomes like a file global (just in view of scope). But I am just curious to know. Can we make it work by creating the types under sequences locally? ie the same type will be created with different names under my Main Sequnce and Subsequence.

0 Kudos
Message 7 of 10
(4,042 Views)

You can turn off type checking for parameters entirely by right-clicking on the parameter and unchecking the "check types" menu item. I don't recommend this though. I think adding various versions of types with different names could quickly turn into a maintenance nightmare. Also, disabling type checking basically means it doesn't check the type at all and you could pass anything at all instead of the expected type.

 

-Doug

0 Kudos
Message 8 of 10
(4,038 Views)

One more question, is "types" in TestStand similar to "typedefenitions" in LabVIEW? Will it update all its copies with changes made in any copy?

0 Kudos
Message 9 of 10
(4,010 Views)

The way custom data types in teststand work by default is that the structure is enforced. You can only change the structure in the type definition, the instances will not allow structure editing (at least with supported editors), and changing the structure in the definition changes the structure of the instances too. Values and some other minor settings can differ between the definition and instances though. Not completely sure how labview type definitions work so I can't say for sure if it is similar.

 

Hope this helps,

-Doug

0 Kudos
Message 10 of 10
(3,992 Views)