10-3
10 Sample Programming
NJ/NX-series CPU Unit Motion Control Userās Manual (W507)
10-2 Basic Programming
Samples
10
10-2-1 Monitoring EtherCAT Communications and Turning ON Servos
10-2 Basic Programming Samples
This section provides programming samples for the basic functions of the MC Function Module.
Precautions for Correct UsePrecautions for Correct Use
⢠When you use these programming samples for reference, be sure to add programming for
suitable interlocks that suit the operating conditions of the devices.
⢠Enter the variables that are used in the programming samples from the Programming Layer in
the Edit Pane of the Sysmac Studio.
In this sample, the MC_Power (Power Servo) instruction is executed to turn ON the Servo for the Servo
Drive when EtherCAT process data communications are established with the Servo Drive.
Samples are provided for both ladder diagram and ST programming.
10-2-1 Monitoring EtherCAT Communications and Turning ON Servos
Main Variables Used in the Programming Samples
Variable name Data type Default Comment
MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error for
axis 0.
MC_Axis000.Cfg.NodeAddress UINT --- This is the node address.
_EC_PDSlavTbl[N] BOOL FALSE TRUE when EtherCAT process data communi-
cations for node address N are in Operational
state.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.