[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calliung functions from dll by type 61



Hi Werner

I have a c++ dll with four exportable functions. So this dll don't have any argumets but the functions do have the arguments. So here name of the dll and the name of the functions are different.

Let the name of the dll is EXTDLL.dll and the functions are

initiate_SOFCSystem(double * param, double * input, int debug_flag);
kill_SOFCSystem();
operation_GasNode_SOFC( const double* time , double * input, double * output);
operation_WaterNode_SOFC( const double* time , double * input, double * output);

Now if I want to call these functions from type61, what should I writre between the interface?

Best regards

Werner Keilholz schrieb:


Hi Selim,

In TRNSYS 15 you can have only one external user- DLL (TRNSYS 16 will
allow any number).

If you need to call more than one, I would recommend to use Parameter 1 of
type 61as a 'mode' indicator.

In your DLL, you can then simply write something like

if (par[0]==1)
function1(...);
else if (par[0]==2) function2(...);
else if (par[0]==3) function3(...);
else if (par[0]==4) function4(...);
else printf("Unknown mode: %d", par[0]);

Werner

Selim Ullah wrote:



Halloo TRNSYS users

I have c++ dll with four exportable functions. To call these functions
by type 61 what should I change in the type 61 routine?

Can anybody help with example?

Thanks in advance

Selim