Try the attached task. If you want to get help, you should at least do your part. You can ask another question if something is not clear in the manual.by Jaewon - Questions and Answers
I said you could use the trial history in the block selection function or block change function. Do you understand what they do? Also, your code does not work because you reset TrialRecord.User.consecutiveCorrect to 0 every time in the very first line. You should have written it like this. if ~isfield(TrialRecord.User,'consecutiveCorrect'), TrialRecord.User.consecutiveCorrect = 0;by Jaewon - Questions and Answers
It did not work without assigning Strobe Bit, because the strobe option that you chose required the Strobe Bit. "Send and Clear" does not need Strobe Bit. See the following manual page. https://monkeylogic.nimh.nih.gov/docs_MainMenu.html#Strobe If you are okay with your current setting, there is no need to send the strobe bit anywhere. Just leave it unconnected.by Jaewon - Questions and Answers
Did you see the manual pages that I linked? All the information that you need to calculate the number of correct trials in each block is in the TrialRecord structure. https://monkeylogic.nimh.nih.gov/docs_TrialRecordStructure.htmlby Jaewon - Questions and Answers
If you are using the trialerror function in your timing script, you can get the trial success history from TrialRecord.TrialErrors during the task. https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#trialerror https://monkeylogic.nimh.nih.gov/docs_TrialRecordStructure.html Then, you can use the trial history to determine whether to switch the block or not in the block selection/chaby Jaewon - Questions and Answers
You also need to set NIMH ML to receive the pupil data either through a voltage channel or TCP/IP. If you receive eye XY signals through voltage channels (i.e., NI board), assign the pupil size input to one of "General Input" on the Input/Output panel of the main menu. Then you can read it like get_analog_data('gen1') in the timing script. If you receive eye XY signalsby Jaewon - Questions and Answers
Not that I know of. You should probably check it with the manufacturer of the webcam. If you look up the old posts in this forum, some people complained that the timestamps of the frames were not correct. As far as I know, it is a problem of the incorrectly programmed webcam driver and seems to occur with very old products. It is difficult to find out without testing with a real product, thougby Jaewon - Questions and Answers
The start time of a scene and the time of Success in a child adapter are not the same thing, but I understand what you mean. Unfortunately, the Success time of SingleTarget (= AcquiredTime of WaitThenHold) is not stored in BHV2. mlplayer replays scenes by feeding recorded eye signals to the adapter chains again as if those signals are just acquired, not by remembering all the timing info. Yby Jaewon - Questions and Answers
I am glad to hear that you fixed the problem. I do not see any reason for the pump not to work, if it is correctly connected to the analog output (AO) of the NI board and also the AO channel is correctly assigned to the "Reward" signal type in NIMH ML.by Jaewon - Questions and Answers
It is not ML but Windows that handles the acquisition. ML just receives the images and their timestamps from Windows. So, the question should be whether your computer is faster enough to run both the webcam and ML. Also, the images are stored in the memory until a trial ends, so your computer needs sufficient memory to hold them.by Jaewon - Questions and Answers
* Changes in 2.2.45 (Mar 28, 2024) - When NI samples were not read out quickly on low-performance machines, data acquisition stopped with an undisplayed error, which made some modal dialogs like the calibration tools not responsive to user input. The measures to mitigate sample loss and capture those errors are taken. (Thanks to Caitlyn Bartsch) - The WebcamMonitor adapterby Jaewon - News
For wired reward triggering, you can get a parallel port. It is cheap and provides up to 12 digital output lines. I have no idea why it happens. It would make more sense if the touchscreen got slower while running a task. Does the screen respond to touch well outside NIMH ML?by Jaewon - Questions and Answers
Please see my previous comment again and try running ML as written there. After you change the main display, MATLAB opens on the new main display and so does the ML window. You need to drag them back to your old main display. I guess you started the task without doing so, which is why you saw the warning, "The main menu window will be occluded by the subject screen. Please move it to a diffeby Jaewon - Questions and Answers
Please read the manual that I linked above. What you need to do is 1) to restart ML after changing the main display and 2) to drag the ML window onto the HDMI monitor and change the "Subject screen device" to the DVI monitor. All are written in the first section of the manual page.by Jaewon - Questions and Answers
Make the touchscreen the main display of your system and try again. https://monkeylogic.nimh.nih.gov/docs_MonitorSetup.html There were a few people who talked about a similar issue, but they never followed it through with me, so I do not know the reason for sure.by Jaewon - Questions and Answers
In the scene framework, TaskObjects and graphic adapters are shown if they are included in the scene and not shown if they are not included. Since it is you that determine whether to include them or not, you know which stimuli are presented in a particular scene. All stimuli are presented when the current scene starts and removed when the next scene starts. It is easier to record the numbers tby Jaewon - Questions and Answers
Thank you for the explanation. Sending additional codes itself is not a difficult thing. What is difficult is to add a new function without making it conflict with existing ones. Things that immediately occur to me are like how to stamp the frame number when two movies with different starting points and different frame rates are presented, what if the frame number is already used by other codes,by Jaewon - Questions and Answers
* Changes in 2.2.44 (Feb 16, 2024) - The BlackrockLED adapter that has been broken since 2.2.36 (May 24, 2023) is fixed. - Minor fixesby Jaewon - News
See if the following post helps. https://forums.ni.com/t5/Multifunction-DAQ/PCI-MIO-16E-4-old-drivers/td-p/4275417 The E-series boards were considered old even twenty years ago and NI discontinued all support for them several years ago. I suggest purchasing a new board. https://monkeylogic.nimh.nih.gov/board/read.php?3,1376by Jaewon - Questions and Answers
Please tell me about your research. There are a few reasons why what you want is not as easy as it seems. I need to know what you are trying to do, to think about how to solve the problems and determine whether it is worth my time. You can email me, if you do want to write it here.by Jaewon - Questions and Answers
Photodiode is supposed to change when a new scene begins, not when an eventcode is issued. So, it does not change in Events 9 & 18. It goes back to black in a new trial, if it was white at the end of the previous trial. idle() is also regarded as one scene.by Jaewon - Questions and Answers
Does your Blackrock require Strobe Bit? Is any of the digital input pins labeled as "strobe"? ---------- Such a mapping rule between the Blackrock digital input and the NIMH ML strobe cannot be applied here, since it is not certain whether the "rising edge" in the Blackrock option means the rising edge of strobe bit or data bits. If your Blackrock does not require Strobeby Jaewon - Questions and Answers
What is the digital input option used on the Blackrock side? Do you know how frequently your Blackrock scans the digital input? I mean the sample rate. What do you mean by "they will occur at the same time of the original behavioral code"? Are their Blackrock timestamps exactly the same? Do the codes and times of the original events recorded by Blackrock match those from NIMH ML,by Jaewon - Questions and Answers
I see. Then you do need a custom adapter. I tried making one. Since this adapter does not make sure that the LED is off at the end, you need to add it again with NotAdapter when you want to keep the LED off. See the following code. btn = SingleButton(button_); btn.Button = 1; ind = OnOffIndicator(btn); ind.Port = 1; % TTL #1 tc = TimeCounter(ind); tc.Duration = 5000; scby Jaewon - Questions and Answers
Use normal USB cameras. https://monkeylogic.nimh.nih.gov/docs_MainMenu.html#Webcamby Jaewon - Questions and Answers
I think your method is way more complex than it needs to be. If the LED can be driven by TTL, you can just connect it (and probably a 1-kOhm resistor as well) to the button in series. The intervention of NIMH ML is not necessary.by Jaewon - Questions and Answers
You got only a 1-by-2 vector, because you ran the task in the simulation mode. You will get a long 2-column matrix with an actual eye tracker. To get the data that is being collected in the current trial, use get_analog_data(). The function returns a given number of samples acquired most recently. https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#get_analog_data The function doesby Jaewon - Questions and Answers
Obviously you tried to save a variable that did not exist. Place bhv_variable() at the end of the script or after the variable is created. Timing script functions are available only in the timing script. I do not know why you want to get a key input in the userloop, but you need to use a different method to do so. Please read the manual, if you did not. https://monkeylogic.nimh.nih.gov/docs_Cby Jaewon - Questions and Answers
Use bhv_variable(). https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#bhv_variableby Jaewon - Questions and Answers
I assume you know how the scene framework works. If not, please read the following manual page. https://monkeylogic.nimh.nih.gov/docs_CreatingTask.html#RuntimeVersion2_Background Another thing that you need to understand is the difference between stimulus events and behavioral events. For stimuli, it is you that determine when they will be presented, so you can set an eventcode in advance andby Jaewon - Questions and Answers