root/ResearchApps/PHY/WARPLAB/WARPLab_SISO_MIMO2x2/M_Code/warplab_siso_GUIinitialize.m
| Revision 844, 2.0 kB (checked in by MelissaDuarte, 4 months ago) |
|---|
| Line | |
|---|---|
| 1 | |
| 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 | % Start of Code to avoid conflict between users, only needed for the |
| 4 | % workshop |
| 5 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6 | % fid = fopen('c:\boards_lock.txt'); |
| 7 | % |
| 8 | % if(fid > -1) |
| 9 | % fclose('all'); |
| 10 | % errordlg('Boards already in use - Please try again!'); |
| 11 | % okToUseBoards = 0; |
| 12 | % return; |
| 13 | % end |
| 14 | % |
| 15 | % !echo > c:\boards_lock.txt |
| 16 | % okToUseBoards = 1; |
| 17 | |
| 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 19 | % End of Code to avoid conflict between users, only needed for the |
| 20 | % workshop |
| 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 22 | |
| 23 | % Create arp entry for magic sync |
| 24 | !arp -s 10.0.0.244 ff-ff-ff-ff-ff-ff 10.0.0.200 |
| 25 | |
| 26 | %Close any stale sockets before trying to create new ones |
| 27 | pnet('closeall'); |
| 28 | |
| 29 | %Load some global definitions (packet types, etc.) |
| 30 | warplab_siso_GUIdefines; |
| 31 | |
| 32 | %Initial packet number |
| 33 | warplab_sisoGUI.pktNoTx = 1; |
| 34 | |
| 35 | %Define nodes |
| 36 | warplab_sisoGUI.nodes = [1:2]; |
| 37 | |
| 38 | %Define the nodes' IP addresses & UDP ports |
| 39 | % The IP address and UDP port ranges must match those hardc-coded in the FPGA |
| 40 | warplab_sisoGUI.IPAddrs = warplab_IP2int('10.0.0.0') + warplab_sisoGUI.nodes; |
| 41 | warplab_sisoGUI.UDP_Ports = 9000 + warplab_sisoGUI.nodes-1; |
| 42 | |
| 43 | %Define the magic SYNC address; this must match the address hard-coded in the FPGA |
| 44 | warplab_sisoGUI.MagicSyncAddr = '10.0.0.244'; |
| 45 | |
| 46 | warplab_sisoGUI.socketHandles = warplab_initNets(warplab_sisoGUI.MagicSyncAddr, warplab_sisoGUI.IPAddrs, warplab_sisoGUI.UDP_Ports); |
| 47 | |
| 48 | %Initialize the individual nodes |
| 49 | warplab_initNodes(warplab_sisoGUI.socketHandles); |
| 50 | |
| 51 | %Separate the socket handles for easier access |
| 52 | % The first socket handle is always the magic SYNC |
| 53 | % The rest can be arranged in any combination of Tx and Rx |
| 54 | warplab_sisoGUI.udp_Sync = warplab_sisoGUI.socketHandles(1); |
| 55 | warplab_sisoGUI.udp_Tx = warplab_sisoGUI.socketHandles(2); |
| 56 | warplab_sisoGUI.udp_RxA = warplab_sisoGUI.socketHandles(3); |
Note: See TracBrowser
for help on using the browser.