Configuring the Line Direction for the NI 9403 (FPGA Interface)

CompactRIO

Configuring the Line Direction for the NI 9403 (FPGA Interface)

Each digital channel on the NI 9403 is initially configured as a digital input. You can configure the initial line direction for each channel on the NI 9403 at edit time using the C Series Module Properties dialog box. You can programmatically change the line direction for each channel at run time using the FPGA I/O Method Node. The execution of an I/O Method Node that is configured with a Set Output Enable method overwrites the values you configured in the C Series Module Properties dialog box. In addition, the execution of an FPGA I/O Node configured for output automatically configures the line for output and overwrites the values you configured in the C Series Module Properties dialog box or using the Set Output Enable method.

Configuring Line Direction Using the C Series Module Properties Dialog Box

Complete the following steps to set the line direction of channels using the C Series Module Properties dialog box.

  1. Configure the CompactRIO system, and add an NI 9403.
  2. Right-click the NI 9403 in the Project Explorer window and select Properties from the shortcut menu to display the C Series Module Properties dialog box.
  3. Select the channel(s) for which you want to configure the line direction from the Channels table. You can select more than one channel by holding the <Ctrl> or <Shift> key when selecting channels.
  4. Select the direction for the channel(s) from the Direction pull-down menu.
  5. Click the OK button.
  6. Select File»Save All in the Project Explorer window.

Configuring Line Direction of One Channel Using the FPGA I/O Method Node

Complete the following steps to set the line direction of a channel using the FPGA I/O Method Node.

  1. Create FPGA I/O items for the channel of the NI 9403 for which you want to configure the line direction.
  2. Place an FPGA I/O Method Node on the block diagram and configure it for this channel.
  3. Click the Method section and select the Set Output Enable method from the shortcut menu.
  4. Right-click the Enable input and select Create»Control from the shortcut menu.
  5. On the front panel of the VI, click the Enable Boolean control to set it to TRUE if you want to set the line direction of the channel to digital output.

Configuring Line Direction of Multiple Channels Using the FPGA I/O Method Node

Complete the following steps to set the line direction of multiple channels using the FPGA I/O Method Node.

  1. Create FPGA I/O items for the digital port of the NI 9403 that contains the channels you want to configure.
  2. Place an FPGA I/O Method Node on the block diagram and configure it for this digital port.
  3. Click the Method section and select the Set Output Enable method from the shortcut menu.
  4. Right-click the Enable input and select Create»Control from the shortcut menu. If you configured the FPGA I/O Method Node for the DIO7:0, DIO15:8, DIO23:16, or DIO31:24 digital port, the Enable control appears as an unsigned 8-bit integer. If you configured the FPGA I/O Method Node for the DIO31:0 digital port, the Enable control appears as an unsigned 32-bit integer. Each bit in the integer represents the line direction of one channel of the NI 9403.
  5. On the front panel of the VI, use the Enable control to enter the line direction for each channel in the port. Change a bit to 1 to set the line direction of the corresponding channel to digital output. Leave a bit as 0 to set the line direction of the corresponding channel to digital input. Refer to the table below for examples of what to enter in the Enable control if you configured the FPGA I/O Method Node for the DIO7:0 digital port.

    Channel Line Direction Configuration Enable Control (Hex) Enable Control (Binary)
    Change all channels to input 0x00 0b00000000
    Change all channels to output 0xFF 0b11111111
    Change channel 0 to output 0x01 0b00000001
    Change channels 0 through 5 to output 0x3F 0b00111111
    Change channels 3 and 7 to output 0x88 0b10001000


    Refer to the table below for examples of what to enter in the Enable control if you configured the FPGA I/O Method Node for the DIO31:0 digital port.

    Channel Line Direction Configuration Enable Control (Hex) Enable Control (Binary)
    Change all channels to input 0x00000000 0b0000000000000000 0000000000000000
    Change all channels to output 0xFFFFFFFF 0b1111111111111111 1111111111111111
    Change channel 0 to output 0x00000001 0b0000000000000000 0000000000000001
    Change channels 0 through 5 to output 0x0000003F 0b0000000000000000 0000000000111111
    Change channels 3 and 7 to output 0x00000088 0b0000000000000000 0000000010001000