[Next] [Previous] [Up] [Top] [Contents] [Index]

5.1 Overview of ODEV Operation

5.1.1 Event/Stimulus Overview

When the script is being interpreted and an ODEV's event type is encountered for the first time, the ODEV will be connected to the ODEV Manager. At this time the ODEV should allocate any necessary data structures specific to that ODEV type. At this point it will receive from the ODEV Manager a source from which it can read any type-specific defaults from attributes in the experiment entry using the attribute utilities (see "11.5.3 Event Stimuli and Attributes"). It should then pass back to the ODEV the default duration of the event type, and whether or not the ODEV will handle the duration of the stimulus itself (very few ODEVs will need to do this).

As each new event of the ODEV's type is encountered in the script, the ODEV will be asked to readthe stimulus and attributes of the event and allocate the necessary internal data structures (see "5.2 Allocating Stimuli and Attributes"), and pass back a reference to each new pairing of stimulus and attributes.

When the first trial is about to be run, the ODEV will be asked to initialize its hardware. At this time the ODEV should do everything necessary to begin loading and playing stimuli.

When the Trial Manager knows that it will need to use a stimulus, it will ask the ODEV to load the stimulus into memory. At this point any time-consuming loading preparations should be made so that the stimulus can be displayed as quickly as possible when requested.

During the trial, the ODEV will be asked to play/display and usually clear any loaded stimuli one or more times.

When the Trial Manager believes that it may no longer need a stimulus, it will ask the ODEV to unload it. At this point any memory allocated for the stimulus when it was loaded should be freed, unless explicitly specified otherwise by the stimulus's attributes.

Any time there is a user break in the experiment, or an error message is displayed, the ODEV will be asked to suspend any operations which would interfere with normal processing of events, or with display of the break/error dialog. When the break/error dialog is dismissed, the ODEV will be allowed to resume normal operation.

When trials are finished running, the ODEV will be asked to close its hardware at this point, any initializations made at the start of trials should be closed.

When the current set of stimuli is no longer needed the ODEV will be asked to free it. Any data structures allocated when reading stimuli and attributes should be freed at this time.

After the experiment is completely finished running, the ODEV Manager will disconect from each connected ODEV. At this point any remaining allocated memory should be freed. Note and remember that between the time when it is disconnected from the ODEV manager and the next time it is connected the PSYX may be purged from memory, and it will not necessarily be reloaded in the same place next time, so you shouldn't rely on the value of global variables retaining their values

Note: when trials are not pre-compiled that stimulus allocation may come both before and after initializing hardware. Also, since a particular event type may not be first used until well after trials have begun running, an ODEV may be connected and asked to initialize hardware in mid-experiment.

PSYX Programmer's Manual - 24 AUG 95
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with CERN WebMaker