PLC uruchamia programy robota

PLC loads robot’s programs by control register

Robot can be controlled by general PLC or other system. This article shows how to easly run any robot’s program by one control register and its deferent values. 


Komendy Tool, Oadl są zachowane zarówno przy wywołaniu programu instrukcją CallP, jak i po powrocie do programu głównego. Czyli można ich użyć jeden raz w jakimś programie i wartość zostanie aktywna cały czas.

Komendy  Accel, Spd, Ovrd, JOvrd nie zachowują wartości z poprzedniego programu i w nowym programie są zresetowane do wartości domyślnych (czyli maksymalnych). Zatem te komendy każdorazowo powinny być użyte w wywoływanych programach (i głównym).

I Introduction 

This method allows to run robot programs by using one PLC control register. Robot as default runs one main control program (named MAIN) which can load any other defined program by Callp command. MAIN program receives a value from control register and compares it with values defined in Select…Case function. If the value matches to one of defined then the specified program is executed.

Example

PLC control register = 100   ->   Robot runs: INIT

PLC control register = 200   ->   Robot runs: SEQ1

PLC control register = 300   ->   Robot runs: SEQ2

PLC control register = other   ->   Robot runs: nothing


 Robot programs - example:

All program’s names in this document are exemplary and can be changed to any other. 

Also signals numbers are exemplary and can be changed to any other. In this solution general I/O signals (area 0-63) are used. To run these functions by a network (e.g. Profinet, CC-Link, etc.) – mount a network card, configure it and set signals from area 2000 or 6000. To run these functions in Q or R type robot (integrated with Mitsubishi Electric PLC platform) set signals from area 10000.

II Program codes 

Sample codes to copy are at the end of the article

II.1 Sample code of MAIN control program



Control register is read by M_Inw(16) and rewrited to mProgram variable.

Line M_Outw(16)=M_Inw(16) can be used as a confirmation of received value back to PLC (and generally as a communication working confirmation).

Select…Case function compares a value from control register and activate a Case if the value matches to Case value.

 

Additional information

Callp instruction switches program on specified Slot to called one, for example: Main program is switched to Init program after Callp “Init” instruction.

Called program by Callp instruction is performed only one time, then the previous program is loaded again.

Do not insert any movement command to this program. Movements and other application command insert to programs run by CallP instruction.

 

II.2 Sample code of first called program (INIT)

This is an example of application program (movements, etc.).

M_Outw(16) commands are introduced here to send out to PLC information of performed steps. Control value was “100”, confirmation values are respectively “101”, “102”, etc.

PLC program, right after receiving confirmation that called program is executed, should change its value (e.g “100” -> “0” or “100” -> “101”). Otherwise the program will be run once again, right after ending.

 

II.3 Sample code of second called program (SEQ1)



This is an example of application program (movements, etc.).

M_Outw(16) commands are introduced here to send out to PLC information of performed steps. Control value was “200”, confirmation values are respectively “201”, “202”, etc.

PLC program, right after receiving confirmation that called program is executed, should change its value (e.g “200” -> “0” or “200” -> “201”). Otherwise the program will be run once again, right after ending.

  

III Parameters

III.1 Slot Table

Set below parameters to load the MAIN program to Slot 1 for execution:

1 Open Slot Table parameters

2 Select first Slot

3 Click Set… and confirm next window about reading program list

4 In Slot Table Parameter Setting chose desired program

5 Set condition to START (or ALWAYS)

6 Write parameters and restart robot

 

III.2 General control

Set general control signals
No needed if the MAIN program is executed in ALWAYS mode


By these signals control the Main program.

After robot power on, set Operation Enable signal and then Start signal. The Main program on Slot 1 will start running.

 

IV Operation

When MAIN program is running, send right control value to execute desired application program.

When robot confirms the program execution by its output register M_Outw(…) immediately change the PLC control value to other one.

If the control value is 0 or any other than values defined in Select…Case function, robot will not load any program -the only working program will be MAIN.


Sample codes
1. Main

'Main control program - example
'No movement commands
'
mProgram=M_Inw(16)    'control value received from PLC
M_Outw(16)=M_Inw(16)  'confirmation of received value to PLC
'
Select mProgram
Case 100            'action wher control value "100"
   CallP "INIT"     'INIT program start
Break
'
Case 200            'action wher control value "200"
   CallP "SEQ1"     'SEQ1 program start
Break
'
Case 300            'action wher control value "300"
   CallP "SEQ2"     'SEQ2 program start
Break
End Select
'
End


2. Process program
'Sample
M_Outw(16)=101  'INIT program start, information to PLC
Mov P1
Mov P2
M_Outw(16)=102  'INIT program end, information to PLC
End


    • Related Articles

    • Robot palletization sample program

      Sample program for palletization on the RV-7FLL robot. It can also be used for other robots. "Copyright © Mitsubishi Electric Europe B.V. IMPORTANT ! These Function Blocks are demo versions that are only intended to demonstrate program functions and ...
    • Sample GOT screens for robot control (FR Series, CR800-D), Full Project

      An official sample GOT2000 project for robot FR Series (CR800-D controller) controlling and monitoring System configuration: Project contains follwing screens: Robot operation Position Edit JOG control HAND control Variable edit Load level monitor ...
    • INV - FR-E800 - Position control in Vector Mode

      The article provides information on how to prepare the FR-E800 frequency converter and FR-A8AP -E-kit encoder card for positional vector operation. For details, refer to the manual: FR-E800 Instruction Manual (Function), Chapter 7 FR-A8AP E-kit card ...
    • Summary of the programs included in iQ Works suite

      This article summarizes all the software included in the Mitsubishi iQ Works software suite. An iQ Works license code is required for all programs to work. All software can be downloaded from Mitsubishi Electric main site: ...
    • Error number sending to HMI_PLC (Programs running continuously, Always mode)

      This is an universal solution describing how to send actual error code or other data from robot all the time (even if robot is in Error State). This solution uses State Variable, Multitasking function and program set in Always (permanent) mode. I ...