Second monitor = experimenter display

Hi,

I’m trying to add 2nd monitor output to a working builder based desktop experiment, so that the experimenter can see what’s going on. This is not mirroring, as the information should not be seen by the subject.

I’m trying to do this through adding code blocks, to a component (created through the builder) that lasts 5 seconds. The experiment should then proceed on to other components, before returning to this section, displaying information about the next trial.

Begin Experiment

# create window and text object
otherWin = visual.Window(size=[1920, 1080], pos=[0, 0], screen=1, units='norm', waitBlanking=False, allowGUI=False, fullscr = True)
myText = visual.TextStim(otherWin, text="PlaceHolder", pos=(0,0), units='norm', color='white', autoDraw=False)
myText.size = 0.09

Begin routine:

# create message for secondary display
otherMsg="Stimulus#" + str(stimNum) + " Temp = " + str(level) + "\nNumber of reversals = " + str(RevCounter)
myText.setText(text=otherMsg)
myText.setAutoDraw(True)

Each Frame:

# show message on Experimenter display
otherWin.flip()

The message displays on the second monitor, but at the end of the 5 seconds the program crashes with the following message:

1.1059     WARNING     Monitor specification not found. Creating a temporary one...
  File "C:\Users\NAME\PsychoPy\Adaptive_Staircase_updated\ASP_lastrun.py", line 1570, in <module>
    thisComponent.tStart = None
AttributeError: 'str' object has no attribute 'tStart'
2.1559     WARNING     Monitor specification not found. Creating a temporary one...
################ Experiment ended with exit code 1 [pid:10664] #################

Not sure what I’m missing…

Any help/suggestions would be much appreciated.

Best wishes,
Jon

It turns out the inclusion of a text object in the next component was causing all the grief.

Cheers, Jon

Hello!
I tried your code and I got the error message,
can you please help me with that?


Thanks!

You may pass any string to the setText() method and it will be displayed in the second window. You got an error, however, because you copied variables that appear to be specific to Jon’s experiment. So just change the string to the information you would like to be displayed in the second window.

1 Like

I am trying to get the psychopy to display the experiment to work on the second monitor since we have two computer screens. I was able to create the experiment. The only thing I need to do to figure out how to display and flipping the frame on the second monitor/computer.

I came across this article and I am still stuck on how to get to work.
https://peerherholz.github.io/Python_for_Psychologists_Winter2021/experiments/intro_psychopy_I.html#a-very-simple-experiment

Here’s the screenshot from the article:

Thanks!