10-18-2007 03:04 PM
10-19-2007 12:21 PM
10-19-2007 02:07 PM
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
10-22-2007 03:22 PM