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

Re: [TRNSYS-users] Error using getLabel-function in C++ type



Dear Gernot,

I cannot help you about C++ because we use to develop components in Fortran. However, if there is a problem with GetLabel function in C++, why not use a text file to communicate the IP Address? 

Best regards,

Marcello Caciolo
Responsable Outils et Méthodes d'Analyse Energétique


Cellule Efficacité Energétique et Environnementale - Pôle Projets et Réalisations
46 Boulevard de la Prairie au Duc
BP 40119 - 44201 Nantes Cedex 02
Tél.: +33 02 40 41 06 57
marcello.caciolo@cofelyaxima-gdfsuez.com
Pensez à l'environnement avant d'imprimer ce message





-----Message d'origine-----
De : trnsys-users-bounces@cae.wisc.edu [mailto:trnsys-users-bounces@cae.wisc.edu] De la part de g-steindl@gmx.at
Envoyé : mardi 24 septembre 2013 09:29
À : trnsys-users@cae.wisc.edu
Objet : [TRNSYS-users] Error using getLabel-function in C++ type

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
_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@cae.wisc.edu
https://mailman.cae.wisc.edu/listinfo/trnsys-users