Download NJ-series CPU Unit Motion Control User`s Manual

Transcript
10 Sample Programming
ST Programming
// When StartPg is TRUE, the Servo is turned ON for axis 0 if process data communications are active and normal.
// If process data communications are not active, the Servo is turned OFF.
IF (StartPg=TRUE)
AND (_EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress]=TRUE)
AND (_EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress]=FALSE) THEN
Pwr_En:=TRUE;
ELSE
Pwr_En:=FALSE;
END_IF;
IF (Pwr_Status=TRUE)
OR (Pwr_Bsy=TRUE) THEN
UpgOn := TRUE;
ELSE
UpgOn := FALSE;
END_IF;
// Further processing executed.
// Further processing not executed.
// MC_Power
PWR(
Axis
:= MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy
=> Pwr_Bsy,
Error
=> Pwr_Err,
ErrorID => Pwr_ErrID
);
10-16
NJ-series CPU Unit Motion Control User’s Manual (W507)