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

Add block to overwrite control signals and receive output through a web service #926

Closed
mwetter opened this issue May 17, 2018 · 5 comments

Comments

@mwetter
Copy link
Contributor

mwetter commented May 17, 2018

This issue is to implement an single input/output block, and a single input block, that allows

  • overwriting a control signal or setpoint through through a web service call, and
  • posting an output on a web server.

For the implementation, there should be a global setting (using an inner/outer construct) to

  • set a default samplingPeriod, and
  • disable all blocks, which would render the input/output blocks as a direct feedthrough block and thereby not affecting computing performance.

This will be needed for BOPTEST. The development branch is issue926_control_io

@mwetter
Copy link
Contributor Author

mwetter commented May 25, 2018

@SenHuang19 I started integrating some of the code to issue926_control_io. The modelica model is in Utiliities.IO.RESTClient. Please merge this code to your development branch.

Next tasks are

  • Revise modelica code to comply with coding convention, see https://github.com/ibpsa/modelica-ibpsa/wiki
  • Revise parameter name (e.g., use names that are also used in other models; rather than using samPer, use samplePeriod as is used in the base class and in many other blocks.
  • Move header functions from to_be_added to Resources/C-Sources, rename them so it is clear to what model they belong to, and refactor so that the implementation is in a .c file and not the header file. Use one .h and .c file for Linux and Windows, and use compiler directives where the operating systems require different implementation. (See also the Modelica language specification for how to properly use C code.)
  • Add an outer block. See for example Buildings.Utilities.Plotters.Configuration on branch issue1151_plots
  • Add a UsersGuide.mo that explains the package.
  • Add example and include it in regression testing.
  • Add a block Send_Real that sends a Real signal.

@SenHuang19
Copy link

I completed the modification based on your comments and created a pull request.

The major revisions are

  • Revise modelica code to comply with coding convention,
  • Add an outer block to set global parameters,
  • Reorganize the c function and put it to the Resources/C-Sources,
  • Add a UsersGuide.mo that explains the package,
  • Add an example folder.

The remaining tasks are

  • Include the blocks in regression testing,
  • Add a block Send_Real that sends a Real signal.

I need more detailed explanations to finish the above tasks.

@mwetter
Copy link
Contributor Author

mwetter commented Jul 13, 2018

@SenHuang19 I made some revisions to your latest code on issue926_control_io
Please search the code for the string fixme.
Also, when I run the examples, I get a segmentation fault with message

*** buffer overflow detected ***: ./dymosim terminated

Please address the fixme and the segmentation fault so I can do further review.

I also suggest to change OverWritten_Real to Read_Real and Sampler_Real to Send_Real as both sample.

I also merged the latest master into this branch as we switched to Dymola 2019. This will be needed for the regression tests.

@SenHuang19
Copy link

I tried my best to address all the fixmes and changed OverWritten_Real to Read_Real and Sampler_Real to Send_Real as both sample.
In addition, I also added the feature to include the variable name in the socket message.

@mwetter
Copy link
Contributor Author

mwetter commented Jan 4, 2019

I am closing this due to the new implementation that is done through #1059

@mwetter mwetter closed this as completed Jan 4, 2019
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