C/C++ example for SYSARY

 

#include "stdafx.h"

#include "DllFunc.h"

 

SYSARY_API void __cdecl request_usub

           (double time, double upar[], int npar, int iflag, double result[8])

{

           using namespace rd_syscall;

           // Parameter Information

           //   time   : Simulation time of RD/Solver. (Input)

           //   upar   : Parameters defined by user. (Input)

           //   npar   : Number of user parameters. (Input)

           //   iflag  : When RD/Solver initializes arrays, the flag is true. (Input)

           //   result : Returned values. (Output, Size : 8)

 

           // User Statement

  

   // Local variable definitions

 

   double VALUE[9];

   int mkid[4];

   int errflg;

 

   //Call SYSARY to collect information for Calculations

 

   sysary("ACC",mkid,3,VALUE,6,&errflg);

 

   //Assign the returned value to User Subroutine Request

 

   result[1] = VALUE[0];

   result[2] = VALUE[1];

   result[3] = VALUE[2];

   result[5] = VALUE[3];

   result[6] = VALUE[4];

   result[7] = VALUE[5];

 

}