PROCESS CONTROL

Abstract: Apparatus is described for controlling a real-time process by means (2, 4, 5) of creating and/or editing on a computer screen (3) a timing chart of input/output signals desired to control the real-time process. Means (4) is provided for selectively converting the chart to a set of instructions for monitoring the input signals and governing the output signals. The set of instructions, which may be a computer program, can then be used in the same or another computer or other instrument to monitor the input signals and govern the output signals of the real-time process in order to control the real-time process.

Description: PROCESS CONTROL The present invention relates to the control of automated real-time processes, for example laboratory or manufacturing processes, by a computer or microprocessor. Automation of, particularly prototype, laboratory or manufacturing processes needs to be as flexible as possible. At the same time, programs for controlling such processes need to be able to be developed quickly, whilst remaining easily modifiable. However, many researchers or process developers do not have the skills necessary to write control programs themselves, so there can be significant delays in developing suitable control programs since it is often necessary to explain the requirements to a programmer who then has to implement the required control strategy in a given programming language. However, researchers and engineers are generally familiar with so-called timing diagrams or the like in which a representation of the control process is provided by plural graphs, each representing a given control signal or the like, displayed one above the other with the abscissa representing the elapsed time from the start of the process. Real-time process controls are often developed from diagrams of this sort, by the preparation (by a computer programmer) of a computer program implementation of a timing diagram prepared by the system developer, but the need to involve a programmer inevitably slows down the development. Furthermore, modifications that frequently need to be made during development will usually require further input from the programmer. The present invention sets out to overcome these problems by making use of the timing chart method of describing a real-time process control strategy to develop, automatically, an instruction set for the process control. According to the present invention therefore, apparatus for controlling a real-time process, comprises: an image display means; means for creating and/or editing a timing chart, of input/output signals desired to control the real-time process, on the image display means; means for selectively converting the chart to a set of instructions for monitoring the input signals and governing the output signals; and means for processing the set of instructions to monitor the input signals and govern the output signals of the real-time process, thereby to control the real-time process. The invention also includes apparatus for generating a set of instructions to monitor the input signals and govern the output signals of a real-time process, the apparatus comprising: an image display means; means for creating and/or editing a timing chart, of input/output signals desired to control the real-time process, on the image display means; and means for selectively converting the chart to a set of instructions for monitoring the input signals and governing the output signals. Further, the invention includes a method of controlling a real-time process, comprising the steps of creating and/or editing a timing chart, of input/output signals desired to control the real-time process, on an image display means; converting the chart to a set of instructions for monitoring the input signals and governing the output signals; and processing the set of instructions to monitor the input signals and govern the output signals of the real-time process, thereby to control the real-time process. Preferably the apparatus of the invention will comprise a computer, the conventional image display means comprising a visual display unit of the computer, and the means for creating and/or editing a timing chart comprises a keyboard and/or computer mouse together with the computer processor when programmed appropriately. • The screen representation of the timing chart is a visual representation of a data structure held in memory in the computer. The instruction set generated by the apparatus is preferably in the form of a computer program which may be saved to a conventional storage medium such as a magnetic disk. Preferably, the program generated is in a high level language such as 'BASIC so that modification of the program can easily be carried out directly if required, but the program may alternatively be generated in assembler source code, in machine code or in other specific code to be interpreted by a machine or instrument. This enables a program to be generated at one location where the appropriate apparatus (according to the invention) is present, and run on another computer at a separate location, any desired alteration to the control process instructing program being able to be made on the other computer, without the need for the presence of the apparatus of the invention. In other words, the control program may be generated on one computer by use of a program running on it which enables the creation and editing of the timing chart and subsequent control program generation, and can then be run on another computer which does not have the program means for generating the chart etc.. An example of apparatus according to the present invention will now be described with reference to the accompanying drawings, in which:- Figure 1 is a representation of computer apparatus according to the invention; Figure 2 is a representation of a visual display unit (VDU) screen of the apparatus showing a timing chart for a first real-time process; Figure 3 is a representation of a visual display uni (VDU) screen of the apparatus showing a timing chart for a second real-time process; and, Figure 4 shows an enlargement of a portion of Figur 3 together with details of the associated data structure. The computer apparatus of this particular exampl comprises an Acorn Archimedes (registered Trade Mark) personal computer 1 having a keyboard 2, a screen or VDU 3, a central processing unit (CPU) 4, and, optionally, a mous 5. The CPU also has at least one input/output port (no shown) comprising a plurality of digital input/output lines for connection to process control apparatus in the form o switches, sensors, motors and the like. The inputs/outputs may additionally or alternatively be transmitted/receive through a standard serial port such as RS232 or an IEEE488 port in the form of data strings that may be set up withi a text window associated with a particular event, or may b analogue signals. In the particular example the apparatus is shown bein used to generate an instruction set for the input/outpu signals required to control a pelican or similar pedestria crossing system. The notation shown on the screen is the visua representation of a data structure that is held in th computer's memory and which, itself, can be used t generate an instruction set for controlling the process. Entry of information on the screen is thus a visua representation of an entry to the underlying data structur in memory form which the screen is updated. The dat structure is constructed so as to represent th relationship of causes and effects in time and, whe required, is used to generate program code to enable process to be carried out in accordance with th relationships set up in the data structure and represente on the screen. The screen 3 displays a timing chart of the variou inputs and outputs that are present, inputs having as prefix the '>' symbol and outputs the •<• symbol, and the signals being, namely, as an input to the pelican crossing system, a button 101, and as outputs thereto, a pedestrian •WAIT' signal 102, a redman indicator 103, a greenman indicator 104, a warning beeper 105, and red 106, amber 107 and green 108 vehicle signal lights. Each of the signal lines may either be 'on' or 'off, as represented on the chart by the signal representation being respectively high or low. In order to represent a waiting state a shaded horizontal bar (see the button signal 101) is used. The start of a timer is indicated by a solid upwards arrowhead, the duration of the timer by a horizontal line connected thereto, and the end or end and restart by a short vertical bar (see the amber signal 107 at 107'). The cancellation of a timer is represented by an open upwards arrowhead which, when drawn outside the duration of the timer, is joined to the timer line by a dotted line (see the beeper signal 105 at 105'). A dotted vertical bar (eg. 112 on greenman signal 104) represents an instruction to change a switch signal to the state in which it is shown on the chart, in case, as may sometimes happen, it is not in that state already. Thick horizontal bars 109,110,111 indicate recycling processes, in that, when the right hand end of the bar is reached, the process moves immediately to the left hand end of the bar to start again. Alignment of the signal switches indicates that they occur at the same time of course, but alignment of an input signal switch with output signal switches (see the button 101 signal switch and the 'WAIT' 102, amber 107 and green 108 signals) indicates that the outputs are dependent on the input and that the output switches occur as a result of the input switch. This is one of a number of possible • cause and effect' relationships that may be selected. There are three possible causes, the start of the process itself (at time 0) ; switches in shaded inputs (eg button 101 at 101'); and timer ends (eg. amber signal 107 at 107') . Effects are items such as a switch in an output (eg. WAIT signal 102 at 102'); the start of a timer (eg. greenman signal 104 at 104'); cancellation of a timer (eg. beeper signal 105 at 105*) ; taking notice of a switch (represented by the start of a shaded horizontal bar) ; ignoring a switch (represented by the end of a shaded horizontal bar) ; and the start and end of a recycling signal (eg. beeper and amber signals 105, 107 at 109' and 111' , recycling of which is indicated by the bars 109 and 111 respectively) . Where two causes are aligned, either one or the other can produce an effect. The screen shows only a portion of the chart and can be scrolled left or right or up or down by use of appropriate keys on the keyboard or the mouse. The keyboard also uses the so-called 'function keys' or mouse to enable editing of the chart to add or change the signal switches, timers etc. and/or the timing, relationships etc. of signal switches, timers etc., and the screen can be expanded in the horizontal direction to give additional detail. The functions of the function keys Fl to F12 when unshifted, when shifted, when pressed with 'CONTROL' and when shifted with the 'CONTROL' key pressed as well are as shown in Tables 1 to 4 below. The graphical notation used in the apparatus resembles the waveform used in logical analysers and in data sheets for electronic components and the example shows the range of commands for process control that can be used. For example, the amber light 107 is made to flash without regard to when it will stop, and although it is stopped at a particular time, it could be stopped by any one of a number of different events, themselves the result of other causes, unknown to the flashing process. After the chart has been constructed on the screen to the user's satisfaction CONTROL + F7 is pressed to cause the apparatus to generate, from the data structure represented by the screen display, an instruction set for the pelican crossing control, in the form of a program. This is shown in Listing 1 attached hereto. TABLE 1 10 15 20 25 30 35 TABLE 3 The listing is in BBC BASIC 5 and contains references to procedures (PROCxxxx_yyy) which are not shown in detail, but which are already known for use in the creation of control programs for controlling the I/O lines of ports in an Acorn Archimedes computer. These procedures are given in detail in Listing 2 attached hereto and are described in Appendix 1 hereto. Using the program generated (Listing 1) the computer can be used to control a pelican crossing or a set of lights and switches representing such a crossing. By saving the program, and if desired translating it into machine code, the program can then be run in situ to control the real-time, real-life process from another computer or microprocessor. In the example illustrated in Figure 3, the apparatus is shown being used to generate an instruction set for the input/output signals required to control the apparatus for and thus the method of carrying out a tissue perfusion experiment. The screen 3 shows a timing chart similar to that of Figure 2 and identical symbols will not be separately described. The signals associated with the process are a switch 201, outputs 202,203 for controlling a pair of pumps a and b, an output 'stim' 204 to control a device for electrical stimulation of the tissue, an output 205 to control a fraction-collector, and a stop button 206. The process defined in Figure 3 is started by the switch 201 at 201' and the time between samples is controlled by a repeating timer 201" on the 'start' signal. This causes pump a to start pumping a first fluid through the tissue sample at 202• and samples are taken by a fraction collector at regular intervals by pulses at 205' which cause perfusate to be moved into fresh collecting tubes. At 203' pump b starts pumping a second fluid and at the same time, at 202" pump a stops pumping. At the beginning of the collection of the central sample of perfusate using both pump a and pump b, the tissue is stimulated briefly by activating the electrical stimulator 204'. A recycle bar 207 (shown at the bottom of the screen) returns control to the switch 201 to await another start and stop button signal 206 can be used at any time to halt the process and cancel all timers. At 201' further activations of the start switch are to be ignored, for the time being, as soon as it is pressed. The lighter shading to the right of 201' indicates that an alternative cause, in this case activation of the stop switch at 206*, may result in the start switch being ignored in combination with other effects. The fact that one cause is represented later in time than another does not mean that the one necessarily precedes the other - they are alternatives. Listing 3 shows the program generated by apparatus from the timing chart of Figure 3. The notation shown on the screens is the visual representation of a data structure that is held in the computer's memory and which, itself, can be used to generate an instruction set for controlling the process. The relationship between the screen shown in Figure 3, the underlying data structure and the program of Listing 3 can be illustrated by reference to Figure 4. Figure 4 illustrates a portion of the 'start' signal line of Figure 3, with the underlying data structure for this part of the screen shown below the trace and an indication of the functions associated with it shown below that. The relative time according to the screen of Figure 3 is shown above the trace line. Each of the HEXADECIMAL (HEX) bytes shown as comprising the data structure elements in figure 4 is formed of two nybbles each resulting from four binary digits (bits) which indicate the ON or OFF state of given functions. The table below (Table 5) indicates the relationship between these functions and the bits of the two HEX nybbles. TABLE 5 The table below (Table 6) illustrates for Figure 4 ow the HEX bytes result from the bit coding of Table 5. TABLE 6 The underlying data structure results in program code being generated (when CONTROL+F7 is pressed) as shown in Listing 3, the relevant portion relating to what is shown in Figure 4 and Tables 5 and 6 being at lines 260 to 380 (these lines also include code generated from other traces/lines of the timing chart of Figure 3 over the same period of time. The examples show the generation of programs for controlling single processes, but a program may be generated in a form which enables simultaneous control of multiple identical processes or devices. Although not shown in Figures 2 or 3, for simplicity, any event may have, associated with it, a text window which may contain explanatory data. The window can be accessed, when the cursor is located at the particular event by means of a function key combination assigned to this task. In this example the function key combination used is SHIFT+CONTROL+F5. Such a text window can be used to predefine a number of events of a specified type that must occur to produce a cause, for example the voltage to be produced on an analogue port or the required threshold to generate an analogue cause, a number of times a process is to recycle, or data to be output through for example the serial or IEEE port when the event occurs or the pattern of incoming data expected on the serial or IEEE port. The system accommodates the occurrence of an event dependent on two causes having occurred in either order of occurrence of the two causes. APPENDIX 1 Defined entities Several items in the description below appear in triangular brackets, e.g. <sw_num>. These entities are defined here for reference whe determining correct syntax. <chan_num> an expression whose integer result is the physical number of an analogue input channel. <dac> an expression whose integer result is the physical number of a digital-to-analogue converter. <error> an error number: the corresponding message i given by FNreport(<error>). <expr> an expression yielding a numeric result. <fn_name> a string expression which gives the name of a service function. <off> the logical "off" <state>: i.e. drawing no curren if govn'd (an output) or negated if free (a input). N.B. The data bit in the I/O chip may be 0 or a 1, depending on the interface. <on> the logical "on" <state>: i.e. drawing current i govn'd (an output) or asserted if free (an input). N.B. The data bit in the I/O chip may be a 0 or 1, depending on the interface. <parm> an <expr> whose integer result is stored an passed to a service function when it is called i response to an event. <port_num> an <expr> whose integer result is the physical number of a group of eight consecutive switche ranging from <port_num>*8 to <port_num>*8+7. <ret> a variable to which a procedure or functio returns a result. <sw_num> an expression whose integer result is the physical number of a digital I/O line. <state> <on> or <off>. <time> an <expr> whose integer result is a time i centiseconds. <t_num> an <expr> whose integer result is the number of timer. SUBSTITUTE SHEET Constants On has the value -1 (TRUE). Off has the value 0 (FALSE). Over has the value 1 (i.e. neither TRUE nor FALSE). Pseudo-variables FNa ax the highest numbered analogue input channel in the system. FNdmax the highest numbered digital I/O line in the system. FNpipes the number of events currently piped. Linking events to service functions PROCpipe_timer(<t_num>, <time>, <expr>, "FN<fn_nameX", <parm>, <rβt>) <t_num> <expr>: integer result is timer number (0 to 31). <tTme> <expr>: integer result is a time in centiseconds. <expr> dummy: set to 0. "FN<fn_name>( M the name of a service function, optionally followed ~~ by extra parameters. <parm> <expr>: evaluated as an integer. <ret> a variable to which an error code will be returned. PROCpipe_ti er() establishes a pipe between a timer and a service function. It sets timer number <t_num> to <time> centiseconds, and it starts counting down immediately. There are 32 timers, numbered 0 to 31. <parm> is evaluated and saved for use when the timer reaches zero. When this happens, provided that the program has entered PROCwaitO (see below), FN<fn_name> is called, and the saved value of <parm> is passed to its formal parameter. <expr> 1s a dummy for future use: it must be present, and should be set to zero. If the timer is already piped, the new call supercedes the old one. Timers have only one "life": i.e., once the service function has been executed, the pipe is cancelled and the timer will not restart - if required, this must be done with a further PROCpipe_timer() statement in the service function. A timer can be stopped early and the pipe cancelled by PROCkill_timer() or PROCkill_all (see below). On exit <ret> is set to zero if the PROC succeeded, and to an <error> if it failed. Possible errors are a non-existent timer, bad function syntax, non-existent function, bad DEFFN statement or the service function returning a non-zero result when probed. SUBSTITUTE SHEET F. „imer( <t. "um> , < . <3t> ) FNtimerO returns the current value of timer number <t_num>. ~ If th timer is not piped, it returns zero; and if it is piped it returns th time in centiseconds the timer has left to run. If PROCwaitO (se below) is late servicing a timer (held up servicing something else) then a negative value is returned, indicating the size of the delay this is usually very sma l in practice. On exit <ret> is set to zero if the FN succeeded, and to an <error> i it failed. The most likely error is trying to read a non-existen timer. PROCkiπ_timer(<t_num>, <ret>) PROCkin_timer() stops timer number <t_num> and cancels the pip linking it to a service function: the service function is not called. If the timer has not been piped, then nothing happens. On exit <ret> is set to zero if the PROC succeeded, and to an <error if it failed. The most likely error is trying to kill a non-existen timer. PROCpipe_switch(<sw_num>, <dir>, <expr>, "FN<fn_name>(", <parm>, <ret> <sw_num> <expr>: integer result is the number of a digital input line. <dir> <expr>: integer result is the direction of change. <expr> dummy: set to 0. "FN<fn_name>(" The name of a service function, optionally followe by extra parameters. <parm> <expr>: evaluated as an integer. <ret> a variable to which an error code will be returned. PROCpipe_switch() establishes a pipe between a free switch (digit input line) and a service function. It specifies that a change <state> on switch number <sw_num> is to cause service function <fn_nam to be called. (In Issue xθ.02, <sw_num> may not be greater than 3 i.e., only switches 0 to 31 may be piped). The direction of change is given by <dir>: if <dir> is TRUE, a chang from <off> to <on> will be effective, but not from <on> to <off>; i <dir> is FALSE, a change from <on> to <off> will be effective, but no from <off> to <on>; if <dir> is any other value, a change of <state will be effective, regardless of direction. <parm> is evaluated and saved for use when a change of the specifie direction occurs. When this happens, provided that the program ha entered PROCwaitO (see below), FN<fn_name> is called, and the save value of <parm> is passed to its formal parameter. <expr> is a dumm for future use: it must be present, and should be set to zero. If -the <εw_num> is already piped, then the new call supercedes the ol one. The pipe set up by this PROC remains in force indefinitely: eac change of <state> of the specified direction will cause the servic function to be called. The pipe can be cancelled with a call t PROCk1ll_switch() or PROCk1ll_all (see below). Note that 1f the switc is govn'd (an output) the PROC will succeed, but the service functio will not be called when the switch changes state. . X.1X. <rr > is s«ac to zero if the PROC succeecsα, and to an <error if it fa * , .ed. Possible errors are a non-existent switch, a switc number greater than 31, bad function syntax, non-existent function, ba DEFFN statement or the service function returning a non-zero resul when probed. PROCkin_switch(<sw_num>, <ret>) PROCkill_switchO cancels the pipe between the switch <sw_num> and th service function specified by the most recent call t PROCpipe_switch(). If the switch 1s not piped, or is a govn'd switc (i.e. a digital input line) then nothing happens. On exit <ret> is set to zero if the PROC succeeded, and to an <error if it failed. The most likely error is a non-exitent switch. PROCkill_all PROCkill_all cancels all outstanding pipes for timers and switches. I is usually used at the beginning of a program to ensure that there i nothing left over from an old program, and also it is the way to leav PROCwaitO (see below) when terminating a program. PROCwa1t(<ret>) PROCwaitO is called when all the initial pipes for a program have bee established. When a piped event occurs (a switch changing to th specified <state> or a timer reaching zero), it is from PROCwaitO tha the appropriate service function is called. In addition to manipulating the I/O, service functions may set up ne pipes and cancel others before returning: the program will stay i PROCwaitO until all pipes have been cancelled. A common way of leavin PROCwaitO is for a service function to make a call to PROCkill_all PROCwaitO then finds all pipes cancelled and returns. Servic functions usually return zero, to indicate success; but if they retur a non-zero result, PROCwaitO terminates immediately, returning th value obtained from the service function in <ret>. On return from PROCwaitO, the main program continues from th statement immediately following the PROCwaitO statement. Usually, thi will signal the end of the program, and it may do some tidying up o print some results before ending. However, it is possible to set u further pipes and call PROCwaitO again. Direction of digital input/output lines PROC ree_switch(<sw_num>, <ret>) PROCfree_switch() frees the switch number <βw_num> for control by th outside world: i.e. ft makes it an input to the computer. On exit <ret 1s set to zero if the PROC succeeded, and to an <error> if it failed. The most likely error- is specifying a non-existent switch. SUBSTITUTE SHEET Pi.OCgovn_sv .ch( <sw_.num> , <ret> ) PROCgovn_εwitch() (literally GOVerN SWITCH) takes over the switc number <sw_num> for control by the computer: i.e. it makes it a output. On exit <ret> is set to zero if the PROC succeeded, and to a <error> if it failed. The most likely error is specifying non-existent switch. PROCfree x port(<port_num>, <ret>) PROCfree x port() frees the eight switches in port number <port_num> fo control by the outside world: I.e. it makes them all inputs. On exi <ret> is set to zero if the PROC succeeded, and to an <error> if i failed. The most likely error is specifying a non-existent port. PROCgovn_port(<port_num>, <ret>) PROCgovn_port() (literally GOVerN PORT), takes over the eight switche in in port number <port_num> for control by the computer: i.e. it make them all outputs. On exit <ret> is set to zero if the PROC succeeded and to an <error> if it failed. The most likely error is specifying non-existent port. FNs-tatus(<βw_num>, <ret>) FNstatusO returns the direction of switch number <sw_num>: the resul is FALSE if it is a free switch (an input), and TRUE 1f it is a govn' switch (an output). On exit <ret> is set to zero if the FN succeeded and to an <error> if it failed. The most likely error is specifying non-existent switch. Manipulation of digital I/O lines PROCswitch_on(<sw_num>, <ret>) PROCswitch_on() puts switch number <sw_num> into the <on> state, if i iβ a govn'd switch (an output). If it is a free switch (an input), o if it is already <on>, then nothing happens. On exit <ret> is set t zero if the PROC succeeded, and to an <error> if it failed. The mos likely error is specifying a non-existent switch. PROCswitch_off(<sw_num>, <ret>) PROCswitch_off() puts switch number <sw_num> into the <off> state, i it is a govn'd switch (an output). If it is a free switch (an input) or if it is already <off>, then nothing happens. On exit <ret> is se to zero if the PROC succeeded, and to an <error> if it failed. The mos likely error is specifying a non-existent switch. PROCswitch_over(<8w_num>, <ret>) PROCswitch_over() inverts switch number <εw_num>, if it 1s govn'd (a output); turning it <on> if It was <off>, or turning it <off> it wa <on>. If it is a free switch (an input) nothing happens. On exit <ret i„ set to iro if the PROC succeeded, and to an <error> IT it τaι iβα. The most 1 _κely error is specifying a non-existent switch. PROCswitch(<sw_num>, <expr>, <ret>) PROCswitchO puts switch number <sw_num> into the <state> specified by <expr>. Unless the switch is free (an input), in which case nothing happens, then the switch is turned <off> if <expr> is zero, and it is turned <on> if <expr> is non-zero. On exit <ret> is set to zero if the PROC succeeded, and to an <error> if it failed. The most likely error is specifying a non-existent switch. FNε itch(<sw_num>, <ret>) FNswitchO returns the state of switch number <sw_num>: the result is TRUE if the switch is <on>, or FALSE if it is <off>. If the switch is govn'd (an output), the result is the current setting; and if the swi ch is free (an input), the result is the state at the instant the switch was read. On exit <ret> is set to zero if the FN succeeded, and to an <error> if it failed. The most likely error is specifying a non-existent switch. PROCport(<port_num>, <expr>, <ret>) PROCportO puts the eight switches within port number <port_num> into the <state> specified by the least significant eight bits of <expr>. For n=0 to 7, if bit n of <expr> is a 1, then switch number <port_num>*8+n is switched <on>; and if bit n of <expr> is a 0, then switch number <port_num>*8+n is switched <off>. If any switch was free (an input) or was already in the <state> specified, nothing happens to it. On exit <ret> is set to zero if the PROC succeeded, and to an <error> if it failed. The most likely error is specifying a non-existent port. FNport(<port_num>, <ret>) FNportO returns the <state> of the eight switches within port number <port_num> in the least significant eight bits of its result. For n=0 to 7, bit n gives the <state> of switch number <port_num>*8+n: if the switch is <on>; the bit is a 1, and if the switch is <off> the bit is a 0. For switches that are govn'd (outputs) the result is the current setting, and for for switches that are free (inputs) the result is the state at the instant the switches were read. On exit <ret> is set to zero if the FN succeeded, and to an <error> if it -failed. The most likely error is specifying a non-existent port. SUBSTITUTE SHEET Analogue Input and Output PROCdac(<dac>, <expr>, <ret>) PROCdacO sets digital-to-analogue converter number <dac> to the valu given by the 12 least significant bits of <expr>, when evaluated as a integer. On exit <ret> is set to zero if the PROC succeeded, and to a <error> if it failed. The most likely error is specifying non-existent DAC. FNadc(<chan_num>, <ret>) FNadcO performs an analogue-to-digital conversion on analogue inpu channel number <chan_num>. On exit <ret> is set to zero if the F succeeded, and to an <error> if it failed. The most likely error i specifying a non-existent channel. ARACHNID error messages Bad function syntax The function name given in a PROCpipe_ statement did not have the form: FN<name>([<parm>,] * The first two characters must be "FN"; next there must be the name of function followed by a "("; this may be followed by one or mor parameters ending in a ",". Can't use SWITCH The switch number given in a PROCpipe_switch() statement was large than 31 (the current restriction on pipeable switches). No such analogue line The analogue input channel or the DAC number exceeded the maximu present in the system. No such PORT The port number specified was greater than the maximum present in t system. No such SWITCH The switch number specified was greater than the maximum present in th system. E SHEET N such TT" < =R The timer number specified was greater than 31 . Not a service function A function was specified as a service function in a PROCpipe statement, but responded to a probe call with a non-zero result, indicating that the programmer had specified that it was not to be use as a service function. ARACHNID Error codes and messages 72 No such analogue line 91 No such PORT 94 No such SWITCH 101 No such TIMER 103 Can't use SWITCH 105 Bad function syntax 120 Not a service function LISTING 1 REM > ]giprog.PELICAN - created: Mon,21 May 1990.13:59:23 DIM countonX(31),countoffX(31) DIM L$(31),VX(31) PROCinlt PROCarachnidprogram END : DEFPROCarachnidprogram LOCAL qX LOCAL ERROR ON ERROR LOCAL PROCβrror:ENDPROC l EX) ENDPROC : DEFFNβtart PROCpipe_switch(button,On,0,"FNbutton_sw1tch1(",0,EX) PROCswitch_on(redman,EX):countonX(redman)+=1 PROCswitch_on(green,EX):countonX(green)+=1 =0 : DEFFNbutton_8w1tch1(PX,RX) IF RX=0 =0 countonX(button)+=1 PROCkil1_βw1tch(button,EX) PROCswitch_on(WAIT,EX):countonX(WAIT)+=1 PROCswitch_on(amber,EX):counton (amber)+=1 PROCp1pe_t1mer(amber,300,0,°FNamber_timer f,0,EX) PROCβwitch.off(green,EX):countoffX(green)+=1 sθ : DEFFNatnber_timer1(PX, X) IF RX=0 sO PROCswitch_on(red,E ):countonx(red)+=1 PROCpipe_t1mer(red,200,0,"FNred_t1mβrK",0,EX) PROCswitch_off amber,Ex):countoff (amber)♦=1 =0 : DEFFNred_timer1(PX,RX) IF RXrO =0 PR0C6Witch_off(WAIT,EX):countoffX(WAIT)+=1 PROCswitch_off(redman,EX):countoffX(redman)+=1 PROCswitch_on(greenman,EX):counton (greenman)+=1 PROCpipe_timer(greenn * un,500,0,"FNgreenman_timer1(",0,EX) PROCswitch_on(beeper,EX):counton (beeper)+=1 PROCpipe_timer(beeper,10,0,"FNbeeper_t1mer1(",0,EX) sO : DEFFNbeeper_t1mβr1(PX,RX) IF RX=0 sO PROCβwitch_off(beeper,EX):countoffX(beeper)+=1 PROCp1pe_t1mer(beeper,10,0,"FNbeeper_timer2(",0,EX) ) :countonx(beeper)+=1 ,0,"FNbeeper_timer3(",0,EX) ) 760 DEFFNgreenman_timer1(PX,RX) 770 IF RX=0 =0 780 PROCswitch_on(greenman,EX):countonx( reenma )+=1 790 PROCswitch_off(beeper,EX):countoffx( eeper)+=1 800 PROCkm_timer(beeper,EX) 810 PROCswitch_off(red,EX):countoffx(red)+=1 820 PROCpipe_timer(red,500,0,"FNred_timer2(",0,EX) 830 PROCswitch_on(amber,E :countonx(amber)+=1 840 PROCpipe_timer(amber,50,0,"FNamber_timβr2(",0,EX) 850 =0 860 : 870 DEFFNamber_timer2(PX,RX) 880 IF RX=0 =0 890 PROCswitch_off(greenman,EX):countoffx(greenman)+=1 900 PROCswitch_off(amber,EX):countoffX(amber)+=1 910 PROCpipe_timer(amber,50,0,"FNamber. timer3(",0,EX) 920 =0 930 : 940 DEFFNamber_timer3(PX,RX) 950 IF RX=0 =0 960 PROCswitch_on(greenman,EX):counton (greenman)+=1 970 PROCswitch_on(amber,EX):countonX(amber)+si 980 PROCpipe_timer(amber,50,0,"FNamber_ti er4(",0,EX) 990 =0 1000 : 1010 DEFFNamber timer4(PX,RX) 1020 IF RX=0 =0 1120 DEFPROCresults 1130 LOCAL iX.jX.kX 1140 PRINT"*" SWITCH ONs OFFs SWITCH ONs OFFs' 1150 JX=0 1160 FOR 1X=0 TO 31 1170 IF L$(iX)<>" " THEN vX(jX)=iX:jX+=1 1180 NEXT 1190 jX+=1 1200 FOR kX=0 TO JXDIV2-1 1210 FOR 1X=0 TO JXDIV2 STEP JXDIV2 1220 IF 1X+kX<jX-1 THEN 1230 IF iX PRINT" "; 1240 PRINT" ";L$(vX(iX+kX))j 1250 IF LEFT$(L$(vX(iX+kX)),1)=">" PRINT" "; 1260 PRINTFNdecalign(countonX(vx(iχ+kX))); 1270 IF LEFT$(L$(vX(iX+kX)),1)="<" THEN 1280 PRINTFNdecalign(countoffX(vX(ix+kX))); 1290 ELSE 1300 PRINT" "; 1310 ENDIF 1320 ENDIF 1330 NEXT 1340 PRINT 1350 NEXT 1360 ENDPROC 1370 : 1380 DEFFNdeca1ign(dX)=RIGHT$(" "+STR$(dX),9) 1390 : 1400 DEFPROCerror 1410 IF (ERRAND*FF)=17 THEN PROCresults 1420 REPORT:PRINT" at line ";ERL 1430 ENDPROC LISTING 2 10 ARACHNID Iss xθ.03 Real-Time extension for BBC BASIC V (C) 1989 Paul F ray Ltd 20 REMcu 30 DEFPROCkm_a1 1 40 LOCAL ZX 50 FOR ZX=0 TO 4 STEP 4:reqreg!ZX=0:flags!ZX=0:NEXT 60 pipesx=0 70 ENDPROC 80 : 90 DEFPROCpipe_timer(tX,timeX,nX,fn$,parmx, RETURN EX) 100 LOCAL TX 110 EX=FNchktim: IF EX ENDPROC 260 DEFPROCpipe_switeh(sx,dirX,nX,fn$,parmX l RETURN EX) 270 LOCAL SX NOT SX SX 450 : 460 DEFPROCkm_timer(tX, RETURN EX) 470 EX=FNchktim: IF EX ENDPROC 480 tX=K<tX 490 IF i reqreg AND tX THEN 500 ! reqreg= i reqreg AND NOT tx 510 ! Hags= ! flags AND NOT tx 520 pipesX=pipesX-1 530 ENDIF ) 620 p pesχ-spipeβX-1 630 ENDIF 640 ENDPROC 650 : 660 DEFFNtimer (tX , RETURN EX ) 670 EX=FNchktim: IF EX ENDPROC 680 IF i reqreg AND 1 <<tX THEN =-timers ! ( tx<<2 ) ELSE =0 690 : 700 DEFFNchktim 710 IF tX<0 OR tX>31 THEN =101 ELSE =0 720 : 730 DEFFNchkpipe 740 IF SX<0 OR sX>=(?nmpipts<<3) THEN =103 ELSE =0 750 : 760 DEFFNchksw 770 IF SX<0 OR sX>!dmax THEN =94 ELSE =0 780 : 790 DEFFNchkport 800 IF pX<0 OR (pX<<3)>!dmax THEN =91 ELSE =0 810 : 820 DEFFNchkadc 830 IF CX<0 OR cX>iamax THEN =72 ELSE =0 840 : 850 DEFFNchkdac 860 IF cX<0 OR (cX<<2)>!amax THEN =72 ELSE =0 870 : 880 DEFFNchkfn 890 LOCAL ERROR 900 ON ERROR LOCAL IF ERR=29 OR ERR=30 OR ERR=31 THEN =ERR ELSE PRINT'REPO RT$" at line ";ERL: END 910 IF LEFT$(fn$,2)<>"FN" OR LENfn$<4 OR INSTR(fn$,"(")=0 OR RIGHT$(fn$)<> "(" AND RIGHT$(fn$)<>"," THEN =105 920 IF EVAL(fn$+"0,FALSE)") THEN =120 930 =0 940 : 950 DEFPROCwait(RETURN EX) 960 LOCAL ZX 970 LOCAL ERROR 980 ON ERROR LOCAL IF ERR=17 EX=ERR: ENDPROC ELSE PRINT 'REPORTS" at line ~;ERL: END 990 WHILE pipesX>0 1000 ZX=USRwait 1010 IF ZX<32 THEN !reqreg=!reqreg AND NOT (1<<ZX): pipesX=pipesX-1 1020 EX=EVAL(fn$(ZX)+"parmX(ZX),TRUE)") 1030 IF EX ENDPROC 1040 ENDWHILE 1050 EX=0 1060 ENDPROC 1070 : 1080 DEFPROCclaim 1090 RX=EXTtOPENIN"$.Library.registers" 1100 WX=EXT#OPENIN"$.Library.wait" 1110 CX=EXT#OPENIN"$.Library.code" 1120 CLOSE#0 1130 HIMEM=HIMEM-CX-WX-RX-256 AND &FFFFFFFC 1140 PROCinit 1150 ?claimed=0 1160 TX=TIME: REPEAT UNTIL TIME>TX 1170 IF ?claimed=0 THEN 1180 OSCLI"LOAD $.Library.registers "+STR$~HIMEM 1190 OSCLI"LOAD $.Library.wait "+STR$~(HIMEM+RX) 1200 OSCLI'LOAD $. ibrary.code "+STR$~(HIMEM+RX+WX) 1210 SYS"I/O Podule_Hardware" TO ,IX 1220 !iopod=IX AND IFFOOFFFF 1230 SYS"OS_C1aim" ,*1C,HIMEM+RX+WX,HIMEM 1240 PROCio 1250 ENDIF 1260 PRINT"ARACHNID Issue xθ.03 (C) Paul Fray Ltd 1989"* 1270 ?(PAGE+1)=255: ?(TOP-1 )=0 1280 END 1290 : 1300 DEFPROCvariables 1310 On=T 1320 osby read sheila=150 1330 PX=HIMEM: PROCregisters 1340 ENDPROC 1350 : 1360 DEFPROCinit 1370 LOCAL PX.ZX 1380 PROCvaπ'ables 1390 DIM report$(127), fn$(63), parmX(63) 1400 PROCreportε 1410 err=0: pipesX=0 1420 ENDPROC 1560 reportS(120)="Not a service function" 1570 ENDPROC 1580 : 1590 DEFPROCregisters 1600 [ OPT 0 • * 1610 ALIGN 1620 .timers 1630 ] 1640 PX=PX+32*4 1650 [ OPT 0 1660 .flags 1670 EQUD 0 1680 .sw_flag 1690 EQUD 0 1700 .reqreg 1710 EQUD 0 1720 .sw_req 1730 EQUD 0 1740 .dirreg 1750 EQUD 0 1760 .ignreg 1770 EQUD 0 1780 .tick 1790 EQUD 0 1800 .oldtick 1810 EQUD 0 1820 .softiodef 1830 EQUD 0 1840 EQUD 0 1850 EQUD 0 1860 EQUD 0 2 ? 1870 EQUD 0 1880 EQUD 0 1890 EQUD 0 1900 EQUD 0 1910 .oldiodef 1920 EQUD 0 1930 .softport 1940 EQUD 0 1950 EQUD 0 1960 EQUD 0 1970 EQUD 0 1980 EQUD 0 1990 EQUD 0 2000 EQUD 0 2010 EQUD 0 2020 .claimed 2030 EQUD !claimed 2040 .dmax 2050 EQUD idmax 2060 .amax 2070 EQUD iamax 2080 .smax 2090 EQUD is ax 2100 . opod 2110 EQUD !iopod 2120 .jimsheila 2130 EQUD !jimsheila 2140 .dbase 2150 EQUD !dbase 2160 .abase 2170 EQUD !abase 2180 .sbase 2190 EQUD !sbase 2200 .onemegpage 2210 EQUW ionemegpage 2220 .nmpipts 2230 EQUB !nmpipts 2240 . iocode 2250 EQUB ! iocode 2260 .portab 2270 EQUD !portab 2280 EQUD 430312021 2290 EQUD &50514041 2300 EQUD 470716061 2310 EQUD 490918081 2320 EQUD 4B0B1A0A1 2330 EQUD 4D0D1C0C1 2340 EQUD 4F0F1E0E1 2350 .invtab 2360 EQUD ! invtab 2370 E EQQUUDD 4FFFFFFFF 2380 E EQQUUDD 4FFFFFFFF 2390 E EQQUUDD 4FFFFFFFF 2400 E EQQUUDD 4FFFFFFFF 2410 E EQQUUDD 4FFFFFFFF 2420 E EQQUUDD 4FFFFFFFF 2430 E EQQUUDD &FFFFFFFF 2440 .wait 2450 ] 2460 ENDPROC 2470 2480 DEF FNswitch(sX, RETURN EX) 2490 LOCAL PX, BX 2500 EX=FNchksw: IF EX THEN =0 SUBSTITUTE SHEET 2510 PX=sX>>>3: BX=K<(SXAND7) 2520 IF softiodef?PX AND BX THEN 2530 sx=softport?PX 2540 ELSE PROCpagedig 2550 SYS osbytβ, ?iocode, portab?PX TO ,,βx 2560 PROCrestpage 2570 ENDIF 2580 =((sX EOR invtab?PX) AND BX) <> 0 2590 2600 DEF FNstatus(sX, RETURN EX) 2610 EX=FNchksw: IF EX THEN =0 2620 = (softiodef?(sX>>>3) AND 1<<(sX AND 7)) <> 0 2630 2640 DEF PROCswitch(8X,stX, RETURN EX) 2650 IF stX PROCswitch_on(8X,EX) ELSE PROCswitch_off(sX,EX) 2660 ENDPROC 2670 2680 DEF PROCswi tch on(sX , RETURN EX ) 2690 LOCAL PX , BX 2700 EX=FNchksw: IF EX ENDPROC 2710 PX=SX>>>3: BX=K<(sXAND7) 2720 sX=softport?PX EOR invtab?PX OR BX EOR invtab?PX 2730 softport?PX = βx 2740 PROCpagedig 2750 SYS osbyte, ?iocode+1, portab?PX, sX 2760 PROCrestpage 2770 ENDPROC 2780 2790 DEF PROCsw itch off(sX , RETURN EX) 2800 LOCAL PX, BX 2810 EX=FNchksw: IF EX ENDPROC 2820 PX=SX>> >3 : BX=K< (sXAND7 ) 2830 8X=(softport?PX EOR invtab?PX) AND NOT BX EOR invtab?PX 2840 softport?PX = sX 2850 PROCpagedig 2860 SYS osbyte, ?iocode+1 , portab?PX, sX 2870 PROCrestpage 2880 ENDPROC 2890 2900 DEF PROCswitch_over( sX, RETURN EX) 2910 LOCAL PX BX 2920 EX=FNchksw: IF EX ENDPROC 2930 PX=SX> > >3: BX=K < (SXAND7 ) 2940 sX=8θftport?PX EOR BX 2950 softport?PX s sX 2960 PROCpagedi 2970 SYS osbyte, ?iocode+1 , portab?PX, sx 2980 PROCrestpage 2990 ENDPROC 3000 3010 DEF PROCf ree_swi tch (sx, RETURN EX ) 3020 LOCAL PX, BX 3030 EX=FNchksw: IF EX ENDPROC 3040 PX=SX>>>3: BX=K<(SXAND7) 3050 8X=softiodef?PX AND NOT BX 3060 εoftiodef?PX=sX 3070 PROCpagedig 3080 SYS osbyte, ?iocode+1 , portab?PX+2, sX 3090 PROCrestpage 3100 ENDPROC 3110 3120 DEF PROCgovn_switch(8X, RETURN EX) 3130 LOCAL PX BX 3140 EX=FNchksw: IF EX ENDPROC 3150 PX=sX>>>3: BX=K<(εXAND7) 3160 SX=(softport?PX EOR invtab?PX) AND NOT BX EOR invtab?PX 3170 εoftport?PX = sx 3180 PROCpagedig 3190 SYS osbyte, ?iocode+1 , portab?PX, sx 3200 sX=softiodef?PX OR BX 3210 softiodef?PX=sX 3220 SYS osbyte, ?iocode+1, portab?PX+2, sX 3230 PROCrestpage 3240 ENDPROC 3250 3260 DEF FNport(pX, RETURN EX) 3270 LOCAL DX 3280 EX=FNchkport: IF EX THEN =0 3290 PROCpagedig 3300 SYS osbyte, ?iocode, portab?pX TO ,,DX 3310 PROCrestpage 3320 = DX AND NOT softiodef?pX OR softport?pX AND softiodef?pX EOR invtab? PX 3330 3340 DEF PROCport(pX,DX, RETURN EX) 3350 EX=FNchkport: IF EX ENDPROC 3360 DX=DX EOR invtab?px 3370 εoftport?pX=DX 3380 PROCpagedig 3390 SYS osbyte, ?iocode+1 , portab?pX, DX 3400 PROCrestpage 3410 ENDPROC 3420 3430 DEFPROCgovn_port(pX, RETURN EX) 3440 PROCport(pX,0,EX) 3450 IF EX ENDPROC 3460 PROCpagedig 3470 softiodef?pX=4FF 3480 SYS osbyte, ?iocode+1 , portab?pX+2, 4FF 3490 PROCrestpage 3500 ENDPROC 3510 3520 DEFPROCfree_port(pX, RETURN EX) 3530 EX=FNchkport: IF EX ENDPROC 3540 PROCpagedig 3550 softiodef?px=0 3560 SYS osbyte, ?iocode+1, portab?pX+2, 0 3570 PROCrestpage 3580 ENDPROC 3590 3600 DEFPROCpagedig 3610 onemegpage?1=?onemegpage 3620 ?onemegpage=dbase?1 3630 SYS osbyte, writefred, 4FF, dbase?1 3640 ENDPROC 3650 3660 DEFPROCpagean 3670 onemegpage?1=?onemegpage 3680 ?onemegpage=abase?1 3690 SYS osbyte, writefred, 4FF, abase?1 3700 ENDPROC 3710 3720 DEFPROCpageser 3730 onemegpage?1=?onemegpage 3740 ?onemegpage=sbaεe?1 3750 SYS osbyte, writefred, 4FF, sbase?1 3760 ENDPROC 3770 3780 DEFPROCrestpage 3790 ?onemegpage=onemegpage?1 3800 SYS osbyte, writefred, 4FF, ?onemegpage 3810 ENDPROC 3820 3830 DEFPROCdac(oX,VX, RETURN EX) 3840 EX=FNchkdac: IF EX ENDPROC 3850 cX=cX<<3 OR 8 OR cX<<1 AND 2 3860 PROCpagean 3870 SYS osbyte, writejim, cX, VX 3880 SYS osbyte, writejim, cx+1 , VX>>>8 3890 PROCrestpage 3900 ENDPROC 3910 3920 DEFFNadc(cX , RETURN EX ) 3930 LOCAL BX 3940 EX=FNchkadc: IF EX THEN =0 3950 BX=CX<<1 AND 4F0 3960 PROCpagean 3970 SYS osbyte, writejim, BX, cX AND 7 3980 SYS osbyte, readjim, BX+2 3990 SYS osbyte, readjim, BX+1 TO ,,cx 4000 SYS osbyte, readjim, BX+2 TO ,,BX 4010 PROCrestpage 4020 = CX<<8 OR BX 4030 4040 DEFPROCio 4050 !amax=FNsetamax: IF !amax=-1 THEN !abase=0 4060 !smax=FNsetεma : IF ismax=-l THEN !εbase=0 4070 !dmax=FNsθtdmax 4080 IF !dmax=-1 THEN 4090 IF FNtestvia(readshei1a,460) THEN 4100 idbase=4FE60: !dmax=7: ?portab=460: ?invtab=0: ?softiodef=0 4110 SYS osbyte, writesheila, 462, 0 4120 ?iocode=readshei1a: !jimεhei1a=43C2000-460*4 4130 ELSE !dbase=0 4140 ENDIF 4150 ENDIF 4160 IF !dbase=0 AND !abase=0 AND !sbase=0 ERROR 0, "No I/O found" 4170 ?nmpipts=!dmax+1>>>3 4180 IF ?nmpipts>4 THEN ?nmpipts=4: REM extend later 4190 ENDPROC 4200 4210 DEFFNsetdmax 4220 LOCAL ZX 4230 ZX=0 4240 PROCpagedig 4250 WHILE FNtestvia(read i .ZX) AND ZX<256 4260 8θftiodef?(ZX>>>3)=0: softiodef?((ZX>>>3)+1)=0 4270 SYS osbyte, writejim, ZX+2, 0 4280 SYS osbyte, writejim, ZX+3, 0 4290 ZX+=16 4300 ENDWHILE 4310 PROCrestpage 4320 =ZX-1 4330 4340 DEFFNteεtvia(IX,O ) 4350 SYS osbyte, IX+1 , OX+6, 0 4360 SYS osbyte, IX+1, 0X+4, 455 4370 SYS osbyte, IX, OX+6 TO ,,OX 4380 IF OX=455 THEN =TRUE ELSE =FALSE 4390 4400 DEFFNsetamax 4410 LOCAL ZX 4420 ZX=0 4430 WHILE FNteεtan(ZX) AND ZX<128 4440 ZX+=16 4450 ENDWHILE 4460 =(ZX>>>1)-1 4470 z 4480 DEFFNtestan(ZX) 4490 PROCpagean 4500 SYS osbyte, readjim, ZX TO ,,ZX 4510 PROCrestpage 4520 IF ZX=1 THEN =TRUE ELSE =FALSE 4530 ; 4540 DEFFNsetsmax 4550 LOCAL ZX 4560 zx=o 4570 WHILE FNtestser(ZX) AND ZX<32 4580 ZX+=32 4590 ENDWHILE 4600 =ZX-1 4610 : 4620 DEFFNtestser(ZX) 4630 PROCpageser 4640 zx=o 4650 PROCrestpage 4660 IF ZX THEN =TRUE ELSE =FALSE 4670 : 4680 DEFFNdmax=!dmax 4690 DEFFNamax=!amax 4700 DEFFNsmax=!smax 4710 DEFFNdbase=!dbase 4720 DEFFNabase=iabase 4730 DEFFNsbase=!sbase 4740 DEFFNpipes=pipesX 4750 DEFFNreport(RX)=reportS(RX AND 127) 4760 ; LISTING 3 REM > Jgiprog.perfuseq - created: Mon,14 May 1990.17:19:23 DIM countonX-(31 ),countoffX(31 ) DIM LS(31),VX(31) PROCinit PROCarachni program END : DEFPROCarachnidprogram LOCAL qX LOCAL ERROR ON ERROR LOCAL PROCerror:ENDPROC PRock*m_aπ LS()=STRINGS(10," ") LS(0)=">start ":εtart=0:PROCfree_switch(start,EX) LS(4)="<pump_a ":pump_a=4:PR0Cgovn_switch(pump_a,EX) LS(5)="<pump_b " :pump_b=5:PROCgovn_switch(pump_b,EX) LS(6)="<stim ":stim=6:PR0Cgovn_swi ch(εtim,EX) LS(7)="<fraction ":fraction=7:PROCgovn_switch(fraction,EX) LS(1)=">εtop ":stop=1:PROCfree_εwitch(εtop,EX) qX=FNεtart PROCwait(EX);IF EX ERROR EX.FNreport(EX) PROCresults ENDPROC : DEFFNstart PROCpipe_switch(start,On,0,"FNstart_switchi(",0,EX) PROCpipe_switch(stop,On,0, "FNstop_εwitchl (",0,EX) =0 : DEFFNstart_switch1(PX,RX) IF RX=0 =0 countonX(start)+=1 PROCkill_switch(start,EX) PROCpipe_timer(start,800,0, "FNstart_timer2(",0,EX) PROCswitch_on(pump_a,EX):countonX(pump_a)+=1 PROCswitch_on(fraction,EX):countonx(frac ion)+=1 PROCpipe_timer(fraction,20,0, "FNfraction_timer1 (",0,EX) =0 : DEFFNfraction_timer1(PX,RX) IF RX=0 =0 PROCswitch_off(fraction,EX):countoffx(fraction)+=1 =0 : DEFFNfraction_timer2(PX,RX) IF RX=0 =0 PROCswitch_off(fraction,EX) :countoffX(fraction)+=1 =0 : DEFFNstim_timer1(PX,RX) IF RX=0 =0 PROCswitch_off(stim.EX) :countoffx(stim)+=1 =0 : 640 DEFFNstart_timer3(PX,RX) 650 IF RX=0 =0 660 PROCpipe_timer(start,800,0, "FNstart_timer4( " ,0,EX) 670 PROCswitch_on(fraction,EX):countonx(fraction)+=1 680 PROCpipe_timer(fraction,20,0, "FNfraction_timer3(",0,EX) 690 =0 700 : 710 DEFFNfraction_timβr3(PX,RX) 720 IF RX=0 =0 730 PR0Cεwitch_off(fraction,EX):countoffx(fraction)+=1 740 =0 750 : 760 DEFFNstart_timer4(PX,RX) 770 IF RX=0 =0 780 PROCpipe_timer(start,800,0, "FNstart_timer5(",0,EX) 790 PROCswitch_off(pump_a,EX):countoffx(pump_a)+=1 800 PROCswitch_on(pump_b,E ):counton (pump_b)+=1 810 PROCswitch_on(fraction,E ) :countonX(fraction)+=1 820 PROCpipe_ti er(fraction,20,0,"FNfraction_timer4(" ,0,E ) 830 =0 840 : 850 DEFFNfraction_timer4(PX,RX) 860 IF RX=0 =0 870 PROCswitch_off(fraction,E ):countoff (fraction)+=1 880 =0 890 : 900 DEFFNstart_timer5(PX,RX) 910 IF RX=0 =0 920 PROCpipe_timer(start,800,0,"FNstart_timer6(" ,0,EX) 930 PROCswitch_on(s im,EX):countonX(εtim)+=1 940 PR0Cpipe_timer(stim,200,0,"FNstim_timer2(" ,0,EX) 950 PROCswitch_on(fraction,EX):counton (fraction)+=1 960 PROCpipe_timer(fraction,20,0, "FNfraction_timer5(",0,EX) 970 =0 980 : 990 DEFFNfraction_timβr5(PX,RX) 1000 IF RX=0 =0 1010 PR0Cεwitch_off(fraction,EX):countoffX(fraction)+=1 1020 =0 1030 : 1040 DEFFNstim_timer2(PX,RX) 1050 IF RX=0 =0 1060 PROCswitch_off(stim,EX):countoffX(stim)+=1 1070 =0 1080 : 1090 DEFFNstart_timer6(PX,RX) 1100 IF RX=0 =0 1110 PROCpipe_timer(start,800,0,"FNstart_timer7(",0,EX) 1120 PROCswitch_on(fraction,EX):countonX(fraction)+=1 1130 PROCpipe_timer(fraction,20,0,"FNfraction_timer6(",0,EX) 1140 =0 1150 : 1160 DEFFNfraction_timer6(PX,RX) 1170 IF RX=0 =0 1180 PROCswitch off(fraction,EX):countoffX(fraction)+=1 1190 =0 1200 : 1210 DEFFNstart_timer7(PX,RX) 1220 IF RX=0 =0 1230 PROCεwitch off(pump_b,EX) :countoffx(pump b)+=1 1240 =FNstart 1250 : 1260 DEFFNεtop_εwitch1(PX,RX) 1270 IF RX=0 =0 1280 PROCki l l_switch( start, EX) 1290 PROCkm_timer(start, EX) 1300 PROCsw i tch_off ( pump_a, EX ) : countof fx( pump_a)+=1 1310 PROCswi tch_off ( pump_b , E ) : countof fx ( pump_b )+= 1 1320 PROCswitCh_off(stim,EX) :countoffX(εtim)+=1 1330 PROCki l l_timer(stim,EX) 1340 PROCswitch_of f (fraction, EX) :countoffx(fraction)+=l 1350 PROCki n_timer(f raction, EX) 1360 countonx ( stop )+=1 1370 PR0Cki π_sw1tch(stop, EX) 1380 =0 1390 : 1400 DEFPROCresultε 1410 LOCAL iX.jX.kX 1420 PRINT'"" SWITCH ONs OFFs SWITCH ONs OFFs * 1430 jX=0 1440 FOR iX=0 TO 31 1450 IF LS(iX)<>" " THEN vX(jX)=iX:jX+=1 1460 NEXT 1470 jX+=1 1480 FOR kX=0 TO XDIV2-1 1490 FOR 1X=0 TO XDIV2 STEP JXDIV2 1500 IF iX+kX<jX-1 THEN 1510 IF i PRINT" " ; 1520 PRINT" ";LS(vX(iX+kX)); 1530 IF LEFTS(LS(vX(iX+kX)),1)=">" PRINT" "; 1540 PRINTFNdecalign(countonX(vX(iX+kX))); 1550 JF LEFTS(LS(vX(iX+kX)),1)="<" THEN 1560 PRINTFNdecalign(countoffX(vX(iX+kX))); 1570 ELSE 1580 PRINT" "; 1590 ENDIF 1600 ENDIF 1610 NEXT 1620 PRINT 1630 NEXT 1640 ENDPROC 1650 : 1660 DEFFNdecalign(dX)=RIGHTS(" "+STRS(dX),9) 1670 : 1680 DEFPROCerror 1690 IF (ERRAND4FF)=1 THEN PROCresults 1700 REPORT:PRINT" at line ";ERL 1710 ENDPROC SUBSTITUTE SHEET

Claims: CLAIMS 1. Apparatus for controlling a real-time process, the apparatus comprising: an image display means (3); means (2,4,5) for creating and/or editing a timing chart, of input/output signals desired to control the real-time process, on the image display means; means (4) for selectively converting the chart to a set of instructions for monitoring the input signals and governing the output signals; and means (4) for processing the set of instructions to monitor the input signals and govern the output signals of the real-time process, thereby to control the real-time process. 2. Apparatus for generating a set of instructions to monitor the input signals and govern the output signals of a real-time process, the apparatus comprising: an image display means (3) ; means (2,4,5) for creating and/or editing a timing chart, of input/output signals desired to control the real-time process, on the image display means; and means (4) for selectively converting the chart to a set of instructions for monitoring the input signals and governing the output signals. 3. A method of controlling a real-time process, comprising the steps of creating and/or editing a timing chart, of input/output signals desired to control the real-time process, on an image display means (3) ; converting the chart to a set of instructions for monitoring the input signals and governing the output signals; and processing the set of instructions to monitor the input signals and govern the output signals of the real-time process, thereby to control the real-time process. 4. An apparatus or method according to any of the preceeding claims, wherein the timing chart is a visual representation of a data structure from which the instruction set is generated. 5. Apparatus according to claim 1 or claim 2, including a computer (4) , and wherein the image display means comprises a visual display unit (3) of the computer, and the means for creating and/or editing a timing chart comprises a keyboard (2) and/or computer mouse (5) together with the computer processor when programmed appropriately. 6. An apparatus or method according to any of the preceeding claims, wherein the instruction set generated is in the form of a computer program which may be saved to a conventional storage medium such as a magnetic disk. 7. A method according to claim 6, wherein the program is generated at one location where the appropriate apparatus is present and run on another computer at a separate location.

Inventors: FRAY PAUL JONATHAN, FRAY, PAUL, JONATHAN
Applicants: FRAY PAUL JONATHAN, FRAY, PAUL, JONATHAN
Application year: 1990
Main classification: G05B19
IPC codes: G05B19