Robotforum | Industrial Robots Community

Industrial Robot Support and Discussion Center => Kawasaki Robot Support Forum => Topic started by: Motouser on March 26, 2019, 08:16:38 AM

Title: AS Programming info
Post by: Motouser on March 26, 2019, 08:16:38 AM
Hi Forum,
just a couple of question today:

1. I have got a couple of example program in AS in which is used the instruction TASK. I understand from the manual that is used to monitor the status of a program, what I don't understand is how assign this instruction to monitor a SPECIFIC program.
Basically I want to know if the main is primed, in execution, holded etc.. How I can do it?

2. Do you know if exists a signal that turn ON when I prime a job? ( In yaskawa there is the signal top of master job after a "prime")?

3. Any experience/EXAMPLE with WORKING AREAS?

Thanks anyway
Title: Re: AS Programming info
Post by: Kawaguy on March 26, 2019, 09:22:08 PM
1. TASK gives the status of the robot program (1) or the background programs (1001-1005):
Code: [Select]
>type task(1001)
 1       <- 1=running
>pcab
PC program aborted.No = 1001
>type task(1001)
 2      <- 2=paused
>pckill
Are you sure ? (Yes:1, No:0) 1
>type task(1001)
 0    <- 0=not running

To see if a specific program is running, you can use WHICHTASK

Code: [Select]
IF WHICHTASK("main")==1 THEN    <- check if program main is started as robot program
WHICHTASK("main") returns -1 if no program exists or if program is not active.
It returns 1 when started as robot program, 1001-1005 when started as pcprogram 1-5.

2. If you want to know if your main program is at step 1, you can do something like this
Code: [Select]
.PROGRAM main()
  CALL gohome
  CALL cycle
.END

In your PC-Program:
Code: [Select]
  IF (WHICHTASK("main")==1) AND (WHICHTASK("gohome")<0) AND (WHICHTASK("cycle")<0) AND (SYSDATA(STEP)==1) THEN
     SIGNAL s_initialized
  ELSE
     SIGNAL -s_initialized
  END

3. What do you want to know? WORKSPACE outputs a signal if the tool center point is within a defined area. Is this what you mean with WORKING AREAS?

Title: Re: AS Programming info
Post by: Motouser on March 27, 2019, 07:33:13 AM
Thanks for your answer.


3) Yes.


1) So task(1) will give the status of the program that is running?
Imagine that I have this classical code:

Code: [Select]
.PROGRAM main()
CALL job1
TWAIT 0.5
CALL job2
.END

task will refer to main or when I will call the job1 it will give me the status of job1?

Title: Re: AS Programming info
Post by: Kawaguy on March 27, 2019, 01:38:49 PM
Task(1) returns 1 if any program is running. 
It returns 2 if the program is stopped and can be continued. (E.g held or paused or stopped by an e-stop).

It returns 0 if no program is running or the running program is halted. Prime or program selection is needed before starting the robot cycle.
Title: Re: AS Programming info
Post by: Kawaguy on March 29, 2019, 10:09:41 AM
Working space is set in AUX-Menu 403 (Basic Settings, Working space).

Set the upper and lower limits in XYZ. When the Tool Center Point is inside this virtual box the dedicated output is set or reset, depending on setting logic positive or negative.

To set the dedicated output signal go to AUX Menu 602 (Input/Output signals, Dedicated output signals).
Find 'WORK_SPACE..' and set to 'DEDICATED'. Input the signal number and you are done.
Title: Re: AS Programming info
Post by: Motouser on April 04, 2019, 03:14:25 PM
Hi Kawaguy,
thanks for your answer (I've successfully implemented the workspace solution just a few hour before your reply).

About the "priming", all the code that you suggest, is referred to a PC program (if I understand) but my question is about a simple program not a PC?
(What I learn in these days is that the instructions TASK and WHICHTASK covers only parallel task).