WinProp API Rural Propagation

Fernando Martinez
Fernando Martinez New Altair Community Member
edited October 2020 in Community Q&A

I was able to successfully follow the WinPropScriptingAPIReferenceGuide.Pdf and run the outdoor_propagation located in C:\Users\USER\Altair\2019_server\feko\api\winprop\examples. 

What I am trying to figure out is how to use the API to calculate a rural path-loss propagation. 
I've attached my code as a reference: 

 

    int                 Error = 0;
    WinProp_ParaMain    GeneralParameters;
    WinProp_ParaRural    RuralParameters;
    WinProp_Antenna     Antenna;
    WinProp_Callback    Callback;
    WinProp_Result      Resultmatrix;
    WinProp_RayMatrix   RayMatrix;

    char* my_tdb_database = API_DATA_FOLDER 'Perimeter_Topo_DB.tdb'; // name of .tdb database without extensions 

    /* ------------------------ Initialization of parameters ----------------------*/
    WinProp_Structure_Init_ParameterMain(&GeneralParameters);
    WinProp_Structure_Init_Antenna(&Antenna);
    WinProp_Structure_Init_Result(&Resultmatrix);
    WinProp_Structure_Init_RayMatrix(&RayMatrix);

    /*---------------- Definition of scenario -------------------------------------*/
    /* Definition of general parameters. */
    GeneralParameters.ScenarioMode = SCENARIOMODE_RURAL; // Rural prediction
    GeneralParameters.PredictionModelRural = PREDMODEL_RURAL_RDP; // Use Dominant Path Model

    /* Definition of prediction area. */
    GeneralParameters.RuralLowerLeftX = -102;
    GeneralParameters.RuralLowerLeftY = 30;
    GeneralParameters.RuralUpperRightX = -100;
    GeneralParameters.RuralUpperRightY = 31;

    /* Size of matrix with results. */
    GeneralParameters.Resolution = 100; // Resolution in meters
    GeneralParameters.MatrixFormat = MATRIXFORMAT_DEFAULT;
    GeneralParameters.MatrixWidth = (int)((GeneralParameters.RuralUpperRightX - GeneralParameters.RuralLowerLeftX) / GeneralParameters.Resolution + 1.0);
    GeneralParameters.MatrixHeight = (int)((GeneralParameters.RuralUpperRightY - GeneralParameters.RuralLowerLeftY) / GeneralParameters.Resolution + 1.0);
    GeneralParameters.PredictionHeight = 1.5; // Prediction height in meter

    GeneralParameters.BreakpointMode = BREAKPOINT_FIXED;
    GeneralParameters.BreakpointDistance = 12.56637;

    /* Building topography data. */
    GeneralParameters.TopographyMode = TOPOMODE_SEPARATE; // Consider Topography from separate file
    sprintf(GeneralParameters.TopographyName, '%s', my_tdb_database); // Topography database in WinProp format
    GeneralParameters.TopographyHeightMode = 1; // Topography database includes buildings (0) or not (1)
    
    /* Specifying Rural Parameters as needed */
    RuralParameters.KnifeEdge = KE_OFF; // Not considered
    RuralParameters.HataSubMode = HATA_SUB_OPEN; // Open area
    

    /*----------------------------- Definition of antenna ---------------------------------------------*/
    /* Position and configuration. */
    Antenna.Longitude_X = -101;
    Antenna.Latitude_Y = 30.5;
    Antenna.Height = 8.0;
    Antenna.Power = 30.0; // Power in dBm, 1 W = 30 dBm
    Antenna.Frequency = 900.0; // Frequency in MHz
    Antenna.Model = WINPROP_MODEL_DPM; // Wave propagation model used
    Antenna.DataType = PROP_RESULT_PATHLOSS; // Type of result to be computed
    Antenna.Name = 'BuildingAntenna';

    /*-------------------------- Callbacks --------------------------------------------------*/
    Callback.Percentage = CallbackProgress; // Function pointer to function called for progress bar update
    Callback.Message = CallbackMessage; // Function pointer to function called for message output
    Callback.Error = CallbackError; // Function pointer to function called for error output

    /*--------------------------- Compute outdoor prediction --------------------------------*/
    Error = OutdoorPlugIn_ComputePrediction(&Antenna, &GeneralParameters, NULL, NULL, &RuralParameters, NULL, &Callback, &Resultmatrix, &RayMatrix, NULL);
    // Returns 0 = success, 1 = failure

 

............ The rest of the code is essentially from the example cpp file provided from the API. 

 

Visual Studio produces the following error when debugging: Exception thrown at 0x00007FF954B7335C (ucrtbase.dll) in SiteCoverage_debug.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.  the Error = OutdoorPlugin_ComputePrediction line bolded in the code posted above. 

Again, I was able to run the initial example just fine. Is there something I'm missing or specifying incorrectly that does not allow me to compute a path-loss propogation from a topography database (.tdb) and my antenna? 

Tagged:

Answers

  • Mel
    Mel Altair Community Member
    edited July 2020

    Please post your query in the Winprop forum here.