Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Use M-Series cards with DAQmx in Matlab!

I finally got it working - no more error -200088 for me!

 

I had to pass the initial task handle as empty - uint32([]). Using an uint32(0) or uint32(1) didn't work. This is the code that worked for me:


 

taskhDO0 = [];
[err,b,taskhDO0] = calllib('myni','DAQmxCreateTask','DO0',uint32(taskhDO0))
[err,b,c,d] = calllib('myni','DAQmxCreateDOChan',taskhDO0,'Dev1/port0/line0','',DAQmx_Val_ChanPerLine)

 

 

I am using matlab 7.8.0 (R2009a) on XP. 

0 Kudos
Message 91 of 106
(3,161 Views)

Has anyone gotten this to work in R2009b (Windows 7 32-bit, NI-DAQmx 9.1.0)? If so, could you post your code? I'm still getting errors with nathancolorado's code:

 

??? Error using ==> DAQmxCheckError at 24

DAQmx error - NULL pointer was passed for a required parameter.


Error in ==> DAQmxCreateDOChan at 28

DAQmxCheckError(lib,err); 

 


When I use my own code, the task is successfully created (error = 0) but subsequent operations on the task return -200088:

 %%

DAQmx_Val_ChanPerLine = 0;

taskhDO0 = [0];

[err,b,taskhDO0] = calllib('nidaqmx','DAQmxCreateTask','DO2',uint32(taskhDO0))  % err = 0

[err,b,c,d] = calllib('nidaqmx','DAQmxCreateDOChan',uint32(taskhDO0),'Dev1/port0/line0','',DAQmx_Val_ChanPerLine)   % err = -200088

 

%%

    % setup MUX scanning task

charBuffer = '111111111111111111111111111111111111111111111111111111111111111111111';

muxHandle = libpointer('voidPtr',[0]);

muxHandle = uint32(1);

[result, ~, muxHandle] = calllib('nidaqmx','DAQmxCreateTask','aas2',muxHandle);

decodeDAQError(result); % result = 0

[result, ~, ~] = calllib('nidaqmx','DAQmxGetTaskName',uint32(muxHandle),charBuffer,length(charBuffer));

decodeDAQError(result); % result = -200088

[result,~,~,~] = calllib('nidaqmx','DAQmxCreateDOChan',uint32(muxHandle),'/Moo/port0/line0:3','MUXlines',0);

decodeDAQError(result); % result = -200088 

0 Kudos
Message 92 of 106
(3,076 Views)

Through trial and error, I figured out the solution to a -200088 "Task specified is invalid or does not exist" error (for MATLAB R2009b, NI-DAQ 9.1.0, Win 7 32-bit):

taskh = libpointer('voidPtrPtr',0);

muxHandle = taskh;


[result, ~, muxHandle] = calllib('nidaqmx','DAQmxCreateTask','',muxHandle);

muxHandle.setdatatype('voidPtrPtr'); % this is critical!

[result, a, b] = calllib('nidaqmx','DAQmxGetTaskName',muxHandle,charBuffer,length(charBuffer));

[result,~,~,~] = calllib('nidaqmx','DAQmxCreateDOChan',muxHandle,'/Moo/port0/line0:3','MUXlines',0);

 

For some reason the setdatatype line was critical in getting it to work. 

Message 93 of 106
(3,045 Views)

@lid

 

I am using R2008b and am experiencing a similar problem, I tried yor fix:

 

muxHandle.setdatatype('voidPtrPtr'); % this is critical!

 

but this causes a fatal error and MATLAB crash dumps.

 

any ideas

 

Cheers Ben

0 Kudos
Message 94 of 106
(2,954 Views)

MATLAB crash file:C:\DOCUME~1\LukehurB\LOCALS~1\Temp\matlab_crash_dump.824
------------------------------------------------------------------------
       Segmentation violation detected at Thu Jul 01 08:18:25 2010
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.7.0.471 (R2008b)
  MATLAB License:   443655
  Operating System: Microsoft Windows XP
  Window System:    Version 5.1 (Build 2600: Service Pack 3)
  Processor ID:     x86 Family 6 Model 15 Stepping 13, GenuineIntel
  Virtual Machine:  Java 1.6.0_04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
  Default Encoding:  windows-1252

Fault Count: 1

Register State:
  EAX = 0000000d  EBX = 00000000
  ECX = 0000003d  EDX = 6c031dec
  ESI = 0000003d  EDI = 1958e418
  EBP = 00c2d340  ESP = 00c2d334
  EIP = 78313cd3  FLG = 00010202

Stack Trace:
  [0] mcos.dll:public: void __thiscall mcos::RefManager::releaseInternalRef(void)(0x199ec660, 0x194c59e8, 0x194c59e8, 0x00c2d3b0 "lÔÂ") + 3 bytes
  [1] libmwcli.dll:public: virtual __thiscall RefPtrClass::~RefPtrClass(void)(0x1958e418, 0x00c2d378 "¼ÓÂ", 0x6c01ac38, 1) + 62 bytes
  [2] libmwcli.dll:public: virtual void * __thiscall RefPtrClass::`vector deleting destructor'(unsigned int)(1, 0x00c2d3bc "ìÓÂ", 0x7a823613, 0x1958e418) + 11 bytes
  [3] libmwcli.dll:public: virtual void __thiscall PointerUDC::destroyObject(class UDInterface *)(0x1958e418, 0x199eb9d0, 0x1958e418, 0x7a823776 "ë\r%ÿÿ÷ÿ\r") + 40 bytes
  [4] udd.dll:private: void __thiscall UDInterface::destroyInternals(void)(0x022434e0, 0, 1, 0x7af4c966) + 51 bytes
  [5] udd.dll:public: virtual void __thiscall UDInterfaceRefManager::destroyRef(void)(0x16cf9668, 0x17b5faa8, 0x16cf9668, 0) + 26 bytes
  [6] libmx.dll:_mxDestroyArray(0x16dc9c60, 0x00c2efe4, 73, 0) + 154 bytes
  [7] m_interpreter.dll:void __cdecl `anonymous namespace'::inFinalizeMfcnCallContext(bool,bool,enum opcodes,struct opcodes::Mfun_call_context_tag *)(0x1792db01, 73, 0x00c2efe4, 0x1792dbd0 "_mxSetGlobalArrayData") + 965 bytes
  [8] m_interpreter.dll:bool __cdecl inMfileEpilogFinalizer(enum opcodes,void *,enum opcodes *,int *)(73, 0x1792dbe0 "yData", 0, 0) + 74 bytes
  [9] m_interpreter.dll:void __cdecl inRunFinalizers(enum opcodes,enum opcodes *,int *)(73, 0, 0, 0x00c2db20) + 56 bytes
  [10] m_interpreter.dll:void __cdecl RunMfileErrorCondition(class MathWorks::MException::MExceptionEnvelope const &,struct `anonymous namespace'::Mfun_call_context_tag *,bool)(0x00c2db20, 0x00c2efe4, 0, 0x78158eb7) + 38 bytes
  [11] m_interpreter.dll:__catch$?inRunMfile@@YAXHPAPAUmxArray_tag@@H0PAVMfh_mp@@PAUinWorkSpace_tag@@@Z$2(3, 0x00c2f1e4, 2, 0x00c2f244) + 36 bytes
  [12] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(3, 0x00c2f1e4, 2, 0x00c2f244) + 42 bytes
  [13] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(3, 0x00c2f1e4, 2, 0x00c2f244) + 202 bytes
  [14] m_interpreter.dll:int __cdecl inDispatchFromStack(int,char const *,int,int)(617, 0x194ca454 "NIcollect", 3, 0x19589920) + 841 bytes
  [15] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *,int *)(1, 0, 1, 0) + 1264 bytes
  [16] m_interpreter.dll:int __cdecl protected_inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *,int *)(1, 0, 1, 0) + 39 bytes
  [17] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *,int *)(1, 0, 1, 0) + 251 bytes
  [18] m_interpreter.dll:int __cdecl inExecuteMFunctionOrScript(class Mfh_mp *,bool)(0x7977f201, 0xffffffff, 0x193fd068, 0) + 949 bytes
  [19] m_interpreter.dll:void __cdecl inRunMfile(int,struct mxArray_tag * *,int,struct mxArray_tag * *,class Mfh_mp *,struct inWorkSpace_tag *)(0, 0x00c2fb4c, 0, 0) + 467 bytes
  [20] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00c2fb4c, 0, 0) + 42 bytes
  [21] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00c2fb4c, 0, 0) + 202 bytes
  [22] m_interpreter.dll:void __cdecl inEvalPcodeHeaderToWord(struct _memory_context *,int,struct mxArray_tag * * const,struct _pcodeheader *,class Mfh_mp *,unsigned long)(0x7aef6ba4, 0, 0x00c2fb4c, 0x00c2fa58) + 73 bytes
  [23] m_interpreter.dll:enum inExecutionStatus __cdecl in_local_call_script_function(struct _memory_context *,struct _pcodeheader *,int,struct mxArray_tag * * const,unsigned long,bool)(0x7aef6ba4, 0x00c2fa58, 0, 0x00c2fb4c) + 70 bytes
  [24] m_interpreter.dll:__catch$??1inProtectHotSegment@@QAE@XZ$0(0x7aef6ba4, 0x01f92b20 "[status, a, b]= NIcollect(freque..", 0, 0) + 307 bytes
  [25] m_interpreter.dll:enum inExecutionStatus __cdecl inEvalCmdWithLocalReturn(char const *,int *,bool,bool,bool (__cdecl*)(void *,char const *))(0x01f92b20 "[status, a, b]= NIcollect(freque..", 0, 0, 1) + 79 bytes
  [26] m_interpreter.dll:public: virtual enum inExecutionStatus __thiscall InterpBridge::EvalCmdWithLocalReturn(char const *,int *,bool,bool)(0x01f92b20 "[status, a, b]= NIcollect(freque..", 0, 0, 1) + 25 bytes
  [27] m_interpreter.dll:_inEvalCmdWithLocalReturn(0x01f92b20 "[status, a, b]= NIcollect(freque..", 0, 0, 1) + 27 bytes
  [28] bridge.dll:enum inExecutionStatus __cdecl evalCommandWithLongjmpSafety(char const *)(0x01f92b20 "[status, a, b]= NIcollect(freque..", 0x0211dca0 "à3@", 0x01fdc578 "Ô3@", 0x0211e460) + 67 bytes
  [29] bridge.dll:__catch$_mnParser$0(0x0211e460, 0x16f187a0, 0x798e0201, 0x16fd3a60) + 294 bytes
  [30] mcr.dll:public: void __thiscall mcrInstance::mnParser(void)(0x0040547c, 336710, 0, 28) + 51 bytes
  [31] MATLAB.exe:int __cdecl mcrMain(int,char const * * const)(1, 0x0211d0e0, 4194304, 10) + 568 bytes
  [32] MATLAB.exe:_WinMain@16(4194304, 0, 336710, 10) + 75 bytes
  [33] MATLAB.exe:___tmainCRTStartup(0, 0, 0x7ffd6000, 0x8054b6ed) + 320 bytes
  [34] kernel32.dll:0x7c817067(0x00401b1f, 0, 0x00905a4d, 3)

Please follow these steps to report this problem to The MathWorks so we
have the best chance of correcting it:

The next time MATLAB is launched under typical usage, a dialog box will
open to help you send the error log to The MathWorks. Alternatively, you
can send an e-mail to segv@mathworks.com with the following file attached:
    C:\DOCUME~1\LukehurB\LOCALS~1\Temp\matlab_crash_dump.824

If the problem is reproducible, please submit a Service Request via:
    http://www.mathworks.com/support/contact_us/ts/help_request_1.html

A technical support engineer might contact you with further information.

Thank you for your help. MATLAB may attempt to recover, but even if recovery appears successful,
we recommend that you save your workspace and restart MATLAB as soon as possible.

 

0 Kudos
Message 95 of 106
(2,917 Views)

@DonMushroom 

 

I'd say that crash is a bug in MATLAB, and would submit a service request against it. 

0 Kudos
Message 96 of 106
(2,906 Views)

Thanks a lot, it worked 🙂

0 Kudos
Message 97 of 106
(2,693 Views)

Hi, Do any body encoountered this problem.

I can not find the cause of it. but probably it is after installing NI DAQ card on my PC.


-----------------------------------------------------------------------
       Segmentation violation detected at Sun Jan 16 13:38:33 2011
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.9.0.529 (R2009b)
  MATLAB License:   161051
  Operating System: Microsoft Windows XP
  Window System:    Version 5.1 (Build 2600: Service Pack 2)
  Processor ID:     x86 Family 6 Model 7 Stepping 10, GenuineIntel
  Virtual Machine:  Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
  Default Encoding:  windows-1252

Fault Count: 1

Register State:
  EAX = 00c31923  EBX = 382884b4
  ECX = 38ec36b0  EDX = 00000010
  ESI = 00000018  EDI = 382884cc
  EBP = 00c3b1a4  ESP = 00c3b128
  EIP = 78e19289  FLG = 00210246

Stack Trace:
  [0] hg.dll:void __cdecl gs_data3matrix_to_pixel(double *,double *,double *,struct GObject_tag *,struct Real_point3 *,int)(0x69aa0020, 0x6a250020, 0, 0x3981f880) + 633 bytes
  [1] hg.dll:public: virtual void __thiscall HgCurveDescriptor::transformToPixels(struct Real_point3 *,int)(0, 1000001, 0, 0x3c0c7890) + 45 bytes
  [2] libmwgui.dll:bool __cdecl gui_objects::isCurveInRectangle(class gui_objects::CurveDescriptor &,class gui_objects::Rectangle2i const &)(209, 0x00c3b270, 0x00c3b3d8, 206) + 729 bytes
  [3] hg.dll:bool __cdecl CurveInRect(struct GObject_tag *,struct mwrect *)(0x3c0c7890, 0x00c3b2c8, 0x00c3b2f4 "D³Ã", 0x78da0d7b) + 78 bytes
  [4] hg.dll:_GO_ObjectInRect(0x3c0c7890, 0x00c3b2c8, 0x2e5d3348, 0x0230cb70) + 22 bytes
  [5] hg.dll:struct GObject_tag * __cdecl pt_in_object(struct mwpoint *,struct GObject_tag *,class Vector *)(0x00c3b3d8, 0x3c0c7890, 0, 0x2e5d3348) + 699 bytes
  [6] hg.dll:struct GObject_tag * __cdecl pt_in_object(struct mwpoint *,struct GObject_tag *,class Vector *)(0x00c3b3d8, 0x3981f880, 0, 0x2c7155c0) + 469 bytes
  [7] hg.dll:struct GObject_tag * __cdecl pt_in_object(struct mwpoint *,struct GObject_tag *,class Vector *)(0x00c3b3d8, 0x3981d318, 0, 0x3981d318) + 469 bytes
  [8] hg.dll:void __cdecl wbd_side_effect(struct GObject_tag *,void *)(0x3981d318, 0x013f00ce, 0x78da37b0, 0x3955cc18 "ð¶µ@") + 103 bytes
  [9] hg.dll:enum inExecutionStatus __cdecl goCallEventCallback(struct GObject_tag *,class MCallback *,char const *,void (__cdecl*)(struct GObject_tag *,void *),void *,void (__cdecl*)(struct GObject_tag *,void *),struct mxArray_tag *)(0x3955cc18 "ð¶µ@", 0x78ed10b8 "WindowButtonDownFcn", 0x39af55a8, 0x78da38b0) + 185 bytes
  [10] hg.dll:_goCallCallback(0x3981d318, 0x3955cc18 "ð¶µ@", 0x78ed10b8 "WindowButtonDownFcn", 0x78da37b0) + 171 bytes
  [11] hg.dll:_figure_WindowButtonDownFcn(0x2ddfd590, 0x022434a8, 0x2ddfd590, 0x022434a8) + 279 bytes
  [12] libmwgui.dll:void __cdecl wm_ButtondownFcn(struct WinRec_tag *,void *)(0x2ddfd590, 0x022434a8, 0x443f75a8, 0x00c3b5d0) + 67 bytes
  [13] libuij.dll:public: static void __cdecl FigureJavaEventManager::ButtonCallback(class UDInterface *,void *,void const *,bool)(0x2c714a80, 0x01eeb1e0, 0x00c3b5d0, 0x7b2c6900) + 582 bytes
  [14] libuij.dll:public: virtual bool __thiscall uij::JavaEventListener::execute(class UDEvent *)(0x00c3b5d0, 0x36ed2fa0, 0x2c714a80, 0x00c3b5d0) + 68 bytes
  [15] udd.dll:public: bool __thiscall UDListenerList::execute(class UDEvent *)(0x00c3b5d0, 0x00c3b58c "°µÃ", 0x7b2ed98f, 0x1cdfddc0 "°'0{") + 89 bytes
  [16] udd.dll:public: virtual void __thiscall UDListenerManagerHost::notifyEvent(class UDDatabaseClient *,class UDEventSource const *,class UDEventInfo const *,class UDEvent *)(0x1cdfddc0 "°'0{", 0x2c714a84, 0x36ed2fa0, 0x00c3b5d0) + 54 bytes
  [17] udd.dll:public: virtual void __thiscall UDEventInfo::send(class UDDatabaseClient *,class UDInterface *,class UDEvent *)(0x1cdfddc0 "°'0{", 0x2c714a80, 0x00c3b5d0, 0x2d3147d0) + 63 bytes
  [18] udd.dll:public: void __thiscall UDInterface::send(class UDDatabaseClient *,class UDEventInfo *,class UDEvent *)(0x1cdfddc0 "°'0{", 0x36ed2fa0, 0x00c3b5d0, 0) + 123 bytes
  [19] udd_mi.dll:void __cdecl ProcessBeanUDDEvent(int)(44, 0, 0x00030000 "Actx ", 0x00c3b748) + 585 bytes
  [20] uiw.dll:bool __cdecl UIW_DispatchUserMessage(int,int)(9226, 44, 0x00c3b748, 0x395f3b58 "ATL@@YGPA_WPA_W@Z$0") + 81 bytes
  [21] uiw.dll:long __stdcall HandleUserMsgHook(int,unsigned int,long)(0, 1, 0x00c3b748, 0) + 95 bytes
  [22] USER32.dll:0x77d56e46(0x00030000 "Actx ", 1, 0x00c3b748, 0x7b38edd0)
  [23] USER32.dll:0x77d4ecc3(0x00c3b738, 0x00c3b748, 0x00c3b764, 0)
  [24] USER32.dll:0x77d56ddb(0x00c3b738, 48, 0x00030000 "Actx ", 1)
  [25] ntdll.dll:0x7c90eae3(0x00c3b7d0, 0, 0, 0)
  [26] uiw.dll:char * __cdecl getCommand(char *,int)(0x78aa6850, 4096, 0x00c3b86c "è¸Ã", 0x78a9390f) + 364 bytes
  [27] uiw.dll:public: virtual char * __thiscall uiw::UIW_IOProxy::getCmdWindowCommand(char *,int)const (0x78aa6850, 4096, 0, 0) + 16 bytes
  [28] bridge.dll:char * __cdecl winReadStdin(char * const,unsigned int,bool)(0x78aa6850, 4096, 0, 0x00c3fa0c) + 79 bytes
  [29] bridge.dll:char * __cdecl ioReadLineOS(bool,struct _iobuf * const,char * const,char * const,int,bool * const,void (__cdecl*const)(void),char * (__cdecl*const)(char * const,unsigned int,bool))(0, 0x781c1b78, 0x0228f4b0, 4096) + 265 bytes
  [30] bridge.dll:char * __cdecl ioReadLine(bool,struct _iobuf *,char *,char *,int,bool *)(0, 0x781c1b78, 0x0228f4b0, 0x0228f4b0) + 99 bytes
  [31] bridge.dll:void __cdecl mnGetFullLine(char * *,unsigned int *,unsigned int *,bool)(0x00c3fa10, 0x00c3fa04, 0, 0x7bb18c17) + 205 bytes
  [32] bridge.dll:_mnGetCommandLineBuffer(0, 0, 0x17ab72d0, 0) + 124 bytes
  [33] bridge.dll:__catch$_mnParser$0(0x0243ff78, 0, 0x74730e01, 1) + 164 bytes
  [34] mcr.dll:private: void __thiscall mcrInstance::mnParser_on_interpreter_thread(void)(0x17ab7308, 0x7ffdd000 "ĬÃ", 0x00c3fb3c, 0x77d4ecc3) + 51 bytes
  [35] mcr.dll:public: void __thiscall boost::function0<void>::operator()(void)const (0, 0x17ab72d0, 0, 0x17ab72d0) + 63 bytes
  [36] mcr.dll:public: virtual void __thiscall mcr::runtime::InterpreterThread::Impl::NoResultInvocationRequest::run(void)(0x7a27a800, 0x7c90eae3, 0x00c3fb70, 48) + 53 bytes
  [37] mcr.dll:private: static void __cdecl mcr::runtime::InterpreterThread::Impl::invocation_request_handler(int)(0x17ab72d0, 0, 0x00030000 "Actx ", 0x00c3fcb4) + 40 bytes
  [38] uiw.dll:bool __cdecl UIW_DispatchUserMessage(int,int)(9225, 0x17ab72d0, 0x00c3fcb4, 2) + 81 bytes
  [39] uiw.dll:long __stdcall HandleUserMsgHook(int,unsigned int,long)(0, 1, 0x00c3fcb4, 0x79c73540) + 95 bytes
  [40] USER32.dll:0x77d56e46(0x00030000 "Actx ", 1, 0x00c3fcb4, 0x7b38edd0)
  [41] USER32.dll:0x77d4ecc3(0x00c3fca4, 0x00c3fcb4, 0x00c3fcd0, 0)
  [42] USER32.dll:0x77d56ddb(0x00c3fca4, 48, 0x00030000 "Actx ", 1)
  [43] ntdll.dll:0x7c90eae3(0x00c3fd20, 0, 0, 0)
  [44] uiw.dll:void __cdecl UIW_GetAndDispatchMessage(struct tagMSG *)(0x00c3fd20, 2, 2, 0x17ab72d0) + 20 bytes
  [45] uiw.dll:void __cdecl UIW_GetAndDispatchMessage(void)(0x02328d28, 0, 0x024758a0, 0) + 15 bytes
  [46] uiw.dll:void __cdecl ws_ProcessPendingEventsMainLoop(int,bool)(1, 0, 0x00c3fdbc "üýÃ", 0x7a27d26a) + 356 bytes
  [47] uiw.dll:void __cdecl ws_ProcessPendingEvents(int,int)(1, 0xffffffff, 0x02328d28, 0x024758a0) + 14 bytes
  [48] mcr.dll:public: void __thiscall mcr::runtime::InterpreterThread::Impl::process_events(class boost::shared_ptr<class mcr::runtime::InterpreterThread::Impl> const &)(0x00c3fe14, 2, 0x02475338, 0x0337dd8c) + 138 bytes
  [49] mcr.dll:__catch$?run@Impl@InterpreterThread@runtime@mcr@@QAEKABV?$shared_ptr@VImpl@InterpreterThread@runtime@mcr@@@boost@@PAUinit_context@1234@@Z$0(0x00c3fe14, 0x02477eb0, 0x7a27d630, 0x024713b0) + 128 bytes
  [50] mcr.dll:unsigned long __cdecl run_init_and_handle_events(void *)(0x0337dd8c, 0, 0x024752a8, 0) + 76 bytes
  [51] mcr.dll:private: void __thiscall mcr::runtime::InterpreterThreadFactory::runThreadFunction(void)(0x00c3fec8, 0x00c3fe80, 0x00c3fe84 "ðþÃ", 0x7bafb34c) + 108 bytes
  [52] MATLAB.exe:public: void __thiscall boost::function0<void>::operator()(void)const (336710, 0x0040b7f4, 0, 0x78131731) + 63 bytes
  [53] MATLAB.exe:int __cdecl mcrMain(int,char const * * const)(1, 0x02478778, 4194304, 10) + 230 bytes
  [54] MATLAB.exe:_WinMain@16(4194304, 0, 336710, 10) + 75 bytes
  [55] MATLAB.exe:___tmainCRTStartup(0, 0, 0x7ffde000, 0x8054a6ed) + 320 bytes
  [56] kernel32.dll:0x7c816d4f(0x00406faa, 0, 0x00905a4d, 3)

0 Kudos
Message 98 of 106
(2,343 Views)

Thank you all for your suggestions/workarounds.  I was having a similar problem.  I used libfunctionsview to resolve some problems with my output arguments.

 

Here is my story:

Happily running WinXP, Matlab 2010a, ni-daqmx 8.7 with a pair of PCI-4462 cards for almost a year.  One of the PCI4462 cards mysteriously stops working.  I send it to NI and they fix it (blown cap, still trying to get more out of NI what caused this).  But while NI is fixing my board, I decide to reinstall OS and applications on a brand new hard drive (because NI had mentioned that I should run the latest and greatest nidaqmx 9.2.2).  

 

I reinstall winxp and upgrade to matlab 2010b, nidaqmx 9.2.2.  I try out my old code and it doesn't work.  It is throwing the -200088 error. 

It looks like some of my values for sampleCounts, DAQ read and other things are getting overwritten with variables of the wrong type!  I try some of your suggestions but to no avail.  However, I checked in libfunctionsview('nidaq') and voila NIDAQmx 9.2.2 has different outputs compared to 8.7!

 

NIDAQmx 8.7 

 

[err,b]=calllib('daqop','DAQmxCreateTask','',masterTaskHandle);
NIDAQmx 9.2.2
[err,b,masterTaskHandle]=calllib('daqop','DAQmxCreateTask','',masterTaskHandle);

 

 

Now, matlab doesn't enforce output error quantity, so the my old code didn't throw an error (once I tried some of your suggestions above using libpointer).  However, for other functions you get something more like this:

 

NIDAQmx 8.7

 

        [err,masterData,masterRead,empty]=calllib('daqop','DAQmxReadAnalogF64',...

            masterTaskHandle,samplesPerLoop,5.0,DAQmx_Val_GroupByScanNumber,...

            masterData_ptr,arrayLength,masterRead_ptr,empty_ptr);

NIDAQmx 9.2.2
        [err,masterTaskHandle,masterData,masterRead,empty]=calllib('daqop','DAQmxReadAnalogF64',...
            masterTaskHandle,samplesPerLoop,5.0,DAQmx_Val_GroupByScanNumber,...
            masterData_ptr,arrayLength,masterRead_ptr,empty_ptr);
masterData gets written with a libpointer.  masterRead is now masterData and so on.  Big mess.
So, if you're running into these issues, remember to use libfunctionsview for a quick sanity check, just to make sure your input and output arguments are correct.  Sorry if this is the wrong thread for this post, but it could save somebody some time if they have the same problem I did...

 

0 Kudos
Message 99 of 106
(2,317 Views)

Thanks JWQ, 

 

spent the whole day trying to figure out the problem. 

 

Your solution works for me - just grabbed a prototypes.pl file from an older version and replaced it. 

 

Haven't actually tried to talk to the DAC module too, but it seems all the functions are there: 

 

>> libfunctions('nicaiu.dll')

 

Thanks again...

0 Kudos
Message 100 of 106
(1,684 Views)