Using Buffers; Communicating To The Outside World; Receiving Strings; Creating Buffers - AMX AXCESS CONTROL SYSTEM PROGRAM Instruction Manual

Programming language
Table of Contents

Advertisement

Using Buffers

Using Buffers

Communicating to the Outside World

One of the most powerful features of Axcess is its ability to send and receive any combination of
values using RS-232, RS-422, RS-485, PA-422, MIDI, and a variety of other formats. You have the
ability to construct any combination of numbers and characters with the string expression and send
it to an external device. In addition, you can receive strings from external devices and interpret
them to obtain useful information.

Receiving strings

Receiving strings requires several more steps than sending strings. You must first create a buffer for
device to receive strings from that device. A buffer is an array variable associated with a particular
device for the purpose of storing information received from the device.

Creating buffers

To create a buffer, use the CREATE_BUFFER keyword. This keyword can only appear in the
DEFINE_START section of your program; the syntax is:
CREATE_BUFFER device, array
CREATE_BUFFER can only be used in the DEFINE_START section.
The CREATE_BUFFER keyword directs Axcess to place any data received from the specified
device into the specified array. When Axcess places the bytes into the array, it increments the length
value for the array and then places the bytes into the array at the current end of the array. See
FIG. 23 for a pictorial explanation.
Even though the array is acting as a buffer, it is still an array and can be treated as one. You can still
access the individual locations, send it to a device, assign it to other arrays, assign other arrays to it
and use the array manipulation keywords, discussed previously in Arrays and Strings on page 31.
FIG. 23 When data comes in from a device, it goes into the spot determined by the length value of the array.
Here, the length value was 3. So the 'Y' is put into location 4, and the length value is incremented to 4.

Storing characters

When a device sends string information to the Central Controller, the Central Controller places the
incoming information into the buffer created for that device, and updates the buffer's length value.
These actions are executed after the Central Controller has passed through mainline. Since all data
going in and out of these devices is serial, each byte is handled one at a time.
Axcess Programming Language
73

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Axcess

Table of Contents