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.
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.
01-18-2017 10:25 AM
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.
Solved! Go to Solution.
01-18-2017 04:49 PM
use the get property object to get the reference to the array and then use the setnumelements on that?
01-19-2017 02:25 PM
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?
01-20-2017 09:19 AM - edited 01-20-2017 09:20 AM
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.
01-20-2017 10:06 AM
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.
01-23-2017 05:21 PM
01-24-2017 08:30 AM
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.