Discussion:
fortran dll
(too old to reply)
battler.
2008-08-05 12:10:19 UTC
Permalink
Hi all,
I too have fortran source code which I would like to use in LabVIEW.  I have the .for and the .obj files.  I'm not a fortran user.  I've seen that it is reasonable simple to interface directly with Fortran code in MatLab using the .mex functions.  Don't worry I hate MatLab too, although I do have a copy.  If it's so easy to do in MatLab then it has to be even easier in LabVIEW, surely.
Can anyone tell me what to do?
Thanks,
Jay.
Aashish_M
2008-08-06 22:40:05 UTC
Permalink
Hey Battler,
You could use the Call Library Function Node to do this.
For more information on this, refer to <a href="http://digital.ni.com/public.nsf/allkb/DCB90714981A1F148625731E00797C33?OpenDocument" target="_blank">How Do I Call a Dynamic Link Library (DLL) from LabVIEW?</a>
Hopefully this helps!!
battler.
2008-08-07 09:10:12 UTC
Permalink
Hi there,
The Call Library function requires that the fortran code be in the form of a .dll.&nbsp; I am not new to LabVIEW (infact I am an ex-employee;-)) but I have no clue when it comes to Fortran or C.&nbsp; I have uncompiled (.for) and compiled (.obj) fortran code.&nbsp; How do I compile into a .dll?&nbsp; Do I need to creat a c code header file (.h)?&nbsp; How do I go about it?
Thanks again.
Aashish_M
2008-08-08 20:40:06 UTC
Permalink
Hey Battler,
&nbsp;
You'd need to look up how you can convert Fortran to a DLL. Here's link I got from a quick Google search: <a href="http://support.microsoft.com/kb/123841" target="_blank">How To Create a FORTRAN DLL and Call It from Visual Basic</a>
&nbsp;
Once you develop the DLL you'll have to create a C wrapper for LabVIEW to understand the Fortran DLL. A good reference for this would be <a href="http://zone.ni.com/devzone/cda/epd/p/id/4489" target="_blank">Writing a Wrapper Function for an External Code Function</a>.
&nbsp;

Continue reading on narkive:
Loading...