Global Variables

The following AdeptGEM global variables are used for the purposes described.

$gm.change.ec.s
gm.change.ec.t 

gm.change.ec.v
gm.dvval.ecid

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.

Variable
Data Item
Associated Messages
gm.fmt.alid
ALID
S5F1/F6/F8
gm.fmt.ceid
CEID
S6F11/F13/F16/F18
gm.fmt.dataid
DATAID
EDID
S6F5/F11/F13/F16/F18
S9F13 (when EDID is a DATAID)
gm.fmt.ecid
ECID
S2F30
gm.fmt.length
DATALENGTH
LENGTH
S6F5
S7F1
gm.fmt.rptid
RPTID
S6F11/F13/F16/F18
gm.fmt.smpln
SMPLN
S6F1
gm.fmt.trid
TRID
S6F1
gm.fmt.undef
Undefined value
S1F4, S2F14,
S6F1/F11/F13/F16/
F18/F20/F22
gm.fmt.vid
SVID

VID
S2F46/F48,
S6F13/F18/F22
S1F12
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
END

gm.gem.task

Sets 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.

gm.mtask

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.)

gm.offlinest

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.)

gm.online

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.)

gm.rc.args

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)().

gm.remote

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.)

gm.secs1.master

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.

NOTE: AdeptGEM system versions prior to version 3.2B operated as a slave in SECS-I communications. System versions 3.2B and later operate as a master, unless this variable is modified by the user.

This variable can be set in the routine gm.user.init( ).

gm.serv.poll.c

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( ).

gm.serv.poll.nc

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( ).

gm.service.go

This Boolean is TRUE if the Communications State is Enabled. (Also see gm.comm, gm.offlinest, gm.online, and gm.remote.)

gm.stask

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.)

gm.temp.log2siz

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.)

$gm.user.mdln

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()'.

$gm.version

Contains the AdeptGEM version identification string that is displayed during AIM initialization and that defines the value of status variable 9011 (adeptgemvrsn).

uc.hd.*

These variables can be used as indexes for the hd[ ] array that is used by several of the AdeptGEM routines.

Index
Global
Description
0
uc.hd.device
Device ID, with R-bit removed
1
uc.hd.wait
Boolean that indicates state of W-bit
2
uc.hd.stream
High byte of message ID field, with W-bit removed
3
uc.hd.function
Low byte of message ID field
4
uc.hd.block
Block number, with E-bit removed
5
uc.hd.end
Boolean that indicates state of E-bit
6
uc.hd.sys.1
System byte 1
7
uc.hd.sys2
System byte 2
8
uc.hd.sys3
System byte 3
9
uc.hd.sys4
System byte 4
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.

Index
Global
Count of
Used by
0
uc.stat.t1
Receive timeouts
SECS-I & HSMS
1
uc.stat.t2
protocol timeouts
SECS-I & HSMS
2
uc.stat.t3
Reply timeouts
SECS-I & HSMS
3
uc.stat.t4
interblock timeouts
SECS-I
4
uc.stat.t5
Connect separation timeouts
HSMS
5
uc.stat.t6
Control transaction timeouts
HSMS
6
uc.stat.t7
Connection-idle timeouts
HSMS
7
uc.stat.t8
Network intercharacter timeouts
HSMS
8
uc.stat.t9
Connection timeouts
HSMS
9
uc.stat.rty
Retries
SECS-I
10
uc.stat.chk
Checksum failures
SECS-I
11
uc.stat.pro
Protocol errors
SECS-I
12
uc.stat.ovr
Overrun errors
SECS-I & HSMS
13
uc.stat.frm
Framing errors
SECS-I & HSMS
14
uc.stat.erc
Other receiver errors
SECS-I & HSMS
15
uc.stat.snd
Blocks sent
SECS-I & HSMS
16
uc.stat.rcv
Valid blocks received
SECS-I & HSMS
17
uc.stat.bbk
Invalid blocks received
SECS-I & HSMS
18
uc.stat.srv
Connections made
HSMS
19
uc.stat.cli
Client connections made
HSMS
20
uc.stat.cs
Client sends
HSMS
21
uc.stat.cr
Valid messages received
HSMS
22
uc.stat.cb
Invalid messages received
HSMS
23
uc.stat.dis
Disconnects
HSMS
24
uc.stat.msg
Miscellaneous debug messages
SECS-I & HSMS