| 59 | |
| 60 | This function is the best way to create [wiki:WARPLab7/Reference/Architecture/Classes#Node wl_node] objects and have them configured to communicate with WARP nodes in your network. There are two ways of calling wl_initNodes: |
| 61 | |
| 62 | 1. Single Argument |
| 63 | |
| 64 | Let {{{N}}} represent the number of nodes in the network. Then, |
| 65 | |
| 66 | {{{ |
| 67 | nodes = wl_initNodes(N) |
| 68 | }}} |
| 69 | will create a vector of {{{N}}} wl_node objects in the variable {{{nodes}}} |
| 70 | |
| 71 | 2. Double Argument |
| 72 | |
| 73 | An optional second argument can be provided to assign specific node IDs to the created wl_node objects. |
| 74 | |
| 75 | {{{ |
| 76 | nodes = wl_initNodes(N, 0:(N-1)) |
| 77 | }}} |
| 78 | results in precisely the same vector of wl_node objects as the single argument case. However, the optional second argument can be changed to an other vector of IDs to speak to boards configured with those IDs on their DIP switches. |