NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Set sequence parameter of type Object Reference from LV

Hi.

 

I have a number of sub-sequences which have a parameter of type object reference. I use this to pass in a LabVIEW object from a calling sequence. The LabVIEW object is passed out of a VI via the connector pane.

 

I would like to programmatically set the sequence parameter from LabVIEW but have been unable to determine how to do this. Whilst I can see how to set parameters which are of type string etc, i.e. by the SetValString method of the PropertyObject class, it isn't apparent to me how I can do this for parameters of type object reference.

 

Does anyone have any suggestions?

 

Thanks


0 Kudos
Message 1 of 5
(3,642 Views)

Try SetValIDispatch or SetValInterface.

 

I can't ever tell the difference between the two but one of them should work.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 5
(3,640 Views)

Neither of those work for me sadly, they both just silently fail to set the parameter.

 

 

In the example below, the first property node fails to set the object reference in the sequence parameters but doesn't error so the following string is set correctly.

setObjRefParam.png


0 Kudos
Message 3 of 5
(3,629 Views)

To be able to update these properties from within  LabVIEW we need to pass a sequence context reference to the code module.From TestStand we need to pass the sequence context (this context).

 

 

We can then use this in LabVIEW to access the associated properties like below:

 

 

The above VIs functionality is equivalent to the TestStand experesion:

 

ThisContext.Sequence.Main["Action"].Name = "newStepName

 

Hopefully this helps, do let me know if you have any more questions.

 

Thanks,

 

Aaron

Aaron. E
Product Performance Engineer
Dyson
0 Kudos
Message 4 of 5
(3,605 Views)

Nopie, unfortunately the images seem to be broken.

 

I have the same problem, this help could have been helpful for me too. 

0 Kudos
Message 5 of 5
(3,099 Views)