From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Bounds on a TS Array of containers from Labview

Solved!
Go to solution

I'd like to be able to set the bounds on my TS array of containers from Labview.  I've done it before from CVI on a numeric array using TS_PropertySetDimensions.  

I'm passing in SeqContext from TS and I'm using the AsPropertyObject Invoke Node to get a reference.  This allows me to use a PropertyObject to set the values but I can't figure out how to set the bounds.

I see a SetNumElements Method but it doesn't have a lookup string to select the array.

I could probably initialize it then use the insert if missing property but I'd just prefer to set it to the size I already know.

 

 

 

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

use the get property object to get the reference to the array and then use the setnumelements on that?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 7
(4,051 Views)

I was thinking the same thing but I don't know how to do it.  

This is my failed attempt.  Can you explain what I've done wrong?

 

Property Object.JPG

 

Message 3 of 7
(4,035 Views)

Hello MickF,

 

I think it would be helpful if the post knew in what context your were calling this in (e.g. OI, Code Module, etc.).

 

As for what is going on with your code I'm unsure if you can call "SetNumElements" by plugging in "GetSubProperties". From a LabVIEW perspective it looks like "GetSubProperties" is a variant arrary (because of the thicker purple line) of some sort and it is trying to be passed into a terminal for property object reference (thin green line). So moving forward you might have to look into how to get the  property object reference (thin green line) of the array and pass that into the SetNumElements method.

 

Could you show us where the arrary is the variables pane during runtime to give us a better idea of what we could do to first get it in LabVIEW, and then manipulate it.

JY
Application Engineer, RF and Communications
National Instruments
0 Kudos
Message 4 of 7
(4,027 Views)

That is exactly the question.  How do I get a reference to the array to pass into the SetNumElements?  

I know I can set the values of any particular variable using the SeqContext I've already passed in.  For instance the SetValNumber has an input for the lookup string.  The lookup string points to the specific variable I'm interested in modifying.  Unfortunately the SetNumElements doesn't have a lookup string so it seems like I need to pass it a reference directly to my array.  That is the part I don't know how to do.  

This is an image of my array in TS at runtime.  I changed the name from the previous post.  The path is now Step.Edit.Channels.

 

Array of Containers.JPG

 

0 Kudos
Message 5 of 7
(4,018 Views)
Solution
Accepted by topic author MickF

Hi MickF,

 

I experimented a bit and this is what I found (following jiggawax's advice):

 

TSPropertyObjects.PNG

The GetPropertyObject method returns a reference, which you can then use for SetNumElements.

 

Jorr-El
Systems Engineer
Testeract: Automated Test Specialists
Message 6 of 7
(3,988 Views)

Perfect.  Thanks for showing it in detail.  I saw the correct answer from jiggawax but I didn't comprehend the difference of Get Property Object and what I had of As Property Object.

0 Kudos
Message 7 of 7
(3,981 Views)