next up previous 61
Next: Controlling tea and coffee making
Up: Making tea and coffee
Previous: Making tea

Making coffee

interface test_coffee
#  Test coffee task
    action mocha1
        obey
        endobey
    endaction
    action mocha2
        obey
        endobey
    endaction
    action mocha3
        obey
        endobey
    endaction
    action mocha4
        obey
        endobey
    endaction
    action mocha5
        obey
        endobey
    endaction
endinterface

      SUBROUTINE TEST_COFFEE (STATUS)

*     Test D-task that is run from a rescheduling control task

      IMPLICIT NONE
      INTEGER   STATUS          ! Modified STATUS
 
      INCLUDE   'SAE_PAR'
      INCLUDE   'ACT_ERR'
 
      INTEGER   SEQ             ! Action sequence number
      INTEGER   DELAY           ! Delay between initial and final entries
      CHARACTER NAME*24         ! Action name
 
      IF (STATUS .NE. SAI__OK) RETURN

*  Pick up required "ACT parameters"

      CALL TASK_GET_NAME (NAME,STATUS)
      CALL TASK_GET_SEQ (SEQ,STATUS)

*  Loop through possible OBEYs
 
      IF (NAME(1:5) .EQ. 'MOCHA') THEN
         IF (SEQ .EQ. 0) THEN
            CALL MSG_SETC ('NAME',NAME)
            CALL MSG_OUT (' ','COFFEE: Starting ^NAME action',STATUS)
            DELAY = 1000 * (ICHAR(NAME(6:6)) - ICHAR('0'))
            CALL TASK_PUT_DELAY (DELAY,STATUS)
            CALL TASK_PUT_REQUEST ( ACT__WAIT, STATUS )
         ELSE
            CALL MSG_SETC ('NAME',NAME)
            CALL MSG_OUT (' ','COFFEE: Finishing ^NAME action',STATUS)
            CALL TASK_PUT_VALUE ('Mocha''s ready!',STATUS)
         ENDIF
      ENDIF
      END



next up previous 61
Next: Controlling tea and coffee making
Up: Making tea and coffee
Previous: Making tea

ADAM Guide to Writing Instrumentation Tasks
Starlink User Note 134
B D Kelly
A J Chipperfield

30 March 1992
E-mail:ussc@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils