Motion Coordinator Technical Reference Manual
Trio BASIC Commands 8-45
Input / Output Commands
Input / Output Commands
AIN
Type:
Function
Syntax:
AIN(analog chan)
Description
Up to 4 analog input modules (P325) may be connected on the Motion Coordina-
tor’s built in CAN bus port. Each P325 has 8 channels of +/-10v analog inputs which
return 2047..-2048. The values from each P325 channel are updated every 10msec.
On controllers with a built-in analog channel such as the MC206 channel 0 from the
CAN bus is replaced by the built-in channel 0.
Parameters:
Example:
The speed of a production line is to be governed by the rate at which material is fed
onto it. The material feed is via a lazy loop arrangement which is fitted with an
ultra-sonic height sensing device. The output of the ultra-sonic sensor is in the
range 0V to 4V where the output is at 4V when the loop is at its longest.
MOVE(-5000)
REPEAT
a=AIN(1)
IF a<0 THEN a=0
SPEED=a*0.25
UNTIL MTYPE=0
Note:
Note that the analog input value is checked to ensure it is above zero even though it
always should be positive. This is to allow for any noise on the incoming signal
which could make the value negative and cause an error because a negative speed
is not valid for any move type except
FORWARD
or
REVERSE
.
analog chan:
analog input channel number 0.31