Duke-UNC Brain Imaging and Analysis Center
BIAC Forums | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password   Forgot your Password?
 All Forums
 Support Forums
 Experimental Control
 ni-daq trigger at 4T
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

james.kragel
Starting Member

USA
9 Posts

Posted - Mar 18 2008 :  3:15:41 PM  Show Profile  Reply with Quote
I ran into some issues trying to trigger a stimuli script to the scanner at the 4T earlier today, using the following code.

ainidaq = analoginput('nidaq',1);
chan = addchannel(ainidaq,2);
duration = 2; % two second acquisition
set(ainidaq,'SampleRate',44100);
ActualRate = get(ainidaq,'SampleRate');
set(ainidaq,'SamplesPerTrigger',ActualRate*duration);
set(ainidaq,'TriggerChannel',chan);
set(ainidaq,'TriggerType','Software');
set(ainidaq,'TriggerCondition','Rising');
set(ainidaq,'TriggerConditionValue',1);
set(ainidaq,'TriggerFcn','scannertrigger');
start(ainidaq);
wait(ainidaq,26);
delete(ainidaq)
clear ainidaq

This method of triggering has worked in the past, but I ran into a couple of separate issues. The first is that there was an error concerning setting SamplesPerTrigger, as ActualRate was apparently not an integer value and this was causing crashes. After hard coding it to an integer, there were still issues coming up trying to set the TriggerFcn.

I'm curious as to whether or not there have been hardware/software changes I am unaware of, as this has worked in the past.

Thanks,

James
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BIAC Forums © 2000-2010 Brain Imaging and Analysis Center Go To Top Of Page
This page was generated in 0.45 seconds. Snitz Forums 2000