Hello @SMM
you can print a variable to the console with the following print-command
print("_40mwt_lapend: ", _40mwt_lapend)
I do not see a routine called lapped_routine in your flow.
I noticed in the flow that you created a couple of routines with similar names, e.g. routine_4MWT1 and routine_40MWT1. It is better to reuse a routine if only the stimuli and some presentation parameters differ from one routine to another. Therefore, instead of using constants, use variables where necessary. See here Wakefield's Daily Tips - #7 by wakecarter
Best wishes Jens