APX-3302 User's Manual (OM110000019A)
-81 -
Start counting of absolute position encoder multi point. Configure bit17 of APX-3302 encoder control
register as 1 by using AcapSetReg function. Do not change other bit.
The address of encoder control register is 1028h for ch1 and 2028h for ch2.
bit
Function
17
Configure counting start/stop of absolute position encoder.
0: Stop multipoint Count
1: Start multipoint Count
When you write this bit as "0" during operation, abort counting.
Power on status is "0".
Table6-7: Encoder control register (bit17)
// Start counting of multi point
// Standard functions of AcapLib2 do not support this processing,
// so you have to configure register of APX-3302 directly.
// CH1: Configure bit17 of register address 1028h as 1
// CH2: Configure bit17 of register address 2028h as 1
// Get the value of encoder control register
dwRegOffset = (INPUT_CH - 1) * APX3302_CH_OFFSET;
AcapGetReg(ghDev, INPUT_CH, 0, dwRegOffset, &dwRegVal);)
// Start counting of multi point mode (configure bit17 as 1)
dwRegVal | = 0x20000;
// Configure encoder control register
AcapSetReg(ghDev, INPUT_CH, REGTYPE_LOCAL, dwRegOffset, dwRegVal);
// Outward trip: Start frame number specifying capturing (Capture 5 frames)
AcapGrabStart(ghDev, INPUT_CH, 5);
/////////////////////////////////////////////////////////////////////////////////////
// point 1 - point 4: Outward trip, start capturing //
/////////////////////////////////////////////////////////////////////////////////////
// When absolute count reaches "1000", coincidence pulse is generated and capture 1 time.
// After that, capture when counting reaches "2000","3000","4000" or "5000".
// It captures 5 times in total.
// You can get latest value of comparison memory by 10
th
argument of "AcapGetEncoder" function,
// and can get current value by "ACL_ENC_ABC_COUNT".
ULONG ulCompMem, ulAbsCount;
// Get the latest value of comparison memory
AcapGetEncoder(hDev, INPUT_CH, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &ulCompMem, NULL);
// Get the value of absolute position encoder count
AcapGetInfo(hDev, INPUT_CH, ACL_ENC_ABS_COUNT, 0, &ulAbsCount);)
Summary of Contents for APX-3302
Page 1: ...APX 3302 User s Manual ...