AS Programming info

  • 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

  • 1. TASK gives the status of the robot program (1) or the background programs (1001-1005):

    Code
    >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
    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
    .PROGRAM main()
      CALL gohome
      CALL cycle
    .END


    In your PC-Program:

    Code
    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?

  • Thanks for your answer.



    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?


    3) Yes.



    1. TASK gives the status of the robot program (1) or the background programs (1001-1005):


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


    Code
    .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?

    Edited once, last by Motouser ().

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now