CATIA-Systems / FMPy

Simulate Functional Mockup Units (FMUs) in Python
Other
429 stars 118 forks source link

Pipe Init Failed. Error Code: 231 #639

Open K3ik3i opened 8 months ago

K3ik3i commented 8 months ago

Hello.

I am simulation a FMU which works with windows clock. When i load FMU and do instantiate, i meet below error.

[ERROR] fmi2Instantiate: Pipe Init Failed. Error Code: 231

Where the error occurred is, fmuins = instantiate_fmu(unzipdir=unzipdir, model_description=md)

And the terminal log is as below. [OK] fmi2Instantiate: init [OK] fmi2Instantiate: set startValues [OK] zsBuffer=D:\kk\CodingArea [OK] szPath=C:\Users\Administrator\AppData\Roaming [OK] vECUPath=C:\Users\Administrator\AppData\p4_vecu_sbw_cyt2b.fmu\binaries\win32\p4_vecu_sbw_cyt2b.exe [OK] vECUDir=C:\Users\Administrator\AppData\p4_vecu_sbw_cyt2b.fmu\binaries\win32 [OK] startExternal(). [OK] CreateProcess failed(). [ERROR] fmi2Instantiate: Pipe Init Failed. Error Code: 231

Does anyone knows what's causing it?

t-sommer commented 8 months ago

Can you share the FMU?

K3ik3i commented 8 months ago

@t-sommer Sorry i cannot share because this FMU is possession of company. Can you share some hypothesis without FMU?

t-sommer commented 8 months ago

Does unzipdir contain the file binaries/win32/p4_vecu_sbw_cyt2b.exe?

K3ik3i commented 8 months ago

@t-sommer Thanks, the reason was path in the unzipdir is different from path FMU wrapper set. Can i change the path for the extractAPI? unzipdir = extract(fmu1)

t-sommer commented 8 months ago

You can pass the extracted FMU to simulate_fmu():

from fmpy import *

unzipdir = extract('p4_vecu_sbw_cyt2b.fmu')

result = simulate_fmu(unzipdir)