162
VERSION 2.1 AXCESS Programming Guide

Axcess Programming Guide

  • Upload
    nwagner

  • View
    267

  • Download
    5

Embed Size (px)

DESCRIPTION

Axcess Language Reference.This guide is a reference to the AXCESS programming language. Several sectionsare “look-up” references to keywords and commands, and other sections coveradvanced programming and debugging topics. This guide is the programmer’smain tool once he or she has read the AXCESS Language Tutorial.

Citation preview

Page 1: Axcess Programming Guide

VERSION 2.1

AXCESS Programming Guide

Page 2: Axcess Programming Guide

Version 2.1January, 1994

Copyright

READ THE FOLLOWING TERMS AND CONDITIONS BEFORE USING THE SOFTWARE DESCRIBED IN THIS DOCUMENT.Information contained in this document is subject to change without notice and does not represent a

commitment on the part of AMX Corporation. USE OF THE SOFTWARE DESCRIBED IN THIS AGREEMENT CON-

STITUTES YOUR AGREEMENT THAT YOU HAVE A LIMITED, NON-EXCLUSIVE LICENSE TO USE THE SOFTWARE

AND THAT YOU WILL NOT COPY, DUPLICATE OR TRANSMIT THE SOFTWARE BY ANY MEANS FOR ANY PURPOSE

(EXCEPT THAT THE PURCHASER MAY MAKE A COPY FOR BACKUP PURPOSES) WITHOUT THE EXPRESS WRITTEN

PERMISSION OF AMX CORPORATION. It is a violation of U.S. and international copyright laws and subject tocriminal prosecution to copy the software except as specifically permitted by the foregoing.

© 1994 AMX Corporation. All rights reserved.

Trademarks

AMX and AXCENT2 are trademarks of AMX Corporation. All other trademarks contained in this manual arethe property of their respective owners.

Credits

Written by Erik Engstrom and David Hooker.Contributing writers: Jody Brunelle, Cat Fowler, and Scott Hetzler.Edited by Gordon Alexander, Ron Barber, Fawzi El-Alami, and Kelly Hilliard.Layout and design by Erik Engstrom.Cover designs by Don Crum.

Special thanks to all at AMX for invaluable input and support.

Printed in USA.

For additional technical support, feel free to call us.

AMX Corporation11995 Forestgate DriveDallas, Texas 75243(214) 644-3048(800) 222-0193(214) 907-2053 FAX

Page 3: Axcess Programming Guide

Table of Contents iii

Table of Contents

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

Unit 1: Basic Programming Reference

All About Mainline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Introduction 3

Check the Wait and Wait_Until lists 3

Turn off expired Pulses 3

Handle Master Card RS-232 communications 4

Update the AXlink communications bus 4

Reserved Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Exclusively for AXCESS 5

Keyword Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Active 7

And (&&) 7

Atoi 7

Band (&) 8

Bnot (~) 8

Bor ( | ) 8

Bxor (^) 9

Call 9

Cancel_All_Wait 9

Cancel_All_Wait_Until 10

Cancel_Wait 10

Cancel_Wait_Until 10

Clear_Buffer 10

Create_Buffer 11

Create_Level 11

Create_Multi_Buffer 12

Date 12

_ _Date_ _ 12

Day 13

#Define 13

Define_Call 13

Page 4: Axcess Programming Guide

Table of Contentsiv

Define_Combine 14

Define_Connect_Level 15

Define_Constant 15

Define_Device 15

Define_Latching 16

Define_Mutually_Exclusive 16

Define_Program 17

Define_Start 17

Define_Toggling 17

Define_Variable 17

Device_ID 18

Do_Push 18

Do_Release 20

Else 20

#End_If 20

External_Control 21

_ _File_ _ 21

Find_String 21

Get_Buffer_Char 22

Get_Multi_Buffer_String 22

Get_Pulse_Time 22

Get_Timer 23

If 23

#If_Defined 24

#If_Not_Defined 25

Include 25

Integer 25

Itoa 25

Itohex 26

Left_String 26

Length_String 26

_ _Line_ _ 26

Local_Var 27

Long_While 27

Lower_String 28

Master_Slot 28

Medium_While 28

Mid_String 29

Min_To 29

_ _Name_ _ 29

Page 5: Axcess Programming Guide

Table of Contents v

Not (!) 29

Off 30

On 30

Or ( | | ) 30

Pause_All_Wait 31

Pause_Wait 31

Program_Name 31

Pulse 31

Push 32

Push_Channel 32

Push_Device 32

Random_Number 33

Redirect_String 33

Release 33

Release_Channel 34

Release_Device 34

Remove_String 34

Restart_All_Wait 34

Restart_Wait 35

Right_String 35

Select...Active 35

Send_Command 36

Send_Level 36

Send_String 36

Set_Length_String 36

Set_Pulse_Time 37

Set_Timer 37

System_Call 37

Time 37

_ _Time_ _ 38

To 38

Total_Off 38

Upper_String 39

Wait 39

Wait_Until 40

#Warn 40

While 40

Xor (^^) 41

Page 6: Axcess Programming Guide

Table of Contentsvi

Operator Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43Changing and comparing values 43

Arithmetic operators 43

Relational operators 44

Logical operators 45

Bitwise operators 47

Abbreviations 48

Precedence among operators 48

Hexadecimal ASCII Chart . . . . . . . . . . . . . . . . . . . . . . . 51How to use this chart 51

Unit 2: Eliminating Errors

Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Introduction 55

Types of errors 55

Compilation errors and warnings 55

Run-time errors 57

Tracking down your errors 58

Tracing program flow 58

Viewing variables 60

Compiler Error Messages . . . . . . . . . . . . . . . . . . . . . . 63Compilation errors 63

Unit 3: System_Call Reference

Factory System_Calls . . . . . . . . . . . . . . . . . . . . . . . . . . 71Introduction 71

System_Call format 71

System_Call names 72

Parameters 73

Timeouts 75

Defeating System_Call feedback 75

Defining functions 76

Debugging aid 76

Master Card software 76

Factory System_Call charts 77

Page 7: Axcess Programming Guide

Table of Contents vii

Unit 4: Communications

Master CardCommunication Commands . . . . . . . . . . . . . . . . . . . . 93

Introduction 93

Device-Specific Operations . . . . . . . . . . . . . . . . . . . . . 97Accessing channels 97

Sending commands and sequences 97

Symbols in this section 97

AXC-232 RS-232/422 Card 98

AXC-422 PA-422 Card 99

AXC-DMX DMX 512 Control Card 100

AXC-IR/S Infrared/Serial Card 101

AXC-MIDI MIDI Card 102

AXC-OXM Oxmoor Interface Card 103

AXC-PRN Printer Card 104

AXC-PTC Precision Time Code Card 105

AXC-PTI Pan/Tilt Interface Card 106

AXC-PTSM TSM Pan/Tilt LensInterface Card 108

AXC-SLD Slide Projector Interface Card 109

AXC-SAV European Slide ProjectorInterface Card 109

AXB-SLD Slide Projector Interface 109

AXC-SMP SMPTE Time Code Card 110

AXC-SPE Enhanced SpeechSynthesizer Card 111

AXC-SPS Speech Synthesizer Card 111

AXC-TEMP Temperature Control Card 112

AXC-VAI2 Voltage Input/Output Card 113

AXC-VG24 Voltage Generator Card 115

AXC-VRG4 Voltage Generator Card 115

AXC-VOL Volume Control Card 116

AXC-X10 X-10 Interface Card 117

AXB-FD Floppy Disk Drive 118

AXB-TM Television Manager 120

AXB-TCM Television Control Manager 120

AXB-PTM Prism Television Manager 120

AXB-VOL3 Volume Controller 122

AXP-CPI Custom Panel Interface 124

AXP-CPIL Custom Panel Interface (LED) 125

Page 8: Axcess Programming Guide

Table of Contentsviii

AXP-MSP Mini-Softwire Panel 125

AXP-SP+ Softwire Panel 125

AXP-EL Electroluminescent Touch Panel 126

AXP-EL+ Electroluminescent Touch Panel 127

AXP-LC Liquid Crystal Touch Panel 127

AXP-TS TiltScreen Touch Panel 127

AXP-MLCD Mini-LCD Panel 129

AXU-SPL4 Softwire LCD Panel 130

The External_Control Protocol . . . . . . . . . . . . . . . . . 133Controlling AXCESS from the outside 133

Sending commands 133

Responses from AXCESS 134

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

Page 9: Axcess Programming Guide

Introduction to AXCESS ix

Introduction to AXCESS

What is AXCESS?

The AXCESS system is a microprocessor-based control system capable of control-ling both simple and complex devices. Its basic function is to give you completecontrol of every device in any system. Using a flexible language, you can pro-gram AXCESS to handle nearly any task. AXCESS can automatically dim lights, in-crease volume controls to preset levels, turn on video projectors, and much more.

An IBM-compatible computer is required to program the AXCESS system.Not much memory is needed; even complex AXCESS programs can be handledby an average laptop computer. Once the system is programmed, the computeris only needed for diagnostics tests and any loading or saving of programs.

The AXCESS language

We designed the AXCESS programming language to be user-friendly. Althoughthere are over 90 commands, many are self-explanatory and take little time tomaster. If you accidentally make a mistake in your programming, AXCESS findsthe error and reports it to you. As a result, both minor and major changes inprogramming can be done quickly and easily by you in the field.

AXCESS is not some strange new language that only brilliant engineers candecipher. On the contrary, anyone with an average knowledge of computersand presentation devices should be able to understand this manual withoutany difficulty. An understanding of DOS is not even necessary, except for a fewcommands involved in the initial installation of AXCESS.

The AXCESS Programming Guide

This guide is a reference to the AXCESS programming language. Several sectionsare “look-up” references to keywords and commands, and other sections coveradvanced programming and debugging topics. This guide is the programmer’smain tool once he or she has read the AXCESS Language Tutorial.

Page 10: Axcess Programming Guide

x Introduction to AXCESS

Style conventions

Throughout this manual, certain style conventions are used to make the manualeasier to read. They are as follows:

• Create_Buffer

When a keyword is mentioned within the main text, it is displayed in sansserif boldface type. However, we recommend that all keywords be in up-percase throughout your AXCESS program.

• Create_Buffer

When a keyword is mentioned in a caption or chart, it is in italic type.Again, we recommend that all keywords be in uppercase throughout yourAXCESS program.

•CREATE_BUFFER device, array

When an actual line from an AXCESS program is displayed, it is in “com-puter type.” If a word is in lowercase (such as “device” in the exampleabove), it denotes a parameter for the previous keyword.

Page 11: Axcess Programming Guide

UNIT 1

BASICPROGRAMMINGREFERENCE

AXCESS Programming Guide

Page 12: Axcess Programming Guide
Page 13: Axcess Programming Guide

Unit 1: Basic Programming Reference All About Mainline 3

All About Mainline

Introduction

An AXCESS system program consists of several definition sections, such asDefine_Device, Define_Variable, and Define_Program. Each definition sectionhas a different function, and not all sections are required for a complete program.

One section that is required is the Define_Program section, which containsthe program code the Master Card actually executes. This section is also knownas mainline, and it is continuously executed for as long as the Master Card haspower. When the Master Card is powered up, it first executes the code in theDefine_Start section. Then it starts at the top of mainline, which is the first lineof program code after the Define_Program header. During execution of main-line, the Master Card processes the statements in the program, taking whateveractions as defined by the program.

At the end of mainline, the Master Card does some internal processing beforereturning to the top of mainline for another loop. See Figure 1-1. During thistime, the Master Card takes care of the following chores:

• Check the Wait and Wait_Until lists

• Turn off expired Pulses

• Handle Master Card RS-232 communications

• Update the AXlink communications bus

After the Master Card handles these tasks, it executes mainline again. Thefollowing sections break down what happens during each of these operations.

Check the Wait and Wait_Until lists

During this time, the Master Card scans the Wait list for any Waits whose timeshave expired and then checks the Wait_Until list for any Wait_Untils whoseconditions have become true. If one of these events has occurred, the MasterCard immediately goes back into the program and executes the statement orcompound statement directly following the Wait or Wait_Until statement.

Turn off expired Pulses

Next, the Master Card checks to see if any channels activated by the Pulse key-word need to be turned off. If there are, the Master Card turns them off.

Mainline

The only section of the

program that is executed

continuously by the Master

Card. Also known as the

Define_Program section.

NOTE

The only definition sections

that have executable code

are Define_Start and Define_

Program. Define_Call

sections are not considered

“definition sections.”

C H A P T E R

1

Page 14: Axcess Programming Guide

4 All About Mainline Unit 1: Basic Programming Reference

Handle Master Card RS-232 communications

At this time, the Master Card handles its RS-232 communications. It checks forincoming characters, executes valid commands typed by the user, and sendsout any information that is pending.

Update the AXlink communications bus

After all other business is taken care of, the Master Card updates the AXlinkbus. During this time, the Master Card blinks the green LEDs on all AXCESS busdevices, reads pending input changes, and updates all levels and bar graphs.This action must be done quite frequently or the AXlink bus will stop operating,causing the entire system to stop working.

DEFINE_PROGRAM

Continuous loop

Mainline

Check the Wait and Wait_Until lists

Turn off expired Pulses

Handle Master Card RS-232communications

Update the AXlink communications bus

Internal processing

End of program

Figure 1-1

Mainline execution and

internal processing.

Page 15: Axcess Programming Guide

Unit 1: Basic Programming Reference Reserved Identifiers 5

Reserved Identifiers

Exclusively for AXCESS

There are certain identifiers that are reserved for AXCESS commands, functions,and system variables. These are integral to the system and cannot be redefinedor used as identifiers. See Figure 1-2 for the complete list.

C H A P T E R

2

Figure 1-2

A list of reserved identifiers

that cannot be redefined.

Reserved identifiers

Active

And

Atoi

Band

Bnot

Bor

Bxor

Call

Cancel_All_Wait

Cancel_All_Wait_Until

Cancel_Wait

Cancel_Wait_Until

Clear_Buffer

Create_Buffer

Create_Level

Create_Multi_Buffer

Date

_ _Date_ _

Day

#Define

Define_Call

Define_Combine

Define_Connect_Level

Define_Constant

Define_Device

Define_Latching

Define_Mutually_Exclusive

Define_Program

Define_Start

Define_Toggling

Define_Variable

Device_ID

Do_Push

Do_Release

Else

#End_If

External_Control

_ _File_ _

Find_String

Get_Buffer_Char

Get_Multi_Buffer_String

Get_Pulse_Time

Get_Timer

If

#If_Defined

#If_Not_Defined

Include

Integer

Itoa

Itohex

Left_String

Length_String

_ _Line_ _

Local_Var

Long_While

Lower_String

Master_Slot

Medium_While

Mid_String

Min_To

_ _Name_ _

Not

Off

On

Or

Pause_All_Wait

Pause_Wait

Program_Name

Pulse

Push

Push_Channel

Push_Device

Random_Number

Redirect_String

Release

Release_Channel

Release_Device

Remove_String

Restart_All_Wait

Restart_Wait

Right_String

Select

Send_Command

Send_Level

Send_String

Set_Length_String

Set_Pulse_Time

Set_Timer

System_Call

Time

_ _Time_ _

To

Total_Off

Upper_String

Wait

Wait_Until

#Warn

While

Xor

Page 16: Axcess Programming Guide
Page 17: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 7

C H A P T E R

3

Keyword Reference

Active

See Select...Active.

And (&&)

The logical operator And is used to evaluate two conditions. These conditionsmust be true for the entire expression to be true. And is usually used in If state-ments to check for multiple true conditions. For example:

IF((X = 1) AND (Y = 2)){

(* These statements are executed if the above Andstatement is true; that is, if X = 1 is true andY = 2 is true. *)

}

See also Not, Or, Xor.

Atoi

The Atoi keyword stands for “ASCII to integer” and does just that. It takes astring literal, string expression, or array as a parameter, and returns a singleinteger as the result. Here are some examples:

DEFINE_CONSTANTSTR1 = ‘456’STR2 = ‘YES789GO19’

DEFINE_PROGRAMNUM = ATOI(‘123’) (* NUM = 123 *)NUM = ATOI(STR1) (* NUM = 456 *)NUM = ATOI(STR2) (* NUM = 789 *)

If the string contains all non-numeric characters (such as ‘HELLO’), Atoi returnsthe integer zero. However, if there are any numeric characters embedded within

Page 18: Axcess Programming Guide

8 Keyword Reference Unit 1: Basic Programming Reference

the string, Atoi returns the first complete set it comes upon, as is the case withSTR2 in the example. Notice that only the first set of numbers from STR2 is returned.

See also Itoa, Itohex.

Band (&)

Band is a bitwise operator used to perform a “bitwise And” operation betweentwo bytes. Each of these bytes can be a constant value, number, or variable. Theresult of the operation can be tested with an If statement or assigned to a vari-able. Here is an example:

X = 5 BAND 14 (* X is equal to 4 *)

See Chapter 4 for a description of bitwise operations.

See also And, Bnot, Bor, Bxor.

Bnot (~)

Bnot is a bitwise operator used to perform a “bitwise Not” operation on a byte.Each bit of the byte is inverted; that is, each “1” bit becomes “0,” and vice versa.The result of the operation can be tested with an If statement or assigned to avariable. Here is an example:

X = BNOT 1ØØ (* X is equal to 155 *)

See Chapter 4 for a description of bitwise operations.

See also Band, Bor, Bxor, Not.

Bor ( | )

Bor is a bitwise operator used to perform a “bitwise Or” operation between twobytes. Each of these bytes can be a constant value, number, or variable. The re-sult of the operation can be tested with an If statement or assigned to a variable.Here is an example:

X = 1 BOR 14 (* X is equal to 15 *)

Page 19: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 9

See Chapter 4 for a description of bitwise operations.

See also Band, Bnot, Bxor, Or.

Bxor (^)

Bxor is a bitwise operator used to perform a “bitwise Xor” operation betweentwo bytes. Each of these bytes can be a constant value, number, or variable. Theresult of the operation can be tested with an If statement, or assigned to a vari-able. Here is an example:

X = 1Ø BXOR 6 (* X is equal to 12 *)

See Chapter 4 for a description of bitwise operations.

See also Band, Bnot, Bor, Xor.

Call

To tell AXCESS to execute a subroutine, use the Call keyword and the name ofthe subroutine in single quotes. For example, in order to execute the subroutineLIGHTS OFF, you would type the following where you want the Call to occur:

CALL ‘LIGHTS OFF’

When AXCESS executes the Call, program execution “jumps” to the first lineinside the braces of the Define_Call. The subroutine is executed only once, andthen AXCESS returns to the statement directly following the Call statement.

See also Define_Call, System_Call, Local_Var.

Cancel_All_Wait

This keyword cancels all Waits (named and unnamed) in the Wait list. This is afunction by itself.

See also Wait, Cancel_Wait.

Page 20: Axcess Programming Guide

10 Keyword Reference Unit 1: Basic Programming Reference

Cancel_All_Wait_Until

This keyword cancels all Wait_Untils (named and unnamed) in the Wait_Untillist. This is a function by itself.

See also Wait_Until, Cancel_Wait_Until.

Cancel_Wait

This keyword cancels a specifically named Wait by removing it from the Wait

list. Only named Waits can be cancelled by Cancel_Wait. The format:

CANCEL_WAIT ‘name of Wait’

See also Wait, Cancel_All_Wait.

Cancel_Wait_Until

This keyword cancels a specifically named Wait_Until by removing it from theWait_Until list. Only named Wait_Untils can be cancelled by Cancel_Wait_Until.The format:

CANCEL_WAIT_UNTIL ‘name of Wait_Until’

See also Cancel_All_Wait_Until, Wait_Until.

Clear_Buffer

AXCESS provides a single keyword which clears the contents of a buffer: Clear_

Buffer. The format:

CLEAR_BUFFER buffer name

This keyword sets the length of the buffer to zero so that subsequentGet_Buffer_Char statements will not return anything. Using Clear_Buffer ispreferable to other methods, such as assigning a null string to the buffer or usingSet_Length_String. The Clear_Buffer keyword actually compiles into smallercode and executes faster than the other methods, plus it is clearer to the readeras to what the programmer is trying to accomplish.

See also Create_Buffer, Get_Buffer_Char.

Page 21: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 11

Create_Buffer

To create a buffer, use the Create_Buffer keyword. This keyword can only ap-pear in the Define_Start section of your program, and it has the following syntax:

CREATE_BUFFER device, array

The Create_Buffer keyword directs AXCESS to place any strings receivedfrom the specified device into the specified array. When AXCESS places the byteinto the array, AXCESS increments the length value for the array and then placesthe byte at the current end of the array. When the array is full, all bytes in thearray are shifted to make room at the end for the new byte.

Even though the array is acting as a buffer, it is still an array and can betreated as one. You can access its individual locations, send it to a device, as-sign it to other arrays, assign other arrays to it, as well as use keywords to ma-nipulate the array.

See also Clear_Buffer, Create_Multi_Buffer, Get_Buffer_Char.

Create_Level

To read a level from an AXCESS device that supports levels, use the keywordCreate_Level. Here is the syntax:

CREATE_LEVEL device, level number, variable

Create_Level takes three parameters:

• The device from which to read the level

• The level of the device to read (some devices have many different levels)

•The variable in which to store the level

This keyword creates an association between the specified level of the deviceand the specified variable. During the execution of a program, AXCESS continu-ally updates the variable to contain the value of the level with which it is asso-ciated. (See the complete discussion of mainline and the AXlink bus in Chapter1.) Since this association only needs to be done once, Create_Level is only al-lowed to appear in the Define_Start section of a program.

See also Send_Level, Define_Connect_Level.

Page 22: Axcess Programming Guide

12 Keyword Reference Unit 1: Basic Programming Reference

Create_Multi_Buffer

This keyword is similar to Create_Buffer, except it creates a “multi-buffer” thatcan accept strings from a group of cards. This keyword can only appear in theDefine_Start section of your program, and it has the following syntax:

CREATE_MULTI_BUFFER starting device, ending device, array

Create_Multi_Buffer directs AXCESS to place any strings received from thespecified range of devices into the specified array.

Three header bytes are present before each string in a multi-buffer. The firstheader byte is the hexadecimal value $FF, which marks the beginning of a newstring. The next byte is the number of the device that received the string, andthen the length of the string follows. For example, if the string ‘HELP’ is receivedby device 1, these are the contents of the corresponding multi-buffer:

$FF, 1, 4, ‘H’, ‘E’, ‘L’, ‘P’

See also Clear_Buffer, Create_Buffer, Get_Multi_Buffer_String.

Date

The system variable Date returns the current date in the form of the string MM/DD/YY, in which MM equals “month,” DD equals “day,” and YY equals “year.”The wildcard character “?” is allowed for string comparisons. For example:

IF (DATE = ‘12/25/??’){

(* These statements are executed every Christmas *)}

See also _ _Date_ _, Day, Time.

_ _Date_ _

At compile time, this keyword is replaced by a string (MM/DD/YY) that con-tains the compile time date.

Page 23: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 13

For example:

(* The program was compiled on November 24, 1993 *)

SEND_STRING Ø, _ _DATE_ _

The string ‘11/24/93’ is sent to device 0.

See also Date, _ _Time_ _.

Day

The system variable Day returns the current day of the week in the form of oneof the strings MON, TUE, WED, THU, FRI, SAT, or SUN. For example:

IF (DAY = ‘MON’){

(* These statements are executed every Monday *)}

See also Date, Time.

#Define

This keyword is actually a command to the compiler, not to the Master Card. Itis simply used to define a symbol. Here is the format:

#DEFINE symbol name

The symbol can be any identifier not already used anywhere in the program.When the symbol is defined using #Define, it can only be referred to by one ofthe other preprocessor keywords, #If_Defined and #If_Not_Defined.

See also #End_If, #If_Defined, #If_Not_Defined.

Define_Call

In AXCESS, subroutines are created using the Define_Call statement. Enclosed insingle quotes, the subroutine name follows the Define_Call keyword.

Page 24: Axcess Programming Guide

14 Keyword Reference Unit 1: Basic Programming Reference

There are certain restrictions for these subroutine names:

• They cannot be previously defined constants or variables.

• They cannot be names that have already been assigned to buffers or Waits.

• They are case-sensitive. ‘Test’ and TEST’ are not the same.

Subroutines must be defined before they can be used. For this reason, Define_

Calls are usually found right before the Define_Start section of the program.Here is the format:

DEFINE_CALL ‘subroutine name’{

(* The subroutine goes here *)}

Spaces in the subroutine name are allowed since it is a string literal. Noticethat the subroutine’s code is enclosed in braces. No matter how long the sub-routine is, it must be in this format.

For more information on subroutines, see the AXCESS Language Tutorial foran in-depth explanation.

Define_Combine

This definition section allows the combination of functionally identical devices,such as identically programmed Touch Panels and Softwire Panels. When theprogram references one of these devices, all other combined devices in the setare also referenced. The devices must be enclosed in parentheses, and this set ofdevices is called a combine list. For example:

DEFINE_COMBINE(PANEL1,PANEL2,PANEL3)

This combines the three devices PANEL1, PANEL2, and PANEL3. Whenever aninput change occurs on any of the three devices, AXCESS “sees” the input as comingonly from the first device in the list: PANEL1. If button [PANEL2,12] is pressed,AXCESS will see the input as coming from [PANEL1,12] due to the combination.

Likewise, any output change that is sent to any device in the list will auto-matically be sent to all devices in the list. This includes level changes. For in-stance, the statement ON [PANEL3,5Ø] will turn on channel 50 for all threedevices in the list. Note, however, that input and output changes occurring onnon-combined panels will not affect combined panels, and vice versa.

Page 25: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 15

Define_Combine is usually located immediately after the Define_Device sec-tion of a program.

Define_Connect_Level

Underneath the Define_Connect_Level header is where all level connectionsare listed. Here is how Define_Connect_Level is used:

DEFINE_CONNECT_LEVEL(device 1, level number 1, device 2, level number 2, ... )

The section inside the parentheses represents a single connection. All levelslisted in the connection will follow each other. If any one level changes, all oth-ers will change to match it. Any number of levels may be supported per con-nection, and there is no limit to the number of connections. The best locationfor this definition section is immediately following the Define_Variable section.

See also Create_Level, Send_Level.

Define_Constant

This section allows numbers to be given names, making programs easier toread and write. The value of a constant cannot be changed within a program.For example:

DEFINE_CONSTANTPLAY = 1STOP = 2

Define_Device

This section allows device numbers to be given names and tells the MasterCard which devices to expect on AXlink. For example:

DEFINE_DEVICEVCR = 1Ø

This section must exist in order to use the built-in diagnostics tools.

Page 26: Axcess Programming Guide

16 Keyword Reference Unit 1: Basic Programming Reference

Define_Latching

In this definition section, latching channels and variables are defined. A latch-ing channel is a channel that only changes its state once per Push. That is tosay, if a latching channel is activated by a To keyword, it changes its state;when the To is stopped by releasing the button that started it, the channel doesnot go back to its previous state like a momentary channel. The channel stayseither on or off. The status of a latching channel will reflect the on/off state ofthe channel. Here is an example:

DEFINE_LATCHING[RELAY,SYSTEM_POWER][VCR,PLAY]..[VCR,REWIND]VAR1

In this example, the device-channel [RELAY,SYSTEM_POWER] is defined aslatching. The next line uses double periods (..) to define a range of device-chan-nels as latching. Finally, the variable VAR1 is defined as latching.

See also Define_Mutually_Exclusive, Define_Toggling.

Define_Mutually_Exclusive

When a channel is turned on in a mutually exclusive set, it activates its physicaloutput as long as the button is pressed. When the button is released, the physi-cal output stops. The status, however, does not work in the same manner. Evenafter the physical output stops, the status still indicates that the channel is onuntil another channel in the mutually exclusive set is activated. The status is onto let you know which channel in the set was last activated. This is sometimescalled “last button pressed” feedback.

When a channel or variable in this set is activated, all the other members ofthe set are turned off beforehand. This is called “break before make” logic. Thisprevents an accidental activation of more than one channel at the same time,which could cause serious damage to some devices.

Members of a mutually exclusive set are placed in parentheses underneaththe Define_Mutually_Exclusive keyword. The double period (..) shortcut speci-fies a range of device-channels to be defined as mutually exclusive. For example:

DEFINE_MUTUALLY_EXCLUSIVE([RELAY,SCREEN_UP],[RELAY,SCREEN_DOWN])([RELAY,DRAPE_OPEN]..[RELAY,DRAPE_STOP])

Page 27: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 17

The first set defines two channels as mutually exclusive. The second set de-fines a range of channels as mutually exclusive.

See also Define_Latching, Define_Toggling.

Define_Program

This statement marks the beginning of mainline, telling the compiler that thefollowing statements make up the actual executing program. See the completediscussion of mainline in Chapter 1.

Define_Start

This statement marks the section of programming that will be executed onlyonce immediately following power-up or system reset. The keyword To cannotbe used within the Define_Start section; instead, use On, Off, or Pulse.

Define_Toggling

When a channel is defined as mutually exclusive and latching, there is no wayto turn off the channel without activating another. Mutually exclusive togglingallows a channel to be turned on or off by successive presses of the same but-ton, just like a normal latching channel. Also, the channel is still affected by itsmutually exclusive characteristics; if the channel is on, it can be turned off byanother activated channel in its mutually exclusive set. The status of a mutuallyexclusive toggling button operates in the same way as that for a mutually ex-clusive latching button.

In order to make a channel toggling, it must be defined as both mutually ex-clusive and toggling. The Define_Toggling section is usually located directlyafter the Define_Mutually_Exclusive section. Here is an example:

DEFINE_TOGGLING[RELAY,SCREEN_UP][RELAY,SCREEN_DOWN]

See also Define_Latching, Define_Mutually_Exclusive.

Define_Variable

This is the section where variables are declared. Variables are places to storedata that will change as the program is executed. Think of a variable as an“anything box;” nearly anything can be placed in here. For example, a variablecan represent a number. The numeric range is from 0 to 65,535; variables can-not hold a negative number. If one variable is subtracted from another, the re-

Page 28: Axcess Programming Guide

18 Keyword Reference Unit 1: Basic Programming Reference

sult must be positive. (If, however, you do subtract a larger number from asmaller number, the result “wraps around” at 65,535. For instance, if you sub-tract 20 from 10, the result is 65,525). One- and two-dimensional arrays are alsodeclared in this section.

Once the system is turned off, variables do not lose their values. If a certainvariable equals 3 when AXCESS is shut down, it will remain 3 when the systemis reactivated. This function has both advantages and drawbacks. It obviouslyhelps when you need AXCESS to retain values for the variables. However, if youneed those variables to be reset when the system is turned on, they must be re-set manually within the Define_Start section.

Here are some examples:

DEFINE_VARIABLESYSTEM_POWERRS232_BUFFER[2Ø]

See also Local_Var.

Device_ID

Every AXCESS device has a unique ID number identifying its device type, suchas an Infrared/Serial Card or a Touch Panel. See Figure 1-3. The Device_ID

keyword returns the ID number of a specified device; if the device does not ex-ist in the system, Device_ID returns zero. This keyword is usually used for de-termining whether or not a device is present in the system. For example:

IF (DEVICE_ID(VHS_CARD)){

(* If the card exists, these statements are executed *)}

Do_Push

This keyword causes an input change from “off” to “on” to occur on a specifieddevice-channel without the device-channel being activated by external means.Here is the format:

DO_PUSH (device, channel)

Page 29: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 19

Device_ID numbers

ID (Hex)

01

03

04

05

06

07

81

82

83

85

86

87

88

89

8A

8B

8C

8D

8E

8F

90

91

92

94

95

96

97

98

99

9A

9B

9E

9F

A1

A4

A5

A6

B1

B3

C0

AXC-REL8 Eight Relay Card

AXC-SLD Slide Projector Card

AXC-SAV Slide Projector Card

AXC-SPE Enhanced Speech Synthesizer Card

AXC-PRN Printer Card

AXC-REL14 Fourteen Relay Card

AXP-SP, AXP-SP+ Softwire Panel

AXP-EL+ Touch Panel, AXP-T/S TiltScreen Touch Panel

AXB-REL8 Eight Relay Controller

AXC-232 RS-232/422 Control Card

AXC-VOL Volume Control Card

AXC-VRG4 Voltage Generator Card

AXC-IR/S Infrared/Serial Control Card

AXC-MIDI MIDI Interface Card

AXP-MSP Mini-Softwire Panel

AXC-VAI2 Voltage Input/Output Card

AXC-SMP SMPTE Time Code Card

AXC-X10 X-10 Interface Card

AXC-422 PA-422 Interface Card

AXP-MLCD Mini-LCD Panel

AXC-PTI Pan/Tilt Interface Card

AXB-FD Floppy Disk Drive

AXC-PTSM Pan/Tilt Lens Interface Card

AXB-SLD Slide Controller

AXC-DMX8 DMX Control Card

AXC-PTC Precision Time Card

AXU-MSP UniMount Mini-Softwire Panel

AXC-OXM Oxmoor Interface Card

AXC-ADI Analog Data Interface Tape Card

AXP-CPI8 Custom Panel Interface Board

AXC-DTMF DTMF Control Card

AXC-VG24 Voltage Generator Card

AXP-LC Liquid Crystal Touch Panel

AXC-INP8 Universal Input Card

AXR-RF RF Receiver, AXR-IR IR Receiver/Sensor

AXC-RCVI Infrared Receiver Interface Card

AXC-TEMP Temperature Control Card

AXB-TM Television Manager

AXU-SPL4 Four-Button Mini-LCD Panel

AXB-VOL3 Three-Channel Volume Controller

DeviceID (Dec)

1

3

4

5

6

7

129

130

131

133

134

135

136

137

138

139

140

141

142

143

144

145

146

148

149

150

151

152

153

154

155

158

159

161

164

165

166

177

179

192

Figure 1-3

Device_ID numbers for a

variety of AMX control

panels, cards, and devices.

Page 30: Axcess Programming Guide

20 Keyword Reference Unit 1: Basic Programming Reference

If a Push statement corresponding to the device-channel is present in theprogram, it will be executed. The Do_Push keyword “holds” the Push for onehalf-second. It then releases the channel by generating another input change forthe device-channel from “on” to “off.” The effect is the same as someone press-ing a button on a panel for one half-second. The release can be delayed by re-peating the Do_Push before the half-second time period elapses.

Note: This keyword is only useful in limited situations, and its use isstrongly discouraged.

See also Do_Release.

Do_Release

This keyword causes an input change from “on” to “off” to occur on a specifieddevice-channel without the device-channel being deactivated by externalmeans. Here is the format:

DO_RELEASE (device,channel)

If a Release statement corresponding to the device-channel is present in theprogram, it will be executed. The Do_Release keyword also forces the releaseof a device-channel turned on by Do_Push.

Note: This keyword is only useful in limited situations, and its use isstrongly discouraged.

See also Do_Push.

Else

If the corresponding If statement is false, the program will jump to this sectionof the If...Else set of statements.

See also If.

#End_If

This keyword marks the end of an #If_Defined or #If_Not_Defined block of code.

See also #If_Defined, #If_Not_Defined.

Page 31: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 21

External_Control

This keyword tells the Master Card to use a particular AXCESS RS-232/422 Inter-face Card as an external control port. Once a port has been thus defined, all sys-tem functions can be controlled by an external computer or by another deviceusing RS-232/422. This keyword can only be used in the Define_Start section ofthe program. Here is the syntax:

EXTERNAL_CONTROL (device)

The protocol used in controlling the AXCESS system in this manner is de-tailed in Chapter 11.

_ _File_ _

At compile time, this keyword is replaced by a string that contains the DOS file-name of your program. For example:

(* The program was saved as SAMPLE.AXS *)

SEND_STRING Ø, _ _FILE_ _

The string ‘SAMPLE.AXS’ is sent to device 0.

See also _ _Name_ _.

Find_String

This keyword tells AXCESS to search through a string for a specified sequence ofcharacters. As soon as AXCESS finds the sequence, it returns the beginning posi-tion. The format:

result = FIND_STRING (string, sequence of characters,starting position of search)

See also Left_String, Mid_String, Remove_String, Right_String.

Page 32: Axcess Programming Guide

22 Keyword Reference Unit 1: Basic Programming Reference

Get_Buffer_Char

This keyword is used to remove characters from a buffer, and it has a two-partoperation:

• First, it retrieves the first character in the buffer for your own utilization.This creates the same effect as if you retrieved the first storage location of anormal string array.

• Second, it removes that character from the buffer, causing all the othercharacters to shift up one place. The second character is now the first, thethird is now the second, and so on.

Here is the syntax of this keyword:

result = GET_BUFFER_CHAR (array)

The parameter passed to Get_Buffer_Char must be an array, but does notneed to be a buffer. (Remember: All buffers are arrays, but not all arrays arebuffers.) The keyword will operate identically in either case. Only one byte(character) will be returned, and this value can be assigned to a variable, array,or a cell in an array.

Get_Multi_Buffer_String

To access characters coming into a multi-buffer, you must first use Get_Multi_Buffer_String to transfer these characters into another array. The syntax:

device = GET_MULTI_BUFFER_STRING (buffer, array)

The next string in the specified buffer is assigned to the specified array. Allthree header bytes for the string are stripped before the string enters the array.

The result of a Get_Multi_Buffer_String statement is the device number ofthe card that received the string.

See also Create_Multi_Buffer.

Get_Pulse_Time

This system variable contains the current duration of Pulses and Min_Tos, asset by Set_Pulse_Time. Time is measured in tenths of seconds, and the defaultis one half-second.

Page 33: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 23

For example:

SET_PULSE_TIME(12)P_TIME = GET_PULSE_TIME

The variable P_TIME now contains 12 (1.2 seconds).

Get_Timer

This system variable contains the current status of the system timer. Time ismeasured in tenths of seconds. For example:

IF (GET_TIMER = 3ØØ){

(* statement(s) *)}

See also Set_Timer.

If

The If statement provides conditional branching of program flow. Every If state-ment must be followed by an expression enclosed in parentheses. This providesthe beginning of a conditional execution of statements. The structure is as follows:

IF (expression)(* Statement 1 *)

If the expression is true, AXCESS executes Statement 1 and then continueswith whatever statements follow. If the expression is false, Statement 1 is ig-nored. If Statement 1 is a compound statement, it must be enclosed in braces.

The If...Else set of statements are similar to the basic If statement, with theaddition of an alternative instruction. If the expression is false, AXCESS executesa statement independent of the “true” expression. For example:

IF (expression)(* Statement 1 *)

ELSE(* Statement 2 *)

Page 34: Axcess Programming Guide

24 Keyword Reference Unit 1: Basic Programming Reference

If the expression is true, then Statement 1 is executed. Statement 2, under-neath the Else statement, is ignored. If the expression is false, then Statement 2is executed. Remember that Statement 1 is automatically ignored if the expres-sion is false.

The If...Else If set of statements allow an essentially unlimited number of paths.AXCESS stops at the first true expression and executes the following statement.After completion, it goes on to the rest of the program. For example:

IF (expression)(* Statement 1 *)

ELSE IF (expression)(* Statement 2 *)

ELSE IF (expression)(* Statement 3 *)

(* As many Else If statements as memory allows... *)

A last Else statement (not Else If) can be placed at the end as a default state-ment; that is, if AXCESS does not find a true If or Else If statement, it executesthe final Else statement. However, this last Else statement is not necessary.

See also Select...Active.

#If_Defined

This keyword is used to achieve conditional compilation. The syntax:

#IF_DEFINED symbol(* Statement *)

#END_IF

The code inside the two preprocessor keywords is compiled only if the sym-bol following the #If_Defined is defined. A symbol is considered defined if

• it has been defined as a variable in the Define_Variable definition section

• it has been defined as a constant in the Define_Constant definition section

• it has been defined as a device in the Define_Device definition section

• it is a name of a Define_Call subroutine

• it has been defined using #Define

See also #Define, #End_If, #If_Not_Defined.

Page 35: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 25

#If_Not_Defined

This is essentially the same as #If_Defined, except the code enclosed by the #If_Not_Defined and the #End_If will be compiled only if the symbol is not defined.

See also #Define, #End_If, #If_Defined.

Include

When the compiler reaches the Include statement, it “jumps” into the specifiedfile and continues compiling. When it has reached the end of the file, it comesback to the line following the Include statement and continues compiling. Thecode compiled in the include file is compiled just as if it were in the main pro-gram where the Include statement is located. The Include statement can appearanywhere in your program, since it is actually a statement to the compiler andnot the AXCESS control system. The syntax:

INCLUDE ‘DOS filename’

Include files are loaded and edited using the AXCESS editor much like normalprogram files. Like program files, the AXCESS name (not the DOS name) of theinclude file is stored on the first line of the file a Program_Name declaration.Include files are saved with the DOS extension “AXI.”

Integer

This keyword can only be used in the Define_Variable and Local_Var sectionswhen declaring arrays. It is placed in front of the array name to denote the ar-ray as an integer array. An integer array is just like a normal array, except thateach location can hold values from zero to 65,535.

There are certain limitations of integer arrays. If an integer array is assigned toa string array, all values are truncated above 255. This also happens if an integerarray is sent to a device using the keywords Send_String or Send_Command.There is no problem, however, in assigning a string array to an integer array.

Itoa

This keyword, which is short for “integer to ASCII,” changes a number into adecimal ASCII string. For example:

STR = ITOA(2842)

Page 36: Axcess Programming Guide

26 Keyword Reference Unit 1: Basic Programming Reference

STR now contains the string of characters ‘2842’.

See also Atoi, Itohex.

Itohex

This keyword, which is short for “integer to hexadecimal,” changes an integerinto an ASCII string containing the hexadecimal representation of the originalnumber. For example:

STR = ITOHEX(2485)

STR now contains the string ‘9B5’.

See also Atoi, Itoa.

Left_String

This keyword returns a specified number of characters from a specified arraystarting from the beginning of the array. This keyword requires that the lengthvalue of the array be greater than zero. The syntax:

result = LEFT_STRING (string array, number of characters)

See also Find_String, Mid_String, Remove_String, Right_String.

Length_String

This keyword returns the current length value of an array. This number is dif-ferent from the storage capacity of an array, which is defined in the Define_

Variable section. The length value of an array is used by several of the AXCESS

string operation keywords, and this value can change during program execu-tion. The syntax:

result = LENGTH_STRING (string array)

_ _Line_ _

At compile time, this keyword is replaced by a constant that contains the linenumber the keyword is on.

Page 37: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 27

For example:

(* This is line number 23 *)

SEND_STRING Ø, _ _LINE_ _

The value 25 (two lines down from 23) is sent to device 0.

Local_Var

This keyword is used inside a Define_Call to declare local variables. A localvariable is a variable which is declared inside a Define_Call and can only beused inside that same Define_Call. Variables declared in the main Define_ Vari-

able section are called global variables. The words “local” and “global” refer toa variable’s scope, which determines the parts of the program that can accessthe variable. Global variables have global scope; that is, the entire program hasaccess to them. A local variable has local scope, and can only be accessed insidethe Define_Call in which it is declared.

A local variable can have the same name as a local variable in another sub-routine. A local variable can also have the same name as a global variable. Ifthis happens, the local variable takes precedence in its scope; the global vari-able is “hidden.”

Local variables are best used in cases where a subroutine needs to use a vari-able, but no other piece of code needs it. Such variables are usually temporaryflags, loop counters, and other variables a subroutine may need to do its work.Local variables are also “static,” meaning that they retain their values betweencalls to the subroutine. A well-organized program may even have more localvariables than global variables, because the main work of the program ishandled mostly by subroutines rather than the main program.

See also Define_Call, Define_Variable.

Long_While

There are cases when a While loop must take longer than one half-second to ex-ecute. If this is the case, change the While keyword in question to a Long_While.

The main difference between a While and a Long_While is that after eachloop through the Long_While’s statement, the AXlink bus is updated. This, ineffect, makes the statement or compound statement following a Long_While a“mini-mainline” section for as long as the condition of the Long_While is true.Therefore, Long_While has absolutely no time-out period.

Page 38: Axcess Programming Guide

28 Keyword Reference Unit 1: Basic Programming Reference

During the execution of a Long_While, AXCESS scans AXlink just like it doeswhen running mainline. It is during this scanning that AXCESS receives infor-mation about input changes from devices such as Softwire Panels and TouchPanels. This activity takes place after each loop through a Long_While. There-fore, if a user presses a button while AXCESS is looping through a Long_While,the input change is lost to any programming outside the Long_While loop. Ifthis becomes a problem, the Medium_While keyword may be used.

Be careful! If you don’t provide a way out of your Long_While (by allowingthe condition to become false), the program will become stuck inside the Long_

While and no other code outside of the loop will be executed. Also, becauseLong_While loops update AXlink, they are much slower than While loops.

Long_While has the exact same syntax as the While keyword.

See also Medium_While, While.

Lower_String

This keyword changes all the alphabetic characters in a string to lowercase.Only the number of characters specified by the length value of the string areconverted. The returned value is an array. The syntax:

result = LOWER_STRING (string)

See also Upper_String.

Master_Slot

This system variable returns a number which represents the slot in which theMaster Card is plugged; “0” represents slot 1, and “1” represents slot 2.

Medium_While

This keyword operates just like a Long_While, but it ignores input changesfrom AXCESS devices. These input changes are not lost, but will remain pendinguntil the Master Card scans for them again—either before the next passthrough mainline, or after a pass through a Long_While. (Refer to the completediscussion of mainline and the AXCESS bus in Chapter 1.)

Be very careful when using Medium_While. If the condition can never be-come false, your program could get stuck in an infinite loop, requiring a resetof the Master Card or maybe even a reloading of the system’s programming.

Medium_While has the exact same syntax as the While keyword.

See also Long_While, While.

Page 39: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 29

Mid_String

This keyword returns the specified number of characters starting at a specifiedlocation in the source string. The length value of the array must be greater thanzero, and the returned value is an array. The syntax:

result = MID_STRING (string array, starting position,number of characters)

See also Find_String, Left_String, Remove_String, Right_String.

Min_To

This keyword operates like the To keyword, except that the specified channelor variable stays on for a minimum amount of time—even if the correspondingdevice-channel is released. The time duration is determined by Set_Pulse_Time.

Min_To follows the same conditions of operation as the To keyword.

See also Get_Pulse_Time, Pulse, Set_Pulse_Time, To.

_ _Name_ _

At compile time, this keyword is replaced by a string that contains the Program_Name description on the first line of your program. For example:

PROGRAM_NAME = ‘This is a sample AXCESS program’

(* Later in the program... *)

SEND_STRING Ø, _ _NAME_ _

The string ‘This is a sample AXCESS program’ is sent to device 0.

See also _ _File_ _.

Not (!)

The logical operator Not is used when the opposite of a condition makes theexpression true.

Page 40: Axcess Programming Guide

30 Keyword Reference Unit 1: Basic Programming Reference

For example:

IF (NOT (X = 2)){

(* If X <> 2, these statements are executed *)}

See also And, Or, Xor.

Off

Off is used to turn a channel or variable off. If used with a variable, Off sets it tozero. The device-channel or variable must be enclosed in brackets. The syntax:

OFF [device,channel]OFF [variable]

See also On, Total_Off.

On

On is used to turn a channel or variable on. If used with a variable, On sets it to1. The device-channel or variable must be enclosed in brackets. The syntax:

ON [device,channel]ON [variable]

See also Off, Pulse, Total_Off.

Or ( | | )

The logical operator Or is used to evaluate two conditions. At least one of theconditions must be true for the entire expression to be true. Or is usually usedin If statements to check for a true condition.

For example:

IF ((X = 1) OR (Y = 2)){

(* These statements are executed if the above Orstatement is true *)

}

Page 41: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 31

If X contains 1 or if Y contains 2, the statements in the braces are executed.

See also And, Not, Xor.

Pause_All_Wait

This keyword, like the name implies, pauses all Waits in the Wait list, regard-less of whether they are named or not.

See also Cancel_All_Wait, Cancel_Wait, Pause_Wait, Restart_All_Wait,Restart_Wait, Wait.

Pause_Wait

This keyword suspends the specified Wait until a Restart_Wait or Cancel_Wait

keyword is given. This keyword only affects a named Wait. When a Wait ispaused, it remains in the Wait list; only its countdown is paused. The syntax:

PAUSE_WAIT ‘name of Wait’

See also Cancel_All_Wait, Cancel_Wait, Pause_All_Wait, Restart_All_Wait,Restart_Wait, Wait.

Program_Name

This keyword is inserted by the compiler to give your program a description. Itmust appear on the first line of the program and cannot appear more than oncein any single program or include file. The syntax:

PROGRAM_NAME = ‘program name’

Pulse

This keyword turns on a channel or variable for a certain amount of time pre-determined by Set_Pulse_Time. Once the time elapses, the channel or variableis turned off. The default time period is one half-second. The syntax:

PULSE [device, channel] (* for a channel *)PULSE [variable] (* for a variable *)

See also On, Set_Pulse_Time.

Page 42: Axcess Programming Guide

32 Keyword Reference Unit 1: Basic Programming Reference

Push

The Push keyword is used to specify an action when a channel has had an in-put change from “off” to “on,” such as when a button is pressed. If the channelhas been turned on, the corresponding Push statement is activated. The opera-tion or operations following this Push statement are only executed once afterthe channel is turned on.

Push must be followed by a device number and a particular channel, andboth are enclosed in brackets. Variables can be used in their places, but this isdone only in special circumstances. Following the Push statement is the opera-tion to be executed when the Push occurs. If more than one event must happen,a compound statement must follow the Push. The syntax:

PUSH[device,channel]{

(* Statement *)}

In addition, multiple Push statements can be specified to execute the sameaction. For example:

PUSH[TOUCH_PANEL,1]PUSH[RADIO,64]{

(* Statement *)}

See also Push_Channel, Push_Device, Release, To.

Push_Channel

Push_Channel is a system variable containing the number of the channel thatwas just turned on due to an input change. This variable is set when the chan-nel is turned on, and it remains constant for one pass through mainline.

See also Push, Push_Device, Release_Channel.

Push_Device

Push_Device is a system variable containing the number of the device having achannel turned on due to an input change. This variable is set when a channelis turned on, and it remains constant for one pass through mainline.

See also Push, Push_Channel, Release_Device.

Page 43: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 33

Random_Number

This keyword returns a random number in the range of zero ≤ X < a specifiedmaximum number. The random number generated can be zero but not themaximum number. For example:

X = RANDOM_NUMBER (1Ø)

The variable X will be assigned a value between zero and nine inclusive.

Redirect_String

This keyword tells the Master Card to pass all strings from device 1 to device 2,and all strings from device 2 to device 1. This is called a redirection, and you canassign up to eight of them at one time. Here is the syntax:

REDIRECT_STRING (entry number 1–8, device 1, device 2)

The entry number references a particular redirection. To cancel a redirection,use the corresponding entry number and place zeros in the device number lo-cations in the parameters.

Redirections are lost if the system power is turned off.Note: This keyword is only useful in limited situations.

Release

The Release keyword is used to specify an action when a channel has had aninput change from “on” to “off,” such as when a button is released. If the chan-nel has been turned off, the corresponding Release statement is activated. Theoperation or operations following this Release statement are only executedonce after the channel is turned off.

Release must be followed by a device number and a particular channel, andboth are enclosed in brackets. Variables can be used in their places, but this isdone only in special circumstances. Following the Release statement is the op-eration to be executed when the Release occurs. If more than one event musthappen, a compound statement must follow the Release. In addition, multipleRelease statements can be specified to execute the same action.

See also Push, Release_Channel, Release_Device.

Redirection

A command that tells

AXCESS to pass all strings

from one device to another,

and vice versa.

Page 44: Axcess Programming Guide

34 Keyword Reference Unit 1: Basic Programming Reference

Release_Channel

Release_Channel is a system variable containing the number of the channelthat was just turned off due to an input change. This variable is set when thechannel is turned off, and it remains constant for one pass through mainline.

See also Push_Channel, Release, Release_Device.

Release_Device

Release_Device is a system variable containing the number of the device hav-ing a channel turned off due to an input change. This variable is set when achannel is turned off, and it remains constant for one pass through mainline.

See also Push_Device, Release, Release_Channel.

Remove_String

This keyword finds and removes a specified sequence of characters in a specifiedstring array. All characters up to and including the sequence are removed. Theremaining characters in the string array move up to fill in the space. If the stringis not found, a null string is returned. The returned value is an array. The syntax:

result = REMOVE_STRING (string array, sequence of characters,starting position of search)

For example:

Y = ‘ABCDEF’X = REMOVE_STRING (Y,‘CD’,1)(* X is ‘ABCD’ *)(* Y is ‘EF’ *)

See also Find_String, Left_String, Mid_String, Right_String.

Restart_All_Wait

This keyword resumes all Waits in the Wait list that have been previouslypaused. This keyword works with both named and unnamed Waits.

See also Pause_All_Wait, Pause_Wait, Restart_Wait, Wait.

Page 45: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 35

Restart_Wait

This keyword resumes a specified Wait that was paused previously with aPause_Wait keyword. This keyword only works with named Waits. The syntax:

RESTART_WAIT ‘name of Wait’

See also Pause_All_Wait, Pause_Wait, Restart_All_Wait, Wait.

Right_String

This keyword returns a specified number of characters from a specified stringarray starting from the end of the string array. The length value of the arraymust be greater than zero, and the returned value is an array. The syntax:

result = RIGHT_STRING (string array, number of characters)

See also Find_String, Left_String, Mid_String, Remove_String.

Select...Active

The Select...Active statement allows the easy placement of several branchesfrom one path.

This is the syntax:

SELECT{

ACTIVE (expression 1) : (* Statement 1 *)ACTIVE (expression 2) : (* Statement 2 *)ACTIVE (expression 3) : (* Statement 3 *)(* ...etc. *)

}

Each one of the expressions, in order, is evaluated until one is found to betrue. The statements associated with that true expression are then executed, andthe path then flows to whatever statements follow the closing brace. Using aSelect...Active is much preferred to multiple If...Else If statements; it uses lessmemory and it runs faster.

See also If.

Page 46: Axcess Programming Guide

36 Keyword Reference Unit 1: Basic Programming Reference

Send_Command

This keyword sends device-specific commands to an AXCESS device. See Chap-ter 10 for lists of these commands. The syntax:

SEND_COMMAND card’s device name, ‘card command’

See also Send_String.

Send_Level

This device-specific keyword sends a value to a specific level of an AXCESS de-vice. The syntax:

SEND_LEVEL device, level number, variable

See also Create_Level, Define_Connect_Level.

Send_String

This device-specific keyword sends a string to an AXCESS device. In some cases,a sequence of strings can be interpreted as a command by the device. See Chap-ter 10 for these instances.

The syntax:

SEND_STRING device, ‘string’

See also Send_Command.

Set_Length_String

This keyword sets the length value of an array to a specified value. The lengthvalue of an array is used by several of the AXCESS string operation keywords.The syntax:

SET_LENGTH_STRING (string array, number)

See also Find_String, Left_String, Length_String, Mid_String, Remove_String,Right_String.

Page 47: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 37

Set_Pulse_Time

To set the length of time for Pulse, use the keyword Set_Pulse_Time. Time ismeasured in tenths of seconds, and the AXCESS default is one half-second. ThePulse time remains the same value until it is changed within the program. Hereis an example of Set_Pulse_Time:

SET_PULSE_TIME(12)

This sets the current duration of Pulses to 1.2 seconds.

See also Get_Pulse_Time, Pulse.

Set_Timer

This keyword resets the system timer to a specified number between zero and65,535. The timer increments by one every one-tenth second. The syntax:

SET_TIMER (number)

See also Get_Timer.

System_Call

This keyword is similar to the Call keyword, except that the subroutine residesin a special file called a library file. When this keyword is used, the compilergenerates a Call to the subroutine in the library file and automatically includesthe library file for compilation. The library file is actually compiled after themain program file is compiled. See Chapter 20 of the AXCESS Language Tutorialfor a thorough description of library files and System_Calls.

See also Define_Call, Include.

Time

The system variable Time returns the current time in the form of the stringHH:MM:SS, in which HH equals “hours,” MM equals “minutes,” and SS equals“seconds.” The time is given in a 24-hour format (military time). For example:

IF (TIME = ‘12:ØØ:ØØ’){

(* These statements are executed at noon *)}

Page 48: Axcess Programming Guide

38 Keyword Reference Unit 1: Basic Programming Reference

The wildcard character “?” allows string comparisons.

See also Date, Day, _ _Time_ _.

_ _Time_ _

At compile time, this keyword is replaced by a string (HH:MM:SS) that containsthe time of compilation. For example:

(* The program was compiled at 1:14:23 PM *)

SEND_STRING Ø, _ _TIME_ _

The string ‘13:14:23’ is sent to device 0.

See also _ _Date_ _, Time.

To

The To keyword is used to activate a channel or variable for as long as the cor-responding device-channel of its Push statement is activated. When the device-channel referenced by the Push statement changes from off to on, the To startsactivating the device-channel or variable in the brackets following it. When thedevice-channel of its Push is released, the To statement stops activating its de-vice-channel or variable. For this reason, To must be found only underneath aPush statement.

The To keyword has several conditions:

• It must be used only below a Push statement.

• It cannot be used with the Wait keyword.

• It cannot be placed within the Define_Start section.

The channel or variable will act under the rules set by Define_Latching,Define_Mutually_Exclusive, and Define_Toggling.

See also Define_Latching, Define_Mutually_Exclusive, Define_Toggling, Off,On, Push.

Total_Off

This keyword turns a channel or variable off. It is not the same keyword as Off,however; Total_Off also turns off the status of a channel or variable that is in amutually exclusive set.

Page 49: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 39

The syntax:

TOTAL_OFF [device, channel] (* for a channel *)TOTAL_OFF [variable] (* for a variable *)

See also Off.

Upper_String

This keyword changes all the alphabetic characters in a string to uppercase.Only the number of characters specified by the length value of the string areconverted. The returned value is an array. The syntax:

result = UPPER_STRING (string)

See also Lower_String.

Wait

The Wait keyword is used to activate functions after a specified delay time haselapsed. The program flow does not stop when a Wait is encountered. Instead,AXCESS places the Wait statement into a list in memory and continues on withthe rest of the program. After each pass through mainline, the Master Cardscans this Wait list, and if any Waits have expired, AXCESS executes the state-ment or compound statement immediately following the expired Wait key-word. Up to 50 Waits are allowed in the list at a time. (Refer to the completediscussion of mainline and the AXCESS bus in Chapter 1.)

Time in the Wait list is measured in tenths of a second. A Wait of 10 is onesecond, a Wait of 15 is one and a half seconds, a Wait of 20 is two seconds, andso on. The syntax:

WAIT time ‘optional name’{

(* Statements to be executed after time is up *)}

See also Cancel_All_Wait, Cancel_Wait, Pause_Wait, Restart_Wait, Wait_Until.

Page 50: Axcess Programming Guide

40 Keyword Reference Unit 1: Basic Programming Reference

Wait_Until

The Wait_Until keyword is not a “timing” keyword; AXCESS does not wait for acertain amount of time to elapse. Instead, AXCESS checks to see if a condition istrue. When the condition becomes true, AXCESS executes the statements listeddirectly below the Wait_Until statement.

All Wait_Untils go into another list very similar to the Wait list, called theWait_Until list. Just as it does with Waits, after each pass through mainlineAXCESS checks to see if any Wait_Until conditions have become true. For eachone that has, AXCESS immediately executes the sequence below the Wait_Until

statement. If not, AXCESS keeps the Wait_Until in the Wait_Until list until itscondition becomes true. The format:

WAIT_UNTIL (condition) ‘optional name’{

(* Statements to be executed when condition becomes true *)}

See also Cancel_Wait_Until, Wait.

#Warn

This compiler directive keyword forces a warning message to be displayed af-ter the program is compiled. It primarily serves to remind the user of certainconditions that were placed in the program. For example:

#WARN ‘This is obsolete code’

While

When AXCESS comes to a While, it checks to see if the condition following it istrue. If the condition is false, AXCESS skips the statement immediately followingthe While—just like the If keyword. However, if the condition is true, AXCESS

executes the statement and then rechecks the While’s conditional expression. Ifthe condition is still true, the statement is executed again.

This sequence continues until the condition is evaluated as false. When thecondition comes up false, program execution continues with the statement fol-lowing the While’s block of code. Here is the syntax:

WHILE (condition){

(* Statements *)}

Page 51: Axcess Programming Guide

Unit 1: Basic Programming Reference Keyword Reference 41

There is a limitation on using the While keyword. The amount of timeAXCESS spends executing any single While cannot exceed one half-second. Thisis because the Master Card updates AXlink between each pass through main-line. If AXlink is not updated at certain time intervals, problems could developduring bus communications. Therefore, to prevent an AXCESS program fromstalling mainline too long, there is a half-second time-out on While loops; thatis, AXCESS will forcibly exit the While after one half-second, regardless of theoperation it is executing. (Remember, Waits are checked after mainline andthus are not subject to such restrictions.)

See also If, Long_While, Medium_While.

Xor (^^)

The logical operator Xor is used to evaluate two conditions. One and only oneof the conditions can be true for the entire expression to be true. Xor is usuallyused in If statements to check for a single true condition.

For example:

IF ((X = 3) XOR (Y = 1)){

(* These statements are executed if only one of the aboveconditions is true *)

}

See also And, Not, Or.

Page 52: Axcess Programming Guide
Page 53: Axcess Programming Guide

Unit 1: Basic Programming Reference Operator Types 43

C H A P T E R

4

Operator Types

Changing and comparing values

Frequently within your AXCESS program, you will need to increase the value ofa variable, see if that variable has reached a certain value, or compare differentvalues to each other. The tools that you use to perform these tasks are calledoperators, and there are four types available in AXCESS: arithmetic, relational,logical, and bitwise. This chapter explains each type of operator and illustrateshow they work in conjunction with each other.

Arithmetic operators

Arithmetic operators create a numeric value from one or more operations such asaddition, multiplication, and division. These operators appear in Figure 1-4.

Here is an example of arithmetic operators in an AXCESS program:

X = 7 + 5Y = X * 3

As you may have guessed, X is equal to 12 and Y is equal to 36.There is an order of precedence for arithmetic operators; that is, some opera-

tions are performed first and others second. See Figure 1-11 later in the chapterfor the precedence of operators within AXCESS. For example, notice that multi-plication operations (*) are performed before addition operations (+).

Figure 1-4

A list of the arithmetic

operators available within

AXCESS.

Arithmetic operators

Symbol Function

+

Symbol

/ Divide

Function

Add

– Subtract

* Multiply

% Modulo (the result is theremainder after division)

Arithmetic operators

Operators within AXCESS

that create a numeric value

from one or more operations

such as addition, multiplica-

tion, and division.

Page 54: Axcess Programming Guide

Operator Types Unit 1: Basic Programming Reference44

Here is a sample line of code that illustrates this precedence:

X = 7 + 5 * 3

If you read this expression left to right, X is equal to 36. Since multiplicationtakes precedence, however, X is equal to 22 (5 * 3 is 15; 7 + 15 is 22).

Precedence will be explained in greater depth at the end of this chapter.

Relational operators

The second type of operators, relational operators, compares two numeric valuesand produces a true or false result. These operators appear in Figure 1-5.

Here is an example of these operators in practice:

X = 12Y = 15

IF (X > Y)(* Statement 1 *)

ELSE(* Statement 2 *)

Notice that the result of the expression (X > Y) determines the path thatAXCESS takes. Since X is less than Y, Statement 1 is bypassed and Statement 2 isexecuted. You do not have to specify two paths, however; if there is no Else

present, AXCESS will simply skip the statement or compound statement under-neath the false relational expression.

Before you read any further, you should understand what “true” and “false”really mean. When a condition or expression is evaluated as “true,” it is giventhe value of 1; if the condition or expression is “false,” it is given the value ofzero. When AXCESS encounters an If, it continues to the next statement onlywhen the result of the If statement is a non-zero value. Otherwise, AXCESS ig-nores the statement directly under the If statement.

Figure 1-5

A list of the relational

operators available within

AXCESS.

Relational operators

Symbol

< Less than

>

=

Function Symbol Function

<=

Greater than

Equal to

Less than or equal to

>= Greater than or equal to

<> Not equal to

Relational operators

Operators within AXCESS

that compare two numeric

values and produce a true

or false result.

Page 55: Axcess Programming Guide

Unit 1: Basic Programming Reference Operator Types 45

It is possible, then, to assign a relational expression to a variable. For example:

X = 9Z = (X > 5)

IF (Z)(* Statement 1 *)

In this case, Z will be equal to 1 since the expression (X > 5) is true. As aresult, the following If statement is also true and AXCESS executes Statement 1.

Only one relational operator should appear within a set of parentheses; twoor more of these operators can produce unexpected results. For example:

X = 5

IF (1Ø > X > 3)(* Statement 1 *)

Is Statement 1 going to be executed? According to everyday algebra, the an-swer is yes. However, AXCESS interprets the expression (1Ø > X > 3) differ-ently. First, 1Ø > X is evaluated. Since this is true, AXCESS assigns this part avalue of 1 (remember that “1” means “true”). Finally, 1 > 3 is evaluated. Sincethis is false, Statement 1 is not executed.

Since you cannot compare X to two different values in this manner, youshould a logical operator, which is described next.

Logical operators

Logical operators, or Boolean operators, are similar to relational operators in thatthey produce a true or false result. Instead of using greater than or less thansigns, however, logical operators use keywords that have different rules. Theseoperators and their corresponding rules are as follows:

• And Both conditions must be true for the result to be true.

• Or At least one of the conditions must be true for the result to be true.

• Xor Only one condition can be true for the result to be true.

• Not This keyword uses only one condition. If this condition is true, theresult is false; if the condition is false, the result is true.

Logical operators

Operators within AXCESS

that compare two conditions

or, in the case of Not, invert

one condition. A true or false

result is produced. These

operators are also known as

Boolean operators.

Page 56: Axcess Programming Guide

Operator Types Unit 1: Basic Programming Reference46

And

T

F

T

F

T

F

T T

Logical operator

The first condition (X = 5) is true

The second condition(Y = 4) is false The result of the expression is false

Figure 1-8

An example of how a logical

expression table is used to

compare two conditions.

Not

T

F

F

T

T

F

T FXor

T

F

F

T

T

F

T FOr

T

F

T

T

T

F

T FAnd

T

F

T

F

F

F

T FFigure 1-6

Tables of results of various

logical expressions.

The tables in Figure 1-6 provide a quick reference guide for the results of alogical expression. Figure 1-7 offers a pictorial explanation of the And table,and the following example demonstrates its use.

X = 5Y = 1

IF ((X = 5) AND (Y = 4))(* Statement 1 *)

ELSE(* Statement 2 *)

See Figure 1-8. Since both (X = 5) and (Y = 4) are not true, the result of theexpression is false and Statement 2 is executed. If both conditions had beentrue, Statement 1 would be executed instead.

Figure 1-7

A pictorial explanation of the

logical expression table of

the operator And.

And

T

F

T

F

F

F

T F

Logical operator

Possible results of the first condition

Possible results ofthe second condition

Results of the expression based upon rules set by the logical operator

Page 57: Axcess Programming Guide

Unit 1: Basic Programming Reference Operator Types 47

Not is used differently than the other logical operators since it only requiresone condition. For example:

IF (NOT(X = 5))X = X + 1

ELSEX = Ø

In this case, X acts like a counter. If X does not equal 5, its value is increasedby one. Eventually X will equal 5, and the Else statement will set it back to zero.

Unlike relational operators, logical operators can appear more than once inan expression. For example:

X = 2Y = 7Z = 12

IF ((X = 2) AND (Y > 4) OR (Z <= 8))(* Statement 1 *)

There is also an order of precedence among the logical operators, and this islisted in Figure 1-11 later in the chapter. Since the operators And and Or havethe same precedence, And is evaluated first since it appears first. Both (X = 2)and (Y > 4) are true, so the result of this part of the expression is true. If youtreat this part as one unit, you can see that its result is actually the first condi-tion of the Or operator. Although the second condition (Z <= 8) is false, theentire expression is true since Or requires only one condition to be true. As aresult, Statement 1 is executed.

Precedence will be explained in greater depth at the end of this chapter.

Bitwise operators

Bitwise operators perform the same logical operations mentioned earlier, but ona bit-by-bit basis. These operators are Band, Bor, Bxor, and Bnot—similar tothe logical operators. For instance, the keyword Band performs a logical And

operation between two bytes on a bit-by-bit basis. Instead of producing a trueor false result, bitwise operations form a new byte.

Here is an example:

X = $A1 BAND $8A

Bitwise operators

Operators within AXCESS

that perform bit-by-bit logi-

cal operations on one byte

or between two bytes.

Page 58: Axcess Programming Guide

Operator Types Unit 1: Basic Programming Reference48

1 0

The result is true, which has a value of 1

1 0 0 0 0 1

1 0 0 0 1 0 1 0

1 0 0 0 0 0 0 0

And

$A1

$8A

$80

Figure 1-9

Band applies the logical

operator And on a bit-by-bit

basis. Since both bits are

“true” in the first location,

the resulting bit is also “true.”

Logical and bitwise operator abbreviations

Abbrev

&& Logical And

| |

^^

Function

!

Abbrev

& Bitwise And (Band)

|

^

Function

~

Logical Or

Logical Xor

Logical Not

Bitwise Or (Bor)

Bitwise Xor (Bxor)

Bitwise Not (Bnot)

Figure 1-10

The logical and bitwise

operators in AXCESS have

shorthand symbols which

can be used in place of the

keywords.

The variable X now equals $80 (see Figure 1-9). The And operation is appliedto the first bit of each value (1 and 1), setting the first bit of the result to 1. Thisis done again for each bit of the values, producing a new byte.

Abbreviations

Instead of typing AND and BNOT in your programs, you can use some abbrevia-tions for the logical and bitwise operators. For example, the characters && cantake the place of AND, and ~ can replace BNOT. The choice is up to you—one wayis easier to read, and the other is faster to type. See Figure 1-10 for a complete list.

Precedence among operators

There is an order of precedence among all of the operators, as shown in Figure1-11. Operators with higher precedence are evaluated before those with lowerprecedence. For example, multiplication operations (*) are performed beforethe Band bitwise operation.

Page 59: Axcess Programming Guide

Unit 1: Basic Programming Reference Operator Types 49

Operator precedence

Level

1 (highest) Not Bnot

2

3

Operators

* / %

+ –

4

5

6 (lowest)

< <= > >= = <>

Band Bor Bxor

And Or Xor

If the operators are within the same level of precedence, the equation is sim-ply solved from left to right. For example:

X = 12 / 3 * 5

Since multiplication does not take higher precedence over division (they areboth in level 2), X is equal to 20.

If you need to manually establish precedence for a certain operation, use pa-rentheses to enclose the operation. Multiple levels of precedence can be createdwith more parentheses. For example:

X = ((4 + 6) / (2 + 3)) + 1

The first operations that are solved are (4 + 6) and (2 + 3), since these op-erations are enclosed by the innermost parentheses. Next, 10 is divided by 5 inthe second level of parentheses. Finally, 1 is added, making X equal to 3.

As you can see, equations involving parentheses can become complex throughmany different levels of precedence. Keep in mind, however, that the numberof left parentheses “(“ must equal the number of right parentheses “)”. Other-wise, the order of precedence may not work in the way intended.

Figure 1-11

The order of precedence

among operators within

AXCESS.

Page 60: Axcess Programming Guide
Page 61: Axcess Programming Guide

Unit 1: Basic Programming Reference Hexadecimal ASCII Chart 51

Hexadecimal ASCII Chart

How to use this chart

The chart in Figure 1-12 displays the hexadecimal values for all ASCII charac-ters. Since some of the entries are abbreviated (for example, LF is short for “linefeed”), the entire command for each abbreviation is listed in Figure 1-13.

In order to find the value for a character, locate the character on the chart.Follow its column to the top to get the first hexadecimal digit. Next, follow itsrow to the left to get the second hexadecimal digit. The combination of the twodigits is the hexadecimal ASCII value.

For example, the hexadecimal ASCII value of the letter “K” is needed. Its col-umn is 4, and its row is B. Therefore, the value of the character is $4B. (The dol-lar sign indicates that the value is hexadecimal.)

In order to find the character or function from its hexadecimal value, simplycross-reference the column and row number.

C H A P T E R

5

0

1

2

3

4

5

6

7

8

9

A

B

C

D

E

F

NUL

SOH

STX

ETX

EOT

ENQ

ACK

BEL

BS

HT

LF

VT

FF

CR

SO

SI

DLE

DC1

DC2

DC3

DC4

NAK

SYN

ETB

CAN

EM

SUB

ESC

FS

GS

RS

US

SP

!

"

#

$

%

&

'

(

)

*

+

,

.

/

0

1

2

3

4

5

6

7

8

9

:

;

<

=

>

?

@

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

[

\

]

^

_

`

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

p

q

r

s

t

u

v

w

x

y

z

{

|

}

~

DEL

0 1 2 3 4 5 6 7Figure 1-12

In this chart, the column

number is the first hexa-

decimal digit, and the row

number is the second.

Page 62: Axcess Programming Guide

52 Hexadecimal ASCII Chart Unit 1: Basic Programming Reference

Abbreviations in the chart

NUL

SOH

STX

ETX

EOT

ENQ

ACK

BEL

BS

HT

LF

VT

FF

CR

SO

SI

DLE

Null

Start of heading

Start of text

End of text

End of transmission

Enquiry

Acknowledge

Bell

Backspace

Horizontal tab

Line feed

Vertical tab

Form feed

Carriage return

Shift out

Shift in

Data link escape

DC1

DC2

DC3

DC4

NAK

SYN

ETB

CAN

EM

SUB

ESC

FS

GS

RS

US

SP

DEL

Device control 1

Device control 2

Device control 3

Device control 4

Negative acknowledge

Synchronous idle

End transmission block

Cancel

End of medium

Substitute

Escape

File separator

Group separator

Record separator

Unit separator

Space

Delete

Figure 1-13

A list of the abbreviations

used in the hexadecimal

ASCII chart.

Page 63: Axcess Programming Guide

UNIT 2

ELIMINATINGERRORS

AXCESS Programming Guide

Page 64: Axcess Programming Guide
Page 65: Axcess Programming Guide

Unit 2: Eliminating Errors 55Debugging

Debugging

Introduction

No programs are ever written without any errors on the first try, and one of themost time-consuming parts of programming is debugging. This chapter willdescribe the various types of errors and bugs common to AXCESS program-ming, and then it will introduce some techniques in solving these problems.

Types of errors

There are three general types of programming roadblocks:

• Compilation errors

• Run-time errors

• Logic errors

Compilation errors are errors that occur at compile time. The AXCESS compileralerts you to these errors immediately and identifies each error and the linewhere it is located. Run-time errors occur after the program has been compiledand loaded into the Master Card. These errors are due to program statementsthat attempt illegal operations. Logic errors are errors in program design andthus are the programmer’s responsibility; AXCESS cannot tell if the program it isexecuting is accomplishing what the user intends.

Compilation errors and warnings

When the compiler finds an error during the compilation process, it informs theprogrammer. Most of the time these errors occur due to a typographical erroror because the programmer is not familiar with the syntax of a particular com-mand. See Chapter 7 for explanations of these errors.

Sometimes the compiler generates a warning message instead of an errormessage; these warning messages always start with “(w).” A warning about aparticular statement is the compiler’s way of saying, “This is not an error, butbe careful doing it.” Some warnings can be disabled using the “Options...”menu selection in the AX File menu. This displays a window where the user canenable and disable the generation of several warning messages. The followingis a list of the various warning messages and a brief description of each.

Compilation errors

Errors that occur at

compile time.

Run-time errors

Errors that occur during

program execution.

Logic errors

Errors in the actual design

of the program.

C H A P T E R

6

Page 66: Axcess Programming Guide

56 Unit 2: Eliminating ErrorsDebugging

(w) Cannot assign unlike types

This warning occurs when a variable or value of one type is assigned to a vari-able of a different type. Here are some examples:

• Assigning a string literal, string expression, or array to a non-array variable

• Assigning a non-array variable to an entire array

• Assigning an integer array to a non-integer array

• Assigning a two-dimensional array to a one-dimensional array, or vice versa

• Assigning the result of a function that returns an array type to a non-arrayvariable or to a two-dimensional array variable (for example, X = ITOA(12),where X is a non-array variable or two-dimensional array variable)

• Assigning the result of a function that returns a non-array type to a one- ortwo-dimensional array variable (for example, X = ATOI(‘AMX’), where X isa one- or two-dimensional array variable)

This message is a warning and not an error because X = ITOA(12) workscorrectly when X is a simple variable, since the result is a single value betweenzero and 255. The generation of this warning can be turned on or off with the“Options...” selection in the AX File menu.

(w) Define_Call is not used

This warning occurs at the end of program compilation for each Define_Callsubroutine that was declared but never used. The generation of this warningcan be turned on or off with the “Options...” selection in the AX File menu.

(w) Integer applies to arrays only

This warning appears when the keyword Integer is applied to a non-array typeof variable. Doing this is not an error because non-array variables are alreadyintegers, but its use is redundant.

(w) Long_While within While

This warning occurs if the compiler notices a Long_While or Medium_While

inside a block of code following a While keyword. This warning exists becausethe While command has a half-second timeout period, and the Long_While andMedium_While keywords do not. This could possibly create a hard-to-findlogic error, so change the While to a Long_While to fix this problem.

(w) Possibly too many nested levels

This warning appears if there is a large amount of nesting in the program. Thiscan happen with a long chain of If...Else If statements. In this case, the Select...

Active set of statements is preferred.

Page 67: Axcess Programming Guide

Unit 2: Eliminating Errors 57Debugging

(w) Variable is not used

This warning occurs at the end of program compilation for each variable thatwas declared but never used. The generation of this warning can be turned onor off with the “Options...” selection in the AX File menu.

Run-time errors

Many times, a program can be compiled and sent to the Master Card error-free,but the system does not act in the way it should. If the program code looksright, it’s time to check for run-time errors. These errors occur in the MasterCard, usually when it could not perform a particular operation in the program.

Normally, there is no way to tell if or what type of run-time error occurs.However, the Master Card can be placed in a special debugging mode. In thismode, the Master Card sends run-time error messages through its RS-232 port asthey occur. Using the terminal emulator in AXCESS, you can see what, if any,run-time errors are happening. To turn this mode on, type the following com-mand in the terminal emulator while on-line with the Master Card:

AMX BUG

The following is a list of some common run-time error messages you may seewhile this mode is on. An ellipsis after the message indicates that there is agroup of messages that have the same beginning. For instance, “BAD TO...” re-fers to the set of errors “BAD TO VARIABLE” and “BAD TO CHANNEL.”

Bad assign 2dim...

These errors occur if an attempt is made to assign a two-dimensional array to adifferent type (such as a variable or one-dimensional array), and vice versa.

Bad assign Call...

These errors occur if the Master Card cannot assign a parameter in a Call state-ment to the parameter in the corresponding Define_Call statement.

Bad element assign...

These errors occur if an assignment is attempted past the end of an array, or tothe “zero” location of an array (for example, ARRAY[Ø]).

NOTE

When the debugging mode

is turned on using the AMX

BUG command, we some-

times say “AMX BUG is on.”

Page 68: Axcess Programming Guide

58 Unit 2: Eliminating ErrorsDebugging

Bad Off...Bad On...Bad To...

These errors indicate that the device-channel or variable that is being refer-enced by a Off, On, or To keyword is out of range.

Bad re-assign Call...

These errors occur when the Master Card attempts to re-assign the parametervariables in a Define_Call to the parameters in the corresponding Call state-ment, and the assignment cannot be made.

Bad run token

This error occurs when the Master Card simply does not understand a piece ofdata in the program it is executing. Most likely your Master Card version needsto be updated.

Bad Set_Length...

These errors occur if the Set_Length_String keyword tries to set the lengthvalue of an array to a value greater than the array’s storage capacity.

Bad While

This error occurs whenever a While loop terminates due to the half-secondtimeout imposed on While loops.

Tracking down your errors

Finding run-time errors and logic errors can sometimes be difficult. Observingthe values of variables during program execution, following program flowthrough conditional statements, and finding the locations of run-time errors arenot easy tasks. However, there are some tools to help in your debugging.

Tracing program flow

Many times, you may want to know if or when your program reaches a certainpoint. By using the Send_String keyword, you can send a message to yourcomputer when it reaches a particular section of code. When a string is sent todevice 0, the information is sent from the Master Card’s communications port.

NOTE

Using the Master Card in this

way is only useful in debug-

ging. The Master Card cannot

control devices through its

communications port.

Page 69: Axcess Programming Guide

Unit 2: Eliminating Errors 59Debugging

Here is an example:

IF (X = Y){

SEND_STRING Ø,“‘X EQUALS Y!’, $ØD, $ØA”}ELSE{

SEND_STRING Ø,“‘X DOES NOT EQUAL Y!’, $ØD, $ØA”}

In this small example, you can observe at run time which branch the pro-gram takes by viewing the message sent out of the Master Card’s communica-tions port. This technique is also helpful in locating run-time errors. By sendingmessages before and after suspected code, you can determine if the code con-tains any bugs. Here is an example:

DEFINE_VARIABLEARY[1Ø]X

DEFINE_PROGRAM

X = 11SEND_STRING Ø, ‘BEFORE...’ARY[X] = 123 (* This will cause an error *)SEND_STRING Ø, “‘...AFTER’, $ØD, $ØA”

The resulting output from the Master Card would look like this (assumingthat AMX BUG has been turned on):

BEFORE...BAD ELEMENT ASSIGN BYTE ARRAY...AFTER

By using the Send_String statements, you can determine that the array as-signment is causing the run-time error message. While the error in this exampleis obvious, in more complex programs the error may not be. In these cases, thisdebugging technique can prove to be invaluable.

Page 70: Axcess Programming Guide

60 Unit 2: Eliminating ErrorsDebugging

F1-Add F2-Delete F3-Current Len F4-Total Len F5-Set VarF7-Step Mode F8-Step Step Mode OFF

Variable Watches

RESULT = 4 ($4)STRING (4) = 'FOUR'

This display represents the speed at which AXCESS is passing through mainline

Decimal value

Hexadecimal value

String length

Figure 2-1

The variable watch window.

Viewing variables

There are two ways to view the values in variables as a program is executed.You can use the SEND_STRING Ø method to display a variable’s value at certainpoints in a program, or you can use the “variable watch” window.

The variable watch window is accessed through the Diagnostics menu, and itcan only be activated if there is a compiled program loaded in the computerand Master Card. Figure 2-1 displays the variable watch window.

The variable watch window allows you to view the contents of up to tenvariables at a time. The window is updated after each pass through mainline;therefore, the displayed value of a variable is its value at the end of mainline.The bottom of the window lists the actions of some function keys and displaysa “speedometer” that is updated on each pass through mainline. Here is a sum-mary of the available functions:

• The arrow keys move the highlight bar in the window, allowing you toselect which variable to modify or delete.

• <F1>: Adds a variable to watch. Only simple variables, one-dimensionalarrays, and the rows of a two-dimensional array can be viewed. The <Ins>key also activates this function.

• <F2>: Deletes the currently selected variable from the window. The <Del>key also activates this function.

Page 71: Axcess Programming Guide

Unit 2: Eliminating Errors 61Debugging

• <F3>: Sets the viewing mode for arrays to the “current” length: the numberof locations that are displayed is determined by the current length value ofthe array.

• <F4>: Sets the viewing mode for arrays to the length defined in the Define_

Variable definition section: all of the locations of the array are displayed,regardless of the current length value of the array.

• <F5>: Allows you to change the value of the currently selected variable.

• <F7>: Toggles the “step” mode between “run” and “single step” mode. Inrun mode, the system program is executed normally in the Master Card. Insingle step mode, program execution is suspended between each passthrough mainline.

• <F8>: In step mode, this key causes mainline to be executed once. This keyonly functions in step mode.

Page 72: Axcess Programming Guide
Page 73: Axcess Programming Guide

Unit 2: Eliminating Errors Compiler Error Messages 63

C H A P T E R

7

Compiler Error Messages

Compilation errors

This chapter describes all of the messages that can occur when there is an errorduring the compilation of your program. Unlike other types of warnings, theseerrors must be corrected before your AXCESS program can be executed.

A “<symbol>” was expected

The compiler is expecting a certain symbol at this particular place.

Active keyword expected

An Active keyword is not present after a Select keyword.

Allowed only in Define_Start

A keyword that is only allowed to appear in the Define_Start section of theprogram was encountered elsewhere.

Attempted Call to undefined subroutine

A Call statement refers to a subroutine that has not been defined with aDefine_Call statement.

Comment never ends, EOF encountered

A comment begins but never ends. Place a “*)” at the end of the unfinishedcomment. (“EOF” means “end of file.”)

Conditional compile nesting too deep

There are too many nested #If_Defined or #If_Not_Defined conditional compi-lation statements. The limit is 20 nested conditional compilation statements.

Constant type not allowed

A constant value was declared as latching, toggling, or mutually exclusive like so:

DEFINE_CONSTANTPLAY = 1

DEFINE_LATCHINGPLAY (* Error: PLAY is a constant *)

Page 74: Axcess Programming Guide

64 Compiler Error Messages Unit 2: Eliminating Errors

Define_Call must have a name

Define_Call must have a name after it. For example, DEFINE_CALL ‘VHS’.

Define_Call name already used

The name of the Define_Call has already been used. This name cannot be thesame as an already declared identifier of any type.

Device values must be equal

In a range specification, the devices (or their defined identifiers) must be equal.For example, ([1,1]..[1,5]) is valid; ([1,1]..[2,5]) is not.

Duplicate symbol

Duplicate definitions of variables or constants are found. All variables and con-stants must have unique identifiers.

Evaluation stack overflowEvaluation stack underflow

The expression is too complicated. Try breaking it up into smaller pieces.

Identifier expected

The compiler is expecting an identifier after a #Define statement or after an In-

teger declaration in the Define_Variable section.

Identifier is not an array type

A non-array variable was treated as an array.

Include file not found

An Include statement was encountered, but the specified include file could notbe found.

Invalid include file name

A string literal enclosed in single quotes must follow the Include keyword.

Library file not found

The library file containing the specified System_Call could not be found.

Maximum string length exceeded

String literals are limited in length to 132 characters, including spaces.

Page 75: Axcess Programming Guide

Unit 2: Eliminating Errors Compiler Error Messages 65

Must be char array reference

An array type variable was expected in Create_Buffer, Create_Multi_Buffer, orClear_Buffer.

Must be integer reference

The identifier in question must be an integer. This error occurs when the thirdparameter of Create_Level is an array or array element.

Out of memory

The compiler has run out of memory. Free up memory either by removing anypop-up programs or drivers, by using extended memory, or by breaking yourprogram into one or more include files.

Parameter mismatch in Call

A value or variable passed to a Call as a parameter is of the wrong type as de-fined by the Define_Call statement.

Program_Name must be on line 1

Move the PROGRAM_NAME= statement to the first line of the program.

Push/Release not allowed within Push/Release

A Push or Release statement was found within a block of code headed by aPush or Release statement.

Push/Release not allowed within WaitPush_Channel not allowed within WaitRelease_Channel not allowed within WaitPush_Device not allowed within WaitRelease_Device not allowed within Wait

These keywords are not allowed in a section of code which will be executeddue to a Wait keyword.

String constant expected

A string is required for the particular operation. This error occurs if a string lit-eral enclosed in single quotes does not follow the Program_Name keyword.

String constant never ends, EOF encountered

A string literal is started but never ends. Add a closing single quotation mark(’) to the end of the string. (“EOF” means “end of file.”)

Page 76: Axcess Programming Guide

66 Compiler Error Messages Unit 2: Eliminating Errors

String literal expected

A string is required for the particular operation. This error would occur if astring literal enclosed in single quotes does not follow the #Warn keyword.

Subroutine may not call itself

A subroutine cannot call itself. It can, however, call a different subroutine.

Syntax error

A syntax error is found in an expression. In most cases, this error means thatsomething is out of place or misspelled.

System_Call name not same as Program_Name in <file>

This error occurs when a library file is compiled and the name of the subrou-tine in the library file does not match the Program_Name string on the first lineof the file.

This variable type not allowed

This error occurs when an attempt is made to use an array variable withDefine_Latching, Define_Toggling, or Define_Mutually_Exclusive.

To not allowed within Define_StartTo not allowed within mainlineTo not allowed within ReleaseTo not allowed within Wait

These errors occur if the To keyword is found in an erroneous location. The Tokeyword can only be associated directly with a Push statement.

Too few parameters in Call

There are not enough parameters being passed to the subroutine.

Too many include files

A program may only Include up to 20 include files.

Too many parameters in Call

There are too many parameters being passed to the subroutine.

Type mismatch in function call

A function was called with a parameter of the wrong type. For instance, at-tempting to use Itoa with an array as a parameter results in an error.

Page 77: Axcess Programming Guide

Unit 2: Eliminating Errors Compiler Error Messages 67

Undefined identifier

An attempt was made to reference an identifier that has not been defined previ-ously in the program.

Unmatched #End_If

An #End_If keyword was found, but no #If_Defined or #If_Not_Defined waspreviously compiled.

Unrecognized character in input file

An invalid character was found during compilation.

Use System_Call [instance] ‘name’

This error occurs if a System_Call statement is written incorrectly as

SYSTEM_CALL ‘name’ [instance number]

Variable assignment not allowed here

Variables may not be assigned a value when they are defined in the Define_

Variable section.

Wait not found

A statement references a Wait by a name that does not exist. For example,CANCEL_WAIT ‘CASS’ will produce this error if there is no Wait named CASS.

Page 78: Axcess Programming Guide
Page 79: Axcess Programming Guide

UNIT 3

SYSTEM_CALLREFERENCE

AXCESS Programming Guide

Page 80: Axcess Programming Guide
Page 81: Axcess Programming Guide

Unit 3: System_Call Reference 71Factory System_Calls

Factory System_Calls

Introduction

AMX has written a set of System_Calls to provide quick “plug-in” programmingsolutions for types of equipment used on a regular basis. The main goal of theseSystem_ Calls is to maintain a consistent “look and feel” for control panel op-eration, regardless of how a deck behaves from its own remote control. TheseSystem_Calls are divided into several categories which include VCRs, switchers,laser disc players, and more. AMX factory System_Calls follow a standard nam-ing convention, and each System_Call in the same group uses similar parameters.

System_Call format

The syntax of a factory System_Call for a VCR is as follows:

SYSTEM_CALL ‘VCR#’ (CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB,SFWDB, SREVB, RECB, FIRST)

The “#” sign should be replaced by the number of the particular VCR

System_Call you are using.System_Calls can be called one time or multiple times in a program. The for-

mat will change slightly depending upon how many times the System_Call isbeing called in the program. For example, here are the two formats used whencalling most System_Calls:

• A System_Call used once within a program

SYSTEM_CALL ‘VCR1’ (UMATIC,TP,1,2,3,4,5,6,7,8,Ø)

• A System_Call used for more than one deck within a program

SYSTEM_CALL [UMATIC1] ‘VCR1’ (UMATIC1,TP,1,2,3,4,5,6,7,8,Ø)SYSTEM_CALL [UMATIC2] ‘VCR1’ (UMATIC2,TP,1,2,3,4,5,6,7,8,Ø)

C H A P T E R

8

Page 82: Axcess Programming Guide

72 Unit 3: System_Call ReferenceFactory System_Calls

System_Call names

The factory System_Calls have been created and named in-house at AMX. It isnecessary to refer to the complete listing of factory System_Calls to determinewhich one is correct for the unit controlled.

With a few exceptions, factory System_Calls use the following naming con-vention: three letters indicate the type of equipment, and the following numberdistinguishes calls within each type. Nearly all of our old System_Calls havebeen renamed to follow this convention, and these new names are shown inFigure 3-1.

New names for old System_Calls

AUTOPATCH X

AUTOPATCH Y

CASS_5

CASS2_5

CASS3_5

CASS3_5R

CASS4_5R

CD1_5

CD2_5

CD3_5

CD4_4

CD5_5

CD6_5

DO_MACRO

DO TYPEWRITER

FAR END CONTROL

HEDCO16X

INIT DECK

IR_LDV_5

OLD FEEDBACK

PIONEER_LDV_5

PIONEER_LDV_7

PIONEER_LDP1_5

PNRLD1_7

PRODIGY PROGRAMMER

SLIDES

SLIDES_2

SWT1

SWT2 or SWT3

CAS1

CAS2

CAS3

CAS2

CAS3

CDP1

CDP2

CDP1

Obsolete

CDP5

CDP2

Obsolete

Obsolete

Obsolete

SWT4

FUNCTION

CDP1

FEEDBACK

LDP2

LDP2

Obsolete

Obsolete

PRO1

SLD1

SLD1

SLIDES_3

SONY8_5

SONYLD_7

TYPE1_5

TYPE1_5R

TYPE1_7

TYPE1_7R

TYPE2_5

TYPE2_5R

TYPE2_7

TYPE3_5

TYPE3_5R

TYPE3_7

TYPE4_5

TYPE4_5R

TYPE5_5

TYPE5_5R

TYPE5_7

TYPE6_5

TYPE6_7R

TYPE7_5

TYPE8_5

TYPE8_7

UTAH SCI

VOLUME PRESET

VOLUME_2

SLD1

VCR8

LDP1

VCR1

VCR1

VCR1

VCR1

VCR2

VCR2

VCR2

VCR3

VCR3

VCR3

VCR4

VCR4

VCR5

VCR5

VCR5

VCR6

VCR6

Obsolete

VCR8

VCR8

SWT5

Obsolete

VOL1

Old name New name Old name New name

Figure 3-1

Many factory System_Calls

have been renamed with a

new naming convention.

Page 83: Axcess Programming Guide

Unit 3: System_Call Reference 73Factory System_Calls

Parameters

The following paragraphs explain the different types of parameters used in thefactory System_Calls. Notice that not all parameters are used in all types ofSystem_Calls.

CARD parameter

The CARD parameter defines the card in the system that is controlling the de-vice for which the System_Call is being used.

PANEL parameter

The PANEL parameter defines the control panel in the system that theSystem_Call looks to for input.

Button parameters

All button parameters end with a “B,” such as PLAYB. For these parameters,simply pass the button number of the panel that should activate that function.If a particular button does not exist or is not used, pass a zero in its place. Allbutton parameter numbers must be between zero and 255.

The functionality of button parameters will change when they are used forequipment with different functions, such as switchers or slide projectors thatdo not have a need for the button parameters PLAYB or STOPB. This informationis described in detail in the individual System_Call documentation that follows.

FIRST parameter

To fully understand how the FIRST parameter is used, you should realize thatthere is an order for functions used in the AXCESS programming language. AMX

refers to this as the “standard function order,” and it is shown in Figure 3-2.This order must be followed for factory System_Calls to operate correctly.

The FIRST parameter is used as an offset to the location of the Play function inthe controlling device, in case the Play function is not at location 1. If no offsetis needed, pass zero. For example, if Play is not located at position 1 but insteadat position 4 (this is possible with a remote controller that controls multiple de-vices), then pass 4 as the FIRST parameter. If Play is at a different position—such as 4—the order of the functions must be maintained (Stop is at 5, Pause isat 6, and so on) for the System_Calls to work.

The factory System_Calls use high-numbered channels on the controlling cardto store feedback information. If the feedback channels need to be moved, passthe desired first channel into the high byte of FIRST. For example, if PLAY_FB is notneeded at the standard position of 241 but instead at 109, then pass 109*256 inthe FIRST position. The multiplication by 256 shifts the offset into the high byte.

Two bytes = 16 bits

Bits 15 to 8 Bits 7 to 0

High byte Low byte

High byte

A normal variable consists of

16 bits, which is equal to two

bytes. One byte is the high

byte, and the other is the low

byte. (See diagram below.)

Offset

A number used as a

“transparent stepping stone”

for other constants and

variables. These constants

and variables are added to

the offset to access different

functions without changing

their original values.

Page 84: Axcess Programming Guide

74 Unit 3: System_Call ReferenceFactory System_Calls

Standard function order

#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

Play

Stop

Pause, Still

FFwd , AMS, Skip Fwd

Rewind, AMS, Skip Rev

Search Fwd, Scan, Search

Search Rev, Scan, Search

Record

Power, On/Off

0, 10

1

2

3

4

5

6

7

8

9

+10

Enter

Function #

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

Channel Up

Channel Down

Volume Up

Volume Down

Mute

On (usually power)

Off (usually power)

TV/Video, TV/VCR, TV/LDP

TV

Video 1, Line A, VCR 1, VDP, Input +

Video 2, Line B, VCR 2, Input –

Video 3

RGB 1, Tape 1

RGB 2, Tape 2

CD

Tuner

Phono

Aux

AM/FM

Play Reverse

A/B

Function

Figure 3-2

The standard function

order for functions used in

AXCESS. Notice that some

numbers can apply to several

different functions (which are

separated by commas).

The following example shows the proper usage of the FIRST parameter. Sup-pose you are programming an infrared-controlled receiver that has controls forboth a CD player and a cassette deck. The CD player controls are in the standardpositions with Play at position 1, but the cassette deck controls begin with Playat position 43. These two lines could be used in this situation:

SYSTEM_CALL ‘CDP2’ (RECEIVER,TP,11,12,13,14,15,16,17,Ø)SYSTEM_CALL ‘CAS3’ (RECEIVER,TP,21,22,23,24,25,Ø,231*256+43)

The CDP2 call works normally; the zero in the FIRST position does not changeany defaults. (Note: sending 241*256+1 in the first position achieves the sameresult.) The CAS3 System_Call changes the offsets so that Play is in the correctposition (in this case, 43) and moves the feedback to start at channel 231. Thisallows the feedback status of both devices to be kept on the same card.

Page 85: Axcess Programming Guide

Unit 3: System_Call Reference 75Factory System_Calls

Other parameters

There are several other parameters that pertain only to certain devices. Thesewill be explained within the complete listing of factory System_Calls.

Timeouts

Several of the transport System_Calls have built-in timeouts that will stop thedeck under various conditions. If you do not want the deck to timeout andstop, then override the default and set the timeout value to zero. Timeouts aremeasured in tenth-seconds, and the maximum value for any timeout is 65,535,or about 109 minutes.

Here is an example. Cassette decks controlled by System_Call CAS1 stop af-ter they have been paused for ten minutes, but this action is not desired for thisparticular application. The following statement is within the actual System_Call:

CAS1_PAUSE_TO_STOP = 6ØØØ

This is a constant defined in the Define_Constant section within theSystem_Call. To override this System_Call constant, the following statementneeds to be in the Define_Constant section of the main program:

CAS1_PAUSE_TO_STOP = Ø

Defeating System_Call feedback

When using a System_Call, you should understand that any feedback which isimplemented is not considered “true feedback.” What this means is that theSystem_Call does not “poll,” or ask, the device to give information back toAXCESS on what mode the device is currently in, nor is AXCESS waiting for thisinformation. If “true feedback” is desired in a system, the feedback normallyimplemented in the System_Call must be defeated.

Here is an example of defeating feedback. Suppose a system has an RS-232-controlled VCR that uses System_Call VCR8, and it is important in this particu-lar system that the deck is truly playing once the “play” code has been sent.This normally requires creating a buffer, polling the deck to determine its cur-rent status, and writing code to display feedback based on this status. The feed-back from the System_Call would then need to be disabled so that the systemdoes not become confused.

Timeout

A defined amount of time

that a device waits for user

input until performing a

default action.

Page 86: Axcess Programming Guide

76 Unit 3: System_Call ReferenceFactory System_Calls

The following statement is in the actual System_Call:

VCR8_DEFEAT_FEEDBACK = Ø

To defeat feedback, this next statement needs to be in the Define_Constant

section of your program:

VCR8_DEFEAT_FEEDBACK = 1

Since this causes the System_Call not to handle feedback for the user, youmust program the necessary code to display feedback from the VCR.

Defining functions

Factory System_Calls take care of defining the functions and their feedback, sofunctions must not be “redefined.” For example, when you are using System_

Call VCR3, do not define any functions as latching or mutually exclusive, becausethis would conflict with existing definitions in the System_Call.

Debugging aid

When the following line is included in your program, System_Calls send amessage—which is visible through the Terminal Emulator—out of the MasterCard’s RS-232 port for easier debugging:

#DEFINE SYSCALL_NOTIFY

Master Card software

If you are using a Master Card with a software version less than 3.30, some ofthe calls will not work correctly. These cards do not have the ability to use thekeywords Min_To or Get_Pulse_Time, which are heavily used by System_Calls.If you are using an old Master Card, include the following line in your program:

#DEFINE MASTER_BELOW_V33Ø

Page 87: Axcess Programming Guide

Unit 3: System_Call Reference 77Factory System_Calls

This changes all Min_To keywords to To keywords within the System_Call,and the current Pulse time will be set to 5 (the default). If your version ofAXCESS will not compile System_Calls, ask us for an updated version as soonas possible.

Factory System_Call charts

The charts on the following pages will help you choose the correct factorySystem_Call. Simply match the characteristics of your piece of equipment tothose specified in the corresponding chart, and then combine the System_Callprefix with the number of the correct column. The information that followseach chart explains the following (when applicable):

• Functions: the way that the System_Call causes the unit to act whencontrolled by an AMX panel

• Parameters

• Timeouts

• Constants

• Variables

• Special commands or notes

Page 88: Axcess Programming Guide

78 Unit 3: System_Call ReferenceFactory System_Calls

Functions

Play Deck plays from any mode, except Record

Stop Deck stops from any mode

Pause On the first press, the deck pauses from Play or Record; on the secondpress, it returns to Play or Record

Record Deck records only from Stop mode. Note: any System_Call that has two ormore codes sent simultaneously can be used only for relay-controllable devices

Fast Forward Decks with five control panel functions: deck fast forwards (latching) fromStop or searches forward (latching) from Play

Decks with seven control panel functions: deck fast forwards (latching) fromany mode except Pause or Record

Rewind Decks with five control panel functions: deck rewinds (latching) from Stop orsearches backward (latching) from Play

Decks with seven control panel functions: deck rewinds (latching) from anymode except Pause or Record

Search Forward Deck searches forward (latching) from any mode except Pause or Record

Search Reverse Deck searches backward (latching) from any mode except Pause or Record

CAS# System_Calls for cassette decks

Functions

1

Play

Stop

Pause

Record

Fast Forward

Rewind

Search Forward

Search Reverse

To exit Pause mode...

Press Play or Record

Press Pause

To enter Record mode...

Press Play and Record

Press Record

2

3

4

5

6

Select the correct System_Call

Page 89: Axcess Programming Guide

Unit 3: System_Call Reference 79Factory System_Calls

Parameters needed for each System_Call

CAS1 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, RECB, FIRST

CAS2 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, RECB, FIRST

CAS3 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, RECB, FIRST

CAS4 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

CAS5 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

CAS6 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, RECB, FIRST

Timeouts

CAS#_REW_TO_STOP Allows the deck to rewind for a specified amount of timebefore Stop is initiated; the default is 1,800, or three minutes

CAS#_PAUSE_TO_STOP Allows the deck to stay paused for a specified amount of timebefore Stop is initiated; the default is 6,000, or ten minutes

CAS#_SREV_TO_STOP Allows the deck to search backward for a specified amountof time before Stop is initiated; the default is 12,000, ortwenty minutes. This constant can only be used for cassettedecks with a Search Reverse function

Page 90: Axcess Programming Guide

80 Unit 3: System_Call ReferenceFactory System_Calls

CDP# System_Calls for compact disc players

Functions

Play

Play/Pause

Stop

Stop/Eject

Skip Forward

Scan Forward

4

5

Scan Reverse

To exit Pause mode...

2 3

••

1

Pause

Skip Reverse

Press Play

Press Pause

Select the correct System_Call

Functions

Play Deck plays from any mode

Stop Deck stops from any mode

Pause On the first press, the deck pauses from Play; on the second press, itreturns to Play

Skip Forward Decks with five control panel functions: when this button is pressed fromStop or Pause mode, the deck skips forward as long as the button ispressed; when the button is released, the deck returns to the previousmode. When this button is pressed from Play mode, the deck searchesforward as long as the button is pressed; when the button is released, thedeck returns to Play mode

Decks with seven control panel functions: when this button is pressed, thedeck skips forward as long as the button is pressed; when the button isreleased, the deck returns to the previous mode

Skip Reverse Same action as Skip Forward, but in reverse

Scan Forward When this button is pressed from Play mode, the deck searches forward aslong as the button is pressed; when the button is released, the deck returnsto Play mode

Scan Reverse Same action as Scan Forward, but in reverse

Page 91: Axcess Programming Guide

Unit 3: System_Call Reference 81Factory System_Calls

Parameters needed for each System_Call

CDP1 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, FIRST

CDP2 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, FIRST

CDP3 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, FIRST

CDP4 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, FIRST

CDP5 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, FFWDB, SFWDB, SREVB, FIRST

Timeouts

CDP#_PAUSE_TO_STOP Allows the deck to stay paused for a specified amount oftime before Stop is initiated; the default is 6,000, or tenminutes

Page 92: Axcess Programming Guide

82 Unit 3: System_Call ReferenceFactory System_Calls

JOY# System_Calls for joystick controllers

Parameters needed for each System_Call

JOY1 DEV, L, L_MIN, L_CENTER, L_MAX, L_LEV, L_FLIP

JOY2 DEV, H, H_MIN, H_CENTER, H_MAX, H_LEV, H_FLIP, V, V_MIN, V_CENTER, V_MAX,V_LEV, V_FLIP

Parameters explained

DEV The device to which the Send_Level keyword is being sent

L Level; refers to the current AI8 level from the Create_Level keyword

H Horizontal; refers to the current AI8 level from the Create_Level keyword

V Vertical; refers to the current AI8 level from the Create_Level keyword

L/H/V_MIN The setting of the low end of the scale for the AI8 potentiometer

L/H/V_CENTER The setting of the center of the scale for the AI8 potentiometer

L/H/V_MAX The setting of the high end of the scale for the AI8 potentiometer

L/H/V_LEV The destination level for the Send_Level keyword

L/H/V_FLIP This variable is set to zero if zero is the bottom of the scale and 255 is thetop. If the unit was installed opposite to this scale, this variable must be setto 1 to reverse the scale; zero is now the top and 255 is the bottom

Constants

LAG The minimum amount of change—from the center—necessary to affect thelevel reading; the default is 10, or one second

Page 93: Axcess Programming Guide

Unit 3: System_Call Reference 83Factory System_Calls

LDP# System_Calls for laser disc players

Protocol

Sony LDP series RS-232

Pioneer LDV4200 series

1

2

Search functions

Fast Play

Multi-speed Play Fwd and Rev

To enter Stop mode...

Press Stop

Press Pause

Select the correct System_Call

Functions

Play Deck plays from any mode

Stop Deck stops from any mode

Pause On the first press, the deck pauses from Play; on the second press, itreturns to Play

Skip Forward Decks with five control panel functions: when this button is pressed fromStop mode, the deck skips forward as long as the button is pressed; whenthe button is released, the deck returns to Stop mode

Decks with seven control panel functions: when this button is pressed, thedeck skips forward as long as the button is pressed; when the button isreleased, the deck returns to the previous mode

Skip Reverse Same action as Skip Forward, but in reverse

Scan Forward When this button is pressed from Play mode, the deck searches forward aslong as the button is pressed; when the button is released, the deck returnsto Play mode

Scan Reverse Same action as Scan Forward, but in reverse

Parameters needed for each System_Call

LDP1 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, FIRST

LDP2 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, FIRST

Page 94: Axcess Programming Guide

84 Unit 3: System_Call ReferenceFactory System_Calls

PRO# System_Calls for PRODIGY

Control panel

Wired Mini-LCD or Touch Panel

PRO-SP8 Wall Panel

Preset mode

Five presets with Record

Five presets without Record

4

2 3

1

Eight presets

Select the correct System_Call

Parameters needed for each System_Call

PRO1 PANEL, PRODIGY

PRO2 PANEL, PRODIGY, MAXZONES

PRO3 PANEL, PRODIGY, MAXZONES

PRO4 PANEL, PRODIGY

Parameters explained

PANEL The device number of the panel controlling the unit

PRODIGY The device number of the PRODIGY unit

MAXZONES The number of modules that the PRODIGY has available (1 to 12)

Variables

PRODIGY_BUSY Indicates when the PRODIGY is busy; if this variable is true,commands should not be sent to the PRODIGY from thecalling program

PRODIGY_PRESET Keeps track of the current PRODIGY preset; this should beset to zero if there is no preset being used. This variable isused for feedback in the calling program, or it is set to avalue for feedback on the wall panels

PRODIGY_PRESET_TIME Determines how long it is necessary to hold both the Up andDown buttons before they cause the system to enter theprogramming mode on the wall panel; the default is 20, ortwo seconds. This variable applies only to System_Call PRO2

Special notes

PRO1 This System_Call does not use the standard bracketed format when multiplepanels are used. Instead, use this format:

SYSTEM_CALL ‘PRO1’ (TP, PRODIGY)SYSTEM_CALL ‘PRO1’ (MLCD, PRODIGY)

Page 95: Axcess Programming Guide

Unit 3: System_Call Reference 85Factory System_Calls

SLD# System_Calls for slide projectors

Functions

Forward

Reverse

1

2

Power On

Power Off

Select the correct System_Call

Focus In

Focus Out

Functions

Forward Projector advances one frame

Reverse Projector reverses one frame

Focus Projector focuses in and out with one toggling button; for slide projectorswith one-button control of Focus functions

Power Projector powers on and off with one toggling button; for slide projectorswith one-button control of Power functions

Focus In Projector focuses in

Focus Out Projector focuses out

Power On Projector powers on

Power Off Projector powers off

Parameters needed for each System_Call

SLD1 CARD, PANEL, FWDB, REVB, FINB, FOUTB, PONB, POFFB, FIRST

SLD2 CARD1, CARD2, CARD3, PANEL, FWDB, REVB, FIRST1, FIRST2, FIRST3

Special commands

SLD2_DEFEAT_POWER Allows you to use the projector regardless of the power state.Notice that this can only be used with System_Call SLD2

Page 96: Axcess Programming Guide

86 Unit 3: System_Call ReferenceFactory System_Calls

Parameters needed for each System_Call

SWT1 CARD, INPUT, OUTPUT, LEVEL

SWT2 CARD, INPUT, OUTPUT, LEVEL

SWT3 CARD, INPUT, OUTPUT, LEVEL

SWT4 CARD, INPUT, OUTPUT, LEVEL

SWT5 CARD, INPUT, OUTPUT, LEVEL

SWT6 CARD, INPUT, OUTPUT, LEVEL

Constants

INPUT The input crosspoint on the switcher

OUTPUT The output crosspoint on the switcher

LEVEL The level used while making a switch on the switcher. If the level is greaterthan or equal to 256, the level comment is omitted from the string; thisapplies only to the System_Calls SWT2, SWT3, SWT4, and SWT6. TheSystem_Calls SWT1 and SWT5 require levels to be specified

SWT# System_Calls for switchers

Protocol

1

Autopatch X series

Autopatch 4Y series RS-232 (literal)

Autopatch 4Y series RS-232 (take)

Hedco SCE-101 series RS-232

Utah Scientific series RS-232

Autopatch 1Y series RS-232

2

3

4

5

6

Select the correct System_Call

Page 97: Axcess Programming Guide

Unit 3: System_Call Reference 87Factory System_Calls

VCR# System_Calls for video cassette recorders

1

To exit Pause mode...

Press Play or Record

Press Pause

To enter Record mode...

Press Play and Record

Press Record

2

3

4

5

6Select the correct System_Call 7

8 9

10

Protocol

Sony broadcast formatU-Matic/SP series RS-422

• •

Sony BKU-701 U-MaticType VII series RS-232

Functions

•Play

Stop

Pause

Record

Fast Forward

Rewind

Search Forward

Search Reverse

To access search functions...

Press SFwd or SRev • ••

Press FFwd or Rew from Play •• • •

To exit Search mode...

Release Search button

Press Stop •

Functions

Play Deck plays from any mode, except Record

Stop Deck stops from any mode

Page 98: Axcess Programming Guide

88 Unit 3: System_Call ReferenceFactory System_Calls

Functions (continued)

Pause On the first press, the deck pauses from Play or Record; on the secondpress, it returns to Play or Record

Record Deck records only from Stop mode; all buttons are inactive except Stop andPause during Record mode. Note: any System_Call that has two or morecodes sent simultaneously can be used only for relay-controllable devices

Fast Forward Decks with five control panel functions: deck fast forwards from Stop orRewind, or searches forward from Play

Decks with seven control panel functions: deck fast forwards from any modeexcept Pause or Record

Rewind Decks with five control panel functions: deck rewinds from Stop or FastForward, or searches backward from Play

Decks with seven control panel functions: deck rewinds from any modeexcept Pause or Record

Search Forward If function is available, deck searches forward from any mode except Pauseor Record

Search Reverse If function is available, deck searches backward from any mode exceptPause or Record

Parameters needed for each System_Call

VCR1 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

VCR2 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

VCR3 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, SFWDB, SREVB, RECB, FIRST

VCR4 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

VCR5 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

VCR6 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

VCR7 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

VCR8 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, SFWDB, SREVB, RECB, FIRST

VCR9 CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

VCR1Ø CARD, PANEL, PLAYB, STOPB, PAUSEB, FFWDB, REWB, SFWDB, SREVB, RECB,FIRST

Timeouts

VCR#_REW_TO_STOP Timeout that allows the deck to rewind for a specifiedamount of time before Stop is initiated; the default is 1,800,or three minutes

Page 99: Axcess Programming Guide

Unit 3: System_Call Reference 89Factory System_Calls

Timeouts (continued)

VCR#_PAUSE_TO_STOP Timeout that allows the deck to stay paused for a specifiedamount of time before Stop is initiated; the default is 6,000,or ten minutes

VCR#_SREV_TO_STOP Timeout that allows the deck to search backward for aspecified amount of time before Stop is initiated; the defaultis 12,000, or twenty minutes. This constant can only be usedfor cassette decks with a Search Reverse function

VCR#_PULSE_DELAY Sets the delay between IR pulses for commands needingtwo or more IR pulses

Page 100: Axcess Programming Guide

90 Unit 3: System_Call ReferenceFactory System_Calls

VOL# System_Calls for volume controllers

Volume controlled by...

AMX AXC-VOL Volume Card

AMX VX1 Volume Controller

1

2

To enter Mute mode...

Press Mute

Press Up and Down simultaneously

Select the correct System_Call

Functions

Up Volume level is increased from any mode

Down Volume level is decreased from any mode

Mute On the first press, the volume level is muted; on the second press, thevolume level returns to its previous state. In addition, pressing either Up orDown cancels the Mute mode

Parameters needed for each System_Call

VOL1 PANEL, UPB, DNB, MUTEB, CARD, UPC, DNC, MUTEC

VOL2 PANEL, UPB, DNB, MUTEB, CARD, UPC, DNC

Page 101: Axcess Programming Guide

UNIT 4

COMMUNICATIONS

AXCESS Programming Guide

Page 102: Axcess Programming Guide
Page 103: Axcess Programming Guide

Unit 4: Communications Master Card Communication Commands 93

Master CardCommunication Commands

Introduction

There are several commands available to the user through the Master Card’scommunications port. Mainly used as diagnostic tools, these commands directthe Master Card to give an immediate response or to take an immediate action.The terminal emulator in the AXCESS program can be used to communicatewith the Master Card in this way. This section lists and explains each of thesecommunication commands.

Compare Device

Upon receiving this command, the Master Card returns a list of all devices thatthe Master Card believes to be missing from the AXlink bus and then a list of allthe extra devices. The Master Card does this by comparing the devices presenton the AXlink bus against the devices listed in the Define_Device section in theMaster Card program.

Date

Upon receiving this command, the Master Card returns the current date andday of the week the Master Card contains.

Device Status <device number>

Upon receiving this command, the Master Card returns a list of all activated(“on”) channels in the specified device.

Echo Off

This command turns off the echoing of received characters. See “Echo On.”

Echo On

Turning the “character echo” on tells the Master Card to send your computer allcharacters it receives so that you can see what you are typing. When the MasterCard powers up, the character echo is off. It is therefore recommended that youturn on the character echo when you first start a session with the Master Card.

C H A P T E R

9

Page 104: Axcess Programming Guide

94 Master Card Communication Commands Unit 4: Communications

Have Control

Upon receiving this command, the Master Card tells you if it is currently con-trolling AXlink. The Master Card will always be in control if the Master Cardcontains a valid system program, unless there is another “redundant” MasterCard present. If the Master Card is not in control of AXlink, it may not contain aprogram, there are AXlink wiring problems, or the other Master Card (if present)is in control. The green LED on the Master Card also shows indication of AXlinkcontrol (see Chapter 1 of the AXCESS Language Tutorial for descriptions of theLED blink patterns).

Have Program

Upon receiving this command, the Master Card tells you if it currently has asystem program in memory.

Help (or ?)

Upon receiving this command, the Master Card gives you a list of availablecommands for direct communication with the Master Card.

Memory

Upon receiving this command, the Master Card tells you how many bytes areavailable for your programs. For the AXC-M Master Card, the first memorybank contains about 48K; if both banks are present, about 112K is available. Forthe AXC-EM Enhanced Master Card, the normal memory capacity is also about48K; replacing the memory with the extended memory option brings the capac-ity to about 191K.

Pass <device number>

This command is used to talk across the AXlink bus to devices. When the Passmode is enabled, all characters sent to the Master Card are passed along to thespecified device, and all characters received from the device travel to the Mas-ter Card and then out of the card’s port. To exit from the Pass mode, type thefollowing while holding down the <Shift> key (<Esc> is the Escape key):

++ <Esc> <Esc>

Send Command

This command operates like the Send_Command keyword in the AXCESS pro-gramming language. For example, to send the command RXON to device 1, youwould type the following:

SEND COMMAND 1,‘RXON’

Page 105: Axcess Programming Guide

Unit 4: Communications Master Card Communication Commands 95

Send String

This command operates the same as the Send_String keyword in the AXCESS

programming language. See “Send Command.”

Set Date

This command changes the date in the Master Card.

Set Time

This command changes the time in the Master Card.

Show Device

Upon receiving this command, the Master Card returns a list of all devicespresent on AXlink.

Show Input Off

This command turns off the Show Input mode. See “Show Input On.”

Show Input On

This command turns on the Show Input mode. Every time a channel is acti-vated in the system, a message containing the corresponding Push is sent outthrough the serial port. When the channel is turned off, a message containingthe corresponding Release is sent.

Slot

Upon receiving this command, the Master Card returns the slot in which theMaster Card is plugged.

System Reset

Upon receiving this command, the Master Card stops communication onAXlink for two seconds and then restarts. The system program then restartswith the Define_Start section.

Time

Upon receiving this command, the Master Card returns the time in its internal clock.

Version

Upon receiving this command, the Master Card returns the version number ofits firmware and the firmware version (if applicable) of the devices on AXlinkor in CardFrames.

Page 106: Axcess Programming Guide
Page 107: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 97

Device-Specific Operations

Accessing channels

Each AXCESS device on the AXlink bus has a set of channels, and each channelhas a corresponding function. This chapter lists the channel functions for mostof these devices. To access one of these functions within your AXCESS program,simply activate the corresponding channel on the card.

Sending commands and sequences

Two basic types of information can be sent to AXCESS devices on the AXlink busand to cards within the CardFrame. First, a command can be sent with theSend_Command keyword, directing the device or card to perform a specificaction. In many instances, parameters are required for the command.

Instead of sending commands, Send_String sends the second type of infor-mation: sequences of numbers and strings. The difference between these se-quences and commands is that sequences are meant to be passed on to theoutside world; commands are intended to be used only by the device or cardreceiving them. In some cases, however, the sequence that Send_String sendsto a card or device is interpreted as an actual command. These cases are notedin this chapter when they occur.

For more information on Send_Command and Send_String, see Chapter 3of this manual.

Symbols in this section

Figure 4-1 describes special symbols used in this section. Since they are for thepurpose of clarity in the manual, do not include them in the actual command.

C H A P T E R

10

Special symbols

Symbol

< > Required parameter

[ ]

( )

Represents Symbol

mm

ss

Represents

ff

Optional parameter

Parameter range

Minutes or month, where applicable

Seconds

Frame number

(d) Default during power-up dd Day

yy Yearhh Hours

Figure 4-1

These symbols are for the

purpose of clarity only.

Page 108: Axcess Programming Guide

98 Device-Specific Operations Unit 4: Communications

AXC-232 RS-232/422 Card

Use Send_String to transmit characters to this card. Use Create_Buffer to receive charactersfrom this card.

Send_Command commands

‘RXON’ All incoming characters are sent to the Master Card. This command is auto-matically sent by the Master Card when a buffer is created for the corre-sponding device.

‘RXOFF’ (d) Incoming characters are not sent to the Master Card.

‘RXCLR’ Any characters waiting in a buffer to be sent to the Master Card are erased.

‘TXCLR’ Any characters waiting in a buffer to be sent to a card are erased, and thetransmission stops.

‘B9MON’ Enables a special mode that overrides the DIP switch settings for data bits,stop bits, and parity; the new settings are nine data bits, one stop bit, andno parity. The baud rate is determined by the current DIP switch setting.

‘B9MOFF’ (d) The values for data bits, stop bits, and parity are determined by the currentDIP switch setting.

‘HSOFF’ (d) Hardware handshaking is disabled. (Versions 1.16+)

‘HSON’ Hardware handshaking is enabled. (Versions 1.16+)

‘XOFF’ Software handshaking is disabled. (Versions 1.18+)

‘XON’ Software handshaking is enabled. (Versions 1.18+)

‘CTSPSH’ Enables Pushes, Releases, and status on channel 255 for Clear To Send(CTS) hardware handshake input. If CTS is high, then the channel is on.(Versions 1.24+)

‘CHARD–<time>’ Sets the delay between all future transmitted characters. Time is measuredin 100 microsecond increments from 0–255.

Send_String escape sequences

If one of the 3-character combinations below is found anywhere within a Send_String programinstruction, it will be treated as a command, not the literal characters.

“27,17,<time>” Sends a “break” character of the specified length of time. Time is measuredin 100 microsecond increments from 0–255.

“27,18,1” Sets the ninth data bit to 1 for all subsequent characters to be transmitted.It is used in conjunction with the B9MON command.

“27,18,Ø” Sets the ninth data bit to zero for all subsequent characters to be transmit-ted. It is used in conjunction with the B9MON command.

“27,19,<time>” Inserts a delay before the next character to be transmitted. Time is mea-sured in millisecond increments from 0–255. (Versions 1.16+)

“27,2Ø,Ø” Request To Send (RTS) hardware handshake is set to high output.(Versions 1.20+)

“27,2Ø,1” RTS hardware handshake is set to low output. (Versions 1.20+)

Page 109: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 99

AXC-422 PA-422 Card

Use Send_String to transmit characters out in one packet. The first character is the PA-422 de-vice to which the packet is directed. Consult the device manual or a PA-422 manual for com-mand formats.

Send_Command commands

‘RXON’ All incoming characters are sent to the Master Card. This command is auto-matically sent by the Master Card when a buffer is created for the corre-sponding device.

‘RXOFF’ (d) Incoming characters are not sent to the Master Card.

‘CHARD–<time>’ Sets the delay between all transmitted characters. Time is measured in milli-second increments from 0–255.

‘PACKD–<time>’ Sets the delay between all transmitted packets. Time is measured in milli-second increments from 0–255.

Send_String escape sequences

If the following 3-character combination is found anywhere within a Send_String program instruc-tion, it will be treated as a command, not the literal characters.

“27,19,Ø” Characters in the next Send_String program instruction are included in thecurrent packet.

Page 110: Axcess Programming Guide

100 Device-Specific Operations Unit 4: Communications

AXC-DMX DMX 512 Control Card

Channels

1 Ramps DMX output level 1 up at current speed

2 Ramps DMX output level 1 down at current speed

3 Ramps DMX output level 2 up at current speed

4 Ramps DMX output level 2 down at current speed

5 Ramps DMX output level 3 up at current speed

6 Ramps DMX output level 3 down at current speed

7 Ramps DMX output level 4 up at current speed

8 Ramps DMX output level 4 down at current speed

9 Ramps DMX output level 5 up at current speed

10 Ramps DMX output level 5 down at current speed

11 Ramps DMX output level 6 up at current speed

12 Ramps DMX output level 6 down at current speed

13 Ramps DMX output level 7 up at current speed

14 Ramps DMX output level 7 down at current speed

15 Ramps DMX output level 8 up at current speed

16 Ramps DMX output level 8 down at current speed

Send_Command commands

‘P<DMX output channel (1–8)>L<level (0–255) or (0–100%)>[T<time in tenth seconds (0–255)>]’

Ramps channel to level or percentage at the current ramp rate or, optionally,in a specified amount of time. Level zero is the lowest voltage, and level 255(100%) is maximum voltage.

‘P<DMX output channel (1–8)>R<time in tenth seconds (0–255)>[U or D]’

Sets the ramp rate of the channel. The specified time determines how long ittakes to ramp the full range both down to up and up to down. As an option,the specified time can determine how long it takes to ramp the full rangeonly up to down (D) or only down to up (U).

Levels

Use Create_Level to get the current DMX output level. Levels 1–8 are for DMX output channels 1–8, respectively. A Define_Connect_Level statement may be used to directly connect a TouchPanel slider to a DMX output channel.

Page 111: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 101

AXC-IR/S Infrared/Serial Card

Channels

1–239 Generates infrared/serial code for the corresponding function

Note: If one of these channels is turned on while another is already on, the previous channel willstop transmitting and the current channel will start.

Send_Command commands

‘INITIR’ Initializes the card to have eight fixed infrared (IR) functions which are thesame; only functions 2, 4, 6, and 8 have no carrier. Be careful with this com-mand: it erases whatever was previously in the card.

‘CAROFF’ Overrides and turns off the carrier on all outgoing functions. This commandis not used very often; instead, the microjumper on the card itself is used.

‘CARON’ (d) Restores the carrier to normal as described by its corresponding function.This command is not used very often; instead, the microjumper on the carditself is used.

‘IROFF’ Turns off the transmission of IR code if any is in progress.

Page 112: Axcess Programming Guide

102 Device-Specific Operations Unit 4: Communications

AXC-MIDI MIDI Card

Use Send_String to transmit characters to this card. Use Create_Buffer to receive charactersfrom this card.

Send_Command commands

‘RXON’ All incoming characters are sent to the Master Card. This command is auto-matically sent by the Master Card when a buffer is created for the corre-sponding device.

‘RXOFF‘ (d) Incoming characters are not sent to the Master Card.

‘RXCLR‘ Any characters waiting in the card’s buffer to be sent to the Master Card areerased.

‘TXCLR‘ Any characters waiting in the card’s buffer to be sent out are erased, andthe transmission stops.

‘OUT=IN‘ Any characters received from IN are automatically transmitted to OUT.

‘OUT<>IN‘ (d) Characters received from IN are not automatically transmitted to OUT.

Page 113: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 103

AXC-OXM Oxmoor Interface Card

Channels

1 Ramps volume up (increases)

2 Ramps volume down (decreases)

3 Volume is muted; when the channel is turned off, the volume level is re-stored to its previous level

Send_Command commands

‘PØL<output level (0–255) or (0–100%)>[T<time in tenth seconds (0–255)>]’

Ramps volume to level or percentage at the current ramp rate or, optionally,in a specified amount of time. Level zero is the lowest volume (mute), andlevel 255 (100%) is maximum volume.

‘PØR<time in tenth seconds (0–255)>[U or D]’

Sets the ramp rate of the volume. The specified time determines how long ittakes to ramp the full range both down to up and up to down. As an option,the specified time can determine how long it takes to ramp the full rangeonly up to down (D) or only down to up (U).

Levels

Use Create_Level and Send_Level to read the current volume level and to display bar graphs.The Oxmoor volume level uses level 1. A Define_Connect_Level statement may be used to con-nect a Touch Panel slider directly to the Oxmoor volume level.

Page 114: Axcess Programming Guide

104 Device-Specific Operations Unit 4: Communications

AXC-PRN Printer Card

Send_String sequences

Use Send_String to send characters to the parallel output port.

Page 115: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 105

AXC-PTC Precision Time Code Card

Send_Command commands

‘CLOCK <date> <time>’

Sets the date (mm-dd-yy) and time (hh:mm:ss) of the card’s clock.

‘UPDATE–<time>’ Sets how frequently (hh:mm:ss) the AXCESS system clock is updated by thecard’s clock. A question mark (?) can be used as a wildcard character.

‘SYSTIME’ Updates the AXCESS system clock with the card’s clock.

Page 116: Axcess Programming Guide

106 Device-Specific Operations Unit 4: Communications

AXC-PTI Pan/Tilt Interface Card

Channels

1 Pans right at current speed

2 Tilts down at current speed

5 Pans left at current speed

6 Tilts up at current speed

10 Pans right at 100% (maximum) speed

11 Pans left at 100% (maximum) speed

12 Tilts down at 100% (maximum) speed

13 Tilts up at 100% (maximum) speed

14 Pans right at 50% speed

15 Pans left at 50% speed

16 Tilts down at 50% speed

17 Tilts up at 50% speed

20 Channel status is on if Pan is seeking to preset (Versions 2.23+)

21 Channel status is on if Tilt is seeking to preset (Versions 2.23+)

Commands

‘G<output channel (1–2)>L<position (0–range)>’

Turns on the channel at the current speed (voltage) until the specified positionas read by the input channel is reached. Channel 1 is Pan and channel 2 isTilt. Position zero is one end of the potentiometer, and position “range” isthe other end. (Revision A cards have 8-bit input resolution with a range of255, while revision B cards have 10-bit resolution with a range of 65,535.)This range divided by two (either 128 or 32,768) is the middle setting.

‘G<output channel (1–2)>S<speed (0–127)>’

Sets the speed (voltage) for future positional commands. Speed zero is theslowest, and speed 127 (default) is the fastest.

‘G<output channel (1–2)>D<deviation (0–127)>’

Sets the maximum position deviation allowed for future positional commands.Although deviation zero is the most accurate, it can produce some jitter. Asa result, the default setting is 2, allowing the actual position to be within ±2from the specified position.

‘G<output channel (1–2)>A<distance (0–127)>S<speed (0–127)>’

Slows the speed of the channel to that specified when the device position iswithin the specified distance from the preset setting. (Versions 1.02+)

Page 117: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 107

Levels

1 Voltage output channel 1 and joystick/slider control (0–255)

2 Voltage output channel 2 and joystick/slider control (0–255)

5 Voltage input channel 1 (0–65,535; 0–255 for Revision A cards)

6 Voltage input channel 2 (0–65,535; 0–255 for Revision A cards)

Note: Use Create_Level with level 5 or 6 to read input voltage (which usually corresponds to po-sition), which allows you to record presets or to display bar graphs with Send_Level. A TouchPanel slider or joystick can be directly connected to level 1 or 2 with a Define_Connect_Levelstatement.

Page 118: Axcess Programming Guide

108 Device-Specific Operations Unit 4: Communications

AXC-PTSM TSM Pan/Tilt Lens Interface Card

Channels

1 Pans left at current speed

2 Tilts up at current speed

3 Zooms in at current speed

4 Focuses in at current speed

5 Pans right at current speed

6 Tilts down at current speed

7 Zooms out at current speed

8 Focuses out at current speed

Send_Command commands

‘P<output channel (1–4)>L<level (0–65,535)>[T<time in tenth seconds (0–255)>]’

Ramps channel to level or percentage at the current ramp rate or, optionally,in a specified amount of time. Channel 1 is Pan, channel 2 is Tilt, channel 3is Zoom, and channel 4 is Focus. Level 32,768 is the middle of the range.

‘P<output channel (1–4)>R<time in tenth seconds (0–255)>[U or D]’

Sets the ramp rate of the channel. The specified time determines how long ittakes to ramp the full range both down to up and up to down. As an option,the specified time can determine how long it takes to ramp the full rangeonly up to down (D) or only down to up (U).

Levels

Use Create_Level to read positions; this allows you to record presets.

1 Pan position (0–65,535)

3 Tilt position (24,576–40,960)

5 Zoom position (0–65,535)

7 Focus position (0–65,535)

Page 119: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 109

AXC-SLD Slide Projector Interface Card

AXC-SAV European Slide Projector Interface Card

AXB-SLD Slide Projector Interface

Channels

1 Slide forward

2 Slide reverse

3 Slide focus

4 Slide focus

5 Power on/off

6 Aux 1 (not present on AXB-SLD)

7 Aux 2 (not present on AXB-SLD)

Page 120: Axcess Programming Guide

110 Device-Specific Operations Unit 4: Communications

AXC-SMP SMPTE Time Code Card

Send_Command commands

‘TIME <channel>–<time>’

At the specified incoming time (hh:mm:ss.ff), the specified channel will bePushed. If another TIME command with the same channel is received, thenew time will replace the previous one.

‘CLEAR’ Clears all TIME commands.

‘FRAME’ Sends the current incoming frame time to the Master Card as a string in theformat hh:mm:ss.ff.

‘FRAME ON[–<rate in tenth seconds (1–255)>]’

Sends the current incoming time to the Master Card at an optional periodicrate. The default rate (no rate specified) is one second.

‘FRAME OFF’ Cancels a FRAME ON command.

‘SEND ON[–<time>]’ Generates outgoing time code at an optional specified time (hh:mm:ss.ff). Ifno time is specified, the first SEND ON command after power-up will start attime 00:00:00.00; otherwise, time continues from the last instance of a SENDOFF command.

‘SEND OFF’ Discontinues or pauses the generation of outgoing time code.

‘TFRAME’ Sends the current outgoing frame time to the Master Card as a string in theformat hh:mm:ss.ff.

‘TFRAME ON[–<rate in tenth seconds (1–255)>]’

Sends the current outgoing frame time to the Master Card at an optionalperiodic rate. The default rate is one second.

‘TFRAME OFF’ Cancels a TFRAME ON command.

Page 121: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 111

AXC-SPE Enhanced Speech Synthesizer Card

AXC-SPS Speech Synthesizer Card

Send_String sequences

Use the Send_String keyword to send English text strings followed by a carriage return, and thecard will convert the text to speech. Since the card uses phonetics instead of a predefined dic-tionary of words, an unlimited vocabulary is available. As a result, it is sometimes necessary tospell differently to achieve better pronunciation.

The AXC-SPE Card has the additional ability to generate tones and music, as well as vary pitch,tone, rate, and volume to attain better sound quality.

Please call AMX if you need additional programming information for these cards.

Page 122: Axcess Programming Guide

112 Device-Specific Operations Unit 4: Communications

AXC-TEMP Temperature Control Card

Levels

Use Create_Level to read temperature channels. If jumper JP1 is set for Fahrenheit degrees andthe temperature is 80.5°F, the level will read as 805. If jumper JP1 is set for Celsius degrees andthe temperature is the same as before, the level will read as 269 (26.9°C).

1 Temperature channel 1 in tenths of a degree

2 Temperature channel 2 in tenths of a degree

3 Temperature channel 3 in tenths of a degree

4 Temperature channel 4 in tenths of a degree

Page 123: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 113

AXC-VAI2 Voltage Input/Output Card

Channels

1 Ramps channel 1 up (increases)

2 Ramps channel 2 up

5 Ramps channel 1 down (decreases)

6 Ramps channel 2 down

10 Voltage level for channel 1 is set to 255 (100%); when the channel is turnedoff, the voltage level is set back to center

11 Voltage level for channel 1 is set to zero; when the channel is turned off, thevoltage level is set back to center

12 Voltage level for channel 2 is set to 255 (100%); when the channel is turnedoff, the voltage level is set back to center

13 Voltage level for channel 2 is set to zero; when the channel is turned off, thevoltage level is set back to center

14 Voltage level for channel 1 is set to 192 (75%); when the channel is turnedoff, the voltage level is set back to center

15 Voltage level for channel 1 is set to 64 (25%); when the channel is turned off,the voltage level is set back to center

16 Voltage level for channel 2 is set to 192 (75%); when the channel is turnedoff, the voltage level is set back to center

17 Voltage level for channel 2 is set to 64 (25%); when the channel is turned off,the voltage level is set back to center

Note: Voltage offset and range adjustments for each channel are configured with potentiometerson the card. Also, the center and power-up levels are determined by the jumper pins in locationE1 on the card. If the jumper is across both pins (MID), then the center is 128 (50%); otherwise,the center is zero (LO).

Send_Command commands

‘P<output channel (1–2)>L<level (0–255) or (0–100%)>[T<time in tenth seconds (0–255)>]’

Ramps channel to level or percentage at the current ramp rate or, optionally,in a specified amount of time. Level zero is the lowest voltage, and level 255(100%) is maximum voltage.

‘P<output channel (1–2)>R<time in tenth seconds (0–255)>[U or D]’

Sets the ramp rate of the channel. The specified time determines how long ittakes to ramp the full range both down to up and up to down. As an option,the specified time can determine how long it takes to ramp the full rangeonly up to down (D) or only down to up (U).

‘G<output channel (1–2)>L<position (0–255)>’

Turns on the channel at the current speed (voltage) until the specified posi-tion as read by the input channel is reached. Position zero is one end of thepotentiometer, and position 255 is the other end; position 128 is the middle.

Page 124: Axcess Programming Guide

114 Device-Specific Operations Unit 4: Communications

Send_Command commands (continued)

‘G<output channel (1–2)>S<speed (0–127)>’

Sets the speed (voltage) for future positional commands. Speed zero is theslowest, and speed 127 (default) is the fastest.

‘G<output channel (1–2)>D<deviation (0–127)>’

Sets the maximum position deviation allowed for future positional com-mands. Although deviation zero is the most accurate, it can produce somejitter. As a result, the default setting is 2, allowing the actual position to bewithin ±2 from the specified position.

‘G<output channel (1–2)>A<distance (0–127)>S<speed (0–127)>’

Temporarily slows the voltage speed when it is within a specified distanceaway from a preset in future preset commands. (AXCESS versions 1.04+)

Levels

1 Voltage output channel 1 and joystick/slider control (0–255)

2 Voltage output channel 2 and joystick/slider control (0–255)

5 Voltage input channel 1 (0–255)

6 Voltage input channel 2 (0–255)

Note: Use Create_Level with level 5 or 6 to read input voltage (which usually corresponds to po-sition), which allows you to record presets or to display bar graphs with Send_Level. A TouchPanel slider or joystick can be directly connected to level 1 or 2 with a Define_Connect_Levelstatement.

Page 125: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 115

AXC-VG24 Voltage Generator Card

AXC-VRG4 Voltage Generator Card

Channels

1 Ramps voltage channel 1 up (increases)

2 Ramps voltage channel 2 up

3 Ramps voltage channel 3 up

4 Ramps voltage channel 4 up

5 Ramps voltage channel 1 down (decreases)

6 Ramps voltage channel 2 down

7 Ramps voltage channel 3 down

8 Ramps voltage channel 4 down

9 * Turns on Aux channel 5 voltage; when the channel is off, Aux channel 5 volt-age is set to zero

* Optional for AXC-VRG4 and not available for AXC-VG24

Note: Voltage offset and range adjustments for each channel are configured with potentiometerson the card. Also, the center and power-up levels are determined by the jumper pins in locationJP2 on the card. If the jumper is across both pins (MID), then the center is 128 (50%); otherwise,the center is zero (LO).

Commands

‘P<output channel (1–4)>L<level (0–255) or (0–100%)>[T<time in tenth seconds (0–255)>]’

Ramps channel to level or percentage at the current ramp rate or, optionally,in a specified amount of time. Level zero is the lowest voltage, and level 255(100%) is maximum voltage.

‘P<output channel (1–4)>R<time in tenth seconds (0–255)>[U or D]’

Sets the ramp rate of the channel. The specified time determines how long ittakes to ramp the full range both down to up and up to down. As an option,the specified time can determine how long it takes to ramp the full rangeonly up to down (D) or only down to up (U).

‘P<output channel (0–4)>C<N, L, or I>’

Sets the ramping curve of the channel to normal linear (N, which is the de-fault setting), logarithmic (L), or inverted logarithmic (I). An output channel ofzero represents all channels. (Versions 1.05+)

Levels

Use Create_Level to get the current output voltage level. Levels 1–4 are for voltage channels 1–4, respectively. A Define_Connect_Level statement may be used to directly connect a TouchPanel slider to a voltage output channel.

Page 126: Axcess Programming Guide

116 Device-Specific Operations Unit 4: Communications

AXC-VOL Volume Control Card

Channels

1 Ramps both channels up (increases)

2 Ramps both channels down (decreases)

3 Mutes both channels; when the channel is off, the volume levels are restoredto their previous levels

4 Ramps volume channel 1 up

5 Ramps volume channel 1 down

6 Mutes channel 1; when the channel is off, the volume level is restored to itsprevious level

7 Ramps volume channel 2 up

8 Ramps volume channel 2 down

9 Mutes channel 2; when the channel is off, the volume level is restored to itsprevious level

Note: Ramping a volume channel while the mute channel is on will not automatically turn off themute channel. However, the ramping will still occur and will be noticed when the mute channel isturned off.

Send_Command commands

‘P<output channel (0–2)>L<level (0–255) or (0–100%)>[T<time in tenth seconds (0–255)>]’

Ramps channel to level or percentage at the current ramp rate or, optionally,in a specified amount of time. An output channel of zero represents bothchannels 1 and 2. Level zero is the lowest volume (mute), and level 255(100%) is maximum volume.

‘P<output channel (0–2)>R<time in tenth seconds (0–255)>[U or D]’

Sets the ramp rate of the channel. The specified time determines how long ittakes to ramp the full range both down to up and up to down. As an option,the specified time can determine how long it takes to ramp the full rangeonly up to down (D) or only down to up (U).

‘P1=P2’ Set the level of channel 1 to that of channel 2.

‘P2=P1’ Sets the level of channel 2 to that of channel 1.

Levels

Use Create_Level and Send_Level to read the current volume level and to display bar graphs.The current volume level uses level 1. A Define_Connect_Level statement may be used to con-nect a Touch Panel slider directly to the volume level.

1 Volume output level channel 1 and slider control (0–255)

2 Volume output level channel 2 and slider control (0–255)

Page 127: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 117

AXC-X10 X-10 Interface Card

Channels

Typically Send_String is used instead of the channels except in conjunction with the Bright andDim functions. All channels (X-10 functions) turned on are buffered by the card to guarantee thatat least one complete packet is transmitted for each function.

1–16 Unit code 1–16 is transmitted over power line

17 ‘ALL UNITS OFF’ is transmitted

18 ‘ALL LIGHTS ON’ is transmitted

19 ‘ON’ is transmitted

20 ‘OFF’ is transmitted

21 ‘DIM’ is transmitted

22 ‘BRIGHT’ is transmitted

23 ‘ALL LIGHTS OFF’ is transmitted

25 ‘HAIL REQUEST’ is transmitted

26 ‘HAIL ACKNOWLEDGE’ is transmitted

29 ‘STATUS=ON’ is transmitted

30 ‘STATUS=OFF’ is transmitted

31 ‘STATUS REQUEST’ is transmitted

32–47 House code is set to A through P (channel 32 is the default)

Send_Command commands

‘UNON’ Unit codes are always transmitted.

‘UNOFF’ (d) If the unit code being turned on is the same as the unit code last transmitted,the unit code is not transmitted; this improves response time.

‘XOFF’ Turns an X-10 function off if one is already being transmitted.

‘CLEAR’ Any functions waiting in a buffer to be transmitted are erased, and the trans-mission stops.

Send_String sequences

“<house code (A–P)><unit code (1–16 or ?)><function (N, F, B, D, L, X, A, or ?)>”

Transmits X-10 commands. The characters for the unit code and the func-tion are as follows:

N On L All lights offF Off X All units offB Brighten one step A All units onD Dim one step ? None

Page 128: Axcess Programming Guide

118 Device-Specific Operations Unit 4: Communications

AXB-FD Floppy Disk Drive

Channels

1–16 Corresponds to the file number; the channel is Pushed and Released if theend of file (EOF) is reached or if the disk is full

20 Push and Release channel if there is a disk access error

254 Push and Release channel for the front-panel Load button

255 Push and Release channel for the front-panel Send button

Send_Command commands

‘DIR’ Reads and sends the directory of files that is on the disk as a set of strings.

‘OPEN <file>,<R or W>,<file # (1–16)>’

Opens the specified file for reading (R) or writing (W). All future references tothe file will use the specified file number until the file is closed. If you attemptto open a file that does not exist, channel 20 is Pushed and Released. Bothbutton LEDs are on if any files are open.

‘CLOSE <file #>’ Closes the file having the specified file number.

‘CLOSEALL’ Closes all files that are open.

‘READ <file #>,<number of bytes>’

Reads and sends the specified number of bytes (as a string) from the filehaving the specified file number. If an end of file (EOF) is encountered, thechannel for the corresponding file number is Pushed and Released.

‘READLN <file #>’ Reads and sends one line of text (as a string) from the file having the speci-fied file number. A line of text ends with a carriage return (decimal 13), a linefeed (decimal 10), or a combination of the two. If an end of file (EOF) is en-countered, the channel for the corresponding file number is Pushed andReleased.

‘SEEK <file #>,<byte #>’

Moves to the specified byte number (position) in the file having the specifiedfile number. If a seek is attempted past the end of file (EOF), the channel forthe corresponding file number is Pushed and Released.

‘WRITE=<file #>’ Sets the current file that the drive will write to when strings are received. Afile that is opened with the OPEN command is automatically set to be thecurrent file. If the drive is writing and the disk becomes full, the channel forthe corresponding file number is Pushed and Released.

If the drive has problems accessing the disk during any of the previous commands (for example,the disk is not present, it’s bad, or it’s in the wrong format), channel 20 is Pushed and Releasedquickly to indicate an error.

Page 129: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 119

Send_Command commands (continued)

The Load button is essentially functionless, but it does Push channel 254. In addition to pushingchannel 255, the Send button will try to reprogram a system by reading files from the floppy disk.During this time, the Send button LED blinks rapidly. The first file that AXCESS searches for isSTARTUP.BAT. This file can have the following commands, all of which must start on the first col-umn (no preceding spaces).

LOAD <file> Loads the file into the Master Card.

LOADTP <file>,<device #>

Loads the file into the Touch Panel having the specified device number.

LOADIR <file>,<device #>

Loads the file into the infrared unit having the specified device number.

Send_String sequences

Use Send_String to send bytes (characters) to the floppy disk. Use Create_Buffer to receivebytes when the floppy disk is read.

Page 130: Axcess Programming Guide

120 Device-Specific Operations Unit 4: Communications

AXB-TM Television Manager

AXB-TCM Television Control Manager

AXB-PTM Prism Television Manager

Channels

1–127 Generates infrared/serial code for the corresponding function

Note: If one of these channels is turned on while another is already on, theprevious channel will stop transmitting and the current channel will start.

128–247 Push and Release channels for received infrared code

248 Push on this channel indicates a power fail error (Versions 1.30+)

249 If both this channel and channel 250 are on, the front panel Response LEDwill blink (Versions 1.20+)

250 While channel is on, front panel Response LED is on

251 While channel is on, I/O 1 is on (switch to Gnd)

252 While channel is on, I/O 2 is on (switch to Gnd)

253 While channel is on, I/O 3 is on (switch to Gnd)

254 While channel is on, I/O 4 is on (switch to Gnd)

Note: Contact closure inputs on I/O 1–4 will also generate Pushes andReleases on channels 251–254, respectively.

255 Channel is on if television power sensor is detecting horizontal scan

Send_Command commands

All of the following commands require version 1.31 or higher.

“‘RO’, <offset>” Sets incoming infrared (IR) offset. This offset is subtracted from the incomingIR code before the code is sent to the Master Card.

“‘DE’, <time>” Sets the delay time (in tenth seconds) that the television power sensor mustbe stable before being considered changed. The default is one second.

“‘DC’, <IR in>, <IR out>”

Makes a direct connection whereby the IR function <IR out> is generated foras long as the <IR in> code is being received. The Push and Release for the<IR in> code are not sent to the Master Card. A maximum of 16 direct con-nections can be made.

‘DK’ Deletes all direct connections made by the DC command.

Page 131: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 121

Send_Command commands (continued)

Up to 16 of the following commands will be buffered and performed in the order received.

‘PON’ Turns on television based on television power sensor. If the sensor readsthat the television is off, then IR function 27 is generated in an attempt toturn the television on. If three attempts fail, the unit will continue executingcommands in the buffer. If no commands are in the buffer, the unit will con-tinue to try to turn the television on until a POF or POD command is received.

If the unit fails to turn the television on, a Push and Release for channel 248are made to indicate a power fail error. If at any time the power sensor readsthat the television is off (someone turned it off manually from its front panel,for example), the unit will automatically attempt to turn the television back on.

Channel 255 changes are disabled after the reception of this command.

‘POF’ Turns off television based on television power sensor. If the sensor readsthat the television is on, then IR function 28 is generated in an attempt toturn the television off. If three attempts fail, the unit will continue executingcommands in the buffer. If no commands are in the buffer, the unit will con-tinue to try to turn the television on until a PON or POD command is received.

If the unit fails to turn the television off, a Push and Release for channel 248are made to indicate a power fail error. If at any time the power sensor readsthat the television is on (someone turned it on manually from its front panel,for example), the unit will automatically attempt to turn the television back off.

Channel 255 changes are disabled after the reception of this command.

‘POD’ Disables previous PON or POF command. Channel 255 changes are enabled.

“‘PTON’, <time>” Sets “IR power-on” pulse time (in tenth seconds). The default is 5 (one half-second). Time is stored in permanent memory.

“‘PTOFF’, <time>” Sets the amount of “off time” (in tenth seconds) after an IR power-on pulse.This time must expire before new IR pulses can be generated; this allows thetelevision time to power-up and get ready. The default is 15 (one and one-half seconds). Time is stored in permanent memory.

“‘CH’, <TV channel>”

Generates the IR digit pulses necessary to select the specified televisionchannel. Channels below 100 are generated as two-digit pulses; for chan-nels 100 and greater, IR function 127 is generated for the first digit. If IRfunction 21 exists (Enter for televisions that have this function), it will followthe digit pulses.

“‘CTON’, <time>” Sets the “IR on” pulse time (in tenth seconds) for channel digits and SP puls-es. The default is 5 (one half-second). Time is stored in permanent memory.

“‘CTOF’, <time>” Sets the “IR off” pulse time (in tenth seconds) between channel digits and SPpulses. The default is 5 (one half-second). Time is stored in permanent memory.

“‘SP’, <IR out>” Generates a single pulse of the specified IR function. Pulse times are set byCTON and CTOF.

Page 132: Axcess Programming Guide

122 Device-Specific Operations Unit 4: Communications

AXB-VOL3 Volume Controller

Channels

1 Ramps channels 1 and 2 up (increases)

2 Ramps channels 1 and 2 down (decreases)

3 Mutes channels 1 and 2; when the channel is off, the volume levels are re-stored to their previous levels

4 Ramps volume channel 1 up

5 Ramps volume channel 1 down

6 Mutes channel 1; when the channel is off, the volume level is restored to itsprevious level

7 Ramps volume channel 2 up

8 Ramps volume channel 2 down

9 Mutes channel 2; when the channel is off, the volume level is restored to itsprevious level

10 Ramps volume channel 3 up

11 Ramps volume channel 3 down

12 Mutes channel 3; when the channel is off, the volume level is restored to itsprevious level

Note: Ramping a volume channel while the mute channel is on will not automatically turn off themute channel. However, the ramping will still occur and will be noticed when the mute channel isturned off.

Send_Command commands

‘P<output channel (0–3)>L<level (0–255) or (0–100%)>[T<time in tenth seconds (0–255)>]’

Ramps channel to level or percentage at the current ramp rate or, optionally,in a specified amount of time. An output channel of zero represents bothchannels 1 and 2. Level zero is the lowest volume (mute), and level 255(100%) is maximum volume.

‘P<output channel (0–3)>R<time in tenth seconds (0–255)>[U or D]’

Sets the ramp rate of the channel. The specified time determines how long ittakes to ramp the full range both down to up and up to down. As an option,the specified time can determine how long it takes to ramp the full rangeonly up to down (D) or only down to up (U).

‘P1=P2’ Set the level of channel 1 to that of channel 2.

‘P2=P1’ Sets the level of channel 2 to that of channel 1.

‘P3=P1’ Sets the level of channel 3 to that of channel 1

Page 133: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 123

Levels

Use Create_Level and Send_Level to read the current volume level and to display bar graphs.The current volume level uses level 1. A Define_Connect_Level statement may be used to con-nect a Touch Panel slider directly to the volume level.

1 Volume output level channel 1 and slider control (0–255)

2 Volume output level channel 2 and slider control (0–255)

3 Volume output level channel 3 and slider control (0–255)

Page 134: Axcess Programming Guide

124 Device-Specific Operations Unit 4: Communications

AXP-CPI Custom Panel Interface

Channels

1–64 Push and Release channels for the buttons (switches) and feedback chan-nels for the LEDs (lamps). Buttons and LED channels start with 1 (top left)and increase in order down the columns, left to right.

Send_Command commands

‘BMODE<bar graph (1–3)><bar graph mode (0–8)>’

Sets the bar graph to operate in one of the following modes:

0 Normal bar graph mode (default): level 0–255 lights 0–8 LEDs

1 Normal dot mode (peak level): only the LED representing the highestlevel will be lit

2 Special bar graph mode: level zero still has the first LED on

3 Special dot mode: level zero still has the first LED on

4 Inverse bar graph mode: the eighth LED is the lowest level

5 Inverse dot mode

6 Inverse special bar graph mode

7 Inverse special dot mode

8 Discrete mode: individual LEDs can be lit for status applications

9 Inverse discrete mode

Bar graph numbers range from 1 (far left) to 3 (far right). Individual LED ele-ments of the bar graphs normally range from 1 (bottom) to 8 (top). UseSend_Level to operate bar graphs.

‘NOLMP’ Disables output drivers. This is sometimes useful when there are long dis-tances to the switches and when no outputs are needed.

‘NOSW’ Disables switch scanning. In normal operation, the outputs are multiplexedwith the switches such that the outputs drop out momentarily. The switchscanning can be disabled for outputs that must remain constant, such asdriving relays.

‘GLOW <level (0–9)>’ All lamps that are not turned on are illuminated at the specified glow level.This disables and overrides the potentiometer setting for the device.

‘GLOW*’ (d) All lamps that are not turned on are illuminated at the glow level determinedby the potentiometer setting for the device.

Page 135: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 125

AXP-CPIL Custom Panel Interface (LED)

AXP-MSP Mini-Softwire Panel

AXP-SP+ Softwire Panel

Channels

1–64 Push and Release channels for the buttons (switches) and feedback chan-nels for the LEDs (lamps). Buttons and LED channels start with 1 (top left)and increase in order down the columns, left to right.

Send_Command commands

‘BMODE<bar graph (1–3)><bar graph mode (0–9)>’

Sets the bar graph to operate in one of the following modes:

0 Normal bar graph mode (default): level 0–255 lights 0–8 LEDs

1 Normal dot mode (peak level): only the LED representing the highestlevel will be lit

2 Special bar graph mode: level zero still has the first LED on

3 Special dot mode: level zero still has the first LED on

4 Inverse bar graph mode: the eighth LED is the lowest level

5 Inverse dot mode

6 Inverse special bar graph mode

7 Inverse special dot mode

8 Discrete mode: individual LEDs can be lit for status applications

9 Inverse discrete mode

Bar graph numbers range from 1 (far left) to 3 (far right). Individual LED ele-ments of the bar graphs normally range from 1 (bottom) to 8 (top). UseSend_Level to operate bar graphs.

Page 136: Axcess Programming Guide

126 Device-Specific Operations Unit 4: Communications

AXP-EL Electroluminescent Touch Panel

Send_Command commands

‘PAGE–<page name>’

Flips to the specified page of the panel.

‘BEEP’ Outputs a beep.

‘DBEEP’ Outputs a double beep.

‘WAKE’ Forces panel out of its screen saver mode and resets its timer.

‘SLEEP’ Forces panel into screen saver mode.

‘TEXT<text button number (1–255)>–<new text for button>’

Changes the text in the specified button. The text remains permanent—evenduring a power outage—until it is changed with another TEXT command orwith the panel editor. A “|” character indicates a carriage return. All text isautomatically centered in the button.

‘FONT<text button number (1–255)>–<font size (1–4)>’

Changes the size of the text in the specified button. The sizes are as follows:

1 Small 3 Large2 Medium 4 Graphics symbols

The font size remains permanent—even during a power outage—until it ischanged with another FONT command or with the panel editor.

‘ICON<text button number (1–255)>–<border style (0–6)>’

Changes the border style of the specified button. The styles are as follows:

0 No border1 Single wide2 Double wide3 Single raised4 Double raised5 Single rounded6 Double rounded

The border style remains permanent—even during a power outage—until itis changed with another ICON command or with the panel editor.

Send_String sequences

Use Send_String to send characters to the 16- and 32-character terminal windows.

Page 137: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 127

AXP-EL+ Electroluminescent Touch Panel

AXP-LC Liquid Crystal Touch Panel

AXP-TS TiltScreen Touch Panel

Send_Command commands

‘RESET’ Clears all panel status (same as powering-up), but does not clear memory

‘SETUP’ Sends panel to Setup page

‘PAGE–<page name>’

Flips to the specified page of the panel.

‘TPAGEON’ Turns on page tracking, whereby when the page changes, a string is sent tothe Master Card in the format ‘PAGE–<page name>’. This string may becaptured with Create_Buffer for one panel and sent directly to another panelbecause the string is in the format of a PAGE– command. (Versions 2.20+)

‘TPAGEOFF’ Turns off page tracking. (Versions 2.20+)

‘BEEP’ Outputs a beep.

‘DBEEP’ Outputs a double beep.

‘WAKE’ Forces panel out of its screen saver mode and resets its timer.

‘SLEEP’ Forces panel into screen saver mode.

‘TEXT<text button number (1–255)>–<new text for button>’

Changes the text in the specified button. The text remains permanent—evenduring a power outage—until it is changed with another TEXT command orwith the panel editor. A “|” character indicates a carriage return. All text isautomatically centered in the button.

TEXT can be abbreviated as “‘!T’,<text button number (1–255)>,‘<new textfor button>’”. (Versions 2.42+)

‘FONT<text button number (1–255)>–<font size (1–21)>’

Changes the size or style of the text in the specified button as follows:

1 X-small 7 Hollow large2 Small 8 Hollow X-large3 Medium 9 Shadow X-large4 Large 20 Fixed symbols5 X-large 21 User-defined symbols6 Hollow medium

The font size remains permanent—even during a power outage—until it ischanged with another FONT command or with the panel editor.

FONT can be abbreviated as “‘!F’,<text button number (1–255)>,‘<font size(1–21)>’”. (Versions 2.42+)

Page 138: Axcess Programming Guide

128 Device-Specific Operations Unit 4: Communications

Send_Command commands (continued)

‘ICON<text button number (1–255)>-<border style (0–14)>’

Changes the border style of the specified button as follows:

0 No border 8 Single diamond1 Single wide 9 Double diamond2 Double wide 10 Triple wide3 Single raised 11 Double/single/single/single4 Double raised 12 Triple raised5 Single rounded 13 Shadow6 Double rounded 14 No border, no background7 Double/single/single (Versions 2.21+)

The border style remains permanent—even during a power outage—until itis changed with another ICON command or with the panel editor.

ICON can be abbreviated as “‘!I’,<text button number (1–255)>,‘<borderstyle (0–14)>’”. (Versions 2.42+)

‘KEYB–<initial text>’ Initializes the text string for the next time a keyboard icon appears, but doesnot automatically pop-up the keyboard. This command will not update akeyboard that is already displayed. The keyboard text string is stored untilpower is lost.

It is recommended that the AKEYB– command is used instead.

‘KEYP–<initial text>’ Initializes the text string for the next time a keypad icon appears, but doesnot automatically pop-up the keypad. This command will not update a keypadthat is already displayed. The keypad text string is stored until power is lost.

It is recommended that the AKEYP– command is used instead.

‘AKEYB–<initial text>’

Pops up the keyboard icon and initializes the text string. The string is storeduntil power is lost. (Versions 2.44+)

‘AKEYP–<initial text>’

Pops up the keypad icon and initializes the text string. The string is storeduntil power is lost. (Versions 2.44+)

‘CLOCK <date> <time>’

Sets the date (mm-dd-yy) and time (hh:mm:ss) on the panel.

‘ZAP!’ Clears all memory; all buttons, pages, and drawings are erased.(Versions 2.44+)

Send_String sequences

Use Send_String to send characters to the 16- and 32-character terminal windows.

Page 139: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 129

AXP-MLCD Mini-LCD Panel

Send_Command commands

‘LIGHT<backlight level (0–9)>’

Sets the backlight level where level zero is off and level 9 is full brightness.

‘TIME<timeout in minutes (1–99)>’

Sets the amount of time until the backlight will turn off if there are no buttonpresses (this saves power). The default time is 15 minutes.

‘TIME’ Resets backlight timeout as if there was a button press.

‘LIGHT’ Causes an immediate backlight timeout (off).

Send_String sequences

Use Send_String to send characters to the LCD screen. After a character appears on the screenwhere the imaginary cursor is located, the cursor moves one position to the right. The followingcharacters (in decimal format) have special results:

2 Moves the cursor to home (line 1, column 1).

3 Moves the cursor to end (line 2, column 16).

8 Moves the cursor one position left.

9 Moves the cursor one position right.

10 Moves the cursor one line down. If the current position is the bottom line,the screen will scroll up one line.

12 Clears the display and moves the cursor to home.

13 Moves cursor to the first column of the current line.

17, <line>, <column>

Moves cursor to the location specified by the next two characters (line, column).

Page 140: Axcess Programming Guide

130 Device-Specific Operations Unit 4: Communications

AXU-SPL4 Softwire LCD Panel

Channels

1 Button 1 (from left to right)

2 Button 2

3 Button 3

4 Button 4

Note: The numbers for the previous four channels are the defaults. These can be changed withthe OFFSET command described later on this page.

251 Relay 1

252 Relay 2

253 Input/output port 1

254 Input/output port 2

Send_Command commands

‘LIGHT<backlight level (0–9)>’

Sets the backlight level where level zero is off and level 9 is full brightness.

‘TIME<timeout in minutes (1–99)>’

Sets the amount of time until the backlight will turn off if there are no buttonpresses (this saves power). The default time is 15 minutes.

‘TIME’ Resets backlight timeout as if there was a button press.

‘LIGHT’ Causes an immediate backlight timeout.

‘OFFSET<switch offset>’

Sets the offset for the four pushbutton switches. If the switch offset is 97,switch 1 (the leftmost) will use channel 97 for its Push, Release, and feed-back channel; similarly, switches 2–4 will use channels 98–100, respectively.

‘BEEP<time (0–9)>’ Generates a beep of the specified duration; time is measured in tenth sec-onds. If another BEEP command is sent before the previous one stops, theduration is extended. A beep time of zero turns off the beep immediately.

Send_String sequences

Use Send_String to send characters to the LCD screen. After a character appears on the screenwhere the imaginary cursor is located, the cursor moves one position to the right. The followingcharacters (in decimal format) have special results:

2 Moves the cursor to home (line 1, column 1).

3 Moves the cursor to end (line 2, column 16).

8 Moves the cursor one position left.

9 Moves the cursor one position right.

Page 141: Axcess Programming Guide

Unit 4: Communications Device-Specific Operations 131

Send_String sequences (continued)

10 Moves the cursor one line down. If the current position is the bottom line,the screen will scroll up one line.

12 Clears the display and moves the cursor to home.

13 Moves cursor to the first column of the current line.

17, <line>, <column>

Moves cursor to the location specified by the next two characters(line, column).

Page 142: Axcess Programming Guide
Page 143: Axcess Programming Guide

Unit 4: Communications The External_Control Protocol 133

The External_Control Protocol

Controlling AXCESS from the outside

Not every AXCESS system is controlled by control panels; sometimes the controlneeds to come from another device, such as a computer (via modem if necessary)or even another AXCESS system. To facilitate this, AXCESS supports a simple se-rial communications protocol that allows every AXCESS function to be controlledfrom an outside source via an AXC-232 RS-232/422 Control Card or an RS-232 porton an AXCENT2.

Sending commands

To control AXCESS from a remote machine, you must first use the External_Control keyword in the Define_Start section of your program to tell AXCESS

which device the RS-232 card is. For example:

DEFINE_STARTEXTERNAL_CONTROL (RS232)

The device RS232 will now be used as an external control port. Notice thatExternal_Control can only be used in the Define_Start section of your program.

Next, you must send command “packets” to AXCESS. Each of these packetsconsists of the following:

• An attention character: prepares AXCESS for the transmission; it is always$2A (*) for sending commands, and it is always $26 (&) for responses

• A command number: Figure 4-2 displays these commands

• One or more parameters

• A checksum byte: the sum of all of the characters in the packet (exceptitself), modulo 256; its purpose is to make sure that the packet was notgarbled during the transmission

C H A P T E R

11

Page 144: Axcess Programming Guide

134 The External_Control Protocol Unit 4: Communications

Command packets

Command

Turn Channel On ‘*’ <1> <device> <channel> <checksum>

Turn Channel Off

Get Channel Status

Packet structure

Send String

Send Command

Do Push

Do Release

Device ID

Pulse

Response Mask

‘*’ <2> <device> <channel> <checksum>

‘*’ <3> <device> <channel> <checksum>

‘*’ <4> <device> <# of bytes> <string> <checksum>

‘*’ <5> <device> <# of bytes> <string> <checksum>

‘*’ <6> <device> <channel> <checksum>

‘*’ <7> <device> <channel> <checksum>

‘*’ <8> <device> <checksum>

‘*’ <10> <device> <channel> <checksum>

‘*’ <11> <mask> <checksum>

Figure 4-2

Commands that can be

sent to AXCESS from a

remote machine.

For example, the following command packet causes channel 4 on device 3 tobe turned on (the bytes are shown in hexadecimal):

<$2A> <$Ø1> <$Ø3> <$Ø4> <$32>

The attention byte appears first. Next, the first command ($01) is needed toturn a channel on. The following two bytes are the device number and channelto be activated. Finally, the checksum appears at the end.

In this next example, the string ‘AMX’ is sent to device 3:

<$2A> <$Ø4> <$Ø3> <$Ø3> <$41> <$4D> <$58> <$1A>

The attention byte remains the same as before, but the command changes to $04in order to tell AXCESS to send a string. The device number is next, followed bythe number of bytes comprising the string—in this case, three. The hexadecimalvalues for each letter of ‘AMX’ is next, and then the packet ends with the checksum.

Responses from AXCESS

In each of the previous section, a command was sent to the Master Card. Inturn, the Master Card also responds to some of the commands. See Figure 4-3for a list of these responses.

For example, after you sent the string ‘AMX’ to the Master Card, you wouldreceive the following packet if the transmission was successful:

Page 145: Axcess Programming Guide

Unit 4: Communications The External_Control Protocol 135

Returned packets

Response

Channel Is On ‘&’ <1> <device> <channel> <checksum>

Channel Is Off

Receive String

Packet structure

Get Push

Get Release

Get Device ID

‘&’ <2> <device> <channel> <checksum>

‘&’ <4> <device> <# of bytes> <string> <checksum>

‘&’ <7> <device> <channel> <checksum>

‘&’ <6> <device> <channel> <checksum>

‘&’ <8> <device> <device ID> <checksum>

Receive String is off

0 1 1 0 0 0 0 0 $60

Get Push is on

Get Release is on

Figure 4-5

The mask byte for one

combination of response

preferences.

Receive String

1 1 1 0 0 0 0 0 $8A

Get Push

Get Release

Figure 4-4

The bit locations of several

responses in the mask byte.

<$26> <$Ø4> <$Ø3> <$Ø3> <$41> <$4D> <$58> <$1A>

As you may notice, this is the exact packet as sent previously with the excep-tion of a different attention byte; it is $26 because this is a response.

You may not want these responses to appear, however. If you don’t, you canturn them off by sending the Response Mask command (11) with the appropri-ate “mask” byte. Only three responses can be turned off, and their mask bit po-sitions are shown in Figure 4-4. A “zero” bit turns the response off, and a “one”bit turns the response on.

For example, to turn off Receive String responses and turn on Get Push andGet Release responses, send the mask byte $60 as shown in Figure 4-5.

Figure 4-3

Responses from the AXCESS

Master Card.

Page 146: Axcess Programming Guide
Page 147: Axcess Programming Guide

GLOSSARYAND INDEX

AXCESS Programming Guide

Page 148: Axcess Programming Guide
Page 149: Axcess Programming Guide

Glossary 139

Glossary

Analog An input or output that can have many values.

Arithmetic operators Operators within AXCESS that create a numeric valuefrom one or more operations such as addition, multiplication, and division.

Array A single variable that has more than one storage location.

ASCII A coding scheme that assigns numeric values to letters, numbers, andother characters.

AXlink The AXCESS communications bus.

Bar graph A visual representation of a level.

Baud rate Speed of data transmission; measured in bits per second (bps).

Bitwise operators Operators within AXCESS that perform bit-by-bit logicaloperations on one byte or between two bytes.

Block Highlighted section of text in the AXCESS text editor.

Block file File saved on disk using the Write Block to Disk command <Alt-W>;it has the DOS extension “AXB.”

Boolean operators See logical operators.

Buffer An array variable that is associated with a particular device for thepurpose of storing information sent by the device.

Caller The Call statement that called a subroutine.

CardFrame Housing for the AXCESS control cards.

Case sensitive Uppercase and lowercase values are not evaluated the same;for example, “CASS” is not the same as “cass.”

Cell One particular location in a two-dimensional array.

Channel The basic input/output unit. Channels correspond to actual controlfunctions such as relays and infrared signals. Each AXCESS device has 255channels, although all are not always used.

Page 150: Axcess Programming Guide

Glossary 140

Comment A description or remark within an AXCESS program that is not con-sidered part of the actual program; it is ignored by the compiler.

Communications port Port through which serial data is transferred.

Compilation error An error that occurs at compile time.

Compile time When the program is compiled.

Compound statement A group of several statements enclosed by a set ofbraces.

Constant An identifier whose value remains unchanged throughout the en-tire program.

Decimal Base 10 numbering system.

Deck A transport-controlled audiovisual device.

Definition section One of the various divisions of the AXCESS program. Thesesections are Define_Device, Define_Constant, Define_Variable, Define_

Latching, Define_Mutually_Exclusive, Define_Toggling, Define_Combine,Define_Start, and Define_Program.

Device A component that can be connected to AXlink.

Device-channel A reference to a specific channel in the AXCESS system in theformat [device,channel].

Device number A unique number from 1 to 255 designated to each deviceconnected to AXCESS via AXlink.

Digital An input or output that can have only two values: “on” or “off.”

DIP switch A switch on a circuit board that can be turned on or off to deter-mine various settings.

Direct assignment Generating an output change by assigning a value to adevice-channel or variable.

Downloading The sending of data from a computer to a device (such as aMaster Card).

Dumb terminal A serial communications device. Whatever is typed goes outthe communications port, and whatever comes in the port is displayed on themonitor screen.

EPROM Acronym for erasable programmable read-only memory.

Error See compilation error, run-time error, and logic error.

Page 151: Axcess Programming Guide

Glossary 141

Executable code A translated version of the source code that the AXCESS sys-tem can understand.

Feedback The lighting of a button that represents a condition.

Firmware Residing within the EPROMs in many AXCESS devices, this machine-level software enables these devices to operate.

Flag A variable that is used to store an “on” or “off” state.

Free format A characteristic of the AXCESS language that allows the sourcecode to be independent of tabs and carriage returns.

Global variable Any variable in the Define_Variable section of the program.The scope of these variables extends throughout the entire program.

Hexadecimal Base 16 numbering system.

High byte A normal variable consists of 16 bits, which is equal to two bytes;one byte is the high byte, and the other is the low byte.

Identifier A combination of letters, numbers, or underscores that represents adevice, constant, or variable; an identifier must start with a letter.

Include file A DOS file which is included in the compiling process withouthaving to reside in the computer’s memory; it has the DOS extension “AXI.”

Index value The number that tells AXCESS which location in an array to re-trieve. This value must be an integer from 1 to 255.

Infinite loop A loop which will never terminate.

Input change A signal sent by the input function of a channel that alertsAXCESS to scan mainline for a reference to that signal.

Instance number A number enclosed in brackets after the System_Call key-word to denote which copy of the compiled library file to call.

Integer In AXCESS, the range of whole numbers from 0 to 65,535, inclusive.

Integer array An array where each location can hold a value ranging fromzero to 65,535. Note that an integer array will take up twice as much AXCESS

memory than a normal array of the same storage capacity would.

Keyword A word or series of words that signifies the operation for AXCESS toexecute.

Latching A defined behavior of status that causes its output channel to stayon or off until activated once more.

Page 152: Axcess Programming Guide

Glossary 142

Level A value that is related to an analog input or output on an AXCESS device.

Library file A special file containing AXCESS program code. These files areused only for System_Calls.

Local variable A variable declared in a subroutine, and whose scope is lim-ited to that subroutine.

Locking When flags are used to disable events.

Logic error An error in the actual design of the program.

Logical operators Operators within AXCESS that compare two conditions or,in the case of Not, invert one condition. A true or false result is produced.These operators are also known as Boolean operators.

“Look and feel” How something interacts with the user. This is also calledthe user interface.

Loop A block of code that is repeatedly executed until a condition is satisfied.

Master Card The AXCESS card that controls the activities of the AXCESS system.

Mainline The section of the program that actually is executed continuously bythe Master Card. This is also known as the Define_Program section.

Modem Communications device used to transfer serial data through phone lines.

Momentary A defined behavior of status that causes its output channel to beactivated as long as the corresponding button is pressed.

Momentary mutually exclusive A characteristic of status that allows onlyone channel of a predefined set to be on at a time. The output channel is acti-vated as long as the corresponding button is pressed.

Mutually exclusive latching A characteristic of status that allows only onechannel of a predefined set to be on at a time. The output channel stays onuntil another channel of the set is activated.

Mutually exclusive set Only one channel or variable in this set can be on at a time.

Mutually exclusive toggling A characteristic of status that allows only onechannel of a predefined set to be on at a time. The output channel stays onuntil it is reactivated or another channel of the set is activated.

Name mangling The process where the name of the Define_Call and anyWaits and Wait_Untils in a library file are changed so that multiple separatecopies can be compiled into a program.

Nesting Placing conditional branches inside other conditional branches.

Page 153: Axcess Programming Guide

Glossary 143

Null string An empty set of single quotes, which represents a string lit-eral with no content and a length value of zero.

Offset A number used as a “transparent stepping stone” for other con-stants and variables. These constants and variables are added to the off-set to access different functions without changing their original values.

Operator A character or group of characters that performs a specificarithmetic, relational, logical, or bitwise function.

Output change A message to the output function of a channel.

Password A series of numbers that allows access to restricted data.

Preset A level saved for later retrieval. When a preset is recalled, thelevel returns to the preset value.

Program file File containing the AXCESS program source code; it hasthe DOS extension “AXS.”

Push window A window on the bottom left of the AXCESS program that dis-plays the Push statement of the last button pressed in the AXCESS system.

Ramp To change a level from one value to another smoothly over a pe-riod of time.

Re-assignment When AXCESS assigns a new value to a parameter vari-able after a subroutine is executed, but before it returns to the caller.

Redirection A command that tells AXCESS to pass all strings from onedevice to another, and vice versa.

Relational operators Operators within AXCESS that compare two nu-meric values and produce a true or false result.

Reserved word An identifier reserved for use by the AXCESS compiler.

Row A one-dimensional array of values in a two-dimensional array.

Run time When the program is executed in the Master Card.

Run-time error An error that occurs during program execution.

S19 format File format used to place code or data into EPROM chips.

Scope The part of the program where the variable can be accessed. Avariable has global scope if the entire program has access to it; a variablehas local scope if only a section of the program has access to it.

Page 154: Axcess Programming Guide

Glossary 144

Select group A group of buttons that selects a single device from a group ofdevices.

Select variable A variable whose value determines which device in a groupis currently selected.

Serial The transfer of data one bit at a time.

Server Card The AXCESS card that distributes command signals among devicecards, to and from the Master Card, and within its CardFrame.

Source code The AXCESS program that you type and edit.

State The “on” or “off” status of a channel.

Statement A keyword and all of its parameters or conditions.

Status Records the state of the physical part of a channel.

String A sequence of bytes (characters).

String expression Enclosed by double quotes, this expression combines sev-eral types of data into a single string.

String length An internal value set for arrays by string assignment operations.

String literal A set of characters (values ranging from 32 to 127) enclosed insingle quotes.

Subroutine A section of code that stands alone and can be “called” from any-where else in the program.

System variable A value kept in the Master Card that can be referenced bycertain keywords.

Timeout A defined amount of time that a device waits for user input untilperforming a default action.

Transport function A common function of devices such as VCRs and cassettedecks. For example: Play, Stop, Pause, Fast Forward, and Rewind.

Two-dimensional array A storage place holding multiple one-dimensional arrays.

Uploading The opposite of downloading; the computer receives data from a device.

User interface See “look and feel.”

Variable A place to store data that will change as the program is executed.

Wait list A list containing unexpired Wait statements. After each pass throughmainline, the Master Card scans this list to see if any have come due.

Page 155: Axcess Programming Guide

Glossary 145

Wait_Until list A list containing unexpired Wait_Until statements. After each passthrough mainline, the Master Card scans this list to see if any have come due.

Warning A statement by the compiler urging caution with a potentially haz-ardous statement in the source code.

Wildcard character Allows any character to be in its place; in AXCESS, this isthe question mark (?). This is only valid when comparing dates and times.

Page 156: Axcess Programming Guide
Page 157: Axcess Programming Guide

Index 147

Index

A

Active. See Select...ActiveAnd 7, 45Arithmetic operators 43–44Arrays

as buffers 11, 12compilation errors 56integer 25run-time errors 57string lengths 26

ASCIIchart 51

Atoi 7–8AXCESS

external control 133–135AXlink

updating 4

B

Band 8, 47Bar graphs

updating 4Bitwise operators 47–48Bnot 8, 47Boolean operators. See Logical operatorsBor 8–9, 47Buffers. See also Multi-buffers

clearing 10creating 11removing characters 22

Bus devicesAXB-FD 118AXB-PTM 120AXB-SLD 109AXB-TCM 120AXB-TM 120AXB-VOL3 122updating 4

Bxor 9, 47

C

Call 9run-time errors 57, 58

Cancel_All_Wait 9Cancel_All_Wait_Until 10Cancel_Wait 10Cancel_Wait_Until 10Cards

AXC-232 98AXC-422 99AXC-DMX 100AXC-IRS 101AXC-MIDI 102AXC-OXM 103AXC-PRN 104AXC-PTC 105AXC-PTI 106AXC-PTSM 108AXC-SAV 109AXC-SLD 109AXC-SMP 110AXC-SPE 111AXC-TEMP 112AXC-VAI2 113AXC-VG24 115AXC-VOL 116AXC-VRG4 115AXC-X10 117

Channelsaccessing 97

Character echo 93Clear_Buffer 10Combine list 14Commands

sending 36, 97Compilation errors 55, 55–57Compiler

error messages 63–67errors and warnings 55–57warning message 40

Page 158: Axcess Programming Guide

Index148

Compilingconditional 24

Constantsdefining 15

Control panelsAXP-CPI 124AXP-CPIL 125AXP-EL 126AXP-EL+ 127AXP-LC 127AXP-MLCD 129AXP-MSP 125AXP-SP+ 125AXP-TS 127AXU-SPL4 130

Create_Buffer 11, 12Create_Level 11

D

Date 12Master Card 93

_ _Date_ _ 12Day 13Debugging 55–61

mode 57#Define 13Define_Call 13–14

compilation errors 56Define_Combine 14–15Define_Connect_Level 15Define_Constant 15Define_Device 15Define_Latching 16Define_Mutually_Exclusive 16–17Define_Program 3, 17. See also MainlineDefine_Start 3, 17

and External_Control 133Define_Toggling 17Define_Variable 17–18Device_ID 18Devices

comparing 93functionally identical 14–15ID numbers 18

Do_Push 18–20Do_Release 20

E

Echo 93Else 20, 24#End_If 20Errors

compilation 55, 55–57logic 55run-time 55, 57–58

External_Control 21, 133–135mask bytes 135responses from AXCESS 134–135sending commands 133–134

F

“False” value 44_ _File_ _ 21Find_String 21

G

Get_Buffer_Char 10, 22Get_Pulse_Time 22Get_Timer 23

H

Hexadecimal 26chart 51

I

Identifiersreserved 5

If 23–24true and false values 44

#If_Defined 24If...Else If 24–41#If_Not_Defined 25Include 25

files 25Input changes

activating 18–20de-activating 20for combined devices 14pending 4

Integer 25compilation errors 56

Page 159: Axcess Programming Guide

Index 149

Itoa 25–26Itohex 26

L

Latchingdefining 16

Left_String 26Length_String 26Levels 11

connecting 15sending 36updating 4

Library files 37_ _Line_ _ 26Local_Var 27Logic errors 55Logical operators 45–47Long_While 27–28

compilation errors 56Loops 27–28, 28Lower_String 28

M

Mainline 3–4executing only once 61marking beginning of 17

Master Cardand mainline 3–4command help 94communication commands 93–95comparing devices on AXlink 93controlling AXlink 94date 95extended memory 94memory 94passing characters 94redundant 94resetting system 95run-time errors 57–58sending commands 94sending strings 95Show Input mode 95showing devices on AXlink 95slot 28, 95system program 94time 95version 95

Master_Slot 28Medium_While 28Mid_String 29Min_To 22, 29Mini-LCD Panels 129Mini-Softwire Panels 125Multi-buffers. See also Buffers

accessing characters 22creating 12header bytes 12

Mutually exclusivedefining 16–17turning channel off 38

N

_ _Name_ _ 29Nesting

compilation errors 56Not 29–30, 45, 47

O

Off 30run-time errors 58

On 30run-time errors 58

Operators 43–49abbreviations 48arithmetic 43–44bitwise 47–48logical 45–47precedence 48–49relational 44–45

Or 30–31, 45Output changes

for combined devices 14

P

Parenthesesand precedence 49

Pause_All_Wait 31Pause_Wait 31Power-up

program section 17Program_Name 31Pulse 3, 31

setting time of 37

Page 160: Axcess Programming Guide

Index150

Push 32Push_Channel 32Push_Device 32

R

Random_Number 33Redirect_String 33Relational operators 44–45Release 33Release_Channel 34Release_Device 34Remove_String 34Restart_All_Wait 34Restart_Wait 35Right_String 35RS-232

communications 4external control 21, 133

Run-time errors 55, 57–58

S

Select...Active 35Send_Command 36, 97Send_Level 36Send_String 36, 97

tracing program flow 58–59Sequences

sending 97Set_Length_String 10, 36

run-time errors 58Set_Pulse_Time 37Set_Timer 37Show Input mode 95Softwire LCD Panel 130Softwire Panels 125Standard function order 74Strings

array string lengths 26finding 21redirecting 33removing 34sending 36setting upper/lower case 28, 39

Subroutinesdefining 13–14executing 9library files 37

Systemresetting 95

System_Call 37factory 71–77

debugging 76defeating feedback 75–76format 71names 72parameters 73–75software version 76–77timeouts 75

T

Time 37–38_ _Time_ _ 38Timer 23, 37To 38

run-time errors 58Toggling

defining 17Total_Off 38–39Touch Panels

AXP-EL 126AXP-EL+ 127AXP-LC 127AXP-TS 127

Tracing 58–59“True” value 44

U

Unlike types 56Upper_String 39

V

Variable Watch window 60Variables

and relational expressions 45compilation errors 56, 57defining 17–18global 27local 27scope 27viewing 60–61

Page 161: Axcess Programming Guide

Index 151

W

Wait 39list 3, 9, 10, 31, 39restarting 34, 35

Wait_Until 40list 3, 10, 40

#Warn 40Warnings

compilation 55–57While 40–41

compilation errors 56run-time errors 58–61

Wildcard characters 12

X

Xor 41, 45

Page 162: Axcess Programming Guide