Skip to content

Problems passing values in GridLAB-D/Fortran co-sim using FAPI #13

@victorayon

Description

@victorayon

Hi,

I've been working with the new Fortran API and I have successfully performed two co-simulations. One simulation involves passing values between two simple Fortran models. The second simulation consists of the same two Fortran models plus the C++ simB model from one of the tutorials. In this simulation all three simulators successfully passed and received values between each other.

I am currently woking on a third co-simulation composed of a simple GridLAB-D model and one of the simple Fortran models used in the previous simulations. However, I am having trouble passing values between them. I have been able to pass the value of the inverter variable "VA_Out" to Fortran but only in the first time step. Below is the output from the Fortran model named "fapi_A":

My name is 'fapi_A'
I am federate 0 out of 2 other federates
current time is 1, received 1 events
event value
fncs_inverter/inverter_1@fapi_A/VA_Out +57713.6+0j VA
current time is 2, received 0 events
event value
current time is 3, received 0 events
event value

What you see for times 2 and 3 is repeated for the rest of the simulation.
This is the GLD output:

name = fncs_inverter
time_delta = 1000000000ns
broker = tcp://localhost:5570
values
fapi_A/fncs_inverter/inverter_1@fapi_A/VA_Out
topic = fapi_A/fncs_inverter/inverter_1@fapi_A/VA_Out
default = +0+0j VA
list = false

This is are the lines in my GLD configure file:

route "commit:inverter_1.VA_Out -> fapi_A/VA_Out; 0";
subscribe "precommit:inverter_1.VA_Out <- fapi_A/fncs_inverter/inverter_1@fapi_A/VA_Out";

And the Config portion in the Fortran model:

config = "name = fapi_A"//NEW_LINE('A')//&
"time_delta = 1s"//NEW_LINE('A')//&
"broker = tcp://localhost:5570"//NEW_LINE('A')//&
"values"//NEW_LINE('A')//&
" fncs_inverter/inverter_1@fapi_A/VA_Out"//NEW_LINE('A')//&
" topic = fncs_inverter/inverter_1@fapi_A/VA_Out"//NEW_LINE('A')//&
" list = false"//NEW_LINE('A')

The fncs_msg object in the GLD model reads as follows:

object fncs_msg {
name fncs_inverter;
parent inverter_1;
option "transport:hostname localhost, port 5570";
configure solar1.txt;

The full files are attached. I created the GLD configure file and fncs_msg object using the gld-ns3 tutorial as reference but I still don't understand the format of the "route", "subscribe", and "function" parts.

Could you please point out what I am doing wrong? Also if possible, could you please explain the format of "route", "subscribe", etc.?

Best regards,

Victor Ayon

GLD-Fortran.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions