Trajexia system
PROGRAMMING MANUAL
25
Revi
si
on 3.0
I/O memory
I/O memory is used for holding the status of input and output devices
connected to the Trajexia system. It is divided into two sub-areas: one for
digital I/O memory, and one for analog I/O memory. The digital I/O memory
holds input and output statuses of digital I/O devices. Its capacity is 256 bits
(input points) for input and 256 bits (output points) for outputs. The inputs in
this memory can be accessed using the
IN
command. The outputs can be
accessed using the
OUT
command.
The analog I/O memory holds input and output values of analog I/O devices.
Its capacity is 36 input channels and 36 output channels. The analog input
channels can be accessed using the
AIN
command. The analog output
channels can be accessed using the
AOUT
command.
VR memory
VR memory is commonly used if some data or value needs to be global,
which means that it is accessible from all programs in the project at the
same time. The size of this memory is 1024 slots with indexes 0 to 1023. A
memory slot is addressed using the
VR(x)
macro where
x
is index of the VR
memory slot. The VR memory is accessible for reading and writing. Writing
is done by making mathematical assignment using the
=
command in the
program. The content of this memory is held in the battery powered RAM
memory and is preserved during power off. The VR memory is also
preserved when changing the battery, if this is done quickly.
TABLE memory
TABLE is commonly used if some data or value needs to be global, which
means that it is accessible from all programs in the project at the same time.
Whereas the VR memory is used for similar purposes to define several
global data and values, TABLE memory is used for much bigger amounts of
global data, which also need to be arranged in a certain order. For this
reason, TABLE memory is commonly used for storing TABLE data, motion
profiles, logging data, etc. Some BASIC commands that provide this type
and size of data, for example
SCOPE
,
CAM
,
CAMBOX
etc., require use of
TABLE memory to write their results. The size of this memory is 64000 slots
with indexes 0 to 63999. The TABLE is accessible for reading and writing
too, but the way it is accessed differs for those two operations. Before being
read, a particular TABLE memory slot needs to be defined and written first,
using the command
TABLE(x, value1, value2,…)
where
x
is the index of
the start TABLE memory slot to define, and
value1
,
value2
, ... are the
values written into the TABLE memory at indexes x, x+1, ... Once defined
and written, the TABLE memory slot can be read using the
TABLE(x)
command, where
x
is the index of the TABLE memory slot. An attempt to
read an undefined TABLE memory slot results in an error reported by the
TJ1-MC__. The TABLE memory content is held in the battery powered RAM
memory and is preserved during power off. The TABLE memory is also
preserved when changing the battery, if this is done quickly.
2.3.3
Data structures and variables
BASIC programs can store numerical data in various types of variables.
Some variables have predefined functions, such as the axis parameters and
system parameters; other variables are available for the programmer to
define as required in programming. The TABLE, global and local variables of
the TJ1-MC__ are explained in this section. Furthermore also the use of
labels will be specified.
TABLE variables
The TABLE is an array structure that contains a series of numbers. These
numbers are used for instance to specify positions in the profile for a
CAM
or
CAMBOX
command. They can also be used to store data for later use, for
example to store the parameters used to define a workpiece to be
processed.
The TABLE is common to all tasks on the TJ1-MC__. This means that the
values written to the TABLE from one task can be read from other tasks.
TABLE values can be written and read using the
TABLE
command. The
maximum length of the array is 64000 elements, from
TABLE(0)
to
TABLE(63999)
. The TABLE array is initialized up to the highest defined
element.
Global variables
The global variables, defined in VR memory, are common to all tasks on the
TJ1-MC__. This means that if a program running on task 2 sets VR(25) to a
certain value, then any other program running on a different task can read
that same value from VR(25). This is very useful for synchronizing two or
I52E-EN-03.book Seite 25 Freitag, 29. Juni 2007 11:55 11