Mworks BNC inputs for rewarding bar pulls

Darren Seibert's Avatar

Darren Seibert

11 May, 2016 05:39 PM

Hi Chris,

We would like to create an mworks training xml for bar pulling where a reward is simply dispensed every time a bar is pulled--nothing needs to be shown on the screen. The bars we have have BNC connectors, so we were considering hooking these up to a battery and have a circuit created/broken each time the bar was pulled such that we could send a TTL pulse to the ITC I believe.

I'm trying to figure out what the xml would look like. My understanding is that I would first define the iochannel with something like:

<iochannel tag="barFeedback" variable="barSent" capability="ITC18_TTL_INPUT5" data_type="edge_low_to_high" direction="input" synchrony="hardware_timed_synchronous" range_min="0" range_max="0" resolution="1" update_interval="3ms" data_interval="0.05ms"></iochannel>

and then define barSent to set the reward variable when changed? (I believe this triggers the reward, if I use one of our prior RSVP xml files as a starting template.

<variable tag="barSent" full_name="" default_value="0" scope="GLOBAL" type="INTEGER" editable="ALWAYS" persistant="NO" logging="WHEN_CHANGED">

                <action type="assignment" variable="reward" value="reward_duration" tag="Assignment"></action>




  1. Support Staff 1 Posted by Christopher Sta... on 12 May, 2016 08:16 PM

    Christopher Stawarz's Avatar

    Hi Darren,

    I believe what you outlined is more or less correct. I'm out of the office today (home with a sick kid), but I'll try to put together a working example tomorrow.

    Another option might be to connect the lever directly to an analog input on the ITC, and trigger the reward based on its value. It would be similar to your proposal, in that you'd attach an action to the variable associated with the analog input channel.


  2. 2 Posted by Darren Seibert on 12 May, 2016 08:43 PM

    Darren Seibert's Avatar

    Hi Chris,

    Thanks for your feedback. Najib created a working prototype just a few
    minutes ago, so I think we're set for now.

    Thanks again,

  3. Christopher Stawarz closed this discussion on 13 May, 2016 12:35 AM.

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