EasyManua.ls Logo

SEW-Eurodrive IPOS plus - Page 88

SEW-Eurodrive IPOS plus
384 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
88
Manual – IPOSplus®
6
Cam controllers
Position Detection and Positioning
Example solved in
the Compiler
/*=============================================
IPOS source file
===============================================*/
#include <const.h>
#include <io.h>
//Declaration
GSCAM Cam1, Cam2; //Declaration of cam outputs 1 and 2
/*=============================================
Main function (IPOS initial function)
===============================================*/
main()
{
/*-------------------------------------
Initialization
--------------------------------------*/
°°Cam1.SourceVar = numof(ActPos_Mot); // Reference size motor encoder
Cam1.DbPreCtrl = 0; // no delay time compensation
Cam1.DestVar = numof(StdOutpIPOS); // Output onf Do01 (H481.1)
°°Cam1.BitPosition = 1;
°°Cam1.BitValue = 0; // Output = 1, if value in window
Cam1.NumOfCam = 3; // Number of windows
Cam1.PosL1 = 0; // 1st window, left limit value
° Cam1.PosR1 = 4096; // 1st window, right limit value
° Cam1.PosL2 = 20366; // 2nd window, left limit value
° Cam1.PosR2 = 20594; // 2nd window, right limit value
° Cam1.PosL3 = 36864; // 3rd window, left limit value
°Cam1.PosR3 = 40960; // 3rd window, right limit value
°°Cam2.SourceVar = numof(ActPos_Mot); // Reference size motor encoder
Cam2.DbPreCtrl = 0; // no delay time compensation
° Cam2.DestVar = numof(StdOutpIPOS); // Output onf Do02 (H481.2)
°°Cam2.BitPosition = 2;
°°Cam2.BitValue = 0; // Output = 1, if value in window
Cam2.NumOfCam = 1; // Number of windows
° Cam2.PosL1 = 4096; // 1st window, left limit value
° Cam2.PosR1 = 8192; // 1st window, right limit value
/*-------------------------------------
Main program loop
--------------------------------------*/
while(1)
{
_GetSys(Cam1 ,GS_CAM ); // Form output of first cam
_GetSys(Cam2 ,GS_CAM ); // Form output of second cam
}
}
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n

Table of Contents