BASIC commands
PROGRAMMING MANUAL
120
Revi
si
on 3.0
3.2.198 OPEN_WIN
/i
3.2.199 OR
/i
Description
The
OP
command sets one or more outputs or returns the state of the first 24
outputs.
OP
has three different forms depending on the number of argu-
ments.
•
Command
OP(output_number,value)
sets a single output channel. The
range of
output_number
is between 8 and 256 and
value
is the value to
be output, either 0 or 1.
•
Command
OP(binary_pattern)
sets the binary pattern to the 24 outputs
according to the value set by
binary_pattern
.
•
Function
OP (without arguments)
returns the status of the first 24 out-
puts. This allows multiple outputs to be set without corrupting others
which are not to be changed.
Note: The first 8 outputs (0 to 7) do not physically exist on the TJ1-MC__.
They can not be written to and will always return 0.
Arguments
•
output_number
The number of the output to be set.
•
value
The value to be output, either off or on. All non-0 values are considered
as on.
•
binary_pattern
The integer equivalent of the binary pattern is to be output.
Example
OP(12,1)
OP(12,ON)
These two lines are equivalent.
Example
OP(18*256)
This line sets the bit pattern 10010 on the first 5 physical outputs, outputs 13
to 17 would be cleared. The bit pattern is shifted 8 bits by multiplying by 256
to set the first available outputs as outputs 0 to 7 do not exist.
Example
VR(0) = OP
VR(0) = VR(0) AND 65280
OP(VR(0))
This routine sets outputs 8 to 15
ON
and all others off.
The above programming can also be written as follows:
OP(OP AND 65280)
Example
val = 8 ' The value to set
mask = OP AND NOT(15*256) ' Get current status and mask
OP(mask OR val*256) ' Set val to OP(8) to OP(11)
This routine sets value
val
to outputs 8 to 11 without affecting the other out-
puts by using masking.
See also
IN
.
Type
Axis parameter
Syntax
OPEN_WIN
OW
Description
The
OPEN_WIN
parameter defines the beginning of the window inside or
outside which a registration event is expected. The value is in user units.
Arguments
N/A
Example
No example.
See also
CLOSE_WIN
,
REGIST
,
UNITS
.
Type
Mathematical operation
Syntax
expression1 OR expression2
Description
The
OR
operator performs the logical
OR
function between corresponding
bits of the integer parts of two valid BASIC expressions.
The logical
OR
function between two bits is defined as in the table below.
Arguments
•
expression1
Any valid BASIC expression.
•
expression2
Any valid BASIC expression.
I52E-EN-03.book Seite 120 Freitag, 29. Juni 2007 11:55 11