47
5 CREATING PROGRAMS
5.6 Program Examples
5.6
Program Examples
The following programs are designed to control the servo amplifiers. The programs use the FBs for servo amplifiers
compatible with CC-Link IE Field Network Basic.
This section provides the sample programs for the station number 1 and station number 2.
Initial setting
Starting communications using CC-Link IE Field Network Basic
Servo ON
K1
MOV
EN
sd
ENO
AxisInfo1.Setting.AxisNo
K2
MOV
EN
sd
ENO
AxisInfo2.Setting.AxisNo
After RUN, ON for 1 scan
SM402
Axis No.
Axis No.
SET
EN
d
ENO
G_stLinkIEF.bnRY[H3F]
SET
EN
d
ENO
G_stLinkIEF.bnRY[H7F]
After RUN, ON for 1 scan
SM402
RY information
RY information
MC_Power_CCLinkIEFBasic_F
Enable
Axis
AxisInfo1
Busy
Status
Error
ErrorID
PowerBusy[1]
PowerStatus[1]
PowerError[1]
PowerErrorID[1]
AxisInfo1
MC_Power_CCLinkIEFBasic_F
Enable
Axis
AxisInfo2
Busy
Status
Error
ErrorID
PowerBusy[2]
PowerStatus[2]
PowerError[2]
PowerErrorID[2]
AxisInfo2
Servo ON
command
X10
RX information
G_stLinkIEF.bnRX[H7F]
Ready to operate FB2
MC_Power_CCLinkIEFBasic_F_2
Axis information 2
Servo ON
command
X0
RX information
G_stLinkIEF.bnRX[H3F]
Ready to operate FB1
MC_Power_CCLinkIEFBasic_F_1
Axis information 1
Ready to operate (executing)
Ready to operate status
Ready to operate (error)
Error code
Axis information 2
Ready to operate (executing)
Ready to operate status
Ready to operate (error)
Error code
Axis information 1