Waits to receive data at a serial port, then registers a trigger and ends on its own. Most commonly set syncExperiment = <cd>true<cd> to tell the element to synchronize the experiment at trigger, then set the timing of any element in the trial (element properties start/end field t_sync) and/or subsequent trial timing (trial object property start field t_sync) from sync. You can also set any element in the trial to start/end from triggers more generally using element properties start/end fields trigger/TriggerBy.
Trigger value recorded in record property trigger is a row vector of bytes (integers 0–255) received. Trigger time recorded in triggerTime or syncTime is time receive 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, add an object of type port and set its properties. Typically you don't need to.
Currently portReceiver elements only work with serial ports.
Yes, when it finishes receiving its data and registers a trigger. You can also set numBytes = <cd>inf<cd> to receive data indefinitely until the element ends on a condition you set in property end. In this case it never registers a trigger.
"Ends on its own" means ends automatically at that point. 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 any condition you set in property end.
portName
numBytes
listenData
All visual elements
position
depth
nn_eyes
rotation
flipHorz
flipVert
colorMask
alpha
intensity
contrastMult
convolution
shader
filterOrder
filterGrayscale
filterResolutionMult
filterGamma
channelResolution
backColor
addDisplay
All visual elements
position
All adjuster elements have
adjust
All response handler elements
translateResponse
scoreResponse
correctResponse
scoreResponseForStaircase
maxNumResponses
recordDefaultResponse
registerTrigger
autoResponse
autoResponseLatency
All elements
start
end
startBuffer
endBuffer
vary
staircase
All objects
info
report
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.
Default: wait for any signal of 1 byte
You can set numBytes = <cd>inf<cd> to receive data indefinitely until a condition you set in property end. In this case it never registers a trigger. Currently this only reads data within the trial the element runs in.
You can vary or allow the subject to adjust the following properties of an object of this type 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)
PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results using input property report.
data
dataTimes
All response handler elements
response
responseScore
responseTime
responseLatency
d_responseTime
numResponses
All elements
startTime
endTime
duration
n_startFrame
n_endFrame
startLatencyBufferable
endLatencyBufferable
All elements
startTime
endTime
duration
n_startFrame
n_endFrame
startLatencyBufferable
endLatencyBufferable
trigger
triggerTime
d_triggerTime
numTriggers
syncTime
data is a row vector of bytes received. Just = record property trigger if the element registers a trigger.
dataTimes is a row vector of times bytes were received relative to trial 1 start (sec). As opposed to triggerTime, which is time the last byte was received.