Variables, indicators and parameters can have different scopes.  Scope in programming determines the range, or reach from which a data item can be referenced.  In Trading Blox different types of variables can have different levels of scope.  Scope is established by selecting the various scope references provided in the Scope's drop-down list, which is always set to Block unless the programmer changes the scope assignment.  When scope is set to Block, that is most narrow or limited reach that the data in that data element is allowed.  Local variables, those declared using the keywords Variables & Type entered into the script section code space, and not used in a custom function, are scoped the script section in which they are declared.  Local variables declared and scoped within a custom function can also be accessible to the variables in the script section that called the custom function.

 

Setting the variable scope to something other than to Block scope allows the variable to be used in other blox in the system.  However, the other blox needs to have a variable with the same name, and it should be defined as external.

Block PermanentVariable Dialog BPV Def-Externally

Only IPV and BPV can be defined as External.  

 

IPV -- Instrument Permanent Variables:

Block

You can only use this variable in the scripts that are in the block.

System

You can use this variable in any block in the System by declaring the variable as External in the other blocks.

Simulation

Same as System scoped except the value is not reset for every test (parameter run).

Notes:

To use a System or Simulation scoped IPV in another block, define an external IPV of the same name in the other block.

 

BPV -- Block Permanent Variables:

Block

You can only use this variable in the scripts that are in the block.

System

You can use this variable in any block in the System.

Test

You can use this variable in any block in the Test.

Simulation

Same as Test scoped except the value is not reset for every test (parameter run).

Notes:

To use a System, Test, or Simulation scoped BPV in another block, define an external BPV of the same name in the other block.

 

Parameters:

Block

You can only use this parameter in the scripts that are in the block.

System

You can use this parameter in any block in the System

Simulation

You can use this parameter in any block in the Test.

 

Indicators:

Block

You can only use this indicator in the scripts that are in the block.

System

You can use this indicator in any block in the System.

Notes:

To use a System scoped Indicator in another block, define an external IPV Series of the same name in the other block.

 

All variables, parameters and indicators are reset between every test run during a multi-stepped parameter test, and it happens just before the Before Test script.  An exception to this data refreshing is allowed when the variable is set to the Simulation scope reference.

 

IPV and BPV variables are reset to their default value, the parameters are set to the next stepped value, and all indicators are recomputed.

 

Setting IPV or BPV variables using Simulation scope will prevent the values from being reset to the default value. This can be useful when keeping track of a value over the course of many stepped tests, or when loading external data in the Before Simulation script.

 

Because all values are reset just before the Before Test script, the Before Simulation script has no access to indicators or parameters, as they are not set yet. Any IPV or BPV that are set or loaded in the Before Simulation script will be reset to their default value unless they are defined as Simulation scope.

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 248

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software