diff --git a/fmpy/simulation.py b/fmpy/simulation.py index b2ce6762..f3cfad08 100644 --- a/fmpy/simulation.py +++ b/fmpy/simulation.py @@ -652,15 +652,19 @@ def simulate_fmu(filename, from fmpy.model_description import read_model_description from fmpy.util import can_simulate - platforms = supported_platforms(filename) + if fmu_instance is None: + + platforms = supported_platforms(filename) - if fmu_instance is None and platform not in platforms and remote_platform is None: - raise Exception(f"The current platform ({platform}) is not supported by the FMU.") + if platform not in platforms and remote_platform is None: + raise Exception(f"The current platform ({platform}) is not supported by the FMU.") - can_sim, remote_platform = can_simulate(platforms, remote_platform) + can_sim, remote_platform = can_simulate(platforms, remote_platform) - if not can_sim: - raise Exception(f"The FMU cannot be simulated on the current platform ({platform}).") + if not can_sim: + raise Exception(f"The FMU cannot be simulated on the current platform ({platform}).") + else: + remote_platform = None if model_description is None: model_description = read_model_description(filename, validate=validate)