APX-3302 User's Manual (OM110000019A)
-72 -
■
The setting example for software
The sample code for capturing by Relative position encoder and Encoder scan mode is as follows.
The setting of encoder is shown below.
Select Encoder : Relative position encoder
Encoder starting method : Not using external trigger
Encoder operational mode : Encoder scan mode
Select Encoder input impulse-wave : Phase AB
Direction of encoder input impulse wave: CW direction
Encoder Z phase input : Not using Z phase
Encoder comparison register 1 : 10
Encoder comparison register 2 : 4
<Sample code>
// Relative position encoder
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_EN, -1, 1);
// Not using external trigger
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_START, -1, 0);
// Encoder scan mode
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_MODE, -1, 0);
// Phase AB
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_PHASE, -1, 0);
// CW
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_DIRECTION, -1, 0);
// Not using Z phase
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_ZPHASE_EN, -1, 0);
// Configure comparison register 1 as 10.
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_COMPARE_1, -1, 10);
// Configure comparison register 2 as 4.
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_COMPARE_2, -1, 4);
// Reflect setting
AcapReflectParam(hDev, INPUT_CH);
Summary of Contents for APX-3302
Page 1: ...APX 3302 User s Manual ...