# OSX: TestDaq error

**URL:** <https://psychtoolbox.discourse.group/t/osx-testdaq-error/1629>\
**Category:** Uncategorized\
**Created:** [May 27, 2006, 11:09am UTC](https://psychtoolbox.discourse.group/t/osx-testdaq-error/1629 "2006-05-27T11:09:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_schmidly](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@r\_schmidly](https://psychtoolbox.discourse.group/u/r_schmidly)\
**Post date:** [May 27, 2006, 11:09am UTC](https://psychtoolbox.discourse.group/t/osx-testdaq-error/1629/1 "2006-05-27T11:09:15Z")

</div>

Greetings,  
  
I recently bought a USB-1208FS data acquisition device and have run across an error when   
I try the TestDaq program. All goes well until the tests for DaqAInScanBegin,   
DaqAInScanContinue, DaqAInScanEnd and the following error results:  
  
??? Undefined function or variable "dinc".  
  
Error in ==\> DaqAInScan at 371  
 for d=(1:3)\*dinc % interfaces 1,2,3  
  
Error in ==\> DaqAInScanContinue at 15  
[data,params]=DaqAInScan(device,options);  
  
Error in ==\> TestDaq at 323  
 params=DaqAInScanContinue(daq(1),options);  
  
Has anyone else seen this or have ideas on its cause? I have not tried to use these   
functions in another program yet. I am using the current beta of PTB and Matlab 7.2 on a   
Powerbook G4 667 with 1 Gb of RAM running Tiger 10.4.6.   
  
Thanks,  
Richard Schmidt  
Associate Professor  
Psychology Department  
College of the Holy Cross

---

<div class="post-metadata">

**Author:** ![daniel0906](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@daniel0906](https://psychtoolbox.discourse.group/u/daniel0906)\
**Post date:** [May 31, 2006, 12:50am UTC](https://psychtoolbox.discourse.group/t/osx-testdaq-error/1629/2 "2006-05-31T00:50:40Z")

</div>

Yes, I get precisely the same error below when running TestDaq.m with  
the USB-1208FS plugged into either a PowerBook G4 or an Intel-based  
Mac mini. (i.e., before I installed Software Updates recently and  
MATLAB on the Mac mini stopped working.)  
  
Both my Macs have the 'beta' branch of OSX Psychtoolbox installed.  
  
Daniel Shima  
Vanderbilt Vision Research Center  
  
  

> On 5/27/06, r\_schmidly \<[schmidtr@...](mailto:schmidtr@...)\> wrote:  
> \> Greetings,  
> \>  
> \> I recently bought a USB-1208FS data acquisition device and have run across an error when  
> \> I try the TestDaq program. All goes well until the tests for DaqAInScanBegin,  
> \> DaqAInScanContinue, DaqAInScanEnd and the following error results:  
> \>  
> \> ??? Undefined function or variable "dinc".  
> \>  
> \> Error in ==\> DaqAInScan at 371  
> \> for d=(1:3)\*dinc % interfaces 1,2,3  
> \>  
> \> Error in ==\> DaqAInScanContinue at 15  
> \> [data,params]=DaqAInScan(device,options);  
> \>  
> \> Error in ==\> TestDaq at 323  
> \> params=DaqAInScanContinue(daq(1),options);  
> \>  
> \> Has anyone else seen this or have ideas on its cause? I have not tried to use these  
> \> functions in another program yet. I am using the current beta of PTB and Matlab 7.2 on a  
> \> Powerbook G4 667 with 1 Gb of RAM running Tiger 10.4.6.  
> \>  
> \> Thanks,  
> \> Richard Schmidt  
> \> Associate Professor  
> \> Psychology Department  
> \> College of the Holy Cross  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \> Post your message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
> \> Please indicate OS9, OSX, or WIN version, and include your full name.  
> \> Denis Pelli, David Brainard, and Allen Ingling.  
> \> [http://psychtoolbox.org](http://psychtoolbox.org)  
> \>  
> \> Yahoo! Groups Links  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>

---

<div class="post-metadata">

**Author:** ![r\_schmidly](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@r\_schmidly](https://psychtoolbox.discourse.group/u/r_schmidly)\
**Post date:** [June 1, 2006, 5:11pm UTC](https://psychtoolbox.discourse.group/t/osx-testdaq-error/1629/3 "2006-06-01T17:11:41Z")

</div>

Thanks for the verification, Daniel. I think I fixed the problem though......  
  
The problem seems to be in the DaqAInScanContinue and DaqAInScanEnd functions which   
call the DaqAInScan. Looking at the code of the latter, I was perplexed as to how the 'dinc'   
variable takes on a value when the options.begin flag is set to 0 (as it would be for the   
DaqAInScanContinue or DaqAInScanEnd functions): the 'dinc' variable only takes on   
a value (line: 269) within a conditional (lines:245-286) that depends on the options.begin   
flag being set to 1.   
  
In order to have the 'dinc' variable to be valued between calls to DaqAInScan (from   
DaqAInScanBegin to DaqAInScanContinue to DaqAInScanEnd), I defined it on line 245 as  
  
persistent dinc;  
  
With that addition to DaqAInScan, TestDaq (and its calls to DaqAInScanContinue and   
DaqAInScanEnd) runs fine. I have not tested it further though....  
  
-Richard  
  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Daniel Shima" \<danielshima@...\> wrote:  
> \>  
> \> Yes, I get precisely the same error below when running TestDaq.m with  
> \> the USB-1208FS plugged into either a PowerBook G4 or an Intel-based  
> \> Mac mini. (i.e., before I installed Software Updates recently and  
> \> MATLAB on the Mac mini stopped working.)  
> \>   
> \> Both my Macs have the 'beta' branch of OSX Psychtoolbox installed.  
> \>   
> \> Daniel Shima  
> \> Vanderbilt Vision Research Center  
> \>   
> \>   
> \> On 5/27/06, r\_schmidly \<schmidtr@...\> wrote:  
> \> \> Greetings,  
> \> \>  
> \> \> I recently bought a USB-1208FS data acquisition device and have run across an error   
> when  
> \> \> I try the TestDaq program. All goes well until the tests for DaqAInScanBegin,  
> \> \> DaqAInScanContinue, DaqAInScanEnd and the following error results:  
> \> \>  
> \> \> ??? Undefined function or variable "dinc".  
> \> \>  
> \> \> Error in ==\> DaqAInScan at 371  
> \> \> for d=(1:3)\*dinc % interfaces 1,2,3  
> \> \>  
> \> \> Error in ==\> DaqAInScanContinue at 15  
> \> \> [data,params]=DaqAInScan(device,options);  
> \> \>  
> \> \> Error in ==\> TestDaq at 323  
> \> \> params=DaqAInScanContinue(daq(1),options);  
> \> \>  
> \> \> Has anyone else seen this or have ideas on its cause? I have not tried to use these  
> \> \> functions in another program yet. I am using the current beta of PTB and Matlab 7.2   
> on a  
> \> \> Powerbook G4 667 with 1 Gb of RAM running Tiger 10.4.6.  
> \> \>  
> \> \> Thanks,  
> \> \> Richard Schmidt  
> \> \> Associate Professor  
> \> \> Psychology Department  
> \> \> College of the Holy Cross  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \> Post your message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
> \> \> Please indicate OS9, OSX, or WIN version, and include your full name.  
> \> \> Denis Pelli, David Brainard, and Allen Ingling.  
> \> \> [http://psychtoolbox.org](http://psychtoolbox.org)  
> \> \>  
> \> \> Yahoo! Groups Links  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \>
