发布于 2012-08-23 17:03:07
6楼
百分之百好用
VAR
vel : LREAL ; //axis velocity
accel : LREAL ; //axis acceleration
jerk : LREAL ; //axis jerk
posN : LREAL ;
posP : LREAL ;
RetDint :DINT;
fParamR0Distance :LREAL;
my_CommandCId :CommandIdType;
END_VAR
RetDINT := _enableaxis(
axis := myAxis,
enablemode := ALL,
servocontrolmode := ACTIVE,
servocommandtoactualmode := INACTIVE,
nextcommand := WHEN_COMMAND_DONE,
commandid := _getCommandId();,
forcecontrolmode := INACTIVE);
RetDINT := _disableaxis(
axis := myAxis,
disablemode := ALL,
servocontrolmode := INACTIVE,
servocommandtoactualmode := ACTIVE,
nextcommand := IMMEDIATELY,
commandid := _getCommandId(),
forcecontrolmode := INACTIVE);
RetDINT := _stop(
axis := myAxis,
stopMode := STOP_AND_ABORT,
stopSpecification := ALL_AXIS_MOTION,
stopId := _getCommandId(),
mergeMode := IMMEDIATELY,
nextCommand := IMMEDIATELY,
commandId := _getCommandId());
my_CommandCId := _getCommandId();
RetDINT := _pos(
axis := myAxis
,direction := BY_VALUE
,positioningMode := RELATIVE
,position := fParamR0Distance
,velocityType := DIRECT
,velocity := vel
,positiveAccelType := DIRECT
,positiveAccel := accel
,negativeAccelType := DIRECT
,negativeAccel := accel
,positiveAccelStartJerkType := DIRECT
,positiveAccelStartJerk := jerk
,positiveAccelEndJerkType := DIRECT
,positiveAccelEndJerk := jerk
,negativeAccelStartJerkType := DIRECT
,negativeAccelStartJerk := jerk
,negativeAccelEndJerkType := DIRECT
,negativeAccelEndJerk := jerk
,velocityProfile := USER_DEFAULT
,blendingMode := USER_DEFAULT
,mergeMode := IMMEDIATELY
,nextCommand := IMMEDIATELY
,commandId := my_CommandCId);
whatname