11-08-2006 01:04 PM
11-08-2006 02:16 PM
11-10-2006 08:17 AM
11-14-2006 01:46 PM - edited 11-14-2006 01:46 PM
Message Edited by MALavoie on 11-14-2006 01:47 PM
11-15-2006 09:55 AM
11-17-2006 07:29 AM
11-17-2006 08:05 AM
11-20-2006 02:26 PM
11-22-2006 01:44 PM
Hi
I have a problem with my NI-USB6009, hope someone can help. I intend to make an S-function for Simulink 6.0 that reads and writes samples. I have done the part that reads samples, and it works fine (thanks to this thread too). There are some problems with the writing part tho.
Here is a bit of my code:
[err,a,task2]=calllib('ni','DAQmxCreateTask','',2);
disp(err)
task2chans=['Dev1/ao0:' num2str(st_izhodov-1)];
err=calllib('ni','DAQmxCreateAOVoltageChan',task2,task2chans,'',0,5,DAQmx_Val_Volts,'');
disp(err)
err = calllib('ni','DAQmxCfgSampClkTiming',task2,'',samplerate, DAQmx_Val_Rising,DAQmx_Val_ContSamps,1);
disp(err)
So here is the problem. The error code for CreateTask is 0 (so it is OK), the error code for CreateAOVoltageChan is also 0, but the error code for CfgSampClkTiming is -200077. I found somewhere that this code means i have requested an action or parameter that the device phisically cannot do. Is this true? And if it is, any idea of what could that be?
The interesting part is that i have practically the same code for input chans and it works fine.
PS: apologize for my english 🙂
Peter
11-22-2006 01:55 PM