Yamaha Yamaha Robot Controller CC-Link Unit Robot program 1st unit’s RCX40 2nd unit’s RCX142

Page 67

 

4. Sample program

 

 

[Robot program]

 

1st unit’s RCX40

2nd unit’s RCX142

‘INIT ROUTINE

‘INIT ROUTINE

RESET SO2()

RESET SO2()

RESET SO4()

RESET SO4()

RESET DO4()

RESET DO4()

A=101

B=201

‘MAIN ROUTINE

‘MAIN ROUTINE

MOVE P,P100,Z=0

MOVE P,P200,Z=0

GOSUB *PICK

GOSUB *PICK

*ST1:

*ST2:

MOVE P,P[A],Z=0

WAIT SI(41)=1

GOSUB *PLACE

SO(41)=1

MOVE P,P100,Z=0

WAIT SI(41)=0

SO(41)=1

SO(41)=0

WAIT SI(41)=1

WAIT SI(40)=1

SO(41)=0

B=SI(23,22,21,20)

WAIT SI(41)=0

SO(40)=1

SO(23,22,21,20)=A-100

WAIT SI(40)=0

SO(40)=1

SO(40)=0

WAIT SI(40)=1

B=B+200

SO(40)=0

MOVE P,P[B],Z=0

WAIT SI(40)=0

GOSUB *PLACE

SO(23,22,21,20)=0

MOVE P,P200,Z=0

GOSUB *PICK

SO(42)=1

WAIT SI(42)=1

WAIT SI(42)=1

SO(42)=1

SO(42)=0

WAIT SI(42)=0

WAIT SI(42)=0

SO(42)=0

GOSUB *PICK

A=A+1

GOTO *ST2

IF A>108 THEN

HALT

A=101

‘SUB ROUTINE FOR PICK

DO(47)=1

*PICK:

WAIT DI(47)=1

DO(40)=1

DO(47)=0

DRIVE(3,P221),S=20

ENDIF

WAIT ARM(3)

GOTO *ST1

DO(40)=0

HALT

DELAY 500

‘SUB ROUTINE FOR PICK

RETURN

*PICK:

‘SUB ROUTINE FOR PLACE

DO(40)=1

*PLACE:

DRIVE(3,P121),S=20

DRIVE(3,P222),S=20

WAIT ARM(3)

WAIT ARM(3)

DO(40)=0

DO(40)=1

DELAY 500

DELAY 500

RETURN

RETURN

‘‘SUB ROUTINE FOR PLACE

 

*PLACE:

 

DRIVE(3,P122),S=20

 

WAIT ARM(3)

 

DO(40)=1

 

DELAY 500

 

RETURN

 

5

Specifications

5-13

Image 67
Contents Unit Page Introduction Precautions for design Safety Precautions Always read before starting usePrecautions for wiring Precautions for installationPrecautions for disposal Precautions for starting and maintenanceWarranty description WarrantyMemo Contents Specifications TroubleshootingAppendix Outline Memo Wiring saving FeaturesEmulated serialization on parallel DIO PLC MechanismCC-Link system cable terminals Station No. setting switch LSB 1st digitStation No. setting switch MSB 2nd digit Communication speed switch BPSA1SHCPU Assignment of CC-Link compatible I/OPLC Outline Outline Memo Connection Memo Operation Confirming the CC-Link compatible module settingsSaving the robot controller data Installing the CC-Link compatible moduleResponse when starting the robot controller ProcedureSetting the station No Setting the CC-Link compatible moduleProcedures Setting the communication speedMounting the ferrite core Noise measuresTesting the line from the master station PLC Connecting to the CC-Link systemParameter Meaning Parameter setting for CC-Link serial I/O boardType Display Meaning Parameter setting for CC-Link serial I/O boardPress the F Edit key Memo Communication Memo When connection to CC-Link system is correctly established State when robot controller power is turned onInitial data process Initial process for connecting to CC-Link systemInitial data process master station PLC side Receiving data Communication with master station PLCTransmitting data Direct connection by emulated serialization on parallel DIO Direct connection from SI n to do n Direct connection by emulated serialization on parallel DIODirect connection from SO n to DI n Direct connection by emulated serialization on parallel DReferring to the data from the programming unit Referring to communication dataTroubleshooting Memo Confirmation details Check Items to confirm before starting up CC-Link systemRUN Errl SD RD Meanings of LEDs on CC-Link compatible moduleConfirmation item TroubleshootingProgramming unit error display confirmation CC-Link compatible module LED confirmation Confirmation from master station PLC Emg.stop on Error messages relating to CC-LinkMemo Specifications Memo Profile Remote registers Device No Signal name Details RXn0 Details of remote input/output signalsDetails of remote input/output signals Details of remote input/output signals Initial data process for CC-Link connection Dedicated input/output signal timing chartServo on process from emergency stop status Initial servo on process after power onServo on and emergency stop Shift to emergency stopProgram execution process SpecificationsAuto mode changeover process Program reset processStopping with program interlock Program stop process using interlock inputDetails of sample Sample programPoints used Robot program data assignment Variables usedBit information used X1FF PLC data assignmentGosub *PLACE Robot program 1st unit’s RCX40 2nd unit’s RCX142X0F From PLC programRET From H0 Set initial data process complete flag OFF Communication speed setting CC-Link compatible module specificationsMemo Appendix Memo Term definition Unit