Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

flex_read_adc16_rtn

hi,
 
I  use "flex_read_adc16_rtn" to read 12 analog signal from multiplexer (i use CVI 6.0 wind2000), the multiplexer is controled by  "outp" :
 
         //port parallel
          
   //*************       
         
 for(i_port = 0 ; i_port<11; i_port++)
          {
              //send adress
         
     outp(0x378, i_port);
           
              //read acquisition           
             
flex_read_adc16_rtn(boardID, 0x51, &analog_data); 
            
             //send information on the CAN
             Transmit_analog_data.Data[0]  =  (u8) analog_data           ;
             Transmit_analog_data.Data[1]  =  (u8) (analog_data >> 8);
              ncWrite(last_step, sizeof(Transmit_analog_data), &Transmit_analog_data);
          }
  //*************       
i use also  :             flex_enable_adcs(boardID, reserved, 0x51)                                ;
                               flex_set_adc_range(boardID, 0x51 , NIMC_ADC_UNIPOLAR_5);       
 
Question:
 
1) why  flex_read_adc16_rtn take about 15ms to execute? (15ms to read only one signal)
2) i have to read 12 signals every 20ms, if i use any multifunction DAQ, will i have the same problem if i use any function to read AI  like  flex_read_adc16_rtn ?
3) is there any solution to save AI on board, and send them to PC, without using windows ?
 
thank you
0 Kudos
Message 1 of 4
(3,704 Views)

i use CVI timer

thank you

0 Kudos
Message 2 of 4
(3,702 Views)
Mekhatria,

the ADCs on motion control devices are primarily designed to work as analog feedback channels that are sampled directly by the DSP on the boards. If you read the ADCs from your host PC or in an onboard program the acquisition time that you are experiencing is expected behavior. Thus writing the data to a data buffer in an onboard program won't be much faster, too.

With a data acquisiton device (e. g.an M-Series device) data acquisition runs much faster (up to 1 MHz) and you can run it with hardware timing which guarantees a deterministic sampling rate.

I hope that helps,

Jochen Klier
National Instruments Germany
0 Kudos
Message 3 of 4
(3,695 Views)

hi Jochen Klier,

now i use asynchronous timer, and every thing goes right,  i can get 12AI in 10ms + motion control + CAN  acquisition. If i load the cpu (with many applications : 10 x IE, 5*Microsoft word, .... ) some troubles appear on the signal, otherwise is right. I don't now why, but CVI timer made a big trouble.

 

thank u again Jochen Klier 

 

0 Kudos
Message 4 of 4
(3,667 Views)