Hello, I seem to be stuck. I’m trying to convince myself that I can compile FAST to call the DLL files for control. My next step is to get it all working together with ADAMS. I’m using IVF 11.1.048.
I am able to use IVF to compile FAST and it works, both 32-bit and 64-bit. I am also able to compile FAST to call the DLL on 32-bit.
When I compile FAST to call DLL on 64-bit, I get the following error (which initiates several others)
C:\DesignCodes\FAST_v7.00\Source\BladedDLLInterface.f90(120): error #6284: There is no matching specific function for this generic function reference. [GETPROCADDRESS]
DLL%ProcAddr = GetProcAddress( DLL%FileAddr, TRIM(DLL%ProcName)//CHAR(0) )
I did some looking into what the above error means, and thought that the following changes to BladedDLLInterface.f90 might help, which they do. I get no errors during compile.
INTEGER(4) :: FileAddr
INTEGER(4) :: ProcAddr
To:
INTEGER( INT_PTR_KIND() ) :: FileAddr
INTEGER( INT_PTR_KIND() ) :: ProcAddr
But then, when I go to use the resulting FAST_dll.exe and DISCON.dll, I get the following (DISCON is in same directory as all my other files and exe’s)
The DLL DISCON.dll could not be loaded.
Aborting FAST.
C:\ADMS2008\Test_NRELOffshrBsline5MW_Onshore>pause
Press any key to continue . . .
Does anyone have advice for me? Thanks in advance.
Brian
I looked into this a little more. I’m learning that 32-bit dll’s are not supposed to be compatible with code compiled for 64-bit. If this is true, then the question is whether there is a way to compile the DISCON.f90 into a 64-bit dll. I can’t seem to find much documentation for this.
In the mean time, I installed 32-bit ADAMS 2008r1 and followed compile instructions in the post to Felix.Hess July 2. I was successful getting it all working. That bat file for Felix was key. Thanks very much.
I’d still be interested in the 64-bit route, if it is practical at all.
Brian
This is not intuitively obvious to me, but I really do not know that much about DLLs.
Since I work with Brian, I’ve been looking into this problem as well. It does seem that 32-bit DLLs are not compatible with 64-bit programs, but there are workarounds. Some information about that is available here:
dnjonline.com/article.aspx?i … access3264
One problem is that pointers, that can be seen in the BladedDLLinterface.f90 code, have different amount of memory associated with them depending on the 32 or 64-bit build chosen (as Brian said).
The real odd thing is that I am able to use the IVF 11.0 64-bit compiler to re-compile the DISCON.dll successfully and without errors. However, I am still unable to run FAST or ADAMS with the re-compiled DLL, and I only get the generic ‘the DLL could not be loaded’ error. Since the Bladed-type DLL uses certain memory spaces to pass data back and forth between the simulator and controller, I’m worried that maybe the memory spaces are unaligned, and the compiler does not pick up on it.
If anyone with DLL experience could comment on this or give us a pointer, it would be greatly appreciated.
-Justin