| Contents | Index |
| On this page… |
|---|
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.
You must install the following hardware before you install the xPC Target software and configure it for network communication:
Network (Ethernet) adapter card — When using the product with TCP/IP, you should have a supported network (Ethernet) adapter (PCI, ISA, or USB) installed on the host and target computers.
Note To boot the target computer from the network, you must install on the target computer an Ethernet adapter card compatible with the Preboot eXecution Environment (PXE) specification. |
Be sure to:
Connect the Ethernet adapters of the host and target computers to a local area network (LAN) using unshielded twisted pair (UTP) cable.
Assign a static IP address to the target computer network adapter card or USB-to-Ethernet converter.
For the most current network communications requirements, see
The host computer network adapter card can have a Dynamic Host Configuration Protocol (DHCP) address. The host computer can be any computer on the network. When using the product with TCP/IP, you must configure the DHCP server to reserve all static IP addresses to prevent these addresses from being assigned to other systems.
You can also directly connect your computers. Use a crossover UTP cable with RJ45 connectors to connect them. Both computers must have static IP addresses. If the host computer has a second network adapter card, that card can have a DHCP address.
I/O boards — If you use I/O boards on your target computer, install the boards according to the manufacturer's instructions.
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:
If the target computer already has an unsupported Ethernet card, remove the card.
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.
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
To install an ISA bus Ethernet card, use the following procedure:
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.
If the target computer already has an unsupported Ethernet card, remove the card. Plug the compatible network card into a free ISA bus slot.
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.
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.
If xPC Target Explorer is not already started, in the MATLAB Command Window, type
xpcexplr
Note xPC Target Explorer runs only on 32-bit host computers. On 64-bit computers, use the MATLAB command-line interface. For further information, see Configuring Environment From the MATLAB Command Line. |
The xPC Target Explorer window opens.
xPC Target Explorer associates network communication environment properties with the target computer.
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).
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.

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.
The Communication Component pane appears to the right.
From the Host target communication list, select TcpIp.
The pane changes to one that contains only those parameters pertinent to network communication.
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:
Select Start > Settings > Control Panel, then double-click Network Connections.
Right-click Local Area Connection, then select Properties.
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. |

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.
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.
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.
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.
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.
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.
![]() | Host Software Installation | Serial Communication | ![]() |

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 |