Welcome! Log In Create A New Profile

Advanced

Adapter Property to analog/digital output

Posted by MoonL 
Adapter Property to analog/digital output
February 16, 2023 09:42AM
Hi Jaewon.

When using singleTarget, I want to send the 'success' property to my AlphaOmega system in real time so that I can do on-line analysis (I want to delete the data when success==false), the signal can be analog or digital.
I tried to use Simulator adapter but it will stop once fixation break. I tried to use ClosedLoopStimulator in example 13, but It seems to conflict with reward, my code are as follows:
------------------------------------
fix1 = SingleTarget(eye_);
fix1.Target = 1;
fix1.Threshold = 3;

rwd = RewardScheduler(fix1);
rwd.Schedule =[0,1000,1000,100];

stim1 = ClosedLoopStimulator(fix1);
stim1.Channel = 1;
stim1.Waveform = [5 -5 0 0]';
stim1.Frequency = 1000;
tc1 = TimeCounter(stim1);
tc1.Duration = 10000;

cc = Concurrent(tc1);
cc.add(rwd)
scene1 = create_scene(cc,1);
run_scene(scene1);
idle(50);
------------------------------------and it would break, the error are as follows:
NI_AOTask::trigger:grinning smileyAQmxTaskControl, You only can get the specified property while the task is reserved, committed or while the task is running.
Reserve, commit or start the task prior to getting the property.
Property: DAQmx_Write_TotalSampPerChanGenerated

I don't know how to modify ClosedLoopStimulator to meet this requirement. Could you please give me some advice?

If that's not possible, I'll have to use the raw data from the eye tracker, but then I won't be able to use ML's eye calibration feature. Or can monkey send calibrated eye singal through analog output?Thank you very much.
Re: Adapter Property to analog/digital output
February 16, 2023 10:08AM
Please explain what kind of analysis the AlphaOmega system will do. The Success property may not reflect the information you need.
Re: Adapter Property to analog/digital output
February 16, 2023 09:18PM
I'm doing a passive viewing paradigm, I present images repidly, regardless of whether monkey is making fixation. Like:[monkeylogic.nimh.nih.gov]

In AlphaOmega, I want to check whether 'Success' of singletarget is ture during image onset, and exclude the images that fixation break too long within a image(I can't use eventcode sent by xxHOLD, because it can't match with image presentation). Any eye-related output(Success property, calibrated eye signal, calibration transform matrix...) is enough for this analysis.

Thank you!
Re: Adapter Property to analog/digital output
February 16, 2023 11:51PM
You can do this much more easily and accurately, if you do it offline. Is there any reason you need to do it online? And you should think about the delay in the online calculation.
Re: Adapter Property to analog/digital output
February 17, 2023 09:38AM
Yes, it would be easy after data collection, but this funtion is necessary for me because I need to select the dataset based on the result from online analysis(the image would be different according to specific neuron's response). Maybe I need to use the raw signal from eye tracker and solve drifting problem.
Re: Adapter Property to analog/digital output
February 17, 2023 10:31AM
You can still do the calculation during the ITI by using the userloop or alert_function and change the images for the next trial. Some people are already doing the analysis that you mentioned with NIMH ML.
https://monkeylogic.nimh.nih.gov/docs_CreatingTask.html#Userloop
https://monkeylogic.nimh.nih.gov/docs_AlertFunction.html

The data recorded in the previous trial is available in both userloop and alert_function through TrialRecord.
https://monkeylogic.nimh.nih.gov/docs_TrialRecordStructure.html

I do not know if the AlphaOmega system allows another computer to retrieve neural data while the recording is in progress, as Plexon does, but that is something you need to talk to AlphaOmega about.
Re: Adapter Property to analog/digital output
February 18, 2023 09:27PM
Thank you Jaewon! I will try to use alter_funtion!
Re: Adapter Property to analog/digital output
March 08, 2023 11:35PM
Hi Jaewon, I was able to resolve the issue by incorporating singletarget.success into an onoffmarke. This allows me to easily load the time series data that pertains to whether the fixation is within the specified window in AO. Thank you for your helpful advice!

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.