Omron CK3M-CPU 1 Series Application Manual page 71

Programmable multi-axis controller
Hide thumbs Also See for CK3M-CPU 1 Series:
Table of Contents

Advertisement

7
Select Motor 6, and then select
CalcTableBasedCompare from the User
Servo list.
8
Click the Apply button.
9
In the Solution Explorer, click the
usercode.c file under C Language –
Realtime Routines and add the functions
shown on the right.
Application Guide Laser Application (O052)
static double X_old=0;
static double Y_old=0;
static double SumDistance=0;
double CalcTableBasedCompare(struct MotorData*Mpt
r)
{
volatile GateArray3 *MySecondGate3IC;
MySecondGate3IC=GetGate3MemPtr(1);
double X_now;
X_now=pshm->Motor[1].DesPos+pshm->Motor[3].DesPo
s;
double Y_now;
Y_now=pshm->Motor[2].DesPos+pshm->Motor[4].DesPo
s;
double distance;
distance=sqrt((X_old-X_now)*(X_old-X_now)+(Y_old
-Y_now)*(Y_old-Y_now));
if(DistanceCountOn)SumDistance+=distance;
X_old=X_now;
Y_old=Y_now;
MySecondGate3IC->Chan[0].CompB=SumDistance;
return 0;
}
3 Connection Procedures
3
3-55

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ck3w-ax2323 seriesCk3w-gc2200

Table of Contents