Specifications
BASIC commands
PROGRAMMING MANUAL 139
Revision 5.0
3.2.199 OPEN_WIN
/i
3.2.200 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 depends on the number of additional digital I/O
connected over the MECHATROLINK-II bus 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. The range for this parameter
depends on the number of additional digital I/O connected over the
MECHATROLINK-II bus. If there are no digital I/O connected, the range
for this parameter is 8..31
• value
The value to be output, either OFF (0) or ON (1). 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 only look for registration marks between 170 and 230
OPEN_WIN = 170
CLOSE_WIN = 230
REGIST(256+3)
WAIT UNTIL MARK
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.