Connecting a Model to Data

The AddInput command has an optional third parameter that controls where it gets its data from.

If left None, it will simply wait for the data to be directly updated by the user, usually through OPC-UA.

If given a string, it can link a couple of different data sources.

Internal References (#)

If the path starts with '#', it's an internal reference - this means that it's a data point read out of a different model.

These have a format of #<model name>.<point name>

If you needed to access the remaining tank volume (from our example), you could do that by giving your model an input like the one below…

TankVol = mod.AddInput("Remaining Tank Volume",50,"#Tank.Volume")

External References

If the path starts any other characters than those show above, it's an ARDI reference - this means that it's a data point read from the live value of an asset and property in ARDI.

These have a format of <model name>.<point name>

If you wanted to read the tank level in our example from live data, you'd change the AddInput line to the one below (assuming the ARDI asset is named 'Water Storage Tank' and the property is 'Level'…

LevelPerc = mod.AddInput("Tank Level Perc",50,"Water Storage Tank.Level")

Flipping Your Model with Goalseek