User manual

PD-1021 TMCL Firmware V1.19 Manual (Rev. 1.01 / 2012-JUL-30) 34
www.trinamic.com
3.5.15 GIO (get input/output)
With this command the status of the available general purpose inputs of the module can be read out.
The function reads a digital or analogue input port. Digital lines will be read as 0 or 1, while the ADC
channels deliver their 12bit result in the range of 0 4095.
GIO IN STANDALONE MODE
In standalone mode the requested value is copied to the accumulator (accu) for further processing
purposes such as conditional jumps.
GIO IN DIRECT MODE
In direct mode the value is only output in the value field of the reply, without affecting the accumulator.
The actual status of a digital output line can also be read.
Internal function: the specified signal pin is read.
Related commands: SIO, WAIT
Mnemonic: GIO <port number>, <bank number>
Binary representation:
INSTRUCTION NO.
TYPE
MOT/BANK
VALUE
15
<port number>
<bank number>
(don't care)
Reply in direct mode:
STATUS
VALUE
100 OK
<status of the port>
Example:
Get the analogue value of IN_3
Mnemonic: GIO 3, 1
Binary:
Byte Index
0
1
2
3
4
5
6
7
Function
Target-
address
Instruction
Number
Type
Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Value (hex)
$01
$0f
$03
$01
$00
$00
$00
$00
Reply:
Byte Index
0
1
2
3
4
5
6
7
Function
Host-
address
Target-
address
Status
Instructio
n
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Value (hex)
$02
$01
$64
$0f
$00
$00
$01
$fa
value: 506