Interfacing EMTP-RV with other
software using C++



Jean-Gabriel Roumy
April 30th, 2009
Overview


    > EMTP-RV DLL interface
    > Interface implementation using C++
    > Usage
       •   Simulink
       •  ...
EMTP DLL Interface


    > What is the DLL Interface ?
       •   DLL is an external, separate piece of code
           li...
DLL Interface in C++


    > Why C++ ?
       •   Interface with 3rd-party software
    > C++ interface maps EMTP memory
 ...
Interface Usage


    > Linking with control code
    > Controllable and observable signals are
      inputs/outputs to 3r...
Using Simulink design in EMTP


    > Protection relay algorithm developped
      at IREQ using Simulink
    > Impossible ...
Using Simulink design in EMTP


    > Use existing Simulink designs
    > Availability of Simulink extensive list of
     ...
Using Simulink design in EMTP


    > C++ code generated with Embedded
      Real-Time toolbox
    > User defines inputs, ...
Simulink DLL Interface Architecture


                                               U se r M o d el
                     ...
Generating Simulink DLL Interface


     > Integrate Simulink code to interface
       code and compile together
     > Us...
Limitations


     > If Simulink design is modified, must
       regenerate and compile
     > Each design requires custom...
Linking with 3rd party software


     > Coupling with other C++ models
     > 3rd party can provide black-box models
    ...
Distributed Simulation


     > High Level Architecture is IEEE
       standard
     > Federation controlled by RTI
     >...
Distributed Simulation


     > NS2 (telecom simulator) modified to
       support HLA
     > Co-simulation run with NS2 a...
Future Work


     > Get the process of generating a model
       more user-friendly and generic
     > Co-simulation with...
The end


     > Questions ?




16                   Groupe – Technologie
Upcoming SlideShare
Loading in …5
×

Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

2,016 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,016
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
63
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

  1. 1. Interfacing EMTP-RV with other software using C++ Jean-Gabriel Roumy April 30th, 2009
  2. 2. Overview > EMTP-RV DLL interface > Interface implementation using C++ > Usage • Simulink • 3rd party software • Distributed Simulation > Future work 2 Groupe – Technologie
  3. 3. EMTP DLL Interface > What is the DLL Interface ? • DLL is an external, separate piece of code linked to EMTP-RV at run-time • EMTP-RV offers an API allowing the implementation of user models • API includes all functions necessary to interact with computational engine • API functions and structures are written in FORTRAN 95 3 Groupe – Technologie
  4. 4. DLL Interface in C++ > Why C++ ? • Interface with 3rd-party software > C++ interface maps EMTP memory space > C++ skeleton that handles all calls to/from EMTP > User implements interface functions 4 Groupe – Technologie
  5. 5. Interface Usage > Linking with control code > Controllable and observable signals are inputs/outputs to 3rd-party control libraries > No participation from user model in system matrices 5 Groupe – Technologie
  6. 6. Using Simulink design in EMTP > Protection relay algorithm developped at IREQ using Simulink > Impossible to duplicate design in EMTP > Production code and model code stem from single simulink design 6 Groupe – Technologie
  7. 7. Using Simulink design in EMTP > Use existing Simulink designs > Availability of Simulink extensive list of toolboxes > Complex Simulink models • Multiple sample times • C-language S-functions > Simulink code is portable, compact, fast and efficient 7 Groupe – Technologie
  8. 8. Using Simulink design in EMTP > C++ code generated with Embedded Real-Time toolbox > User defines inputs, outputs, tunable parameters > Compiled design has 3 top-level functions • Initialise • Step • Terminate 8 Groupe – Technologie
  9. 9. Simulink DLL Interface Architecture U se r M o d el C + + DL L E M T P -R V In sta nc e 1 L o ca l Da ta Str u ct u res S im u link Co de In s ta nce 2 L o c al D a ta S tru ctu re s 9 Groupe – Technologie
  10. 10. Generating Simulink DLL Interface > Integrate Simulink code to interface code and compile together > Use observable and controllable signals as input/output pins in EMTP > Generate symbol in EMTP 10 Groupe – Technologie
  11. 11. Limitations > If Simulink design is modified, must regenerate and compile > Each design requires customizing interface code > Matlab variable initialisation cannot be compiled > Fixed time step 11 Groupe – Technologie
  12. 12. Linking with 3rd party software > Coupling with other C++ models > 3rd party can provide black-box models generated with their own software > Example : HVDC controller model generated by manufacturer, provided to HQ as black-box model 12 Groupe – Technologie
  13. 13. Distributed Simulation > High Level Architecture is IEEE standard > Federation controlled by RTI > Distributed simulation can be performed with any HLA compatible software > EMTP DLL interface acts as bridge between EMTP and RTI 13 Groupe – Technologie
  14. 14. Distributed Simulation > NS2 (telecom simulator) modified to support HLA > Co-simulation run with NS2 and EMTP > Drawback : high overhead, not necessary to share at each timestep > Early steps of development 14 Groupe – Technologie
  15. 15. Future Work > Get the process of generating a model more user-friendly and generic > Co-simulation with Simulink > Development of HLA co-simulation 15 Groupe – Technologie
  16. 16. The end > Questions ? 16 Groupe – Technologie

×