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

[TRNSYS-users] Calling external program from a new C++ Component



Title: Calling external program from a new C++ Component

Hi everybody,

I’m stuck with TRNSYS  v 16.1 , the part of the API that normally allow to call an external program (an exe written in c++) seems to not be supported by the C++ plugin (I can just create my  own component that will basically calculate the output from the input)

I mean the linker cant find the call  subroutine just like described in the programmers guide of the manual (part 8):

8.4.4.1. Calling External Programs

I know the example shown is for fortran but, in the file  ..\Trnsys16_1\SourceCode\Templates\CppType.cpp we have this at the line 133:

  //*** Call N ('normal' call)

That seems to be the function that allow me to call an external program, however there is no reference of that function in the TRNSYS.h, So Im being stuck with a linker problem.

What I want to do is to start a simulation in TRNSYS, then when it reach a certain component, TRNSYS will call a external program with data (in argument if possible)  and wait for it to finish, and then get back value from my program?

Unfortunately, TRNSYS doesnt seem to support Socket connection to exchange data. I see that type66 do it  (This routine calls a program called Engineering Equation Solver (EES)) with the data exchange protocol via the windows clipboard.

To resume:

So do I have to start over with the fortran plugin to be able to call external program?

Or do you know a other way to do what I want ?

And do you think I need to communicate through a file ?


Thanks a lot for your help.

Amine