CATIA-Systems / FMPy

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

Set structural parameters in Configuration Mode #669

Open t-sommer opened 5 months ago

t-sommer commented 5 months ago

The following code

from fmpy import *

simulate_fmu('StateSpace.fmu', start_values={'r': 4}, fmi_call_logger=print)

gives

fmi3InstantiateCoSimulation(instanceName="StateSpace", instantiationToken="{D773325B-AB94-4630-BF85-643EB24FCB78}", resourcePath="C:\Users\xxx\AppData\Local\Temp\tmp5nso4c_u\resources\", visible=False, loggingOn=False, eventModeUsed=False, earlyReturnAllowed=False, requiredIntermediateVariables=NULL, nRequiredIntermediateVariables=0, instanceEnvironment=0x0, logMessage=<CFunctionType object at 0x000002DFC2B1BED0>, intermediateUpdate=<CFunctionType object at 0x000002DFC2B34040>) -> 0x2dfc1f29cd0
[ERROR] Structural variables can only be set in Configuration Mode or Reconfiguration Mode.
fmi3SetUInt64(instance=0x2dfc1f29cd0, valueReferences=[3], nValueReferences=1, values=[4], nValues=1) -> ERROR