This sample illustrates communication between E-Prime and a programmable port, such as the parallel port.
To read a signal from the port, you can use the Port Device in E-Prime, an input device that can be added via the Devices tab of the Experiment object's property pages in E-Studio. Addition of the Port Device in E-Studio is addressed on pages 39-41 of the E-Prime Reference Guide. For more information, please refer to FAQ #2 ("How do I receive a signal from an external device?") in the E-Prime User's FAQ section of our website at the link above.
To send a signal to the port, you should use the WritePort command in an Inline in your experiment. For more information, please refer to FAQ #1 ("How do I send a signal to an external device?") in the E-Prime Users' FAQ section of our website at www.pstnet.com/E-Prime/efaqu.htm.
To send or read signals, you must know the proper address of your programmable port. This address can be found by selecting "System" from the Windows Control Panel, clicking on the Device Manager tab, and navigating to Ports. Select the parallel (LPT or printer) port, click the Properties button, and select the Resources tab. The address of the currently accessible port will be shown.
Note that this sample does not apply to serial communications. The serial port has its own protocol for transmission of signals. For more information on serial communication, please refer to the Serial Device topic in E-Basic Online Help.
*Note: BasicPortRT assumes that the parallel port is configured for standard mode. If this program does not respond, you may need to modify the BIOS settings for the parallel port.
This program illustrates communication with a device connected to the parallel port. The device used to design this experiment was a single button response device with two LEDs (one green, one red). The mapping of these components is as follows:
red lamp = bit 2
green lamp = bit 1
button = bit 7
The Port device is enabled in the Expeirment Object Devices tab, and input via the port is enabled on the Stimulus object (i.e., the object collecting input). The bits to watch for input are designated in the Input properties for the Stimulus object.
The program presents the subject with a fixation and then a stimulus (X or Y). The subject is to respond by pressing the button on the device when an X is presented. When a Y is presented, the subject should not respond. The input is scored for accuracy and reaction time.