The
main RS-232 port
| ECHO |
Echo
back all received characters |
| SADDR# |
Set
address (0 to 100) |
| SILENT |
Suppress
print messages |
| TALK |
Re-activate
print message |
| SLEEP |
Ignore
all commands except WAKE |
| WAKE |
Consider
all following commands |
| BAUD19200 |
Set
baud rate to 19200 bps |
OCHN
(RS2,0,N,38400,1,8,D) |
Open
- No parity, 38.4k bps, 1 stop, 8 data, as Data |
OCHN
(RS4,0,N,38400,1,8,C) |
Open
as RS-485 port (with adapter) as Command |
| IF
LEN>0 |
Check
to see if any (or how much)
data is in the 16 byte input buffer, Data mode |
| c=GETCHR |
Get
byte from buffer into variable c for Data mode |
PRINT
("Char Rcd:",c,#13) |
Print
text, data and ASCII code for carriage return |
The
G port
| UGI |
Redefine
as general input |
| UGO |
Redefine
as general output (Open collector, pulled
to 5V) |
| UG |
Return
pin to default start function, when low motor
starts motion |
| UG=0 |
Set
G port Low (UG=a to set to variable a) |
| UG=1 |
Set G port High (Open collector, weakly pulled
to 5V internally) |
| a=UGI |
Set
variable a to digital input |
| a=UGA |
Set
a to analog input, 0 to = 0 to 5V |
| UCI |
Redefine
Right Limit as general input (UDI for Left Limit) |
| UCO |
Redefine
Right Limit as general output (UDO for Left
Limit) |
| UCP |
Return
pin to limit function (UDM for Left Limit) |
| UC=0 |
Set
Right Limit Low (UD=0 for Left, or UD=a to set to
variable a) |
| UC=1 |
Set
Right Limit High (UD=1 for Left Limit) |
| a=UCI |
Set
variable a to digital input (UDI for Left Limit) |
| a=UCA |
Set
a to analog input, 0 to = 0 to 5V (UDA for Left Limit) |
Counter
functions of ports A and B
| MF4 |
Set
Mode Follow with full quadrature |
| MFR |
Set
Mode Follow with ratio for gearing |
| MS |
Mode
Step and Direction |
| MC |
Mode
Cam |
| MF0 |
Set
follow mode to increment counter only |
| MS0 |
Set
counter mode to increment counter only |
| a=CTR |
Set
variable a to counter value |
General
I/O functions of ports A and B
| UAI |
Set
port A to input (UBI for port B) |
| UAO |
Set
port A to output (UBO for port B) |
| UA=0 |
Set
port A Low (UB=0 for port B, or UB=a to set to variable
a) |
| UA=1 |
Set
port A High (UB=1 for port B) |
| a=UAI |
Set
variable a to digital input (UBI for port B) |
| a=UAA |
Set
a to analog input, 0 to = 0 to 5V (UBA
for port B) |
The
anilink port (using i2c protocol)
| AOUTB,c |
Send
variable c out to Analog I/O board addressed
as B |
| DOUTB0,c |
Send
variable c out to Digital I/O board addressed as
B0 |
| c=AINB2 |
Set
variable c to input 2 from Analog I/O board addressed
as B |
| c=DINB0 |
Set
variable c to input from Digital I/O board
addressed as B0 |
| PRINTB("Temp:",c,#32) |
Print
to LCD on network - text, data and ASCII code |
The
anilink port (using rs-485 protocol)
| OCHN(RS4,1,N,38400,1,8,D) |
Open
- No parity, 38.4k bps, 1 stop, 8 data, as data |
| IF
LEN1>0 |
Check
to see if any data is in the 16 byte input buffer |
| c=GETCHR1 |
Get
byte from buffer into variable c |
| PRINT1("Char
Rcd:",c,#13) |
Print
text, data and ASCII code |
| ECHO1 |
ECHO
back all received characters |
| SILENT1 |
Suppress
print messages |
| SLEEP1 |
Ignore
all commands except WAKE |
| WAKE1 |
Consider
all following commands |
The
anilink port as general I/O
| UEI |
Set
port E to input (UFI for port F) |
| UEO |
Set
port E to output (UFO for port F) |
| UE=0 |
Set
port E Low (UF=0 for port F, or UF=c to set to variable
c) |
| UE=1 |
Set
port E High (UF=1 for port F) |
| c=UEI |
Set
variable c to digital input (UFI for port F) |
| c=UEA |
Set
c to analog input, 0 to = 0 to 5V (UFA for port F) |
|
Ports
E and F have internal 5k Ohm resistive pull-ups |
The
SmartMotor brings out 5 volt power and ground, as well as seven
I/O points. Each one has multiple functions. They are UA, UB,
UC, UD, UE, UF and UG and have the following functions:
UA Digital
Input, TTL, 0 to 5 volts
Digital Output, TTL, 0 to
5 volts
Analog Input, 10 bit, 0 to
External Encoder A Input
Step and Direction, Step
Input
UB Digital
Input, TTL, 0 to 5 volts
Digital Output, TTL, 0 to
5 volts
Analog Input, 10 bit, 0 to
External Encoder B Input
Step and Direction, Direction
Input
UC Digital
Input, TTL, 0 to 5 volts
Digital Output, TTL, 0 to
5 volts
Analog Input, 10 bit, 0 to
Positive Limit Input
UD Digital
Input, TTL, 0 to 5 volts
Digital Output, TTL, 0 to
5 volts
Analog Input, 10 bit, 0 to
Negative Limit Input
UE Digital
Input, TTL, 0 to 5 volts
Digital Output, TTL, 0 to
5 volts
Analog Input, 10 bit, 0 to
AniLink Data I/O
AniLink RS-485 Signal A
UF Digital
Input, TTL, 0 to 5 volts
Digital Output, TTL, 0 to
5 volts
Analog Input, 10 bit, 0 to
1024
AniLink Clock Output
AniLink RS-485 Signal B
UG Digital
Input, TTL, 0 to 5 volts
Digital Output, TTL, 0 to
5 volts
Analog Input, 10 bit, 0 to
1024
Start Motion (or GO) Input
When
used as general I/O, the following commands will select the port
function.
UAI Assign
pin A to input state
UAO Assign
pin A to output state
UA=0 Set
UA to zero volts
UA=1 Set
UA to 5 volts
a=UAI Read
UA digital value, 0 or 1
a=UAA Read
UA analog voltage
UBI Assign
pin B to input state
UBO Assign
pin B to output state
UB=0 Set
UB to zero volts
UB=1 Set
UB to 5 volts
a=UBI Read
UB digital value, 0 or 1
a=UBA Read
UB analog voltage
UCI Assign
pin C to input state
UCO Assign
pin C to output state
UCP Re-assign
pin C to +limit action
UC=0 Set
UC to zero volts
UC=1 Set
UC to 5 volts
a=UCI Read
UC digital value, 0 or 1
a=UCA Read
UC analog voltage
UDI Assign
pin D to input state
UDO Assign
pin D to output state
UDM Re-assign
pin D to -limit action
UD=0 Set
UD to zero volts
UD=1 Set
UD to 5 volts
a=UDI Read
UD digital value, 0 or 1
a=UDA Read
UD analog voltage
UEI Assign
pin E to input state
UEO Assign
pin E to output state
UE=0 Set
UE to zero volts
UE=1 Set
UE to 5 volts
a=UEI Read
UE digital value, 0 or 1
a=UEA Read
UE analog voltage
UFI Assign
pin F to input state
UFO Assign
pin F to output state
UF=0 Set
UF to zero volts
UF=1 Set
UF to 5 volts
a=UFI
Read UF digital value, 0 or 1
a=UFA Read
UF analog voltage
UGI Assign
pin G to input state
UGO Assign
pin G to output state
UG Re-assign
pin G to "GO"
UG=0 Set
UB to zero volts
UG=1 Set
UB to 5 volts
a=UGI Read
UB digital value, 0 or 1
a=UGA Read
UB analog voltage
The
UAA, UBA, UCA, UDA, UEA, UFA and UGA variables reflect the analog
voltages at the port pins regardless of how the pins are configured.
Any time the variable is used it is loaded with the current value.
You can read a pin without effecting it this way. That can be
helpful in debugging. For example you could be using a pin as
an output and then read the analog input value to see if it were
shorted.
The
encoder and step counting capabilities of ports A and B are described
in the section on External Encoder Modes. The serial data capabilities
of ports E and F are described in the section on communications.
Anilink
I/O Modules
In
the event the on-board I/O is not enough, additional I/O can be
connected via the AniLink port. A variety of Analog and Digital
I/O cards are available, as well as peripheral devices like LCD
and LED displays, push-wheel input devices, pendants and more.
These products communicate with the SmartMotor through the AniLink
port using I2C protocol.
Output
Assignments
| AOUT{address},exp |
Output
byte to analog address=A-H |
| DOUT{address}{ch},exp |
Output
byte to network,
address=A-H, ch=0-63 |
Input
Assignments
| var=AIN{address}{input} |
8
bit analog input from network,
address=A-H,
and input=1-4 |
| var=DIN{address}{ch} |
8
bit digital in from network,
address=A-H, and ch=0-63 |