Page 92
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
39. 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 (hexadecimal) denotes configurating sensor 1,2;
[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
must be configurated again.
ACK:
AA 00 C9 [S0] [S1] [S2] [S3] [S4] [S5] FF
Comment:
C9
>> Message ID of instruction STGx
;
[S0] ~ [S5]
>> Received data 0 ~ 5
[S0] ~ [S2] is the converted value for sampling mode of sensor 1 (16 bits)
(Figure 10-1 )
[S3] ~ [S5] is the converted value for sampling mode of sensor 2 (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;