APX-3302 User's Manual (OM110000019A)
-74 -
■
The setting example for software
The sample code for capturing 50 lines at round-trip each by Absolute position encoder single point and
Encoder scan mode is as follows. The setting of encoder and the coordinate of each point that is shown at
“Figure6-30: Absolute position encoder single point” is shown below.
[Encoder setting]
Select Encoder : Absolute position encoder single point
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 : 5000
Encoder comparison register 2 : 100
[Coordinates of every point]
A:point 5000 count
B:point 9900 count
C:point 9900 count
D:point 5000 count
<Sample code>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// starting point : Configure outward setting and start capturing //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Outward trip : Start capturing at absolute encoder count "5000"
// After that, capture 1 line every time counting "100" counts, and capture "50" lines.
// Configure encoder setting (outward trip)
AcapSetEncoder(hDev, INPUT_CH, 2, 0, 0, 0, 0, 0, 5000, 100);
// Start encoder count
AcapSetInfo(hDev, INPUT_CH, ACL_ENC_ABS_START, 0, 1);
// Snap
AcapGrabStart(hDev, INPUT_CH, 1)
/////////////////////////////////////////////////////////////////////////////////////
// Point A : Start capturing of outward trip //
/////////////////////////////////////////////////////////////////////////////////////
// Coincidence pulse will be generated and start capturing, when absolute count reaches "5000".
// You can check current count value by the 11
th
argument of "AcapGetEncoder" or
"ACL_ENC_ABC_COUNT".
// Get absolute position encoder count
ULONG ulAbsCount;
AcapGetEncoder (hDev, INPUT_CH, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &ulAbsCount);)
AcapGetInfo (hDev, INPUT_CH, ACL_ENC_ABS_COUNT, 0, &ulAbsCount);)
Summary of Contents for APX-3302
Page 1: ...APX 3302 User s Manual ...