Development of external interface for DISCON.dll

Provide feedback, request enhancements, and get help with wind-turbine computer-aided engineering tools.

Moderators: Bonnie.Jonkman, Jason.Jonkman

JuanCamilo.TejadaEscobar
Posts: 1
Joined: Sun Aug 25, 2019 8:28 am
Organization: Technische Universität Hamburg (TUHH)
Location: Germany

Development of external interface for DISCON.dll

Postby JuanCamilo.TejadaEscobar » Fri Mar 13, 2020 8:04 am

Dear Bonnie and Jason,


I am developing an external interface to exchange information with already compiled DISCON.dll controllers from OpenFAST. The goal is to understand how data is exchanged between the compiled dll and OpenFAST in order to implement these type of controller into specific simulation methods developed here at the university.
As a starting point, I am trying to understand how information is exchanged during simulation between the dll-file and OpenFAST.

Currently, I'm using Python 3.8 with the "ctypes" function library to load the DLL and call the functions exported by it. The implementation is not limited to Python though, I'm using it for testing and convenience reasons. My system is a Windows machine with x64 architecture, and I am working on my own compiled DLLs using the Visual Studio solution described in the reg-test repository of OpenFAST (Visual Studio 16 2019 + Intel Fortran Compiler).

Until now I am able to call the DISCON function exported by the DLL, but I am not sure if the avrSWAP-array I am passing from Python has the right data format. The only output I get (besides numerous "access violation errors" from Windows) is an 8-digit integer and I have no clue what that means :roll:


My question is: Could you provide some light into this information exchange? Does OpenFAST send the data to the DLL with some specific format (like a C-Array or a C-pointer with the memory address of avrSWAP)

I can`t find details of this kind on the BLADED user Manual v3.51 (June 2003) and my Experience with C and Fortran is limited.


Any kind of Information you can provide is greatly appreciated.
Thank you for the time you take moderating and sharing your knowledge on the forum!

Best regards,
Juan Camilo Tejada Escobar

Jason.Jonkman
Posts: 4750
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Development of external interface for DISCON.dll

Postby Jason.Jonkman » Fri Mar 13, 2020 2:52 pm

Dear Juan Camilo,

Well, I recommend you review the Fortran source-code that we wrote in the ServoDyn module of FAST / OpenFAST to interface with the Bladed-style DLL controllers. The source file is named BladedDLLInterface.f90. This source file includes detail on how we load the DLL, as well as details on the size and order of the array arguments pass to, and received from the DLL, including the avrSWAP array.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov


Return to “Computer-Aided Engineering Software Tools”

Who is online

Users browsing this forum: No registered users and 1 guest