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 ---
- To: trnsys-users@engr.wisc.edu
- Subject: [TRNSYS-users] Forcing unit call
- From: Krishna <krishna@cdhenergy.com>
- Date: Wed, 10 Aug 2005 04:19:48 +0700
- Message: 1
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 ---
- To: Krishna <krishna@cdhenergy.com>
- Subject: Re: [TRNSYS-users] Forcing unit call
- From: Jeff Thornton <thornton@tess-inc.com>
- Date: Wed, 10 Aug 2005 07:20:04 +0700
- Cc: trnsys-users@engr.wisc.edu
- In-reply-to: <005501c59d28$12c85a20$1900000a@Sim>
- Message: <005501c59d28$12c85a20$1900000a@Sim>
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 ---
- To: javier mota <fjmi_3i@hotmail.com>, trnsys-users@engr.wisc.edu
- Subject: Re: [TRNSYS-users] (no subject)
- From: Yoshihiro Yamaguchi <yamaguti@alpha-net.ne.jp>
- Date: Wed, 10 Aug 2005 10:04:38 +0700
- In-reply-to: <BAY106-F3007528BAA4D3B8E7144AFC2BB0@phx.gbl>
- Message: <BAY106-F3007528BAA4D3B8E7144AFC2BB0@phx.gbl>
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 ---
- To: trnsys-users@engr.wisc.edu
- Subject: [TRNSYS-users] functions get.. type char
- From: javier mota <fjmi_3i@hotmail.com>
- Date: Wed, 10 Aug 2005 14:58:13 +0700
- Message: 4
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 ---
- To: javier mota <fjmi_3i@hotmail.com>, trnsys-users@engr.wisc.edu
- Subject: Re: [TRNSYS-users] functions get.. type char
- From: Yoshihiro Yamaguchi <yamaguti@alpha-net.ne.jp>
- Date: Wed, 10 Aug 2005 15:59:08 +0700
- In-reply-to: <BAY106-F26AA7E8039857D90B8C20DC2BA0@phx.gbl>
- Message: <BAY106-F26AA7E8039857D90B8C20DC2BA0@phx.gbl>
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