| Reference | Downloads | Github

Sending unique messages to eyelink to start and end each block/sequence

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): latest
Standard Standalone? (y/n) If not then what?:
**What are you trying to achieve?: Send unique messages to eyelink to mark start of each block/sequence.

I have a task which involves 6 blocks in each trial all setup in a nested loop using builder. I want to send a message to eyelink using custom code component to mark the start and end of blocks, i.e start block 1, start block 2 etc… and the same for the end. I can manage to send the message at the correct times using the eyelink.SendMessage (“start_block”) but cannot work out how to add the unique number depending on the block number (number of times it has gone round the loop). I have attempted to define a string and then include in the message but cannot work out how to only send the first number on the first loop and then second on next loop. See below;

i = (1, 2, 3, 4)
eyelink.SendMessage (“start_block”+string(i))

Another way I have thought of doing it is linking it with excel spreadsheet using $ but not sure where to start with this and this brings up syntax error in the custom code component.

Thank you for your help in advance and let me know if any further information would be helpful.

Cheers Dave