Show all posts by user
ML programming tips
I highly doubt that it is a driver problem, but I guess it is not impossible.
by
Jaewon
-
Questions and Answers
Have you tried changing the background color, let's say, to red? Does the touchscreen still go black, instead of red?
Try the instructions in the following link. You may need to change the coordinates in "Fallback screen rect." () to make the fallback screen show up on the touchscreen side. Click the "Test" button in the figure. What happens? Does checking on "For
by
Jaewon
-
Questions and Answers
Your code for the target period makes no sense to me. I just used my imagination to figure out what you tried to do. See the attached script.
by
Jaewon
-
Questions and Answers
I guess you did not understand my previous answer.
https://monkeylogic.nimh.nih.gov/board/read.php?3,1655
You are using toggleobject and eyejoytrack incorrectly. I revised the manual to make it more sense. Please see the last remark of each command.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#eyejoytrack
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#toggleobjec
by
Jaewon
-
Questions and Answers
See Example 2 of the PhotoDiode adapter. You need to download the latest NIMH ML first.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#PhotoDiode
by
Jaewon
-
Questions and Answers
* Changes in 2.2.40 (Oct 11, 2023)
+ The PhotoDiode adapter can toggle the photodiode trigger when an eventcode
is issued, which can be used to check the duration of image presentation.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#PhotoDiode
- The adapters that manipulate the properties of graphic objects, such as
CurveTracer, ImageChanger, GraphicProperty and Back
by
Jaewon
-
News
Update your NIMH ML to the latest version. Then you can calculate the raw voltage values as below.
1. Load data.
= mlread;
2.Initialize the calibration object.
EyeCal = mlcalibrate('eye', MLConfig, 1); % 'eye' or 'joy'; 1 means Eye#1
If an error occurs, refer to the following link, fill in the missing screen size information and retry.
https://monkeylog
by
Jaewon
-
Questions and Answers
If the success status is true, it means the button was pressed; otherwise, it wasn't. Plus, the button signals are recorded for the entire trial and saved in the data file. See the AnalogData field in the data.
by
Jaewon
-
Questions and Answers
Is 'gabor' a TaskObject? In the scene framework, the duration of a TaskObject is just the entire scene. You cannot turn it off in the middle of a scene. If it is an image file, delete it from the conditions file and create with ImageGraphic instead.
fix2_gabor = ImageGraphic(null_);
fix2_gabor.List = { 'gabor.bmp', [0 0] };
tc2 = TimeCounter(fix2_gabor);
tc2.Duration =
by
Jaewon
-
Questions and Answers
I do not see any problem in your files and they work fine in my computer. It seems that the length of the string is not correctly returned on your system, but I have no clue at the moment why it happens. Maybe it is related to the locale of your Windows or MATLAB. The support for unicode has been very poor in MATLAB, so it may take time to find a workaround or a solution may not exist.
by
Jaewon
-
Questions and Answers
Please upload your timing file. There is nothing I can look into with the captured images.
Did you type those letters in the MATLAB editor? What is the version of your MATLAB?
by
Jaewon
-
Questions and Answers
* Changes in 2.2.39 (Aug 27, 2023)
+ UTF-8 system encoding support
https://monkeylogic.nimh.nih.gov/board/read.php?3,1713,1717#msg-1717
by
Jaewon
-
News
Download NIMH ML again and turn on UTF-8 system encoding like the following. To get to this menu in Windows 11, go to - - - and click on . In the resulting window, check on "Use Unicode UTF-8 for worldwide language support". There is no need to change the "Current system locale". Then click "OK" and reboot the computer.
by
Jaewon
-
Questions and Answers
NIMH ML currently runs on only little-endian processors and, unlike your assumption, BHV2 is explicitly set as such.
by
Jaewon
-
Questions and Answers
Thank you for reporting this. I have a different idea about the cause, though. The adapters are not designed to skip a scene of which length is less than a frame. And what happens at the end of a trial is a little difficult to tell because that is the time when the subject and control screens are programmed to display different things. I do not have time to look into this at the moment, but I wil
by
Jaewon
-
Questions and Answers
The output of voltage joysticks is also usually symmetrical, so I believe the issue is caused by the USB interface. The best thing is for the person who made the ADC to fix the problem. You can try removing the ADC and connecting the joystick to your NI board as well.
If you do not want to touch the hardware, try the 2-D Spatial Transform again. I would use just 5 points, like center, top-righ
by
Jaewon
-
Questions and Answers
Yours is an analog voltage joystick, not a digital one. Someone probably added a USB interface to it, so you can ask the person why the cursor is not centered when the stick is not moved.
It sounds like the custom USB interface adds an offset to the digital output. Then adjust Origin X and Y (either to the positive or negative direction) so that the cursor comes to the center when the stick is
by
Jaewon
-
Questions and Answers
What the _cfg2.mat file has is the configuration that you saved last time, not the current configuration. There is nothing correct or incorrect here.
If this is not the answer you wanted, I guess you can figure it out from the code. Unfortunately I do not have time to explain how my code works.
by
Jaewon
-
Questions and Answers
For a USB joystick, you can safely assume that its output changes evenly and symmetrically for the entire field, so you can just use the Origin & Gain method. If you do the 2-D Spatial Transformation, you will likely get distorted calibration because there is no guarantee that you push the stick to the correct direction and degree.
On the main menu, choose the Origin & Gain method and
by
Jaewon
-
Questions and Answers
Although the specification is 1 kHz, the sample interval here is not exactly 1 ms on both sides. TCP/IP transmission is asynchronous and NIMH ML's reading is also based on a software timer, which is affected by the system performance. If NIMH ML reads again after 0.9 ms but the next sample from EyeLink arrives in 1.1 ms, for example, you get a repeated sample.
by
Jaewon
-
Questions and Answers
I fail to see why this is a problem. Can you elaborate?
Did you disable Nagle's algorithm?
https://monkeylogic.nimh.nih.gov/docs_TCPIPEyeTracker.html
by
Jaewon
-
Questions and Answers
Your file is corrupted. The end of Trial42 and the beginning of Trial43 are erased and filled with 0. It is likely due to a disk error.
Overwrite your mlbhv2.m with the attached file. Then you will be able to read the rest of the file, skipping Trial 42 & 43.
-----
The attached file is now included in the download packages.
by
Jaewon
-
Questions and Answers
You should describe it better. It is at the end of a trial that you come to know whether the trial is a success or not. However, eventcodes are sent as soon as relevant commands are executed. Most of the time when an eventcode is sent, the success status of a trial is not determined yet. So what do you mean by the timestamps of wrong trials? What are the codes that you do not see?
For example,
by
Jaewon
-
Questions and Answers
Your description of the problem is not sufficient. What are "the timestamps for incorrect trials"? Are you saying that you do not see the timestamps in BHV2 or neural data?
by
Jaewon
-
Questions and Answers
Does your recording system read eventcodes on the rising edge or falling edge of the triggers or by change detection? Did you set the Strobe option of NIMH ML accordingly?
https://monkeylogic.nimh.nih.gov/docs_MainMenu.html#Strobe
by
Jaewon
-
Questions and Answers
See this post. Basically you need to change the z-order of the circles like the following.
gaze_LED.Zorder = 1; % or any number larger than 0
LED1.Zorder = 1;
by
Jaewon
-
Questions and Answers
* Changes in 2.2.38 (Jul 20, 2023)
+ The TTLOutput adapter can send out pulses of variable lengths with variable
delays.
- Minor fixes
by
Jaewon
-
News
See this manual page. The conditions that you can choose in the current block is in TrialRecord.ConditionsThisBlock.
https://monkeylogic.nimh.nih.gov/docs_TrialRecordStructure.html
by
Jaewon
-
Questions and Answers
Since you switched from Block1 to Block2, your conditions selector should have returned a number between 5 and 8, but it returned 1, which was not in Block2.
by
Jaewon
-
Questions and Answers