psychopy.org | Reference | Downloads | Github

Duration Variable Not Working In Loop

OS (e.g. Win10): Windows 10
PsychoPy version (e.g. 1.84.x): 1.85.2
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: I have a loop xlxs for a dot probe experiment. It houses the right and left images, the fixation cross duration, which answer is correct, and where the cue location goes. All the variables are working as intended with the exception of the Fixation_Duration variable

What did you try to make it work?: I’ve tried setting $Fixation_Duration as start time(s) and as condition for the images that should come after it, and it shows up for the entire loop cycle instead of being delayed by $Fixation_Duration seconds. Also, the fixation cross never appears with it set to start at 0 seconds and last duration $Fixation_Duration. Using it as stop time(s), duration, or condition all have failed.

How can I achieve having a variable length duration for the fixation cross and then having images appear after however long the fixation cross was on screen while using my loop excel sheet?DotProbeDraft2.psyexp (38.7 KB)DotProbTrial1.xlsx (14.8 KB)

  • There is something weird with your Excel file (which is one of the reasons I suggest not to use them: they can hide lots of weirdness). Try exporting to .csv and you’ll see that the file has a bunch of blank columns, which can cause confusion. Stick to a plain text file format like .csv where possible as it is easy to see in a text editor if any otherwise invisible characters have somehow crept in.
  • Probably unrelated, but you are using absolute file paths in the file, with single backslash \ characters. \ are escape characters in most settings and can cause weirdness. If you insist on using them, then they need to be escaped themselves, i.e. replace all \ with \\. But preferably, use single forward slashes instead /. Python is clever enough to use these cross-platforms as a path separator. lastly, you could greatly simplify and shorten your paths by using relative rather than absolute paths.