Skip to Main Content Skip to Search
Product Documentation

Overview of PMC-ADADIO Functionality

Introduction to PMC-ADADIO

The PMC-ADADIO board is an analog I/O PCI mezzanine card (PMC) device that can be used for a number of applications, such as data acquisition and process monitoring.

The xPC Target block library supports this board with A/D and D/A driver blocks. The following xPC Target driver blocks control the A/D functionality of the PMC-ADADIO board:

The following xPC Target driver blocks control the D/A functionality of the PMC-ADADIO board:

The use of these drivers differ slightly from other boards. Of particular note are the Boolean enable ports (labelled E) that most of the A/D and D/A blocks have for input and/or output. These enable ports perform the following:

An input enable port can have an Enable Signal block connected to the port. The Enable Signal block generates an input enable signal for the A/D and D/A blocks. If you do not connect an Enable Signal block to the A/D or D/A block, the input enable port has a constant value of 1, or `true.'

A typical A/D block configuration for analog input operation connects the AD Start block and AD Read block. Because the A/D Start block can take several microseconds to perform the analog to digital conversion of the channels selected by the A/D Read block, you can perform other operations in the meantime. For example, you can insert a typical D/A block configuration between the AD Start and Read blocks. A typical configuration for analog output operation connects the DA Write and DA Update blocks.

This section describes how to use the PMC-Adadio blocks to create a model that interleaves the analog input and analog output operations.

A/D Blocks

A typical A/D block configuration for analog input operation connects the AD Start block and AD Read block. The AD Start block converts the data of the channels selected by the AD Read block.

Adding A/D Blocks to a Model for Analog Input

  1. In the MATLAB Command Window, type

    xpclib

    The xPC Target driver block library opens.

  2. Double-click the A/D group block.

    A window with blocks for A/D drivers opens.

  3. Double-click the General Standards group block.

    A window with blocks for General Standards opens.

  4. From the File menu, click New -> Model.

  5. Drag and drop an AD Start block from the General Standards window to the new model.

    By default, this block should have the Enable input port and Enable output port check boxes selected.

  6. Drag and drop an AD Read block from the General Standards window to the new model.

    By default, this block has the Enable input port and Enable output port check boxes selected. Double-click the AD Read block and clear the Enable output port check box. Clearing this check box prohibits the block from passing the Boolean value from the input enable port to the output enable port.

  7. Connect the AD Start block to the AD Read block.

    Note the following:

    • No signal has been connected to the AD Start block's input enable port, E, so the port has a default value of `true'. Accordingly, the output enable port of the AD Start block and input enable port of the AD Read block also have a value of `true'.

        Tip  

        • Drag and drop a Ground block from the Simulink Source library and connect that block to the unconnected input port of AD Start to prevent build errors until you add another block.

        • Drag and drop a Terminator block from the Simulink Sink library and connect that block to the unconnected output ports of AD Read to prevent build errors until you add another block.

    • Connecting the output enable port of the AD Start block to the input enable port of the AD Read block causes the AD Start block to execute before the AD Read block. The AD Start block initiates the A/D conversion. The Read block waits until the conversion has completed before putting the results on its output port.

        Note   The Start block must execute before every call to the Read block. If the Read block is executed without the Start block, the system hangs because it is waiting for data to be available.

  8. From the File menu, select Save As. Browse to a writable directory and enter a unique model name, for example, AdadioADDA. Then click Save.

Your next task is to add a Create Enable Signal block to this model. See Adding Enable Signal Blocks to A/D Blocks.

Create Enable Signal Blocks

The A/D and D/A series of blocks both have Create Enable Signal blocks.

You can use a Create Enable Signal block to generate an input enable signal for A/D and D/A blocks. You can connect a signal generator to the input of the Create Enable Signal block to control the output enable port. You can then connect the output E port of the Create Enable Signal block to the input E port of an A/D or D/A block.

Adding Enable Signal Blocks to A/D Blocks

This procedure assumes that you have a model named AdadioADDA (see Adding A/D Blocks to a Model for Analog Input). Add a Create Enable Signal block to generate an input enable signal for the AD Start block. If you have Ground or Terminator blocks, remove them as you make connections to the additional blocks.

  1. If your model AdadioADDA is not already open, in the MATLAB Command Window, type

    AdadioADDA

    The model opens.

  2. In the MATLAB window, type

    xpclib

    The xPC Target library opens.

  3. Double-click the A/D group block.

    A window with blocks for A/D drivers opens.

  4. Double-click the General Standards group block.

    A window with blocks for General Standards opens.

  5. Drag and drop a Create Enable Signal block from the General Standards window to the new model.

  6. Double click the Create Enable Signal block and deselect the Show input port for thresholding signal of type double.

    The Create Enable block has an output enable port, E, that can provide an input enable signal for any of the other PMC-ADADIO blocks. The Boolean value of this output enable port is controlled by an input port, S, and (optionally) an input port, L. When the S port is connected to the output of an arbitrary block B, the Create Enable Signal block executes immediately after block B executes. The L port is a level-sensitive thresholding port that allows an attached signal to control the Boolean value at the output enable port E.

  7. Click Start > Simulink > Library Browser.

  8. Click Sources. The Sources pane displays the included blocks.

  9. Drag and drop a Sine Wave block to the new model.

  10. Connect the output port of the Sine Wave block to the input port S of the Create Enable Signal block.

    Connecting the Sine Wave to the Create Enable Signal block triggers the sequence chain of the ADADIO blocks.

  11. In the new model, connect the S port of the Create Enable Signal block to the Sine Wave block.

  12. In the new model, connect the AD Start block E port to the Create Enable Signal E port.

    The output enable port, E, of the Create Enable Signal block provides the first Boolean output to feed into the other ADADIO driver blocks.

  13. From the File menu, select Save.

Your next task is to set up the D/A blocks to provide the analog output for the analog input blocks.

D/A Blocks

A typical D/A block configuration for analog output operation connects the DA Write block and DA Update block. The DA Update block converts the data that the DA Write block puts out.

Adding D/A Blocks to a Model for Analog Output

  1. If the model AdadioADDA is not already open, in the MATLAB Command Window, type

    AdadioADDA

    The model opens.

  2. In the MATLAB window, type

    xpclib

    The xPC Target library opens.

  3. Double-click the D/A group block.

    A window with blocks for D/A drivers opens.

  4. Double-click the General Standards group block.

    A window with blocks for General Standards opens.

  5. Drag and drop a DA Write block from the General Standards window to the new model.

  6. Drag and drop a DA Update block from the General Standards window to the new model.

  7. Connect the DA Update block to the DA Write block.

Note the following:

You can interleave the analog output blocks between the AD Start and AD Read blocks. Such a configuration allows the analog output block to perform concurrently with the A/D conversion by the AD Start block. To connect to the AD Start and AD Read blocks, the interleaving block(s) must have an input enable port and an output enable port. See Interleaving Analog Input and Analog Output Blocks.

Interleaving Analog Input and Analog Output Blocks

After the AD Start block executes, the acquisition hardware becomes busy with the operation. If you have the AD Read block execute immediately, it will idle waiting for the hardware to finish the acquisition. Rather than allowing idle cycles, you can insert other blocks between the AD Start and AD Read block. You can insert

The following procedure assumes that you have a model named AdadioADDA that has AD Start and Read blocks, an Enable Create Signal block, and DA Write and Update blocks:

  1. If the model AdadioADDA is not already open, in the MATLAB Command Window, type

    AdadioADDA

    The model opens.

  2. In the MATLAB window, type

    xpclib

    The xPC Target library opens.

  3. Disconnect the AD Start block from the AD Read block.

    Perform this step to insert the intermediate DA blocks between the AD Start and Read blocks.

  4. Connect the output E port of the AD Start block to the input E port of the DA Write block.

  5. Connect the output port of the Sine Wave block to the input 1 port of the DA Write block.

  6. Connect the output E port of the DA Write block to the input E port of the DA Update block.

  7. Connect the output E port of the DA Update block to the input E port of the AD Read block.

  8. At the xPC Target library, double-click the Misc group block

  9. Drag and drop the Scope (xPC) block into the AdadioADDA model.

  10. Connect the output E port of the AD Read block to the Scope (xPC) block.

  11. From the File menu, select Save.

You can build and run the model and download it to your target computer like any other xPC Target model.

Using Multiple Boards for Simultaneous Analog to Digital Conversion

The previous topics describe how to set up a model for up to eight channels performing simultaneous analog to digital conversion. You can increase the number of channels for this conversion by using two or more PMC-ADADIO boards, configured in a master/slave configuration.

In such a configuration, observe the following guidelines:

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS