Motion Coordinator Technical Reference Manual
Trio BASIC Commands 8-51
Input / Output Commands
HEX
Type:
Command
Description:
The
HEX
command is used in a print statement to output a number in hexadecimal
format. The HEX command is available on MC206/MC224 only.
Example:
PRINT#5,HEX(IN(8,16))
IN()/IN
Type:
Function.
Syntax:
IN(input no<,final input>)/IN
Description:
Returns the value of digital inputs. If called with no parameters, IN returns the
binary sum of the first 24 inputs (if connected). If called with one parameter whose
value is less than the highest input channel, it returns the value (1 or 0) of that par-
ticular input channel. If called with 2 parameters
IN()
returns in binary sum of the
group of inputs. In the 2 parameter case the inputs should be less than 24 apart.
Parameters:
Example 1:
In this example a single input is tested:
test:
WAIT UNTIL IN(4)=ON
GOSUB place
Example 2:
Move to the distance set on a thumb wheel multiplied by a factor. The thumb wheel
is connected to inputs 4,5,6,7 and gives output in BCD.
moveloop:
MOVEABS(IN(4,7)*1.5467)
WAIT IDLE
GOTO moveloop
Note how the move command is constructed:
Step 1: IN(4,7) will get a number 0..15
Step 2: multiply by 1.5467 to get required distance
Step 3: absolute MOVE by this distance
input no:
input to return the value of/start of input group
<final input>:
last input of group