Monitoring expression macro values

Rishi Rajalingham's Avatar

Rishi Rajalingham

26 Apr, 2019 01:20 PM

Hey Chris,
I have a variable that is defined through a series of macros (e.g. ball position, in the bouncing ball demo), and I'd like to track all of the events for this variable. What's the best way to do this? Macro outputs aren't technically variables, so they don't seem to be tracked. Variable assignments are events, but it's not very practical to explicitly assignment the macro output to a variable (e.g. in a given state of the system) -- is there any way that the macro output can be automatically tracked as an event?

  1. Support Staff 1 Posted by Christopher Sta... on 26 Apr, 2019 01:31 PM

    Christopher Stawarz's Avatar

    Hi Rishi,

    As you note, an MWEL expression macro is not in any way a variable. The name you give it is just a shorthand for the associated expression. In order to monitor changes to the expression's value, you have to evaluate it and assign the result somewhere (i.e. to a variable).

    In the case of the bouncing ball example, the expression macros ball_position_x and ball_position_y are used as the values of the x_position and y_position parameters of a circle stimulus. Every time the stimulus is drawn, the values of those parameters are announced via the variable #stimDisplayUpdate. If you want to monitor those values, that's where you'll find them.


  2. 2 Posted by Rishi Rajalingh... on 26 Apr, 2019 01:57 PM

    Rishi Rajalingham's Avatar

    That's perfect, thank you!

  3. Christopher Stawarz closed this discussion on 26 Apr, 2019 02:20 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac