Help required to generate a 32-bit FMU from Windows

183 views
Skip to first unread message

Archan Mudwel

unread,
May 19, 2020, 2:07:49 AM5/19/20
to energyplus-fmu
Hi Team,

In one of the projects we're having, we need to generate a 32-bit FMU from the Windows Environment. 
We have been successful in generating a 64-bit FMU, but can you help with some documentation/steps to generate a 32-bit FMU from Windows. Our guess it that it will include changing the paths to the compiler/linker in the Batch Files, but wanted to check if this process is documented somewhere?

The HIL tool that we're using works with only 32-bit versions of FMUs.

Thanks
Archan

Thierry Nouidui

unread,
May 19, 2020, 4:10:29 AM5/19/20
to Archan Mudwel, energyplus-fmu
You should look at Section 3.4  of the user guide
You basically need to adjust the path of your batch files so they can generate 32-bit binaries.

For instance in the release version of EnergyPlusToFMU in the compile-c.bat (located in Scripts\win),
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat will need to be changed to
to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat


--
You received this message because you are subscribed to the Google Groups "energyplus-fmu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/7e8a4528-09e7-47aa-a85a-07b171d4caae%40googlegroups.com.


--
Prof. Thierry Nouidui
Nouidui Consulting Group
https://nouidui.com/index.php/consulting/
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Archan Mudwel

unread,
May 21, 2020, 3:17:02 AM5/21/20
to energyplus-fmu
Thanks Prof. Nouidui,

We were successful in generating a 32-bit FMU. Our end goal is to have an HIL application where we're trying to use the FMU within the NI HIL Tool - NI VeriStand which supports FMI2.0 co-simulation.
I was unsuccessful in integrating the FMU within NI VeriStand. The FMU loads properly and shows me the inports and outports according to the model description file, but while executing it fails.

Hence, I thought of checking the FMU with a different environment to isolate the problem. Currently, I am trying to import the FMU within the E+ environment itself based on this link: https://energyplus.net/sites/all/modules/custom/nrel_custom/pdfs/pdfs_v9.3.0/ExternalInterfacesApplicationGuide.pdf

When I use the Energy Plus Parser to parse the FMU and get an idf file, it throws up an error (snapshot attached below) and I am confused as to why is it happening.
Can you please help me out here?

Just FYI: I have uploaded the FMU here in case you want to have a look: Google Drive Link

Regards
Archan

The FMU is a 32-bit FMU (I am attaching the FMU as well in case you want to have a look). This is based on the 3.0.0 version which is compatible with FMI 2.0.

Regards
Archan


On Tuesday, 19 May 2020 13:40:29 UTC+5:30, Thierry Nouidui wrote:
You should look at Section 3.4  of the user guide
You basically need to adjust the path of your batch files so they can generate 32-bit binaries.

For instance in the release version of EnergyPlusToFMU in the compile-c.bat (located in Scripts\win),
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat will need to be changed to
to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat


On Tue, May 19, 2020 at 9:07 AM Archan Mudwel <archan...@gmail.com> wrote:
Hi Team,

In one of the projects we're having, we need to generate a 32-bit FMU from the Windows Environment. 
We have been successful in generating a 64-bit FMU, but can you help with some documentation/steps to generate a 32-bit FMU from Windows. Our guess it that it will include changing the paths to the compiler/linker in the Batch Files, but wanted to check if this process is documented somewhere?

The HIL tool that we're using works with only 32-bit versions of FMUs.

Thanks
Archan

--
You received this message because you are subscribed to the Google Groups "energyplus-fmu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to energyp...@googlegroups.com.
Snapshot.png

Thierry Nouidui

unread,
May 21, 2020, 3:43:54 AM5/21/20
to Archan Mudwel, energyplus-fmu
Archan,

The FMU Parser of EnergyPlus is for FMU 1.0 only. Additionally, the FMI import interface of EnergyPlus supports FMI 1.0 for Co-Simulation only. Consequently, you can't import an FMU 2.0 in EnergyPlus or use the FMU Parser to parse an FMU 2.0.

To identify, the root of your problem, I suggest to test the FMU in PyFMI. 
This thread shows how you can call the primitive functions of PyFMI to execute an FMU 2.0.

Please be aware that EnergyPlus FMU requires a fixed synchronization time step which needs to be the same as the zone time step. I don't know whether the NI HIL tool is calling your EnergyPlus FMU at the IDF time step. 

Do you get any error message from the NI HIL tool when you run your FMU?

Thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/5b0ad72b-6f66-41bd-8396-c57b2b9ef02f%40googlegroups.com.

Archan Mudwel

unread,
May 21, 2020, 6:29:53 AM5/21/20
to Thierry Nouidui, energyplus-fmu
Hi Prof. Nouidui,

Thank you for all the information! At least now I can take my mind away from trying the parser.
I'll try to use the PyFMI to execute the FMU I have generated.

The NI tool is automatically detecting a Model Rate of 100Hz. However, by adding the tag "<DefaultExperiment stepSize="0.01"/>" in the model description file, I can change the rate that the tool takes up.

No error anything specific to the FMU, but talking to the NI R&D, they suggested the following troubleshooting steps:
"If it can be imported but not deployed then there's a few usual suspects:
  • the stepSize section is missing in the xml (detailed in the documentation)
  • the binary for the platform is not in the right place (win32 for example) or has a filename that doesn't match the FMUName in the xml
  • the dll is missing some dependencies so it fails to load. you can use dependency walker (you can find it online) to inspect other dlls that are needed"
I did manually add the stepsize section in the XML. I checked the placement of the binary (it is in the win32 folder) and verified the FMUName (although in the description file the model name is 
modelName="_fmu-export-actuator.idf"
whereas the model idf file that I see under the resources folder is _fmu_export_actuator. I don't suspect this may be causing an issue since I tried changing the names as well.

Regarding the 3rd step, I am yet to dig into the dependencies using the Dependency Walker.

Thanks
Archan

Thierry Nouidui

unread,
May 21, 2020, 7:51:56 AM5/21/20
to Archan Mudwel, energyplus-fmu
stepSize is an optional attribute in the xml file. I wonder how NI relies on such attribute.

EnergyPlus FMU step size varies from 1 min to 1 hour. Usually they are set to 15 min (900s). 
If the time step sets in your IDF is 4 (which represents 15 mins), you will have to add a stepSize of 900 in the DefaultExperiment tag.
This is my best guess since I have never used that tool.
I don't think you need to use dependency walker since EnergyPlus FMU comes with all needed libraries. The name of the FMU should also be fine. If the former were not met, you wouldn't have been able to load it at all.
Try to run the FMU with PyFMI and let me know how it goes.

Thanks

Melissa Baars

unread,
Jul 7, 2023, 8:04:43 AM7/7/23
to energyplus-fmu
Hi all, 

I am running into the same problem as mentioned above. I am currently trying to co-simulate Simulink and E+. I exported my Simulink model using the Simulink converter as a standalone fmu (version 2.0). However, when I try to use the EP FMU parser, I obtain the same error of "Illegal element Cosimulation", because of the wrong FMU version (2.0 instead of 1.0). 

Is there a way to export the Simulink model in a fmu version 1.0? 

Thank you in advance.

Kind regards,

Melissa

Op donderdag 21 mei 2020 om 13:51:56 UTC+2 schreef nouidui.c...@gmail.com:

Thierry Stephane Nouidui

unread,
Jul 10, 2023, 2:28:19 AM7/10/23
to energyplus-fmu, Melissa Baars
As you have correctly stated the EP FMU Parser does not support FMI 2.0. In addition to posting here, I suggest contacting the developer of the Simulink converter to see if they can export FMI 1.0 as well.
You may also want to check this page that lists the tools that support FMI https://fmi-standard.org/tools/
The site seems to indicate that Matlab/Simulink supports the export of FMI 1.0 for co-simulation. I am however not sure whether the Simulink converter you are referring to is from Mathworks.

Thanks!

Am Freitag, 7. Juli 2023 um 15:04:47 GMT+3 hat Melissa Baars <meliss...@live.nl> Folgendes geschrieben:


Melissa Baars

unread,
Jul 10, 2023, 3:53:06 AM7/10/23
to energyplus-fmu
I see that I made a mistake, the tool that I am using is called the Simulink Compiler (https://nl.mathworks.com/products/simulink-compiler.html ), which is from Mathworks

Op maandag 10 juli 2023 om 08:28:19 UTC+2 schreef Thierry Stephane Nouidui:
Reply all
Reply to author
Forward
0 new messages