LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call Labview DLL from VB2005

Dear all expert,
I'm a student and very new in Labview programming.
Currently i have build a simple vi and need to convert it to dll so that i can call it from my VB.net. But the problem is how to call the labview dll from my VB.net?
 
I know we must declare function something like this,
 
Auto function Bodeplot Lib"..\\Bodeplot.dll" (Byval Val1 as double, Byval Val2 as double,...) as double
 
but how to determine Val1, Val2 (and so on) is input for which data?  if my vi have 10 input (frequency, Kc,Fcz,Fcp,Wzrhp,Wp,k,Wz,Beta and Operation) ? and how to select the output (my application have 3 possible output : magnitup loop,phase loop, and degree loop)
 
In addition, since I'm using Labview 8.0 , and as i know apllication  builder for this version cannot convert vi to dll which contain Mathscript (but unfortunely, my vi all use Mathscript), so really hope someone can help me to convert my vi to dll using Labview 8.2 (which remove this limitation).
 
here I'm attach my Vi and really hope someone willing to help.
 
Thank you.
 
0 Kudos
Message 1 of 9
(3,696 Views)
You will need to create a project to put this into.  As far as dynamic selection, you really can not do that.  You can do one of three things as far as I see:
  1. Create 3 wrapper VIs.  One for each operation that has the correct inputs, and outputs. (IMHO the best solution)
  2. Modify your inputs and outputs to more general purpose and use those. (requires you to document the usage, and still confusing to the user)
  3. always use all the inputs and outputs to the dll, even if they are null.  (requires you to document each case, confusing to the user, not intuititve.)
As far as building your dll.  I think that is a toughy as you are self admitted wanting to use functions that you have not paid for.  I would talk to your NI DSM, or get the 8.5 evaluation and build it yourself. 
Good luck.

Paul
0 Kudos
Message 2 of 9
(3,675 Views)

Dear stradis,

Very thank for ur reply.

I just a student, and the cost for Labview8.5 is really unaffordable for me! Smiley Sad

May i know who is NI DSM? and how do i get the Labview8.5 evaluation, so that i can try to build myself.

thank.

 

0 Kudos
Message 3 of 9
(3,659 Views)

you will need to Call NI to find out who your DSM (district sales manager) is, it depends on where you live or are.  +1-800-433-3488 in the US.  As far as downloading, get it here. you will need to fill out a questionaire.  Your school may be eligible to get labview 8.5, you will need to discuss with your DSM.
Good Luck

 

Paul
0 Kudos
Message 4 of 9
(3,652 Views)
On Sep 18, 10:10 am, cckoh <x...@no.email> wrote:
> Dear stradis,
> Very thank for ur&nbsp;reply.
> I just a student,&nbsp;and the cost for Labview8.5 is really unaffordable for me! Smiley Sad
> May i know who is NI DSM? and how do i get the&nbsp;Labview8.5 evaluation, so that i&nbsp;can try to build myself.
> thank.
> &

According to Labview's Help File you need Application Builder to build
shared dynamic linked libraries. However, Application Builder is only
included with the Professional version of Labview. Application
Builder is not included with the Student, Base or Full Development
versions of Labview. As far as I know Application Builder is not
included with an evaluation version of Labview. National Instruments
charges US$ 1,000 to buy Application Builder as an add on for use with
the Base and Full development versions of Labview. Considering your
limited funds I suggest you looked at using Free Open Source software
like Scilab or Python for your project.

Howard

0 Kudos
Message 5 of 9
(3,636 Views)
Actually Application Builder is included in the evaluation version of LabVIEW, the only catch is if you build an application then there will be a watermark on the front panel saying LabVIEW Evaluation Version or something to that affect.
Nick R
NI
0 Kudos
Message 6 of 9
(3,611 Views)
On Sep 18, 11:49 pm, hrh1818 <hr...@att.net> wrote:
> On Sep 18, 10:10 am, cckoh <x...@no.email> wrote:
>
> > Dear stradis,
> > Very thank for ur&nbsp;reply.
> > I just a student,&nbsp;and the cost for Labview8.5 is really unaffordable for me! Smiley Sad
> > May i know who is NI DSM? and how do i get the&nbsp;Labview8.5 evaluation, so that i&nbsp;can try to build myself.
> > thank.
> > &
>
> According to Labview's Help File you need Application Builder to build
> shared dynamic linked libraries. However, Application Builder is only
> included with the Professional version of Labview. Application
> Builder is not included with the Student, Base or Full Development
> versions of Labview. As far as I know Application Builder is not
> included with an evaluation version of Labview. National Instruments
> charges US$ 1,000 to buy Application Builder as an add on for use with
> the Base and Full development versions of Labview. Considering your
> limited funds I suggest you looked at using Free Open Source software
> like Scilab or Python for your project.
>
> Howard


You also might want to look at using the student edition of Matlab
with your project. The Matlab help files have extensive information on
linking external programs to Matlab. Look up the subject "Automation
Server" and "External Interfaces" in the Matlab Help file for more
information.

Howard

0 Kudos
Message 7 of 9
(3,581 Views)
On Sep 17, 6:40 am, cckoh <x...@no.email> wrote:
> Dear all expert,
> I'm a student and very new in Labview programming.
> Currently i have build a simple vi and need to convert it to dll so that i can call it from my VB.net. But the problem is how to call the labview dll from my VB.net?
> &nbsp;
> I know we must declare function something like this,
> &nbsp;
> Auto function Bodeplot Lib"..\\Bodeplot.dll" (Byval Val1 as double, Byval Val2 as double,...) as double
> &nbsp;
> but how&nbsp;to determine Val1, Val2 (and so on) is input for which data?&nbsp; if my&nbsp;vi have&nbsp;10 input (frequency, Kc,Fcz,Fcp,Wzrhp,Wp,k,Wz,Beta and Operation)&nbsp;? and how to&nbsp;select the output (my application have 3 possible output : magnitup loop,phase loop, and degree loop)
> &nbsp;
> In addition, since I'm using Labview 8.0 , and as i know apllication&nbsp; builder for this version cannot convert vi to dll which contain Mathscript (but unfortunely, my vi all use Mathscript), so really hope someone can help me to convert my vi to dll using Labview 8.2 (which&nbsp;remove this limitation).
> &nbsp;
> here I'm attach my Vi and really hope someone willing to help.
> &nbsp;
> Thank you.
> &nbsp;
>
> bodeplot.vi:http://forums.ni.com/attachments/ni/170/272124/1/bodeplot.vi

If you insist on using Labview with your project then you should
consider using ActveX in place of using a dynamic link library to
interface to your VB.net code. You don't need "Application Builder"
if you use ActiveX. The Student, Basic and Full development versions
of Labview for Windows come with ActiveX capability. For more
information on ActiveX look up the subject ActiveX in Labview's Help
File.

Howard

0 Kudos
Message 8 of 9
(3,570 Views)

Dear all the expert,

Thank you all for the really good suggestions, especially Howard. I will try to look at the ActiveX .Smiley Happy

 

 

0 Kudos
Message 9 of 9
(3,561 Views)