Opened 8 years ago

Closed 7 years ago

#4192 closed defect (fixed)

Cannot set discrete inputs for Co-Simulation FMU

Reported by: anatoly.trosinenko@… Owned by: Lennart Ochel
Priority: high Milestone: 1.12.0
Component: FMI Version: v1.12.0
Keywords: Cc:

Description

When building CS FMU version 2, I cannot set Integer and Boolean inputs between steps. FMU Checker cannot pass input csv to the model too.

How to reproduce

  1. Set up the following FMU generation parameters
    • Version: 2.0
    • Type: Co-Simulation
  2. Build the following test model to FMU:
    model DiscreteInput
      input Integer int;
    end DiscreteInput;
    
  3. Pass the following input to this FMU using FMU Checker ver. 2.0.3
    "time","int"
    0.0,0
    0.1,1
    0.2,2
    
    fmuCheck.linux64 -l 6 -i input.csv DiscreteInput.fmu
    

What is expected

The FMU passes validation.

What really happens

An error occurres when setting Integer inputs:

[FMU][logStatusError][FMU status:Error] fmi2SetInteger: Illegal call sequence. fmi2SetInteger is not allowed in Continuous-Time Mode state.

See the log attached for details.

Attachments (1)

log.txt (6.2 KB ) - added by anatoly.trosinenko@… 8 years ago.
Error log

Download all attachments as: .zip

Change History (11)

by anatoly.trosinenko@…, 8 years ago

Attachment: log.txt added

Error log

comment:1 by Adrian Pop, 8 years ago

Owner: changed from Adeel Asghar to Lennart Ochel
Status: newassigned

Lennart, can you have a look at this?

comment:2 by Lennart Ochel, 8 years ago

Status: assignedaccepted

comment:3 by Lennart Ochel, 8 years ago

Does that mean fmi2SetInteger is allowed to be called in continuous-time mode?

comment:4 by Adrian Pop, 8 years ago

Yes, in between fmi2DoStep. See:
https://svn.modelica.org/fmi/branches/public/specifications/v2.0/FMI_for_ModelExchange_and_CoSimulation_v2.0.pdf
Figure 11, for inputs and tunable parameters.

comment:5 by Lennart Ochel, 7 years ago

I've just pushed a workaround. Please verify (e.g. using tomorrows nightly build) if it actually helps.

comment:6 by anatoly.trosinenko@…, 7 years ago

I will check it slightly later, but as far as I remember, it was failing not only for Integers, but also for Booleans and Strings

comment:7 by mirko.dangelo@…, 7 years ago

I checked. It works now for Integers but it fails for Booleans and Strings.

comment:8 by Lennart Ochel, 7 years ago

We can do the same workaround for those types as well until we have a proper implementation of the call sequence logics for CS and ME.

comment:9 by mirko.dangelo@…, 7 years ago

It would be perfect since I'm also using Booleans and Strings.

comment:10 by Lennart Ochel, 7 years ago

Milestone: Future1.12.0
Resolution: fixed
Status: acceptedclosed

It should work now: OMCompiler#1674

Note: See TracTickets for help on using tickets.