July 18, 2019, 03:34:09 PM
Robotforum | Industrial Robots Community

 AS Programming info

normal_post Author Topic:  AS Programming info  (Read 510 times)

0 Members and 1 Guest are viewing this topic.

March 26, 2019, 08:16:38 AM
Read 510 times


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

Today at 03:34:09 PM
Reply #1



March 26, 2019, 09:22:08 PM
Reply #1


1. TASK gives the status of the robot program (1) or the background programs (1001-1005):
Code: [Select]
>type task(1001)
 1       <- 1=running
PC program aborted.No = 1001
>type task(1001)
 2      <- 2=paused
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

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
     SIGNAL -s_initialized

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?

March 27, 2019, 07:33:13 AM
Reply #2


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
CALL job2

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

« Last Edit: March 27, 2019, 09:34:52 AM by Motouser »

March 27, 2019, 01:38:49 PM
Reply #3


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.

March 29, 2019, 10:09:41 AM
Reply #4


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.

April 04, 2019, 03:14:25 PM
Reply #5


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

Share via facebook Share via linkedin Share via pinterest Share via reddit Share via twitter

New to programming robots. Looking for more info than the basic NX100 manual.

Started by CollisionDetect on Yaskawa Motoman Robot Forum

2 Replies
Last post March 23, 2017, 04:24:24 PM
by Eli
OTF info to panelview

Started by kmcgregor on Fanuc Robot Forum

2 Replies
Last post May 13, 2015, 12:52:52 PM
by kmcgregor

Started by Motouser on Kawasaki Robot Support Forum

10 Replies
Last post February 19, 2018, 10:02:46 AM
by kwakisaki
Kuka Info

Started by Motouser on KUKA Robot Forum

2 Replies
Last post May 31, 2013, 01:15:08 PM
by SkyeFire