Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx setups vs Legacy, How to match up

I am trying to switch from Legacy PCI-MIO-16E-1 to PCI 6251.  On test system, transition went fine.  But in the Real world, I keep getting -200019 errors.  A/D  no completed before next signal.  I did not get this until high speeds on test system.  But get it always on production system.  MIO card gets the error in DAQmx mode, but not in Legacy mode.  In Legacy it works fine.  But in DAQmx, neither card works.  Can anyone tell be the difference and give me some help.
0 Kudos
Message 1 of 4
(3,288 Views)
Hi Dennis,

Error -200019 occurs when your sampling rate is too high for your buffer.  I would first suggest taking a look at the KnowledgeBase article KB 3NMEUHX6: What Causes Error -200019 When Increasing the Sampling Rate of an Analog Input Task wit... 

Could you elaborate a little more on your application and your setup?  What sampling rate and on how many channels are you trying to acquire data?  What are you using for your clock?  What is the difference between your test system and your production system?






Best Regards

Hani R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,254 Views)

My application is a simple data collection.  I am collecting data from 4 inputs at each pulse.  The pulses are the A+ circuit of a quadriture encoder.The only difference between my test ssytem and the production is the environment.  The test system is in my shop with no other equipment.  The production is in a factory, with other equipment.  The software is identical.  I have tried to slow down the motor driving the encoder but with not change.  The error is the same for the 6251 and the MIO in DAQmx mode.  The MIO works fine in Legacy mode.  The clock rate I am running is 35000 for the External Sample rate in the DAQmxCfgSampClkTiming call.  I used 1000000 in the call in Legacy mode, but this value caused the DAQmx software to hang.  My call sequesce is as follows

if(( j_error = DAQmxCreateTask( "HeadscanTask", &h_headscantask )) != 0 ) goto nidaqscanerror;

sprintf_s( ac_mess,

sizeof( ac_mess ), "Dev%d/ai%d:%d", i_device, ai_heads[0][0], ai_heads[0][1] );

if( i_channel == 4 )

{ j_len = strlen( ac_mess );

sprintf_s( &ac_mess[j_len],

sizeof( ac_mess ) - j_len, ",Dev%d/ai%d:%d", i_device,

ai_heads[j_index][

2], ai_heads[j_index][3] );

}

else

{

if( j_num_heads > 1 )

{ j_len = strlen( ac_mess );

sprintf_s( &ac_mess[j_len],

sizeof( ac_mess ) - j_len, ",Dev%d/ai%d:%d", i_device, ai_heads[0][2],

ai_heads[

0][3] );

if( j_num_heads > 2 )

{ sprintf_s( ac_mess,

sizeof( ac_mess ), ",Dev%d/ai%d:%d", i_device, ai_heads[0][4],

ai_heads[

0][5] );

}

}

}

 

if( j_debug ) printf( "Scan Devices: %s\n", ac_mess ); Result: Scan Devices: Dev1/ai0:1,Dev1/ai2:3

if(( j_error = DAQmxCreateAIVoltageChan( h_headscantask, ac_mess, "", DAQmx_Val_Diff ,

0.0, 10.0, DAQmx_Val_Volts, NULL)) != 0 ) goto nidaqscanerror;

sprintf_s( ac_mess,

sizeof( ac_mess ), "/Dev%d/PFI7", i_device );

if( ps_scan_conf->j_motor_type == COMPUMOTOR_ZETA6000 || ps_scan_conf->j_motor_type == COMPUMOTOR )

{ i_temp = DAQmx_Val_Rising;

}

else

{ i_temp = DAQmx_Val_Falling;      This is what is being used, although neither causes any change

}

j_count_channel = (

int)(( r_length * ps_scan_conf->r_encode_pulses ) - 20 );

j_count = j_count_channel * i_channel;

if( j_debug ) printf( "Before sample Timing, Count %d, Channel COunt%d\n", j_count, j_count_channel );  Count is 400000

if(( j_error = DAQmxCfgSampClkTiming( h_headscantask, ac_mess, r_extsamplerate, i_temp,

DAQmx_Val_FiniteSamps, j_count_channel )) !=

0 ) goto nidaqscanerror;

if( j_debug ) printf( "Before ReadALL\n" );

if(( j_error = DAQmxSetReadReadAllAvailSamp( h_headscantask, TRUE )) != 0 ) goto nidaqscanerror;

if( j_debug ) printf( "BeforeTask Started\n" );

if(( j_error = DAQmxStartTask( h_headscantask )) < 0 ) goto nidaqscanerror;

if( j_debug ) printf( "Task Started\n" );

 

Please help.  I am at the production facility in FUlda Germany with multiple machines down.

Thanks

Dennis

 

0 Kudos
Message 3 of 4
(3,243 Views)
Hi Dennis,

Thanks for the extra information.  You wrote that you were able to sample at 1MS/s when acquiring with Traditional DAQ.  I doubt the system was acquiring 1 MS/s on four channels.  The limit of PCI-MIO-16E-1 for one channel is 1.25MS/s.  It may be that the error was not being handled. 

 Nevertheless, sampling with an external clock 35 kHz should not be a problem for your PCI 6251.  The error may be arising from a possible noisy signal that you are using for the external clock.  If the signal being used as the external clock is noisy, the DAQ card will be receiving a clock cycle before it is ready to sample the next set of data points.  Assuming that this is the problem, you can try to enable a digital filter as described in the KnowledgeBase article: KB 3VDG0388: Enabling the Digital Filters for Counter/Timer Devices in NI-DAQmx

If you can avoid using the external clock, you may want to consider using the internal clock.  You would be able to avoid any glitches that may exist otherwise.

Let me know if the digital filter works out for you.




Best Regards

Hani R.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,219 Views)