ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview .Net interop assembly Entry point

Hi!

 

I have an old working .Vi that is interfaceing with an old Philps industrial scale. It returns the weigt and displays this in a numeric "box". I now try to make use of this in a new VB.Net application that I´m working on but I could really need some help.

 

Image of theblock diagram:

Block diagram

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The value is returned as a double "Aktuell vikt" and displayed in the text box and on the "tank".

 

I have set up my project build like this:

build_parmas_interop.PNG

 

 

The full Method property, not showing completely in the pic, is this:

<Void>
<Name>returnvalue</Name>
</Void>
 Main()

 

 

I have tried to follow the tutorials that I could find on the forum for this, but without success..

 

This is my test calss in VB.net

 

Imports

NationalInstruments.LabVIEW.Interop

Imports

InteropAssembly.LabVIEWExports

 

Public

Class Form1

 

DeclareSub Main Lib"PhilipsPR1602.dll" (ByRef returnObject AsObject)

 

PrivateSub Button1_Click(sender AsObject, e AsEventArgs) HandlesButton1.Click

 

Dim value AsObject = Nothing

Main(value)

 

EndSub

End

Class

 

 

My guess it that this:

DeclareSub Main Lib"PhilipsPR1602.dll" (ByRef returnObject AsObject)

, is where I go wrong. Not really sure what I´m doing here right now so would appreciate all the help I can get!

 

 

The goal is to get hold of the "aktuell vikt" (i.e current weight) value in the vb applicaiton, and have that to act as a datasource for a tank control in measurment studio 2013.

 

BR /Fredrik

0 Kudos
Message 1 of 3
(5,691 Views)

Forgot: The error that I´m reciving when I run the sub, is: "Unable to find an entry point named 'Main' in DLL 'PhilipsPR1602.dll'."

0 Kudos
Message 2 of 3
(5,690 Views)

First issue solved,

 

 

I used the sub .vi instead and then I can select the parameter I want.

 

Still the error "cant find entry point  named ...*... in .dll ...*... " Can i be an issue with the instalation. I found a thread saying that the installed .net framework must be compatable with CLR 2.0, how do I find out if it is?

 

 

0 Kudos
Message 3 of 3
(5,675 Views)