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

[TRNSYS-users] Error using getLabel-function in a new C++ type



Hello everyone,
 
I’ve searched the Mailing list but I didn't find a satisfying answer.
 
I am using TRNSYS just for a few days now. I am not really using it, but I have to write 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. Till now it was hard coded.
 
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