Author Topic: Robot Program call  (Read 563 times)

0 Members and 1 Guest are viewing this topic.

Offline chintankAne

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
Robot Program call
« on: May 25, 2017, 11:43:36 PM »
I want to call program from PLC. I want to know what are the program calling methods. Like in fanuc RSR,PNS ...

 I have to send Program Number from PLC?

Offline Danny_Pla

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
Re: Robot Program call
« Reply #1 on: June 13, 2017, 07:14:49 AM »
You must use

The built In Routine:

  SYS_CALL('ML', 'path of your  program')  -- ML -> memory Load
   
  SYS_CALL('PG', 'ud:\\usr\\prog_main') -- PG-> Program Go!, load and execute de program.
 


To send the program number i use a CASE sentence with an variable that the PLC change.

Offline sandrot

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 6
  • Posts: 66
    • Comau Robotics
Re: Robot Program call
« Reply #2 on: June 26, 2017, 02:10:58 PM »
$FMI and $FMO are Flexible Multiple Ports, reserved to application programs. PDL2 treats them as INTEGER values. Define a $FMI with your program number and then you can use what Danny_Pla suggests.
An email to service.robotics@comau.com will also help.

Offline Ashraf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
Re: Robot Program call
« Reply #3 on: September 05, 2017, 06:49:57 PM »
to call a program from PLC, assuming there is a bus communcation (e.g. ProfiBus) the robot programm should be at a line expecting to receive data from the PLC (or the data is already received and saved in variables)
so how to implement this, depends on what you want to do and on your programm structure
there are 2 cases:
either the program is not loaded, or loaded but not active and you want to activate it, in this case you will need to use SYS_CALL with ml, pg, pa, etc.
or the programm is loaded, but not active, and you want to run the programm without activating it, then you should use CALL (to call the programm) or CALLS (to call a routine within the programm).
remember that the programm (or the routine) is loaded, activated, called, or whatever, by its name, which is a string. So in the calling command you should express the prgramm name (and if necessary path) as a string variable.
Since you usually receive integers from the PLC (you can also receive string, but I never tried) so you should convert this to a string. There are many ways to do this, depending on your preferences and how flexible you want to be. for example, if the programms you want to call have the names abc, def, ghi, then you may use IF...THEN or SELECT...CASE (for example: SELECT Prog_Nr OF, CASE 1: Prog_Name := 'abc', CASE 2: Prog_Name := 'def', and so on, where Prog_Nr = 1, 2, or 3, is the data you revceive from the PLC)
or if your programms are called prog_1, prog_2 and so you may use the command ENCODE to convert the integer to string, for example ENCODE (Prog_Name, 'prog_'::5::1, Prog_Nr::1)
« Last Edit: September 08, 2017, 09:45:55 PM by Ashraf »