Instance constant

« Back to Glossary Index

You define instance constants in the component type, where you often assign a default value to them. Afterward, you can change the final value in each of the instances of the component type.
Instance constants can have two forms:

  1. Only accessible from within the defining type = TRUE. It means that descendants can't use it in methods.
  2. Only accessible from within the defining type = FALSE. It means that descendants can use it in methods.

Below are two examples that show, how you can use instance constants.

Example one

A project engineer needs two regulators with two different regulating intervals. By using instance constants the engineer can design a simple solution. In short, the engineer can create a regulator component type that has an instance constant that defines the regulating interval. When he uses instance constants in the type, he can add two instances of the regulator. Afterward, he can set the interval in each instance to fit the needs.

Example two

A process engineer adds a register subcomponent instance to his component type and connects an instance constant to it. As a result, he can set which variable or constant to expose in the register.

See also: Type constant

« Back to Glossary Index