All BASIC commands
Section 4-2
174
4-2-136 IN
/i
Example
IF key_char=$31 THEN
GOSUB char_1
ELSEIF key_char=$32 THEN
GOSUB char_2
ELSEIF key_char=$33 THEN
GOSUB char_3
ELSE
PRINT "Character unknown"
ENDIF
See also
N/A
Type
I/O function
Syntax
IN(input_number [ ,final_input_number ])
IN
Description
The
IN
function returns the value of digital inputs.
•
IN(input_number, final_input_number)
will return the binary sum
of the group of inputs in range [
input_number
,
final_input_number
]. The two arguments must be less than 24
apart.
•
IN(input_number)
will return the value of the particular input speci-
fied by the parameter
input_number
.
Arguments
•
input_number
The number of the input for which to return a value. The range for
this parameter is 0..255.
•
final_ input_number
The number of the last input for which to return a value. The range
for this parameter is 0..255.
Example
The following lines can be used to move to the position set on a thumb
wheel multiplied by a factor. The thumb wheel is connected to inputs 4,
5, 6 and 7, and gives output in BCD.
moveloop:
MOVEABS(IN(4,7)*1.5467)
WAIT IDLE
GOTO moveloop
The
MOVEABS
command is constructed as follows:
Step 1:
IN(4,7)
will get a number between 0 and 15.
Step 2: The number is multiplied by 1.5467 to get required distance.
Step 3: An absolute move is made to this position.
Example
In this example a single input is tested:
test:
WAIT UNTIL IN(4)=ON ' Conveyor is in position when ON
GOSUB place
See also
OP
.
Summary of Contents for trajexia CJ1W-MCH72
Page 69: ...Specifications Section 2 4 58...
Page 83: ...FINS commands Section 3 4 72...
Page 147: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Page 277: ...All BASIC commands Section 4 2 266...
Page 371: ...360 Index...
Page 373: ...362...