LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass reference to shared variable

Solved!
Go to solution

I use two shared variables within a loop where I write to one and read from another.  I need to repeat this loop 5 times but each loop uses a different pair of shared variables.  These variables are shared between a vi on the computer and a cRio.

 

It would be ideal to incorporate this loop into a subvi where I can pass a reference to the two shared variables into and then read and write to threw those references.  Then I could just call that subvi 5 times, instead of copy and paste the loop 5 times.

 

Is there a way that I can accomplish this?  I can't seem to find an example that would accomplish this.

 

Thanks

0 Kudos
Message 1 of 3
(3,450 Views)
Solution
Accepted by GreenRiver

If I understand correctly, you could use the programmatic access mode to Shared Variables and it would work.

 

https://www.ni.com/docs/en-US/bundle/labview/page/reading-and-writing-shared-variables-programmatica...

 

Message 2 of 3
(3,433 Views)

Yes, this is what I was looking for, thank you.

0 Kudos
Message 3 of 3
(3,412 Views)