UI Robot Technology Co. Ltd.
M4220170607EN
Page 101
Miniature Integrated Stepper Motor Controller(
Closed-loop
)
40. STGx
η Set Digital Input Sampling Mode
Format:
STGx
;
Description:
Set sampling mode of digital input: continnous, intermittent and single
sampling.
Structure of
:
Byte
0
1
2
Defination
D0
D1
IDX
Where,
[D1 D0] compose a hexadecimal 16bit data, D1 is high, D0 is low.
IDX = 00,01,02 (hexadecimal) denotes configurating sensor 1,2,3;
[D1 D0] = 0000,0001,0002,
…
,EA60 denotes that the sensor will not be
triggered until 0,1,2,
…
,60000ms after last sampling. This can eliminate
the shake of sensor signal.
[D1 D0] > EA60, denotes signle sampling, once triggered, the S12CON
(For S1, S2) and S34CON (For S3) must be configurated again.
ACK:
AA [Controller ID] C9 [S0] [S1] [S2] [S3] [S4] [S5] [S6] [S7] [S8] FF
Comment:
C9
>> Message ID of instruction STGx
;
[S0] ~ [S8]
>> Received data 0 ~ 8
[S0] ~ [S2] is the converted value for sampling mode of sensor 1 (16 bits)
(Figure 12-1 )
[S3] ~ [S5] is the converted value for sampling mode of sensor 2 (16 bits)
[S6] ~ [S8] is the converted value for sampling mode of sensor 3 (16 bits)
Example:
Requirements:
1
)
Sensor 1;
2
)
Intermittent mode, interval is 200ms.
Then:
1
)
IDX = 00 (hexadecimal)
2
)
[D1 D0] = 200 (decimal) = 00C8 (hexadecimal),
So, D0 = C8, D1=00; (hexadecimal)
3
)
Then send instruction STGx C8 00 00;