portSender

 elements

Sends data from a serial port when the element starts, then registers a trigger and ends on its own. You can set elements in the trial to start/end from trigger (element properties start/end fields trigger/triggerBy). You can also set later trials to start at fixed times from trigger with zero drift (trial object property start).

Trigger value recorded in record property trigger is a row vector of bytes (integers 0–255) sent. Trigger time recorded in triggerTime is time send completed relative to trial 1 start.

If you want to set options for the port, you can use pb_prefs → "Other" tab. Or to set for only the current experiment, make an object of type port and set its properties. Typically you don't need to.

Currently portReceiver elements only work with serial ports.

▸ Object ends on its own?

Yes, when it finishes sending its data and registers a trigger.

If an element can end on its own, you don't need to set end conditions for it in property end (unless you want it to maybe end earlier).

No—runs until a condition you set in property end.

Input properties

Adjustable properties

You can vary or allow the subject to adjust the following input properties of an object of this type in real time when it's running. If you need to make other properties adjustable, you can edit the element type code—see Element Type Programming Manual.

position
nn_eyes
rotation
colorMask
alpha
intensity
contrastMult
drawCodeVars

(None)

(None)

portName

No default

A string that is name of the serial port, as accepted by Psychtoolbox IOPort('OpenSerialPort'). From Psychtoolbox documentation: On Windows this could be, e.g. <cds>"COM1"<cds>, <cds>"COM2"<cds>, etc.; on Mac it is a path to a BSD device file, e.g. <cds>"/dev/cu.usbserial-FT3Z95V5"<cds> for a serial-over-USB device with unique ID FT3Z95V5; on Linux e.g. <cds>"/dev/ttyS0"<cds> for the first real serial port, <cds>"/dev/ttyUSB0"<cds> for the first serial-over-USB device, etc.

data

No default

Row vector of byte values (integers 0–255) to send.

Input properties all visual elements have

position

Input properties all adjuster elements have

adjust

Input properties all objects have

report
info

Record properties

PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results by listing them input property report.