Global Variables
The following AdeptGEM global variables are used for the purposes described.
Set the variables that are used to define data values 9206 (ecchanged) and 9207 (ecnewvalue), which are associated with an operator change to an equipment constant. These variables are set automatically when the operator changes an equipment constant from the GEM Variables menu page. If custom code provides another way to change an equipment constant, V+ code in the following form can be used to achieve the same results:
;Set the variables that define the values of DVVALs.
gm.dvval.ecid = ecid ;VID of changed EC
IF <is string value> THEN ;If it has string value...
gm.change.ec.t = -1 ;-1 signals string
$gm.change.ec.s = $string ;New value of EC
ELSE ;If it has numeric value...
gm.change.ec.t = <SEMI data type>
gm.change.ec.v = value ;New value of EC
END
; Generate the required collection event.
CALL gm.event(9200) ;OperatorConChg
gm.comm This Boolean is TRUE if the equipment is communicating with the host. (Also see gm.offlinest, gm.online, gm.remote and gm.service.go.)
gm.ctask Defines the number of the V+ task that is used for SECS-I communications. The value is set in the routine gm.mod.init( ), and can be changed by the user in that routine. (The routine gm.mod.init( ) is located in the public files GEMMOD.OVR/OV2.)
gm.debug Controls the output of diagnostic messages by the AdeptGEM system. This variable, which is set to the value of equipment constant 9105 (gemdebugmode) when GEM communications are enabled, is considered as a set of bit flags. Each bit controls a separate set of messages, as follows:
Bit
Number Bit
Mask Messages Enabled When the Bit Is Set 1 1 Activity of the SECS-I or HSMS-SS protocol, displayed in the "SECS-I Debug" or "HSMS-SS Debug" window 2 2 Activity of the SECS-II protocol, displayed in the "GEM Service" window 3 4 Miscellaneous status messages, displayed in the V+ Monitor window"HSMS-SS Debug" window 4 8 Activity of the SECS-II protocol and miscellaneous status messages, stored in a memory-resident log of the most recent messages (see status variable 9010 and the global variable gm.temp.log2siz)gm.fmt.* These variables define the SEMI item formats that are used for the respective data items when they are being sent to the host (e.g. for the ALID data item in an S5F1 message)
All these variables are set to 52 octal (for 2-byte unsigned integer) during AIM start-up initialization of the AdeptGEM module. The default values can be changed in the routine gm.user.init.
gm.fz.size Sets the maximum number of messages from the equipment to the host that can be queued for subsequent transmission. For example, while processing an S2F41 (remote command) message from the host, any resulting messages to the host are held in this queue until the S2F42 response is sent to the host. See the description of the routine gm.freeze.msg (reply, hd[], $data[], end.marker, status)( ) for more information.
This variable is set during AIM start-up initialization of the AdeptGEM module. The default value can be changed by assigning a new value in the routine gm.user.init( ). If the value is increased, the following code must be executed to initialize the enlarged queue:FOR i = 0 TO gm.fz.size-1 ;Mark whole queue as empty
gm.fz.end[i] = 0
ENDSets the number of the first V+ task that is used by the AdeptGEM Module. This variable is set in the routine ai.module.init( ) and can be changed by the user in that routine.
Defines the number of the V+ task that is used for limits monitoring and trace data collection. The value is set in the routine gm.mod.init( ) and can be changed by the user in that routine. (The routine gm.mod.init( ) is located in the public files GEMMOD.OVR/OV2.)
Identifies the Control State when the equipment is Off-Line. The possible values are: 1 = Equipment Off-Line, 2 = Attempt On-Line, 3 = Host Off-Line. (The value is 4 when the equipment is On-Line.) (Also see gm.comm, gm.online, gm.remote, and gm.service.go.)
This Boolean is TRUE if the Control State is On-Line (regardless of the state of the Communications State Model). (Also see gm.comm, gm.offlinest, gm.remote, and gm.service.go.)
This is the index of the first element of a block of $ai.ctl[ ] variables that are used for the GEM Remote Control capability when the host requests that an AIM sequence be initiated. For details, see the description of the routine gm.remote.cmd($name, $argname[],$arg[],num,argstat[], status)().
This Boolean, which represents the setting of the Local/Remote radio buttons on the GEM Control Panel, is TRUE if the Remote button is selected. (Also see gm.comm, gm.offlinest, gm.online, and gm.service.go.)
This variable determines if the AdeptGEM system operates as a master (value = 1 [not the value TRUE]) or as a slave (value = 0) in SECS-I communications. A change to the value of this variable takes effect the next time GEM communications are enabled.
This variable can be set in the routine gm.user.init( ).
Sets the internal polling interval of the SECS-II task when communicating with the host. The value is the number of seconds that the task waits before starting another processing loop to look for a message from the host.
This variable is set during AIM start-up initialization of the AdeptGEM module. The default value can be changed by assigning a new value in the routine gm.user.init( ).
Sets the internal polling interval of the SECS-II task when communications are enabled, but the Communications State is Not Communicating. The value is the number of seconds that the task waits before starting another processing loop to look for a message from the host or to determine that a time-out has occurred for a previous message sent to the host.
This variable is set during AIM start-up initialization of the AdeptGEM module. The default value can be changed by assigning a new value in the routine gm.user.init( ).This Boolean is TRUE if the Communications State is Enabled. (Also see gm.comm, gm.offlinest, gm.online, and gm.remote.)
Defines the number of the V+ task that is used to process SECS-II messages. The value is set in the routine gm.mod.init( ) and can be changed by the user in that routine. (The routine gm.mod.init( ) is located in the public files GEMMOD.OVR/OV2.)
Controls the number of messages retained in the memory-resident log of the most recent AdeptGEM diagnostic messages (which is available as status variable 9010, recent.debuglog), as shown below. This variable, which must have one of the values shown in the example below, has no effect if bit #4 is not set in the global variable gm.debug.
gm.temp.log2siz = 0 1 2 3 4 5 6 7 Messages in log = 1 2 4 8 16 32 64 128
This variable is set during AIM start-up initialization of the AdeptGEM module. The default value can be changed by assigning a new value in the routine gm.user.init( ). (Note, however, that the value should not be changed after the AdeptGEM system has been initialized.)If this variable is defined, its first six characters are used for the data item MDLN. If the variable is not defined, the model number of the Adept controller is used.
This variable can be set in the routine 'gm.user.init()'.
Contains the AdeptGEM version identification string that is displayed during AIM initialization and that defines the value of status variable 9011 (adeptgemvrsn).
These variables can be used as indexes for the hd[ ] array that is used by several of the AdeptGEM routines.
uc.stat[,] Array of communication statistics, which can be used during system debugging. This array is available to the host as status variable 9008 (commstat).
The first index of the array is the communication channel number, which is defined by the global variable gm.chn.
The second index identifies the individual statistics, as listed below. The global variables listed can be used in place of the respective index values.