NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Data Type Problem

I'm having a problem with a Custom Data Type I've created to pass data from a LabVIEW Indicator in one TestStand 3.1 step to a LabVIEW control in another step of the same structure. When I try to pass the indicator data to a local variable of the Custom Data type I get an error.

I've tried creating the Custom Data Type both automatically within the Step Module and manually in the "Custom Data Types" tab of the "Sequence File Types" window of the sequence. I believe the type is correct but when I try to pass the data to a Local variable of the data type I get the error "Elements of array 'Locals.Local' do not match the LabVIEW cluster or cluster passing is off in array element type definition." Cluster passing is on, so my problem must be with the structure.

The LV Indicator structure is a ROI descriptor for Vision functions. It is an array of clusters each containing 2 elements. The first element is an array of four elements "Global Rectangle". The second element is an array of clusters "Contours". This cluster consists of three elements: number "ID", number "Type", and an array of 4 numbers "Coordinates".

The automatically generated Custom Data Type by TestStand consists of a container of 2 elements: An array of numbers "Global_Rectangle" and an array of containers "Contours". This seems correct but didn't work so I though I'd create my own which describes the container. I created another Custom Data Type called "Contours". It consists of three elements: number "ID", number "Type", and an array of 4 numbers "Coordinates". My custom data type then consists of the an array of number "Global_Rectangle" and an array of Type "Contours". I think this matches the indicator structure correctly. My Local variable is then an array of this custom data type.

Any ideas on why either structure is wrong? I've tried everything I can thing of including manipulating the number representations and array bounds.

Thanks.
0 Kudos
Message 1 of 6
(4,101 Views)
I tried to recreate this issue on my side. The trick was to create the secondary cluster correctly. Here are the steps I took to get this to work:

1. In the specify module dialog, add the VI with the cluster in question.

2. Instead of just clicking the button to create the container, hit the + on the "ROI descriptor" (which is the arry of cluster passed back from LabVIEW to testStand) to expose one of the instances of the container.

3. Expand this instance as well to expose the items within the container.

4. Click the Create Custom Data Type from Cluster button for the Contours Array container.

5. The default name will appear, you can accept this or change it.

6. Go back to the Specify Module dialog and create click the Create Custom Data Type for the ROI Descriptor

7. On the Contours Array Cluster Element, it currently says Array of Containers, click the expand arrow next (property field) to this, and choose the name of your first container we named in step 5.

8. You have now created the container correctly. You can create an instance of this type and pass it to and from your LV VI with no issue.

I've tested this exact process and it worked perfectly. Please give this a try and let me know if you run into any issues. I hope this helps.

SijinK
National Instruments
Message 2 of 6
(4,079 Views)
Thank you SijinK, it worked perfectly as you said it would.

Not sure why my old types weren't working but maybe it's because I had some of the array bounds set instead of having the "Initially Empty" box checked. But now I have a bunch of useless Custom Data Types in my sequence. Is it possible to delete them? I don't use any instances of them in the sequence and would like to get rid of them.

Thanks again.
0 Kudos
Message 3 of 6
(4,077 Views)
Sure, you can delete the other custom data types if you don't have any instances of them. So if you saved them in MyTypes.ini, you can simply delete them from the types palette. Or if it is saved under Sequence File Types, select the option "Sequence File Types" from the drop down option in the sequence editor and delete the data structures from there.

Hope this helps
SijinK
National Instruments.
0 Kudos
Message 4 of 6
(4,068 Views)
"select the option "Sequence File Types" from the drop down option in the sequence editor and delete the data structures from there."

The option to delete the data types was not there yesterday. I suppose you have to close and open the sequence file after deleting the instances of these data types first. Thanks.
0 Kudos
Message 5 of 6
(4,057 Views)

Just checking if this issue is now fully resolved?

0 Kudos
Message 6 of 6
(2,875 Views)