|
james.kragel
Starting Member
USA
9 Posts |
Posted - Mar 18 2008 : 3:15:41 PM
|
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 |
|