[TRNSYS-users] Error using getLabel-function in C++ type
g-steindl at gmx.at
g-steindl at gmx.at
Tue Sep 24 00:29:01 PDT 2013
Hello everyone,
I’ve searched the Mailing list but I didn't find a satisfying answer.
I am writing a type which is communicating over a TCP-Socket with another software.
I wrote that Type in C++ and I have to say, it wasn’t that difficult. But now I need a possibility to hand over the IP-Address as String.
My first attempt was to use a String parameter. But as I read here this is not possible, because a parameter intend to be numerical. (I am confused why it is possible to select the String as parameter type ?).
Now I am trying to use Labels. The Problem is that I get an error when I call the getLabel-Function: “Access violation at address … in module ‘DFORRT.dll’. Write of address 0000017”
I read here that I have to change the declaration in trnsys.h into TRNSYSFUNCTIONS_mp_GETLABEL(int*, int*) instead of TRNSYSFUNCTIONS_mp_GETLABEL(int, int). But that is also not working! Then I found the hint to write my own getLabel-Function in the TRNDLL to avoid using return values.
Know I am confused! Why is this function in the trnsys.h, if it is not working?
Maybe there is a simpler way to pass a String into a Type written in C++? I’ve never used Fortran before and I have no idea how to use sockets in Fortran. So I’d like to avoid learning a new programing language, especially because the rest of the component is working!
Regards,
Gernot
By the way: I am using TRNSYS 17
More information about the TRNSYS-users
mailing list