wiki:WARPLab/Reference/NodesConfig

Version 8 (modified by murphpo, 11 years ago) (diff)

--

Nodes Configuration

The Nodes Config utility allows a user greater flexibility when specifying the configuration information of a wl_node as part of the wl_initNodes setup process. Please note that in order to use the wl_nodesConfig utility, you must satisfy the following system requirements:

System Requirements

  • WARPLab 7.1.0 or later
  • WARP v3 hardware
  • User dip switches must have a value of all '1's (ie 0xF)

wl_nodesConfig

File source: wl_nodesConfig.m

This function is the best way to create a wl_node information structure that can be used with wl_initNodes. When calling wl_nodesConfig, the user must specify two arguments: 1) a command and 2) a filename. For example:

nodesConfig = wl_nodesConfig('read', 'my_node_config_file.txt')

There are two valid commands that can be passed to wl_nodesConfig:

  1. 'validate'

This command will parse the file specified by the filename and return either '1' if the input file is valid, or it will error out with a message specifying the issue with the input file.

configFileValid = wl_nodesConfig('validate', 'my_node_config_to_be_validated.txt')
  1. 'read'

This command will parse the file specified by the filename and return a vector of node information structures, one per line in the file, that can be used with wl_initNodes.

nodesConfig = wl_nodesConfig('read', 'my_node_config_file.txt')
nodes = wl_initNodes(nodesConfig)

or

nodes = wl_initNodes( wl_nodesConfig('read', 'my_node_config_file.txt') )

Configuration File

The configuration file for wl_nodesConfig must contain the following information:

  1. serialNumber

This is the WARP hardware serial number printed on your board: W3-a-XXXXX, where XXXXX is your five digit serial number.

  1. ID

This is the wl_node ID that should be used for the node. This node ID must be unique in the file.

  1. ipAddress

This is the IP address that you would like the WARP hardware to use, for example 10.0.0.105. This IP address must be unique in the file.

The configuration file can also contain optional information:

  1. name

This will be used as the text string when you query the name field of a wl_node.

The configuration file is also extensible so that users can add their own parameters that can be used to initial a wl_node as part of the wl_initNodes setup.

Configuration File Formatting Notes

  1. In the configuration file ',' (comma) and '\t' (tab) are reserved characters and will be interpreted as the next field when parsing the file. Putting in additional commas and tabs where not expected can result in an invalid file.
  1. All spaces, ie ' ', are valid and are not removed from the field.
  1. If you add in an optional field, then you must put the correct number of delimiters, ie ',', to indicate that fields are not used
  1. There should be no spaces in the field names of the header row

Example File

This example file specifies a set of nodes with IP addresses. To use this example, please update the file to use one line per WARP board and replace the serial number with the number that appears on your hardware.

serialNumber,	ID,	ipAddress,	name
W3-a-99997,	0,	10.0.0.25,	Transmit Node
W3-a-99998,	1,	10.0.0.26,	Receive Node 1
W3-a-99999,	2,	10.0.0.27,	Receive Node 2

Example Setup

  1. Make sure you have completed the Getting to Know the WARP v3 Hardware page so you are familiar with the WARP v3 hardware.
  1. Set the User IO dip switches to a value of all '1's (ie 0xF).
  1. Power on the board and download the appropriate bit stream. See Introduction to the Xilinx Software Development Kit (SDK) for an example of this.
  1. Once the board finishes its boot sequence, the Seven Segment Display on the board should read "--". Now the board is in a state where it is ready to receive commands from Matlab.
  1. Given you have a valid configuration file, from Matlab you can then execute the following lines to push the configuration information to the node:
nodesConfig = wl_nodesConfig('read', 'my_node_config_file.txt')
nodes = wl_initNodes(nodesConfig)
  1. If the update was successful, the Seven Segment Display on the board should now contain the ID number you assigned the node in the configuration file. Also, you should be able to ping the node using the IP address you assigned in the file.

Additional Questions and Feedback

If you have any additional questions about this exercise or other feedback, please post to the WARP Forums.