Applicable VersionsNetSim StandardNetSim Pro


To print the Received power and BER along with other parameters such as Packet ID, Transmitter ID, Receiver ID, Received Power, and Simulation Time in NetSim console, follow the steps given below:


STEP 1: Open  function fn_NetSim_IEEE802_11_PhyIn() present in IEEE802_11_P.c file inside IEEE802_11 project


STEP 2:  Inside the function fn_NetSim_IEEE802_11_PhyIn(), add the following code as per the screenshot given below:


fprintf(stderr, "\nPACKET ID: %d\nTX ID: %d\nRX ID: %d\nRX POWER(dBm): %f\nBER: %f\nTIME(Micro Sec): %f\n",
packet->nPacketId, packet->nTransmitterId, pstruEventDetails->nDeviceId,
dReceivedPower, ber,pstruEventDetails->dEventTime);
_getch(); //optional


In NetSim v13.0,use the following lines of code:

fprintf(stderr, "\nPACKET ID: %d\nTX ID: %d\nRX ID: %d\nRX POWER(dBm): %f\nBER: %f\nTIME(Micro Sec): %f\n", packet->nPacketId, packet->nTransmitterId, 
    pstruEventDetails->nDeviceId, pdbm, ber, pstruEventDetails->dEventTime);
  _getch(); //optional




STEP 3: After the source code is modified, rebuild IEEE802_11 module and replace the newly built libIEEE802.11.dll file in the bin folder of NetSim after renaming the original libIEEE802.11.dll file to say, libIEEE802.11_original.dll as a backup


STEP 4: Create a simple network scenario in which involves WLAN/IEEE802.11. Following is an example:


Upon running the simulation the parameters such as Packet ID, Transmitter ID, Receiver ID, Received Power, BER and Simulation Time will get printed to the simulation console, for each packet as shown below: