7.1 Overview of IDEV Operation
As the script is interpreted to build a set of trials, the IDEVs being used in that script will be asked to create masks corresponding to particular input states used to trigger actions during the trial, and return references to those masks.
When the Trial Manager begins to run trials, each IDEV will be asked to initialize the hardware. At this point, the IDEV should perform the necessary actions to begin actually reading input.
When the experiment is run the Trial Manager will inform the each IDEV when an action depends upon a particular mask, and when it no longer depends on it. As it is running the trials, the Trial Manager will poll each IDEV, asking its current input state matches that of any of the active masks (those which have actions currently depending upon them), if it does the IDEV must inform the Trial Manager of each action whose mask has been matched. After each polling of an IDEV, its current input state should be in its data buffer so that it can be read by the Trial Manager, if necessary.
If a break occurs, or any error message is displayed, which requires PsyScope to begin reading Macintosh events, each IDEV will be asked to suspend any operations which might interfere with normal processing of events. After the message is removed, the IDEV will be allowed to resume.
At the end of running trials the IDEV will be asked to close its input hardware.
When the Trial Manager writes out its data, it will ask the IDEV to convert data collected from its data buffer into string form to be written to the file.
After the experiment is completely finished running, the IDEV manager will disconnect from each IDEV. At this time it should free any data structures it has used. It is important to remember that between the time it is disconnected from the IDEV manager, and the next time it is connected again, and IDEV may be purged from memory, and it may not be loaded into memory in the same place the next time, so don't rely on any of your variables retaining their values between disconnecting and connecting.
Generated with CERN WebMaker