next up previous 61
Next: A task with two actions
Up: ADAM Guide to Writing Instrumentation Tasks
Previous: Waiting for a command


Carrying out a simple command

Suppose your application is very simple, for example, SUMS.IFL contains

interface SUMS
   parameter VALUE
      type '_REAL'
   endparameter
   action SQUARE
      obey
      endobey
   endaction
endinterface

and SUMS.FOR contains

      SUBROUTINE SUMS ( STATUS )
      IMPLICIT NONE
      INCLUDE 'SAE_PAR'
      INCLUDE 'ACT_ERR'
      INTEGER STATUS
      REAL VALUE

      IF ( STATUS .NE. SAI__OK ) RETURN
      CALL PAR_GET0R ( 'VALUE', VALUE, STATUS )
      CALL MSG_SETR ( 'ANS', VALUE**2 )
      CALL MSG_OUT ( ' ', 'answer is = ^ANS', STATUS )
      END

This can be built as a task called SUMS and loaded using ICL. When it is loaded, the fixed-part reads the interface file and discovers that the task has just one action, called SQUARE, and one parameter called VALUE. If you send a command to it of the form

ICL> send sums obey square

then the task will prompt you for VALUE. It will attempt to square your reply and then return to the fixed-part. If you send the command again, you will not be prompted for VALUE. The task will remember the value of VALUE unless your application calls PAR_CANCL, or you KILL the task from ICL.



next up previous 61
Next: A task with two actions
Up: ADAM Guide to Writing Instrumentation Tasks
Previous: Waiting for a command

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