Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to feed values in the FMU-Configuration.YAML file for Ports which have the casuality set as "Parameter" #4

Open
saanjh-sengupta opened this issue Dec 5, 2024 · 2 comments

Comments

@saanjh-sengupta
Copy link

saanjh-sengupta commented Dec 5, 2024

I have a port in my modelDescription.xml file as the following:
<ScalarVariable name = "XYZ" valueReference ="123" description = "Function Call" causality="parameter" variability="tunable" <String start="0/>

How do I add this port in the YAML file ?

When I try adding this in the Parameters section in the YAML via

  • VariableName: "XYZ"
    Value: "1"

And also map it in the VariableMapping section as

  • VariableName: "XYZ"
    TopicName: "Function_1"
    Transformation:
    TransmissionType: "String"

    I have an error stating [error] Failed to retrieve data via GetString.

Please suggest what am I doing wrong ?

@VJean-ThomasMasse
Copy link
Collaborator

Hello,
This error means that the FMU Importer had trouble calling GetString with a certain ValueReference. Make sure the FMU supports returning the value of all your string parameters. Indeed, the FMU Importer automatically retrieves the FMU's value of a parameter during the first simulation step to publish it to its topic.

If you want to stop the FMU Importer to do this, you can add IgnoreUnmappedVariables: True to the configuration file and map all your other (needed) variables.

@saanjh-sengupta
Copy link
Author

saanjh-sengupta commented Dec 19, 2024

Hello,
The port that was mentioned above is a function call residing inside FMU (causality is of type Parameter)

I want to trigger the function call (and set the value passed to the function via Setters).

Is it possible to have the function call variables under the YAML FMU Configuration File, just as we do for IN/OUT ports?

screenshot

I came across the above section where in it is mentioned that Parameters are by default set as DataPublishers.
But in my context I want to set the Parameters as DataSubscribers.

Below the table I see a statement where in it redirects to a link where the default mapping could be changed.

However, the link is not redirecting me to anywhere. Would it be possible to provide any alternative link (if any).

Please suggest/support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants