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?
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?
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.
$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.
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)