03-04-2015 08:39 AM
I have a problem trying to use a 6009 device through NIDAQmx and XCode 6.1.1 on Yosemite.
Here is my code, taken directly from the contAcquireNChan.c file:
printf("Start\n"); // Task parameters int32 error = 0; TaskHandle taskHandle = 0; char errBuff[2048]={'\0'}; int32 i,j; time_t startTime; bool32 done=0; // Channel parameters char chan[] = "Dev1/ai0, Dev1/ai1"; float64 min = -10.0; float64 max = 10.0; // Timing parameters char clockSource[] = "OnboardClock"; uInt64 samplesPerChan = 1000; float64 sampleRate = 5000.0; // Data read parameters #define bufferSize (uInt32)1000 float64 data[bufferSize * 2]; int32 pointsToRead = bufferSize; int32 pointsRead; float64 timeout = 10.0; int32 totalRead = 0; printf("Example will halt automatically.\n"); printf("Task configuration.\n"); printf("DAQmxBaseCreateTask.\n"); DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle)); printf("DAQmxBaseCreateAIVoltageChan.\n"); DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL)); printf("DAQmxBaseCfgSampClkTiming.\n"); DAQmxErrChk (DAQmxBaseCfgSampClkTiming(taskHandle,clockSource,sampleRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,samplesPerChan)); printf("DAQmxBaseCfgInputBuffer.\n"); DAQmxErrChk (DAQmxBaseCfgInputBuffer(taskHandle,200000)); //use a 100,000 sample DMA buffer printf("Start Task.\n"); DAQmxErrChk (DAQmxBaseStartTask(taskHandle)); // The loop will quit after 10 seconds startTime = time(NULL); while( time(NULL)<startTime+10 ) { DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByScanNumber,data,bufferSize*2,&pointsRead,NULL)); totalRead += pointsRead; printf("Acquired %d samples. Total %d\n",pointsRead,totalRead); // Just print out the first 10 points of the last data read for (i = 0; i < 10; ++i) printf ("data0[%d] = %f\tdata1[%d] = %f\n",i,data[2*i],i,data[2*i+1]); } printf("\nAcquired %d total samples.\n",totalRead); Error: if( DAQmxFailed(error) ) DAQmxBaseGetExtendedErrorInfo(errBuff,2048); if(taskHandle != 0) { DAQmxBaseStopTask (taskHandle); DAQmxBaseClearTask (taskHandle); } if( DAQmxFailed(error) ) printf ("DAQmxBase Error %d: %s\n", error, errBuff);
I have no problem compiling the code, however when I click on the button running the code it crashes and the problem seems to be the DAQmxBaseCreateTask function.
Here is the error message:
Start Example will halt automatically. Task configuration. DAQmxBaseCreateTask. 2015-03-04 15:38:04.748 ProjectName[3850:50381] -[AppDelegate setHandler:withData:]: unrecognized selector sent to instance 0x610000001140 2015-03-04 15:38:04.760 ProjectName[3850:50381] An uncaught exception was raised 2015-03-04 15:38:04.760 ProjectName[3850:50381] -[AppDelegate setHandler:withData:]: unrecognized selector sent to instance 0x610000001140 2015-03-04 15:38:04.760 ProjectName[3850:50381] ( 0 CoreFoundation 0x00007fff8a5a666c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x00007fff8731376e objc_exception_throw + 43 2 CoreFoundation 0x00007fff8a5a96dd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x00007fff8a4f0aa4 ___forwarding___ + 1028 4 CoreFoundation 0x00007fff8a4f0618 _CF_forwarding_prep_0 + 120 5 LabVIEW 14.0 Runtime 0x00000001024866af _ZN19MainLoop_MacCocoaUIC2Ev + 95 6 LabVIEW 14.0 Runtime 0x000000010248673c _ZN19MainLoop_MacCocoaUI4InstEv + 60 7 LabVIEW 14.0 Runtime 0x0000000102569dea WSendEvent + 250 8 LabVIEW 14.0 Runtime 0x000000010256af8f WCreateEx + 543 9 LabVIEW 14.0 Runtime 0x000000010256b20e _ZN8WMgrCore10InitializeEv + 254 10 LabVIEW 14.0 Runtime 0x000000010251a790 _Z12InitManagersiPKPKcPiP14MGAppInterfaceP16MGUIAppInterfaceS0_ + 512 11 LabVIEW 14.0 Runtime 0x0000000101842b53 _Z10MGMainInitiPKPKcPb + 179 12 LabVIEW 14.0 Runtime 0x0000000101842f84 _Z6MGMainiPKPKc + 132 13 LabVIEW 14.0 Runtime 0x0000000101843aed _Z11SysUIThreadPv + 13 14 LabVIEW 14.0 Runtime 0x00000001025dbe9e _Z15ThreadCoverProcPv + 94 15 libsystem_pthread.dylib 0x00007fff8de2e268 _pthread_body + 131 16 libsystem_pthread.dylib 0x00007fff8de2e1e5 _pthread_body + 0 17 libsystem_pthread.dylib 0x00007fff8de2c41d thread_start + 13 ) 2015-03-04 15:38:04.761 ProjectName[3850:50381] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate setHandler:withData:]: unrecognized selector sent to instance 0x610000001140' *** First throw call stack: ( 0 CoreFoundation 0x00007fff8a5a666c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x00007fff8731376e objc_exception_throw + 43 2 CoreFoundation 0x00007fff8a5a96dd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x00007fff8a4f0aa4 ___forwarding___ + 1028 4 CoreFoundation 0x00007fff8a4f0618 _CF_forwarding_prep_0 + 120 5 LabVIEW 14.0 Runtime 0x00000001024866af _ZN19MainLoop_MacCocoaUIC2Ev + 95 6 LabVIEW 14.0 Runtime 0x000000010248673c _ZN19MainLoop_MacCocoaUI4InstEv + 60 7 LabVIEW 14.0 Runtime 0x0000000102569dea WSendEvent + 250 8 LabVIEW 14.0 Runtime 0x000000010256af8f WCreateEx + 543 9 LabVIEW 14.0 Runtime 0x000000010256b20e _ZN8WMgrCore10InitializeEv + 254 10 LabVIEW 14.0 Runtime 0x000000010251a790 _Z12InitManagersiPKPKcPiP14MGAppInterfaceP16MGUIAppInterfaceS0_ + 512 11 LabVIEW 14.0 Runtime 0x0000000101842b53 _Z10MGMainInitiPKPKcPb + 179 12 LabVIEW 14.0 Runtime 0x0000000101842f84 _Z6MGMainiPKPKc + 132 13 LabVIEW 14.0 Runtime 0x0000000101843aed _Z11SysUIThreadPv + 13 14 LabVIEW 14.0 Runtime 0x00000001025dbe9e _Z15ThreadCoverProcPv + 94 15 libsystem_pthread.dylib 0x00007fff8de2e268 _pthread_body + 131 16 libsystem_pthread.dylib 0x00007fff8de2e1e5 _pthread_body + 0 17 libsystem_pthread.dylib 0x00007fff8de2c41d thread_start + 13 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
03-05-2015 02:40 AM
Hi Titoin,
Are you sur that your error is linked at NI product and not just an syntax error in XCode.
I found any information on the error return.
Brice S.
National Instruments France
03-05-2015 03:15 AM
03-05-2015 09:57 AM - edited 03-05-2015 10:05 AM
The error I reported in my first post is when I run the code in an Obective-C Cocoa App project, by the way. If I run the code in a Command Line Tool C project, the code runs without crashing but throw the following warning at the end:
CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
And if I set CA_DEBUG_TRANSACTIONS to 1, here is the message I get:
CoreAnimation: warning, deleted thread with uncommitted CATransaction; created by: 0 QuartzCore 0x00007fff9605de2a _ZN2CA11Transaction4pushEv + 312 1 QuartzCore 0x00007fff9605dcca _ZN2CA11Transaction15ensure_implicitEv + 276 2 QuartzCore 0x00007fff9606b2c2 _ZN2CA7Context10invalidateEv + 32 3 QuartzCore 0x00007fff9607eb26 -[CAContextImpl dealloc] + 46 4 libobjc.A.dylib 0x00007fff8d31489c _ZN11objc_object17sidetable_releaseEb + 236 5 libobjc.A.dylib 0x00007fff8d2fae8f _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 575 6 CoreFoundation 0x00007fff9046c302 _CFAutoreleasePoolPop + 50 7 Foundation 0x00007fff96d7fedf -[NSAutoreleasePool drain] + 153 8 LabVIEW 14.0 Runtime 0x0000000103c87c1e _ZN11LVCocoaMainD0Ev + 62 9 LabVIEW 14.0 Runtime 0x0000000103c873c0 _ZN19MainLoop_MacCocoaUI3RunEv + 352 10 LabVIEW 14.0 Runtime 0x0000000103043027 _Z6MGMainiPKPKc + 295 11 LabVIEW 14.0 Runtime 0x0000000103043aed _Z11SysUIThreadPv + 13 12 LabVIEW 14.0 Runtime 0x0000000103ddbe9e _Z15ThreadCoverProcPv + 94 13 libsystem_pthread.dylib 0x00007fff93e1c268 _pthread_body + 131 14 libsystem_pthread.dylib 0x00007fff93e1c1e5 _pthread_body + 0 15 libsystem_pthread.dylib 0x00007fff93e1a41d thread_start + 13
03-24-2015 02:54 PM
03-24-2015 03:22 PM - edited 03-24-2015 03:23 PM
08-11-2015 02:05 PM
Hey everyone,
The mixture of using XCode newer than 6.1 on the Yosemite OS with a LabVIEW-built 64-bit framework (DAQmx base) has been known in the past to throw a CoreAnimation thread warning. The behavior was tracked with CAR 497256 and is now fixed in LabVIEW 2015 and LabVIEW 2014 SP1 f1!
08-17-2015 12:18 PM - edited 08-17-2015 12:22 PM
This is not really solving my problem. I have a NI USB Daq but not Labview. All I want is working OS X 10.10 drivers and I can't find any newer drivers than version 14.0 on your website, a version that does not work.
Not to mention that your links are directing us to a "Windows readme" page while this thread is all about OS X...
09-16-2015 11:20 AM
did you get it running ? I'm stuck on the same issue : "unrecognized selector sent to instance" when trying to run...
09-16-2015 11:36 AM - edited 09-16-2015 11:36 AM
I found the solution !!!
Apparently, the NiDaq framework tries to send a message setHandler to the appdelegate. If you haven't implemented such message, things go bad. But you can simply implement a dummy handler by adding this to your application delegate class :
- (id)setHandler:(id)a withData:(id) b
{
return nil;
}
this way, the framework doesn't crash !!! I still have to test if the measured data is correct, but at least i'm running again !