11-14-2006 04:19 AM
11-14-2006 05:12 AM
Sean,
Have you looked at chapter 4-6 Creating a New Data Type and chapter 4-7 Creating TestStand Data Types from LabVIEW Clusters in 'Using LabVIEW Data Types With TestStand.
Regards
Ray Farmer
11-14-2006 05:40 AM
11-14-2006 06:30 AM
Hi,
Here is a little example I did for obtaining the subproperties of a container.
http://forums.ni.com/ni/board/message?board.id=330&message.id=2138&query.id=376710#M2138
Hope this helps
Regards
Ray Farmer
11-14-2006 08:40 AM
I'm not too sure what the example does, but the Message Popup is trying to display the numeric Locals.size without a Str() function, so it just gives an error.
I'm trying to avoid doing processing in TestStand to make things efficient. I want to be able to throw an array of containers at a lump of code (either .net or LabVIEW). The problem is that there doesn't seem to be any equivalent to TestStand's concept of each element having its own name.
I already have a workaround in doing a For...Each loop in TestStand to get a 1D array of the names. Ideally, I'd like to be able to directly populate some form of array of structs so that the names of the elements gets passed directly in.
Call me old-fashioned, but I prefer to keep data in one form instead of doing programmatic re-processing of it to pass it from one module to another.
11-15-2006 08:59 AM - edited 11-15-2006 08:59 AM
Hi,
I've attached some code below that should give you the correct roadmap. It has to use the For loop method since you have to get each Named object individually.
I may be missing your point of the need to pass in the array directly including the matching memory structure to include the names, but I really don't think that's going to work.
Hope it helps
Thanks
Sacha Emery National Instruments (UK)
Message Edited by SachaE on 11-15-2006 03:01 PM
11-15-2006 03:36 PM
Ta Sacha. That's basically my workaround that I've done in TestStand, using the Nameof function.
So the conclusion is that TestStand's model of an array of containers/clusters/structs is different from any other language. It has a concept of the array elements each having an individual name. You almost get an extra hidden array of strings. This means that you can't always get all the data out of an array of containers by passing it directly to a code module.
As long as I know I'm doing this in the most elegant way possible. I didn't want to do it my way and later find out there's a better option.
Thanks
-Sean