[TRNSYS-users] Integrate Python with TRNSYS ?

Michaël Kummert michael.kummert at polymtl.ca
Wed Dec 14 17:47:36 PST 2022


The problem has been solved, but in case other users are facing the same puzzling error message about Type 3157 (Type not found or not linked correctly), the most probable causes are:

*	Trying to use Type3157 with a 32-bit TRNSYS version (this is not supported and does not work)
*	Trying to use Type3157 with TRNSYS 17 or a TRNSYS 18 release older than 18.4 (again, this will not work). The version number is printed at the top of the log file with error messages, and in the About box in the Studio (at the bottom of the window).

This is of course assuming that the setup was completed correctly, and that the “PythonInterfaceTester” program detects no other configuration problems.

 

Type 3157 (Calling Python from TRNSYS with CFFI) is available on Zenodo: https://doi.org/10.5281/zenodo.6523078

 

Michaël Kummert

Polytechnique Montréal

 

From: Amirreza Heidari via TRNSYS-users <trnsys-users at lists.onebuilding.org> 
Sent: December 13, 2022 08:46
To: TRNSYS users mailing list at OneBuilding.org <TRNSYS-users at lists.onebuilding.org>
Cc: Amirreza Heidari <amirrezaheidarysbu at gmail.com>
Subject: [TRNSYS-users] Integrate Python with TRNSYS ?

 

Hello,

I have programmed a controller in Python and I need to link it to TRNSYS to control other components. Type 169 does not work at all. So I am trying to use type 163. But the problem is that when I import external libraries in my Python code, the type 163 does not update the py_outputs.dat anymore! How I can use a Python script that include external libraries in type 163? For example the following code works when the pandas and numpy libraries are not included, but with the two first lines it does not work anymore...

 

 

 

I also tried to install the type 3157 that is new and apparently allows the use of external libraries, but when I run the example I get the following error.

 



 

Anyway to do it?

                                                                                                                         

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20221214/e76398c5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 58449 bytes
Desc: not available
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20221214/e76398c5/attachment-0001.png>


More information about the TRNSYS-users mailing list