Skip to Main Content Skip to Search
Product Documentation

Network Communication

Network Communication Overview

This topic describes the establishment of communication between the host computer and target computer using network communications (TCP/IP). For serial communication, see Serial Communication.

Hardware for Network Communication

You must install the following hardware before you install the xPC Target software and configure it for network communication:

Ethernet Card for a PCI Bus

If your target computer has a PCI bus, use an Ethernet card for the PCI bus. The PCI bus has a faster data transfer rate and requires minimal effort to configure.

To install the PCI bus Ethernet card, use the following procedure:

  1. Turn off your target computer.

  2. If the target computer already has an unsupported Ethernet card, remove the card.

  3. Plug the supported Ethernet card into a free PCI bus slot.

  4. Connect your target computer Ethernet card to your LAN using an unshielded twisted-pair (UTP) cable.

Your next task is to set up the xPC Target environment for network communication. See Environment Properties for Network Communication.

Ethernet Card for an ISA Bus

Your target computer might not have an available PCI bus slot or USB 2.0 port or might not contain a PCI bus (older motherboards, passive ISA backplanes, or PC/104 computers). In these cases, you can use an Ethernet card for an ISA bus.

For a list of known compatible network adapter chip families, see

http://www.mathworks.com/products/xpctarget/supported-hardware/xPC_Target_Supported_Ethernet_Chipsets.pdf

To install an ISA bus Ethernet card, use the following procedure:

  1. Turn off your target computer.

  2. On your ISA bus card, assign an IRQ and I/O-port base address by moving the jumpers or switches on the card. Write down these settings, because you need to enter them in the xPC Target Explorer.

    You should set the IRQ line to 11 and the I/O-port base address to around 0x300. If one of these hardware settings would lead to a conflict in your target computer, select another IRQ or I/O-port base address.

      Note   If your ISA bus card does not contain jumpers to set the IRQ line and the base address, use the utility on the installation disk supplied with your card to manually assign the IRQ line and base address. Do not configure the card as a PnP-ISA device.

  3. If the target computer already has an unsupported Ethernet card, remove the card. Plug the compatible network card into a free ISA bus slot.

  4. Connect the target computer network card to your LAN using a coaxial cable or an unshielded twisted-pair cable.

    If you use an Ethernet card for an ISA bus within a target computer that has a PCI bus, you must reserve the chosen IRQ line number for the Ethernet card in the PCI BIOS. Refer to your BIOS setup documentation to set up the PCI BIOS.

Your next task is to set up the xPC Target environment for network communication. See Environment Properties for Network Communication.

Environment Properties for Network Communication

The xPC Target environment is defined by a group of properties. These properties give xPC Target information about the software and hardware that it works with. You might change some of these properties often, while others you will rarely want to change.

After you have installed the xPC Target software, you can specify the environment properties for the host and target computers. Note that you must specify these properties before you can build and download a target application.

  1. If xPC Target Explorer is not already started, in the MATLAB Command Window, type

    xpcexplr

    The xPC Target Explorer window opens.

    xPC Target Explorer associates network communication environment properties with the target computer.

  2. In the xPC Target Explorer, right-click the Host PC node.

  3. Select Add Target.

    A target computer node named TargetPC1 appears in the xPC Target Hierarchy, at the same level as the Host PC node. It appears with the icon (note the X to denote that the host computer is not connected to the target computer).

  4. Repeat Environment Properties for Serial Communication and Environment Properties for Serial Communication for each additional target computer you want to add to your system.

    Additional target computer nodes appear in the xPC Target Hierarchy. As you add other target computers, the PC number is incremented. The following figure illustrates two target computer nodes.

  5. In the xPC Target Explorer, expand a target computer node.

    A Configuration node appears. Under this are nodes for Communication, Settings, and Appearance. The parameters for the target computer node are grouped in these categories.

  6. Select Communication.

    The Communication Component pane appears to the right.

  7. From the Host target communication list, select TcpIp.

    The pane changes to one that contains only those parameters pertinent to network communication.

  8. You must enter the network properties with values required by your LAN environment. Ask your system administrator for values for these settings.

    • Target PC IP address — This is the IP address for your target computer. An example of an IP address is 192.168.0.10.

    • LAN subnet mask address — This is the subnet mask address of your LAN. An example of a subnet mask address is 255.255.255.0.

      Alternatively, you can obtain the LAN subnet mask address from the Network Connections dialog box on your host computer. Depending on your Windows platform, you can access this dialog box in a number of ways. For example, on a Windows XP Professional system, you can use this sequence:

      1. Select Start > Settings > Control Panel, then double-click Network Connections.

      2. Right-click Local Area Connection, then select Properties.

      3. Select Internet Protocol (TCP/IP), then click Properties.

      If your computers connect with a crossover cable, you might have a dialog box like the following. You can obtain your subnet mask address and TCP/IP gateway address from this dialog box.

        Note   The TCP/IP address is for your host computer, not your target computer. You still need to get the target computer TCP/IP address for your target computer from your system administrator.

        The default gateway address is blank in this dialog box. However, in the xPC Target Explorer, you must enter 255.255.255.255 for the gateway value in the TCP/IP gateway address property.

  9. Optionally, enter the following properties, depending on your specific circumstances:

    • TCP/IP target port — This property is set by default to 22222. This value should not cause any problems, because this number is higher than the reserved area (telnet, ftp, ...) and it is only relevant on the target computer. You can change this property value to any value higher than 20000 and less than 65536.

    • TCP/IP gateway address — This property is set by default to 255.255.255.255. This means that you do not use a gateway to connect to your target computer. If you connect your computers with a crossover cable, leave this property as 255.255.255.255.

      If you communicate with the target computer from within your LAN, you might not need to define a gateway and change this setting.

      If you communicate from a host computer located in a LAN different from your target computer, you need to define a gateway and enter its IP address. This is especially true if you want to work over the Internet. Ask your system administrator for the IP address of the required gateway.

  10. Enter the following properties specific to the Ethernet card on your target computer:

    • TCP/IP target bus type — From the list, select: PCI, ISA, or USB.

      • The software defaults this property to PCI.

      • If you set TCP/IP target bus type to PCI or USB, the properties TCP/IP ISA memory port and TCP/IP target ISA IRQ number are disabled (grayed out).

    • TCP/IP target driver — The software defaults this property to Auto. From the list, select:

      • For TCP/IP target bus type PCI, one of 3C90x, I8254x, I82559, NE2000, NS83815, R8139, R8168, Rhine, RTLANCE, or Auto.

        If TCP/IP target driver is Auto, the software will determine the target computer TCP/IP driver from the card installed on the target computer.

          Note   If no supported Ethernet card exists in your target computer, the software returns an error.

      • For TCP/IP target bus type USB, one of USBAX772, USBAX172, or Auto.

        If TCP/IP target driver is Auto, the software will default the driver to USBAX772, the driver most commonly used.

      • For TCP/IP target bus type ISA, one of NE2000 or SMC91C9X.

        Auto is not supported for TCP/IP target bus type ISA.

        Note   To configure the software for a crossover Ethernet cable connection, select I82559.

    • TCP/IP target ISA memory port and TCP/IP target ISA IRQ number — If you are using an ISA bus Ethernet card, you must enter values for the properties TCP/IP target ISA memory port and TCP/IP target ISA IRQ number. The values of these properties must correspond to the jumper settings or ROM settings on your ISA bus Ethernet card.

  11. If the target computer has multiple Ethernet cards, type the following MATLAB commands to specify which card to use. These commands assume that the target computer name is nonDefaultTarget.

    allTargets = xpctarget.targets;
    myTargetEnv = allTargets.Item('nonDefaultTarget');
    set(myTargetEnv, 'EthernetIndex', '#');

    # indicates a single digit to specify the index number for the Ethernet card. For example, set(myTargetEnv, 'EthernetIndex', '2'); selects the Ethernet card with index number 2 as the target computer card.

    After you type this command, boot the target. The kernel selects the specified Ethernet card as the target computer card instead of selecting the default card with index number 0.

    Alternatively, if you have a single target computer system, you can use setxpcenv(‘EthernetIndex', '#'), For example, setxpcenv('EthernetIndex','2') selects the Ethernet card with index number 2 as the target computer card.

  12. Repeat step 5 to 10 for any target computer for which you have a network connection between the host computer and target computer.

    The xPC Target software updates the environment with new properties as you enter them.

    The following figure illustrates the Communication Component pane for a network connection.

For more information on the xPC Target environment, see Target Application Environment in the xPC Target User's Guide.

Your next task is to create a target boot drive. See Booting Target Computers from Removable Boot Drives.

  


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