Changes between Version 3 and Version 4 of WARPLab/Porting


Ignore:
Timestamp:
May 19, 2013, 8:17:02 PM (11 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPLab/Porting

    v3 v4  
    33= WARPLab 7: Porting Code from old WARPLab =
    44Coming soon... For now see the new [wiki:../Examples WARPLab 7 examples]
     5
     6----
     7'''Initialization''': WARPLab 7 provides a utility script [wiki:../Reference/Utility#wl_initNodes wl_initNodes] which simplifies the process of establishing a connection from MATLAB to multiple WARP nodes running the WARPLab reference design. The array returned by {{{wl_initNodes}}} replaces the individual socket handles used in WARPLab 6.
     8
     9{{{#!html
     10<table border=1 width=600><tr valign=top><td width=50% align=left>
     11}}}
     12
     13{{{
     14%WARPLab 6
     15warplab_defines
     16[socketHandles, packetNum] = warplab_initialize(2);
     17udp_Sync = socketHandles(1);
     18udp_node1 = socketHandles(2);
     19udp_node2 = socketHandles(3);
     20}}}
     21
     22{{{#!html
     23</td><td width=50% align=left>
     24}}}
     25
     26{{{
     27%WARPLab 7
     28nodes = wl_initNodes(2);
     29[RFA, RFB] = wl_getInterfaceIDs(nodes(1));
     30}}}
     31
     32{{{#!html
     33</td></tr></table>
     34}}}
     35
     36----
     37'''Setting Parameters''': WARPLab 7 enables setting the same RF and baseband parameters as previous versions. However the syntax for sending commands to nodes has changed. The new syntax allows the same command to be sent to multiple nodes in one line. Each node can be assigned the same parameter value, or multiple values (one per node) can be passed as an array argument. The example below shows equivalent code for setting a few parameters for two nodes.
     38
     39{{{#!html
     40<table border=1 width=600><tr valign=top><td width=50% align=left>
     41}}}
     42
     43{{{
     44%WARPLab 6
     45warplab_writeRegister(udp_node1, TX_DELAY, 0);
     46warplab_writeRegister(udp_node1, TX_LENGTH, 2^14);
     47
     48warplab_writeRegister(udp_node2, TX_DELAY, 0);
     49warplab_writeRegister(udp_node2, TX_LENGTH, 2^14);
     50
     51warplab_setRadioParameter(udp_node1, CARRIER_CHANNEL, 11);
     52warplab_setRadioParameter(udp_node2, CARRIER_CHANNEL, 11);
     53}}}
     54
     55{{{#!html
     56</td><td width=50% align=left>
     57}}}
     58
     59{{{
     60%WARPLab 7
     61wl_basebandCmd(nodes, 'tx_delay', 0);
     62wl_basebandCmd(nodes, 'tx_length', 2^14);
     63wl_interfaceCmd(nodes, 'RF_ALL', 'channel', 2.4, 11);
     64}}}
     65
     66{{{#!html
     67</td></tr></table>
     68}}}
     69