Chapter 9 Global Scope Signals and Parameterless Procedures
AutoCode Reference 9-8 ni.com
Note You must write template code to customize the declarations of these variables,
which includes usage of the Memory Address string because this is target/compiler specific
information.
Issues and LimitationsThis section identifies some other items that you should be aware of if you
intend to use parameterless procedures.
Note Parameterless procedures require the use of global variables. All of the deterministic
safety measures normally used by AutoCode are disabled for these signals. As a result, you
can easily create models that exhibit non-deterministic behavior. Issues such as block
sequencing and selection of variables are now your responsibility.
Communication Between SubsystemsYou cannot use a Global Scope signal to bypass the subsystem interface. A
copy will be required to pass the data between subsystems. If you want to
pass data between subsystems using global variables, use a variable block.
Variable Blocks Versus Global ScopeA Variable Block cannot be used as a Global Scope signal into a
parameterless procedure. The reason for this is that you would be implicitly
writing to that variable block when the procedure is reused. You should
contain the Variable Block within the procedure rather than passing it into
the procedure. In addition, the SystemBuild Simulator would be unable to
simulate the aliasing effect of the Variable Block and the Global Scope
signal.
SystemBuild SimulatorThe SystemBuild Simulator ignores the Output and Input Scope attributes.
Therefore, the subtle effects of the global variables are not simulated and
can mask those effects, thus misleading you to believe your model is
correct while global variables in the generated code are being overwritten
and corrupting the results of your model. If you correctly use the global
variables by proper sequencing and selection, the Simulation should match
the generated code. However, it could also be a coincidence, and there is no
direct way to tell the difference.