### Question

Is there a way to programmatically set what FPGA variables I am reading from or writing to so that I can generalize my main simulation loop for every object that I want to run? The simulation loops for each object are identical except for which FPGA variables they read and write. Details follow.

### Background

I have a code that uses LabVIEW OOP to define a bunch of *things* that I want to simulate. Each *thing* then has an `update` method that runs inside of a Timed Loop on an RT controller, takes a cluster of inputs, and returns a cluster of outputs. Some of these inputs come from an FPGA, and some of the outputs are passed back to the FPGA for some processing before being sent out to hardware.

My problem is that I have a separate simulation VI for every *thing* in my code, since different values are read from and returned to the FPGA for each *thing*. This is a pain for maintainability and seems to cry out for a better method. The problem is illustrated below. The important parts are the FPGA input and output nodes (change for every *thing*), and the input and output clusters for the `update` method (always the same).

![example main simulation VI](https://i.stack.imgur.com/Kaz0C.png)

Is there some way to define a generic main simulation VI and then programmatically (maybe with properties stored in my *things*) tell it which specific inputs and outputs to use from the FPGA?

If so then I think the obvious next step would be to make the main simulation loop a public method for my objects and just call that method for each object that I need to simulate.

Thanks!