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

Chapter 7. IDEVs

7.2 What's the Data Buffer?


An IDEV's data buffer, which is returned to the IDEV manager in response to the connect message, should contain data about the IDEV's input current state after each time the IDEV is polled by the Trial Manager. This data will appear in the data file when an RT action is executed. Thus the data buffer should be considered as a record with one or more named fields that will be written to the data file or used in Trial Manager Variable expressions. It will also be available as a Trial Manager Variable with the same name as the IDEV to which it belongs.

In addition to the data buffer, the IDEV must return a handle of a `dfld' resource defining the number, type and size of the fields in the data buffer, and an integer specifying how many of these fields will be printed. A `TMPL' resource defining the `dfld' resource type for ResEdit is provided in the PSYX Developer's Kit. The resource is defined as follows:

struct {
	short n;
	// followed by a series of n fieldspecifiers:
	struct {
		char fieldName[]; // the name of the field
		char typeName[]; 	 // the type of the field
		long arrayCount; 	 // number of array elements; 0 if scalar
	} fieldSpec[];
} DataFieldResource;
 

The IDEV should return to the IDEV manager a handle to one of these with one element for each field in the data buffer. Each field specifies:

When the IDEV is connected, the IDEV manager will use the field specifiers returned to create a Trial Manager Variable Type with the name of the IDEV plus "data". (e.g. "Mousedata") and a Trial Manager Variable of that type with the name of the IDEV.


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

Generated with CERN WebMaker