All Block properties provide information about the module and the system in which the module is applied.

 

Most often these properties are used in a debugging operation so the programmer will know the source from where the debugging output is being generated.

 

Properties:

Description:

group

Group name of the Blox assigned by the Blox Editor

instrumentExists

Property returns a TRUE value when the script automatically provides instrument context by default.  

 

A FALSE value is returned for scripts where automatic instrument context is not provided.  Access to instruments is still possible using the LoadSymbol() function.

 

See: Accessing Instruments topic for more details.

name

Block name being executed. When name is printed during debugging operation it shows the current script execution locations.

orderExists

Property returns a TRUE value when an instrument's order is in context and available for access.  

A FALSE value is returned an order does not exist or is not in context.

scriptName

Script section being executed will be name of the executing script where this property is place when executed.

 

This also means that when a script section, like a custom function, is called from another script, and this property is executed in the custom script, the name script section where this property is placed is returned.

 

If the calling function name is the name needed, the calling function will need to pass its script name to the script section being called.

 

Example:

script.Execute( "CalledScriptName" , block.scriptName )

 

This Block property is important to use when printed output information is being used to Debug a process.

system

System where block is physically assigned during testing.

systemIndex

System index number of the suite.  

 

When only one system is located in the Suite, the system index value is always 1.  

 

When multiple systems are assigned to the Suite, the index values are assigned based upon the order in which they were first assigned to the Simulation Suite.

 

Within a system where these script name are listed more than once, all the scripts with the following names can execute when a new order is created, and an entry or exit order is filled:

Script Section Name:

Execution Timing:

CAN ADD UNIT

All New Entry Orders

CAN FILL ORDER

ALL FILLED ORDERS

ENTRY ORDER FILLED

ALL FILLED ENTRY ORDERS

EXIT ORDER FILLED

ALL FILLED EXIT ORDERS

 

When modules within a system have multiple instances of any of the above script names, and there is programming code in each of the multiple instances of these scripts it might be necessary to filter which orders can be processed by which module's script section using filtering logic similar to this:

Example - 1:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  CAN FILL ORDER

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Reject Orders Generated by other System Modules
If order.systemBlockName = system.name + "." + block.name THEN
  '  Allow this module's CAN FILL ORDER script to only apply
  '  to orders that are generated by this Blox to do  
  '  something in this area
ENDIF
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns - 1:

 

 

Common debugging block orbject properties:

Example - 2:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'  BEFORE ORDER EXECUTION

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PRINT "Block Name:                ", block.name
PRINT "Block Group Name:          ", block.group
PRINT "Block Script Section Name: ", block.scriptName
PRINT "Blox applied System Name:  ", block.system
PRINT "System Suite Index Number: ", block.systemIndex
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns - 2:

Block Name:                 _Max_Position_Limiter 3

Block Group Name:           _Dev

Block Script Section Name:  Before Order Execution

Blox applied System Name:   Bollinger Breakout Plus

System Suite Index Number:  2

 

Links:

LineNumber

See Also:

 

 


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


Topic ID#: 106

 

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