LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal Internal Error: "LinkObj.cpp", line 714 LabVIEW version 8.5 You will lose any unsaved work. (repost with carriage returns!!)

Greetings to the community!
We are experiencing the following problem: A LabVIEW 8.5 .dll is built out of three simple test functions which add two numbers.
The dll is called from a Visual Basic 6 program running in Visual Studio.
The first LV function returns the sum of two I32 values.
The second LV function returns the sum of two DOUBLE values.
The Third LV function uses a Mathscript node to perform the same summing of inputs, returning the sum of two I32 values.

A dll is built with the Application Builder and moved to the \windows\system32 folder.
Next: I single step through the simple program below, in Visual Studio.
If I stop the execution at any point before the mathscript function Mathscriptsummer is called, no problem.
If I stop execution after that, the "Fatal Internal Error: "LinkObj.cpp", line 714 LabVIEW version 8.5 You will lose any unsaved work." message appears.
Clicking "OK" shuts Visual Studio down instantly.

This was just a test of the interface. I believe this will impact project development, and I am leery of moving forward along this path, as I was hoping to reuse a great deal of mathscript code in several locations throughout the program.

Is there something I'm forgetting here in the code? In the App Builder settings?
Any advice from the sages?
Doesn't this appear to be a compiler/linker bug in 8.5?
Thanks (& please wish the Colorado Rockies well!)

Ted

 '________________________________________
' Begin visual basic 6 program:
'________________________________________
Private Declare Function Summer Lib "summerlib" (ByVal a As Long, ByVal b As Long) As Long
Private Declare Function Doublesummer Lib "summerlib" (ByVal x As Double, ByVal y As Double) As Double
Private Declare Function Mathscriptsummer Lib "summerlib" (ByVal a As Long, ByVal b As Long) As Long
Sub Form_Load()
Dim x, y, fx As Double Dim a, b, sum As Long
a = 1#
b = 2#
x = 1.2345
y = 2.3456
sum = Summer(a, b)
fx = Doublesummer(x, y)
sum = Mathscriptsummer(a, b)
End Sub

Download All
0 Kudos
Message 1 of 4
(7,627 Views)
Piling it on ---
If I merely add another mathscript vi to the same dll, the previous three vi functions mentioned on the last post (summer, etc) now return zeros instead of performing the math correctly.
Here is the new vi, called Clasclap.vi, which calculates vapor pressure from temperature Kelvin.
What is going on here?
Ted

0 Kudos
Message 2 of 4
(7,619 Views)
OK, now it's getting comical... 
I removed the second mathscript node from clasclap.vi and created a dummy LV math operation to replace it.  Called the new vi clasclap_part.vi (attached) and added it to the project in place of clasclap.vi.  Built the dll as usual.  BTW, I'm using the standard calling convention here, not the C language convention.
RESULTS: All of the called functions return zeros, even clasclap_part.vi.  But some good news: the dll isn't crashing Visual Studio anymore.
Now I'm realizing that the functions returning zeros issue greatly overshadows the reason I originally started this thread.  If I don't get any response, I'll start an independent thread that someone might take an interest in....
What might be helpful here would be if someone could (hopefully easily) take the summer .vis and the clasclap_part.vi and build their own dll.  Then, try to call it from VB6 and/or any other language or compiler.  What do you get?
(FWIW, I never mentioned that I'm not a fan of VB or Visual Studio.  LabVIEW is far superior IMHO)
Here is the revised VB code which calls the dll:

Private Declare Function Summer Lib "summerlib" (ByVal a As Long, ByVal b As Long) As Long
Private Declare Function Mathscriptsummer Lib "summerlib" (ByVal a As Long, ByVal b As Long) As Long
Private Declare Function Doublesummer Lib "summerlib" (ByVal x As Double, ByVal y As Double) As Double
Private Declare Function Clasclap_part Lib "summerlib" (ByVal x As Double) As Double

Sub Form_Load()
Dim x, y, fx As Double
Dim a, b, sum As Long
a = 1#
b = 2#
x = 1.2345
y = 2.3456
fx = 1
sum = Summer(a, b)
fx = Doublesummer(x, y)
sum = Mathscriptsummer(a, b)
y = Clasclap_part(290.01)
End Sub

Thanks,
Ted

0 Kudos
Message 3 of 4
(7,619 Views)
This was reported to R&D (# 4ET88JB9) for further investigation. 

Error in Visual Basic 6 calling dll with mathscript node was verified.  Error was not seen when calling dll with mathscript node in .NET 2005 (using C#).
Jared T.
0 Kudos
Message 4 of 4
(7,595 Views)