[[TracNav(WARPLab7/TOC)]] = Nodes Config = The Nodes Config utility allows a user greater flexibility when specifying the configuration information of a [wiki:WARPLab7/Reference/Architecture/Classes#Node wl_node] as part of the [wiki:WARPLab7/Reference/Utility#wl_initNodes wl_initNodes] setup process. Please note that in order to use the wl_nodesConfig utility, the || [[Image(wiki:GettingStarted/files:important.png,nolink,valign=middle)]] || wl_nodesConfig only works with WARP v3 hardware and the [wiki:HardwareUsersGuides/WARPv3/UserIO dip switches] must have a value of all '1's (ie 0xF) || == wl_nodesConfig == File source: [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/wl_nodesConfig.m wl_nodesConfig.m] This function is the best way to create a [wiki:WARPLab7/Reference/Architecture/Classes#Node wl_node] information structure that can be used with [wiki:WARPLab7/Reference/Utility#wl_initNodes 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') }}} 2. '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 [wiki:WARPLab7/Reference/Utility#wl_initNodes 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. 2. '''ID''' This is the [wiki:WARPLab7/Reference/Architecture/Classes#Node wl_node] ID that should be used for the node. This node ID must be unique in the file. 3. '''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 [wiki:WARPLab7/Reference/Architecture/Classes#Node wl_node]. The configuration file is also extensible so that users can add their own parameters that can be used to initial a [wiki:WARPLab7/Reference/Architecture/Classes#Node wl_node] as part of the [wiki:WARPLab7/Reference/Utility#wl_initNodes 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. 2. All spaces, ie {{{' '}}}, are valid and are not removed from the field. 3. If you add in an optional field, then you must put the correct number of delimiters, ie {{{','}}}, to indicate that fields are not used 4. 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 == Coming soon ...