LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling labview dll from fortran lf95

I have a huge legacy app. written in Leahy LF95 fortran. I have GPIB instruments that I want to communicate using Labview from within the fortran code. I have created a labview 8.5 dll with my GPIB functions. I call them from the fortran app. Everything compiles and links just fine. I go to run the app and everything is fine until the call to Labview Runtime engine. I get a generic Error 998 blah blah blah runtime engine problem. This is a National Instruments error message NOT Fortran. I tried creating a MS VC++ 6.0 wrapper dll that simply calls the Labview dll thinking it might be an interface problem. Same error. I am very frustrated at this point and question the viability of Labview in any of my future projects that involve Fortran which is a huge # of projects.
0 Kudos
Message 1 of 7
(3,764 Views)
Hi BoeingJR,

This is not a LabVIEW error, but rather is related to the way the DLL is being called.  Please see these links for more info:


KB:

Why Do I Get Error 998 when I Try to Call a DLL in LabVIEW?


Related forum post:

I get error 998 when calling a LabVIEW buildt DLL from MSVC++


Hope this helps.
Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 2 of 7
(3,737 Views)
Thanks for the input...there is something squirrley about the Labview Run Time Engine. I rewrote my Labview VI's using labWindows 8.5 and created a LabWindows DLL. Using the same _stdcall protos I don't get the error when I call the LabWindows functions form Fortran!!!! . I'll stick with LabWindows until they figure out the problem
0 Kudos
Message 3 of 7
(3,728 Views)
Hi BoeingJR,

If you could post a project (simplified as much as possible) illustrating the error so I can reproduce it on my end, it would helps us determine if it is truly a bug and, if so, what needs to be done to fix it.
Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 4 of 7
(3,704 Views)

Thanks Eric V...I'll create a simple Hello pgm in LF95 with a call to a Labview DLL...I'll post it ASAP

 

0 Kudos
Message 5 of 7
(3,693 Views)

EricV....Here I sit begging forgiveness from the Labview gods.... I wrote a quick console "Hello" app in fortran (LF95) that called a labview vi from a labview generated dll. It worked fine. I took it a step further and created a Fortran "Windows" app using Wisk and called the same Labview VI. Worked fine. I can only think that my large legacy app has some major memory leaks or allocation issues. I will have to start disecting the old fortran code until I find what is trashing the Labview RunTime Engine. Fortran coding should be illegalized with heinous punishment dealt to those who wish to defy.

thanks again

0 Kudos
Message 6 of 7
(3,685 Views)
Hi BoeingJR,

You're very welcome.  I'm sorry to hear that there wasn't a simple fix.  Good luck, and let us know if there is anything else we can do to help.
Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 7 of 7
(3,658 Views)