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 Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
RyanWright

Allow subsequences to pass parameters to callers by value (instead of only by reference)

Status: New

Currently, the only way to pass parameters from a subsequence to a caller is by reference.  It would be nice if you could also pass parameters to callers by value to prevent the callers from modifying them.

5 Comments
GarryG
Member

This is a great idea, Ryan.  I was very much looking for the same functionality.  I think having to protect the variable with a lock or semaphore is onerous.

CLA, CTA
Not my tempo... AGAIN!
Arlyn
Member

Good point Ryan, I hope that gets implemented.

Al.B
NI Employee (retired)

Hi Ryan,

 

You can currently configure how a parameter is passed through the right-click menu for the parameter.  

 

1

 

If you deselect "Pass By Reference", changes to the parameter in the subsequence will not modify the property you passed in from the calling sequence.  Is this the behavior you are looking for?

Al B.
Staff Software Engineer - TestStand
CTA/CLD
~jiggawax~
Trusted Enthusiast

There is no point in preserving the memory of a callee once it has completed execution.  As far as I understand the memory space is gone once it returns.

 

Because you need to store that value somewhere in the caller then why not just use the Pass By Reference and give it your variable.

 

Maybe I'm missing something?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Elaine_R.
Active Participant

This feature already exists? you have to set it inside the subsequence when you define the parameters, I thought. same as strict vs. flexible type checking...