5 National Instruments MIO16-L9   

In the next two chapters we will explain the use of the National Instruments cards MIO16 and the newer MIO16 E. We also advise the user to first consult the hardware manuals of these boards before reading further.

Before the National Instruments card can be used it must be configured properly. The base address, the DMA channels and the interrupt lines must be set with the jumpers. Only the base address must be given in the RAPID configuration program.  

The ADC input mode must be set to differential. The ADC input range can be set as the user wishes. The DAC reference must be set to internal (default). The DAC output polarity can be set freely. Notice that it is important to give all the settings (modes, ranges, polarity) to RAPID when the project is defined. Only the base address must be set once in the configuration program (see appendix A of the RaPID reference manual).

For analog inputs only channel (ACH0-ACH8) and channel (ACH1-ACH9) are used. If only one analog input is selected it must be connected to channel (ACH0-ACH8). If two analog inputs are needed within RAPID channel A in RAPID is connected to channel (ACH0-ACH8) on the MIO16 board, and channel B, in RAPID, is connected to channel (ACH1-ACH9) on the MIO16 board.


 
Table 5.1: input/output assignments e for the MIO16 and RAPID
2||c||Channel A 2c||Channel B 2c||Output      
analog digital analog digital analog digital
ACH0-ACH8   ACH1-ACH9   DAC0  
ACH0-ACH8   ACH1-ACH9     CNT5
ACH0-ACH8     CNT1 DAC0  
ACH0-ACH8     CNT1   CNT5
  CNT0 ACH1-ACH9   DAC0  
  CNT0 ACH1-ACH9     CNT5
  CNT0   CNT1 DAC0  
  CNT0   CNT1   CNT5 .
 

If the output of the controller is an analog signal only DAC0 is used (pin 20). There is only one digital output mode. It is a PWM signal mode. The base frequency of the PWM is defined in RAPID. The control output, in the range $0\%$ to $100\%$, defines the duty cycle of the PWM signal. The output must be connected to OUT5 (pin 49) on the MIO16 board.

The MIO16 board contains 5 timer/counters. Only three of them (counter 1,2 and 5) can be freely used. The other are used by National Instrument for timing of the input/output signals. Counter 1 is always connected to channel A in RAPID if a digital input is selected within RAPID. Counter 2 is connected to channel B if a digital input is selected. Counter 5 is always connected to the output of the controller if a digital output is selected. On overview of the different input/output assignments is given in Table 5.1.

Two digital input modes exist. The input can be pulse count or time measurement. In pulse count mode the number of pulses at the source of the counter during the sample interval are counted. For this mode the signal must be connected to SOURCE1 (pin 41) for channel A or SOURCE2 (pin 44) for channel B. In time mode the board measures the width of a pulse sent to the board via the gate input. At every sample time the last measured pulse width is returned to RAPID. For this mode the signal must be connected to GATE1 (pin 42) for channel A and GATE2 (pin 45) for channel B.



Peter Van Overschee
11/26/1997