ADwin-Gold II
, Manual February 2013
133
SSI interface
SSI_Set_Clock
ADwin
SSI_Set_Clock
SSI_Set_Clock
sets the clock rate (approx. 100kHz to 2.5MHz), with which
the encoder is clocked.
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
SSI_Set_Clock
(
dcdr_no
,
prescale
)
Parameters
Notes
Scale factors < 10 are automatically corrected to the value 10; from val-
ues > 255 only the least significant 8 bits are used as scale factor.
The possible clock frequency depends on the length of the cable, cable
type, and the send and receive components of the encoder or decoder.
Basically the following rule applies: The higher the clock frequency the
shorter the cable length.
See also
,
,
Valid for
Gold II-CNT
Example
Rem Please select the appropriate include for ADbasic /
TiCoBasic
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Rem Decoder 1 runs with 2.5 MHz, Decoder 2 with 1.0 MHz
Init:
SSI_Set_Clock
(
1
,
10
)
'clock rate for decoder 1
SSI_Set_Clock
(
2
,
25
)
'clock rate for decoder 2
SSI_Mode
(
11b
)
'Set continuous-mode for encoder
'
1
+2
SSI_Set_Bits
(
1
,
10
)
'10 encoder bits for encoder 1
SSI_Set_Bits
(
2
,
22
)
'22 encoder bits for encoder 2
Event:
Par_1
=
SSI_Read
(
1
)
'Read out position value
'(encoder 1)
Par_2
=
SSI_Read
(
2
)
'Read out position value
'(encoder 2)
T11 TiCo
dcdr_no
Number (1…4) of the SSI decoder, the clock rate
of which is to be set.
LONG
prescale
Scale factor (10…255) for setting the clock rate
according to the equation:
Clock rate = 25MHz /
prescale
.
LONG