SSI interface
SSI_Start
ADwin
134
ADwin-Gold II
, Manual February 2013
SSI_Start
SSI_Start
starts the reading of one or both SSI encoders (only in mode "sin-
gle shot").
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
SSI_Start
(
pattern
)
Parameters
Notes
In the continuous mode this instruction has no function, because the en-
coder values are nevertheless read out continuously.
An encoder value will be saved only when the amount of bits is read
which is set by
SSI_Set_Bits
.
A complete encoder value is always transferred, even if the operation
mode is changing meanwhile.
See also
,
,
Valid for
Gold II-CNT
Example
Rem Please select the appropriate include for ADbasic /
TiCoBasic
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Rem Both decoders run with 100 kHz
Init:
SSI_Set_Clock
(
1
,
250
)
'clock rate for decoder 1
SSI_Set_Clock
(
2
,
250
)
'clock rate for decoder 2
SSI_Mode
(
0
)
'Set single shot-mode (all
'counters)
SSI_Set_Bits
(
1
,
23
)
'23 encoder bits for encoder 1
SSI_Set_Bits
(
2
,
23
)
'23 encoder bits for encoder 2
Event:
SSI_Start
(
11b
)
'Read position value of encoders
'
1
& 2
Do
'for encoder 1:
Until
(
SSI_Status
(
1
)
=
0
)
'If position value is read
'completely, then …
Par_1
=
SSI_Read
(
1
)
'read out and display position
'value
Do
'For encoder 2:
Until
(
SSI_Status
(
2
)
=
0
)
'If position value is read
'completely, then …
Par_2
=
SSI_Read
(
2
)
'read out and display position
'value
T11 TiCo
pattern
Bit pattern for selecting the SSI decoders which
are to be started:
Bit = 0: No function.
Bit = 1: Start reading of the SSI decoder.
LONG
Bit no.
31:2
3
2
1
0
SSI decoder
–
4
3
2
1