NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help creating a stationglobal programatically

My objective is to dynamically create a stationglobal variable which is an array of numbers with dimensions 2. I have been playing around with the TestStand API to do this but havent had any luck. I looked at a few similar posts on this forum to get started and the things I've mainly experimented with are the NewSubProperty and similar methods of the class PropertyObjects and NewPropertyObject of Engine class. By trying different things as inputs to these calls, I have not been able to dynamically create a stationglobal (or a local or a parameter) at all. I have been able to access methods like GetNumElements etc which can tell me the number of stationglobals or locals.
 
Please help. I do want to indicate that I want this task to be accomplished in TestStand and not through a call to a LabVIEW VI, if possible.
0 Kudos
Message 1 of 6
(3,907 Views)

Hi Anuj,

As you already have looks at some of the examples, can you post your example sequence file and VI. Then we can see what your troubles are.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 6
(3,885 Views)

Well guess what, I come in today morning and it starts working. I dont know what I was doing wrong yesterday evening, but it works now. I have a follow up question for you. After I created my stationglobal array dynamically, I had some trouble accessing it in later steps in the way I wanted to. To show you what I was trying to do and where I failed, I am attaching a mock up sequence file.

It should be fairly simple for you to understand what I am doing since you are all teststand experts. I'll tell you what I am expecting at the end. I am expecting the [0][0] element of this array to change to 5 after I run these steps. The steps run fine but do not change the value to 5. Can you indicate what I am doing wrong? I have tried to put descriptive comments on each step, so hopefully you won't have too much trouble understanding what I am trying to accomplish.

Anuj

0 Kudos
Message 3 of 6
(3,865 Views)
val does not do what you would like.  It returns the value of the property.  It does not let you change the value.   I have used an ActiveX/COM step to accomplish what you want.

If you run this sequence a second time, it generates an error because the StationGlobal already exists.  You'll need to handle that case.

Message Edited by daijoubu on 02-03-2006 10:28 AM

----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
0 Kudos
Message 4 of 6
(3,863 Views)
Hi,
 
Change the options from 0x01 to 0x05 for the first step. This is  InsertIfMissing(0x01)  and DoNothingIfExists(0x04).
 
This will stop your error occurring.
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 5 of 6
(3,851 Views)

That works perfectly !....thanks a lot

Anuj

0 Kudos
Message 6 of 6
(3,844 Views)