4
Positionering met vijf procesdata
30
// Process data no. 5 is the positioning ramp
// left and right in ms
Ramp.Up
= Po10.PO5;
Ramp.Down
= Po10.PO5;
_SetSys(SS_POSRAMP, Ramp);
// and now approach TargetPosition (TargetPos is
// defined in const.h)
TargetPos = Pos32;
// now set the process input words
// process input words 1 through 3 are
// adjusted to the desired size using the
// shell menu items 873 through 875
// (z.B. 873 = STATUSWORD 1)
//
874 = POSITION HI )
//
875 = POSITION LO )
// Process input word 4 represents
// the actual speed
_GetSys(Pi10.PI4, GS_ACTSPEED);
// GetSys(..., GS_ACTSPEED) provides the
// speed with an accuracy of 0.1 rpm
// however, desired is an accuracy of
// 0.2 rpm as process input word => / 2
Pi10.PI4 /= 2;
// Process input word 5 represents
// the actual following error
// (LagDistance is defined in const.h)
Pi10.PI5 = LagDistance;
// and write process input data into
// the output buffer
_SetSys(SS_PIDATA, Pi10);
}
}
Technische handleiding veldbuscommunicatie DFO11A CANopen