Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69105

Passing parameters to Labview DLL from VB.NET

$
0
0

I have tasks to call various LabView DLLs from my VB.NET application.

I found  the LVCalculator.dll example on NI website to call Labview DLL from VB.net. It shows how to declare the DLL and call it from VB.net

Declare Auto Function Calculator Lib "..\LabVIEW\LVCalculator.dll" (ByVal val1 As Double, ByVal val2 As Double, ByVal Op As Integer) As Double

Result.Text = Calculator(System.Double.Parse(Operand1.Text), System.Double.Parse(Operand2.Text), add)

 

This example works fine. Unfortunately, all examples I found have parameters with standard data type such as Integer, Double or String.However in my DLL I have a parameters  LVRefNum *VISAIN, *VISAOUT.

 

void __cdecl LCDColor(LVRefNum *VISAIN, uint16_t LCDColor2,

            TD1 *errorInNoError, LVRefNum *VISAOUT, char OutputString[], TD1 *errorOut,

            int32_t len);

 These parameters in my DLL are a Com Port numbers, which Labview VI uses to communicate with the controlled hardware. When this VI runs as standalone program with Labview GUI the COM port is selected from the menu. But when I call this VI as a DLL, I need to pass my COM port numbers via the parameter LVRefNum *VISAIN and *VISAOUT.  And I could not figure out what data type and format to use to make  DLL understand it.   


Viewing all articles
Browse latest Browse all 69105

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>