Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Andy Mitz

Junior Member
Registered:
Posts: 8
Reply with quote  #1 
We are getting more and more into testing different reward qualities and valances, e.g., different juices, rewarding vs annoying.  The current ML reward system supports only one output bit.  I believe Jaewon and others have programmed digital output bits with Tic and Toc, but what we probably need is an expanded goodmonkey() command.

Here is a proposal:

goodmonkeys([duration],['Parameter',value...])    % note plural of the name

duration uses an array of solenoid opening times.  0 for solenoids not opened.
Parameters
   NumReward uses an array of NumReward values
   PauseTime uses an array of PauseTime values
   TriggerVal uses an array of TriggerVal values

example
   goodmonkeys([0 50 0], 'NumReward',[1 3 2],'PauseTime',[100 100 100]);

Note, the parameter values associated with 0 reward duration are ignored.








  


0
Jaewon

Administrator
Registered:
Posts: 971
Reply with quote  #2 
For those who cannot wait until goodmonkeys is implemented and need a workaround immediately, here is the code I use to trigger a reward device that requires 4-bit input. It is just a simple example of how to control digital I/O with DAQ Toolbox. If you are using ML with duplicate boards, you probably have many digital lines in the second board available for this extra I/O control.

Quote:
% place the following 3 lines at the very beginning of your timing script.
rewarder = digitalio('nidaq','Dev2');  % use the second board
addline(rewarder,0:3,1,'out');         % port1, line0-3 (4 bits)
putvalue(rewarder,0);                  % initialize the output with zeros
.
.
.
% trigger the reward device
putvalue(rewarder,3);            % 3 drops
eventmarker(REWARD);             % stamp the time of reward (rising edge)
pulseTimer = tic;                % start a timer
while toc(pulseTimer)<0.05; end  % 50-ms pulse
putvalue(rewarder,0);            % reset the amount
.
.
.
% place the following line at the end of the timing script
delete(rewarder);  % destruct the dio object


0
maloman

Junior Member
Registered:
Posts: 15
Reply with quote  #3 
you may also just use multiple TTL lines (its what I do and use similar code Jaewon posted) . The advantage here is that the initialization is done with the monkeylogic routine during the ITI and not during trial execution.

cheers

jan
0
cognoman

Junior Member
Registered:
Posts: 28
Reply with quote  #4 
Hi All, 

just wanted to know if there is an updated solution to implement multiple juicers? 

Thanks!
0
Jaewon

Administrator
Registered:
Posts: 971
Reply with quote  #5 
The latest version of NIMH ML now supports the customization of goodmonkey(). See reward_function.m included in the package.

http://forums.monkeylogic.org/post/nimh-monkeylogic-8118700?pid=1294310187
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.