Changes between Version 4 and Version 5 of WARPLab/Porting


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

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPLab/Porting

    v4 v5  
    1313{{{
    1414%WARPLab 6
     15
     16%Load the many global variables for the framework
    1517warplab_defines
     18
     19%Initialize two WARP nodes
    1620[socketHandles, packetNum] = warplab_initialize(2);
     21
     22%Retrieve socket handles for the trigger and both nodes
    1723udp_Sync = socketHandles(1);
    1824udp_node1 = socketHandles(2);
     
    2632{{{
    2733%WARPLab 7
     34
     35%Initialize two WARP nodes
    2836nodes = wl_initNodes(2);
     37
     38%Retrieve IDs for available RF interfaces
    2939[RFA, RFB] = wl_getInterfaceIDs(nodes(1));
     40
     41%Create an Ethernet trigger and assign it to both nodes
     42eth_trig = wl_trigger_eth_udp_broadcast;
     43wl_triggerManagerCmd(nodes, 'add_ethernet_trigger', eth_trig);
     44
    3045}}}
    3146
     
    6883}}}
    6984
     85----
     86'''Writing Samples''': 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.
     87
     88{{{#!html
     89<table border=1 width=600><tr valign=top><td width=50% align=left>
     90}}}
     91
     92{{{
     93%WARPLab 6
     94
     95%Time vector (assumes 40MHz sampling rate)
     96t = (1/40e6) .* [0 : 2^14-1];
     97
     98%Generate a 1MHz sinusoid
     99txSigA = exp(1i*2*pi*t*1e6);
     100
     101%Generate a 2MHz sinusoid
     102txSigB = exp(1i*2*pi*t*2e6);
     103
     104%Write the two signals to RF A and B on both nodes
     105warplab_writeSMWO(udp_node1, RADIO2_TXDATA, txSigA);
     106warplab_writeSMWO(udp_node1, RADIO3_TXDATA, txSigB);
     107warplab_writeSMWO(udp_node2, RADIO2_TXDATA, txSigA);
     108warplab_writeSMWO(udp_node2, RADIO3_TXDATA, txSigB);
     109}}}
     110
     111{{{#!html
     112</td><td width=50% align=left>
     113}}}
     114
     115{{{
     116%WARPLab 7
     117
     118%Time vector (assumes 40MHz sampling rate)
     119t = (1/40e6) .* [0 : 2^14-1];
     120
     121%Generate a 1MHz sinusoid
     122txSigA = exp(1i*2*pi*t*1e6);
     123
     124%Generate a 2MHz sinusoid
     125txSigB = exp(1i*2*pi*t*2e6);
     126
     127%Write the two signals to RF A and B on both nodes
     128% Use vector arguments for interface selection and per-interface signals
     129wl_basebandCmd(nodes, [RFA RFB], 'write_IQ', [txSigA txSigB]);
     130
     131}}}
     132
     133{{{#!html
     134</td></tr></table>
     135}}}
     136
     137