Dear all,
I hope I am placing the following question in the right place.
I would like to understand the module BladedDLLInterface.f90
because I want to write a similar code to use bladed controllers. In particular, I am trying to use the ROSCO controller in an in-house software.
My approach is the following:
First, I created an additional LIB file from the DLL. I have specified its path in Visual Studio as “Additional Dependency”. The additional text-file with controller parameters is also located there. It’s name is set in the input variable accINFILE
.
To access the DISCON controller function, I used the following code:
subroutine DISCON(this, avrSWAP, aviFAIL, accINFILE, avcOUTNAME, avcMSG)
use, intrinsic :: iso_c_binding, only : c_float, c_int, c_char, c_null_char
implicit none
!DEC$ ATTRIBUTES DLLEXPORT :: DISCON
class(model_controller), intent(inout) :: this
REAL(C_FLOAT), dimension(117), INTENT(INOUT) :: avrSWAP
INTEGER(C_INT), INTENT(INOUT) :: aviFAIL
CHARACTER(KIND=C_CHAR, len = 28), INTENT(IN) :: accINFILE
CHARACTER(KIND=C_CHAR, len = 20), INTENT(IN) :: avcOUTNAME
CHARACTER(KIND=C_CHAR, len = 49), INTENT(INOUT) :: avcMSG
end subroutine DISCON .
Then I call the controller like an ordinary subroutine
DISCON(this, avrSWAP, aviFAIL, accINFILE, avcOUTNAME, avcMSG)
.
However, the controller code does not seem to work. I would be very happy if it could be explained to me whether I have forgotten important (ROSCO specific) steps or reading a DLL basically does not work like this. Do you also create a LIB file or can you only access the controller functions with the DLL? I would be very grateful for an answer.
Best regards,
David