next up previous contents
Next: Writing Platform Independent Data Up: Using the Standard User Previous: Replacing the Main Event   Contents


Performing Non-Standard I/O

So far as event I/O is concerned, the user can either use the SIO or EIO software units.

The SIO interface consists of the following routines:-

SIO_OPEN
SIO_READ
SIO_WRITE
SIO_CLOSE
SIO_TRM
If you choose the SIO level then you have complete control over all aspects of the I/O. The price you pay is that you have to handle opening and closing of files including file name association. You also have to handle all exceptions (i.e. errors and EOFs). If you use SU Control, SIO_INI and SIO_TRM will be called automatically. You are also reponsible for any necessary conversion of old data.

The EIO interface consists of the following routines:-

EIO_INI
EIO_WIPE
EIO_EVREAD
EIO_EVWRITE
EIO_O_PUT
EIO_TRM
and the user routines:-
EIO_I_SELECT_USER
EIO_O_SELECT_USER
If you use the EIO interface, the FILE commands are used to determine which streams are active and which files are associated with each. Arbitrary data structures can be input or output although, if using input selection schemes $MERGE_ALL or $MERGE_FIRST, the top level bank must be, or must support, an EV, MC or MAST bank so that the event's date and time can be determined. Normally the user would only need to use EIO_WIPE and EIO_EVREAD to clear memory and load next event and EIO_WRITE to output it. If you wish to output events at different stages of processing to different streams then, instead of calling EIO_WRITE (which outputs to all selected streams) call EIO_O_PUT which outputs unconditionally to a specified stream. How EIO responds to exceptions can be controlled as described in section 3.9.6. If you choose to handle exceptions, return codes use the following conventions (the mnemonics can be found in the file su_mnemonics.inc):-

KSU_OK   No error, the I/O was successful 

KSU_QUIT EOF generated
KSU_FAIL I/O error
KSU_NOOP No action (event already input)
KSU_NO_DATA No data to output
If you use SU control, EIO_INI and EIO_TRM will be called automatically. You can take control of the way EIO handles input or output to multiple streams with the user routines EIO_I_SELECT_USER and EIO_O_SELECT_USER.

EIO tries, as best it can, to handle old format data from 2.08 onwards. See the routine EIO_I_REFORMAT for details.

For all other types of I/O, SNOMAN uses a number of I/O units and it is obviously important that there is no conflict between them and any units you choose. Consult io.inc and zunit.inc for a description of the units currently in use. Note that you may use FORTRAN units 90..99 for private I/O.


next up previous contents
Next: Writing Platform Independent Data Up: Using the Standard User Previous: Replacing the Main Event   Contents
sno Guest Acct 2009-09-09