![Trinamic TMCM-351 Скачать руководство пользователя страница 38](http://html1.mh-extra.com/html/trinamic/tmcm-351/tmcm-351_firmware-manual_1163054038.webp)
TMCM-351 TMCL Firmware V4.45 Manual (Rev. 1.06 / 2014-MAY-16)
38
www.trinamic.com
4.6.15
GIO (get input/output)
With this command the status of the two available general purpose inputs of the module can be read out.
The function reads a digital or analogue input port. Digital lines will read 0 and 1, while the ADC channels
deliver their 10 bit result in the range of 0… 1023.
GIO
IN
S
TANDALONE
M
ODE
In standalone mode the requested value is copied to the
accumulator
(accu) for further processing purposes
such as conditioned jumps.
GIO
IN
D
IRECT
M
ODE
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 line 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 ADC channel 0
Mnemonic:
GIO 0, 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
$00
$01
$00
$00
$00
$00
Reply:
Byte Index
0
1
2
3
4
5
6
7
Function
Host-
address
Target-
address
Status
Instructi
on
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Value (hex)
$02
$01
$64
$0f
$00
$00
$01
$fa
value: 506