Command-Line Ethernet Card Selection by Index

If you are using multiple target computers that have multiple Ethernet cards, you must specify which card to use for the Ethernet link. Use the following procedure to discover the Ethernet index of the PCI cards on a specific target and specify which card to use.

Note

For this procedure, you must be able to burn CDs on your development computer and use network boot mode for routine target operations.

Use the following procedure for target TargetPC1:

  1. Get the target object for this target computer and make it the default target. In the Command Window, type:

    tg = SimulinkRealTime.getTargetSettings('TargetPC1');
    setAsDefaultTarget(tg);

    You apply other settings to this object.

  2. In the Command Window, type:

    tg.ShowHardware = 'on';

    With ShowHardware set, after the kernel starts, the development computer cannot communicate with the target computer. When you have gathered your information, to resume normal functionality, set this property to 'off', recreate the boot image, and restart the target computer.

  3. Set the Ethernet driver to the default:

    tg.TcpIpTargetDriver = 'Auto';

    If TcpIpTargetDriver is set to a specific driver, such as 'I82559', the kernel displays only information about boards that use that driver.

  4. Set the boot method to CD/DVD boot:

    tg.TargetBoot='CDBoot';
  5. Set the target monitor to print text only:

    tg.TargetScope = 'Disabled' ;
  6. Type SimulinkRealTime.createBootImage.

    The Simulink® Real-Time™ software displays the following message and creates the CD/DVD boot image.

    Current boot mode: CDBoot
    CD boot image is successfully created
    
    Insert an empty CD/DVD. Available drives:
      [1]  d:\
      [0]  Cancel Burn
  7. Insert the new boot disk and restart the target computer from the target computer boot switch.

    After the start is complete, the target monitor displays information about the Ethernet cards in the target computer, for example:

    index: 0, driver: R8139, Bus: 16, Slot: 8, Func: 0
    index: 1, driver: I82559, Bus: 16, Slot: 9, Func: 0

    Check that the boot order allows you to start the target computer from your disk. For more information, see your Speedgoat target computer documentation. After the kernel starts with ShowHardware 'on', the development computer cannot communicate with the target computer.

  8. Note the index of the Ethernet card you want to use for the Ethernet link, for example, 2.

  9. In the Command Window, type:

    tg.ShowHardware = 'off';
    tg.EthernetIndex = '#';

    # is the index of the Ethernet card, for example, 2.

  10. Set the boot method back to network boot:

    tg.TargetBoot= 'NetworkBoot';
  11. Set the target monitor to graphics mode:

    tg.TargetScope = 'Enabled' ;
  12. Type SimulinkRealTime.createBootImage.

  13. Start the target computer from the target computer boot switch.

    The kernel selects the specified Ethernet card as the target computer card, instead of the default card with index number 0.

Repeat this procedure as required for each target computer.