NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting API Create Parameter Pass by reference

Solved!
Go to solution

Hello everyone,

 

As part of a teststand sequence generation tool linked to DQMH modules, I am trying in vain to create a sequence parameter with the attribute "Pass by Reference" and not "Pass by value" via the TestStand API in LabVIEW.

 

extract.png

 

Result:

 

TeamJP66_0-1694003525769.png

 

Wish without manual intervention:

 

TeamJP66_1-1694003819478.png

Thank you in advance for your help.

 

0 Kudos
Message 1 of 4
(796 Views)

Your code is setting the actual value of the parameter.

 

Choosing between byRef / byVal option for the parameter has to be done upon creation of the parameter. I don't think SetValString is the appropriate way to do so (though I can't tell you which one to use, I have to admit)

0 Kudos
Message 2 of 4
(758 Views)
Solution
Accepted by topic author TeamJP66

Need to correct myself after checking the documentation! I would've expected to have a "proper/ dedicated" Method for creating parameters, but there isn't

 

From what I have learned, the switch from byVal to byRef is achieved using a property flag for the parameter

 

Oli_Wachno_0-1694064465172.png

 

Can you try to do the following: 

ParameterRef.AsPropertyObject.SetFlags("Pass by Reference", 0, 0x4)

Message 3 of 4
(731 Views)

Hello Oli_Wachno,

 

Thank you for your return and your research, indeed it exactly meets the need and works!

 

I hadn't thought of being able to find this property in the flags 🙂

0 Kudos
Message 4 of 4
(724 Views)