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

[TRNSYS-users] TRNSYS-users Digest, Vol 8, Issue 9



Send TRNSYS-users mailing list submissions to
	trnsys-users@engr.wisc.edu

To subscribe or unsubscribe via the World Wide Web, visit
	https://www.cae.wisc.edu/mailman/listinfo/trnsys-users
or, via email, send a message with subject or body 'help' to
	trnsys-users-request@engr.wisc.edu

You can reach the person managing the list at
	trnsys-users-owner@engr.wisc.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of TRNSYS-users digest..."

Today's Topics:

   1. Forcing unit call (Krishna)
   2. Re: Forcing unit call (Jeff Thornton)
   3. Re: (no subject) (Yoshihiro Yamaguchi)
   4. functions  get.. type char (javier mota)
   5. Re: functions  get.. type char (Yoshihiro Yamaguchi)
--- Begin Message ---
Could anyone please let me know if it is possible to force a unit to be
called at every iteration in a time step irrespective of weather its inputs
have converged.
Thank you,
Krishna

--- End Message ---
--- Begin Message ---
At 04:19 PM 8/9/2005, you wrote:



Could anyone please let me know if it is possible to force a unit to be
called at every iteration in a time step irrespective of weather its inputs
have converged.


Simply set INFO(9) for that component to 1 and it will be called at least
once per timestep - even if it's inputs have not changed between timesteps.
It will however not be called at every iteration within a timestep and I
cannot foresee a reason why you would need this feature.  By definition, if
the inputs are not changing, and TIME is not changing then the OUTPUTS
cannot change!  If you are worried about watching a small value that is an
input (like humidity ratio) and small changes are not caught by the
tolerances check, then simply multiply the output value that is connected to
this input by 1000 with an equation and divide by 1000 within your code.

Oz



****************************************************************************
*****
Thermal Energy System Specialists (TESS)
Jeff Thornton                                       2916 Marketplace Drive
Principal                                           Suite 104
Phone:  (608) 274-2577                    Madison WI 53719
Fax:  (608) 278-1475                               USA
E-mail:   thornton@tess-inc.com                  
Web Page:        www.tess-inc.com <http://www.tess-inc.com/> 

"Providing software solutions for today's energy engineering projects"
****************************************************************************
*****



--- End Message ---
--- Begin Message ---
Dear Javier,

As I checked declarations of Trnsys.h, functions, which require
some arguments, have errors in the declarations.

For example,

In Trnsys.h,

extern "C" __declspec(dllimport) char* _cdecl
TRNSYSFUNCTIONS_mp_GETLABEL(int, int);

should be replaced as below.

extern "C" __declspec(dllimport) char* _cdecl
TRNSYSFUNCTIONS_mp_GETLABEL(int*, int*);

If you want to use the function, you have to use like below.

int arg1 = 1;
int arg2 = 2;
TRNSYSFUNCTIONS_mp_GETLABEL( &arg1, &arg2 );

If you changed some compiler options, it is different.

And, 'C++ bool' has no compatiblity with 'Fortran logical'.

In the case of logicalUnitIsOpen,
You should rewrite the definition like below.

extern "C" __declspec(dllimport) char	_cdecl
TRNSYSFUNCTIONS_mp_LOGICALUNITISOPEN(int*);

-1 means 'true', on the other hand, 0 means 'false'.

Yoshihiro

> Dear all;I ?m javier Mota from 3i,Madrid
> I am trying to use Access functions in type programmed by me.
> The problem is that when I call a function like getDeckFileName or others 
> function with get...
> TRNSYS shows mw an error which says "error aceess violation...".But when I

> build the dll all look OK.
> What may be the problem.Must I configure something in an special way.
> Thank you in advance.
> 

=====================================
  Yoshihiro Yamaguchi    ?????  
  yamaguti@alpha-net.ne.jp
=====================================



--- End Message ---
--- Begin Message ---
Dear all:
I?m Javier mota from 3i, Madrid;once more.
I have a problem with the functions get… which returns a character type like

(e.g. getDeckFileName).
I am using trnsys16 and I would like use this functions in c++

I have among other lines in Trnsys.h

extern "C" __declspec(dllimport) char*_cdecl  
TRNSYSFUNCTIONS_mp_GETDECKFILENAME(void);
and
#define getDeckFileName	TRNSYSFUNCTIONS_mp_GETDECKFILENAME

and in TRNSYSFUNCTIONS.f90 something like

function getTrnsysInputFileDir()
    !dec$ attributes dllexport, c, reference, nomixed_str_len_arg :: 
getTrnsysInputFileDir
    !dec$ attributes alias:"TRNSYSFUNCTIONS_mp_GETTRNSYSINPUTFILEDIR", 
decorate :: getTrnsysInputFileDir
    use TrnsysData
    character (len=maxPathLength) :: getTrnsysInputFileDir
    getTrnsysInputFileDir = TrnsysInputFileDir
end function getTrnsysInputFileDir

so I write in my program:
char *gg;
gg= getTrnsysInputFileDir();


I don?t have problem in making dll but when I run the program in trnys I get

an access violation error
You mus be sure I would like solve this problem,
Thank you

_________________________________________________________________
M?viles, DVD, c?maras digitales, coleccionismo... Con unas ofertas que ni te

imaginas. http://www.msn.es/Subastas/



--- End Message ---
--- Begin Message ---
Dear Javier,

I am trying to write trnsys16 components in C++.
But, there are a few problem, as far as I see.

In your case, I think C++ runtime library, which is linked with
your DLL, is inconsistent with that of trnlib.dll.

Try to do followings,

- Recompile trnlib.dll with release mode.
(The problem in debug mode is trnlib.dll is linking both msvcrt.dll 
and msvcrtd.dll.  It is not good.  I could not fix the conflict for now.)
- In your DLL project, change the compile option like the attached png
file.  ( you don't care where it is release or debug mode ).

It worked at least in my environment.  

Good luck.

Yoshihiro

> Dear all:
> I?m Javier mota from 3i, Madrid;once more.
> I have a problem with the functions getwhich returns a character type
like 
> (e.g. getDeckFileName).
> I am using trnsys16 and I would like use this functions in c++
> 
> I have among other lines in Trnsys.h
> 
> extern "C" __declspec(dllimport) char*_cdecl  
> TRNSYSFUNCTIONS_mp_GETDECKFILENAME(void);
> and
> #define getDeckFileName	TRNSYSFUNCTIONS_mp_GETDECKFILENAME
> 
> and in TRNSYSFUNCTIONS.f90 something like
> 
> function getTrnsysInputFileDir()
>     !dec$ attributes dllexport, c, reference, nomixed_str_len_arg :: 
> getTrnsysInputFileDir
>     !dec$ attributes alias:"TRNSYSFUNCTIONS_mp_GETTRNSYSINPUTFILEDIR", 
> decorate :: getTrnsysInputFileDir
>     use TrnsysData
>     character (len=maxPathLength) :: getTrnsysInputFileDir
>     getTrnsysInputFileDir = TrnsysInputFileDir
> end function getTrnsysInputFileDir
> 
> so I write in my program:
> char *gg;
> gg= getTrnsysInputFileDir();
> 
> 
> I don?t have problem in making dll but when I run the program in trnys I
get 
> an access violation error
> You mus be sure I would like solve this problem,
> Thank you

=====================================
  Yoshihiro Yamaguchi    ?????  
  yamaguti@alpha-net.ne.jp
=====================================

Attachment: setting.PNG
Description: PNG image


--- End Message ---
_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@engr.wisc.edu
https://www.cae.wisc.edu/mailman/listinfo/trnsys-users