Problem for calling a Matlab generated C DLL with Labview
I am not familiar with DLL and I need help for using a Matlab generated C-DLL with a Labview application.
I have created a C-DLL from Matlab compiler version 4.8 and have deployed it on the host PC using MCRinstaller. So far so good.
When I used the VI for calling the DLL, I have the choice between 6 functions:
Do I have to use all of these functions?
In a first attempt, I have created a sequential loop in Labview to run the function Initialize then the function mlf and finally the function T...Calling a LabView DLL from a Labview VI
Hi, I have a vi that is calling a Labview DLL and they both have a same
subVI. If I drop that SubVI into the block diagram first then drop in the
Call Library Function Node, when I run the VI, the DLL would not work and
it did not give me any error. Does anyone know how fix this problem with
Labview? or is there some configuration that I can force the all of that
SubVI points into the DLL.
Thanks for your help,
...labview crashing when calling labview-built dll
Hello I need some help with regard to calling a LabVIEW-built DLL in
LabVIEW.I have created a vi in LabVIEW. I made the DLL for this vi. I
called this VI as a re-entrant in another vi.This vi(calling DLL) has
been working fine till yesterday. Since yesterday, it started crashing
LV.I need some help in this regard.I am attaching the
screenshots of the Application Builder configuration window, the B.D of the vi
using DLL and that of the configuration window which pops up when i call the
DLL.I made a vi which performs FRA. I built its DLL.I have around 10
inputs. I output 3 one-dimensional arrays, and a string from the DLL.When i
build the DLL, the builder defines the outputs 'gain', 'phase' and 'frequency'
as arrays of 8-byte double.When i call this DLL in my vi, the configuration
window sets them as 'numeric' outputs.Why does this happen? What is the
solution to this?When i try to set them as 'array' in this configuration
window, i get a warning that i am trying to change the data types which do not
match with the data type found in the DLL. Is this the problem with my
code or with the Application Builder?Now, after i change the 3 output
datatypes to Arrays, and set their minimum length(i assumed that this value
means the size of the array ), the vi runs and crashes LV. I am nto sure when it
crashes, why it crashes. It runs fine at one time. It crashes at another time. I
am nto sure if these arrays are teh reason why L...Labview Dll call library function Causing Labview to unload
I am trying to use the Call Library function in Labview 7.1 to call an Init function for a Zathic Can4USB device. When I run the vi, it complete log LabView out of the computer. Can anyone tell me why the function totally unloads LV without displaying an error?
Either the function has a serious bug or you are calling it with
invalid parameters or wrongly setup parameters. The problem happening
here is that your DLL passes somehow invlid parameters to a system
device driver and that driver causes a protection fault. For device
driver execeptions which happen in the privileged...Error 1073 when building LabVIEW app which calls LabVIEW dll
I am trying to use application builder to build an application that
calls a dll created in LabVIEW. I get an error referencing a vi within
the dll (Parse Stored String(multibyte).vi) saying that "This property
is writable or this method is available only when the VI is in edit
mode." The only option is to Continue which cancels the build. I had
sucessfully built this application prior to including vis that call
the dll and the program runs fine in the development environment.
Do you have any idea what is causing this and what I cam do about it?
I have found a temporary workaround i...Should I call C from LabVIEW or call LabVIEW from C?
I need to write some software and am trying to choose the best development environment. I currently use Borland C++ Builder to develop most of my software and have also used some LabVIEW occasionally. The new package I need to write has to provide several functions, some of which would be better in C++, some in LabVIEW and I am wondering whether to combine the two. So far, I have had a quick play around and called a very basic piece LabVIEW code, built into a dll, from some C++ code. I am about to try to reverse (create dll in C++ and call from LabVIEW) but would appreciate some advice on the advantages/disadvantages of each method.
Restrictions I have:
1. I will (probably) be using some hardware which will be supplied with C++ driver functions only. My interface with this card is the 'heart' of my system and is time-critical. Also, I need to assign a pointer to pass to this card (could I do this in LabVIEW?)
2. I wish to analyse data from the card using FFT and related functions so would ideally use the LabVIEW Sound & Vibration and Order Analysis toolkits. I need to use these in real-time where the data sampling rate is fairly high (frequency analysis to be done on 4 channels at once with each channel sampled at approx 100kHz).
To add to this, I would like to be able to create/modify the display screen at run-time - something which I am fine with in C++ but understand is very difficult in LabVIEW (I have only used LabVIEW for relatively...How to write a C wrapper dll to export Matlab dll functions so that LabVIEW Call Library Function Node can use it?
Hello LabView developers,
I used LabVIEW to call Matlab m script to implement matlab MPC successfully. I wanted to use Matlab compiler to compile the matlab m script function into a c shared library .dll so that LabVIEW can call it without requiring Matlab installed on the PC.
I used MatLab R2007b with matlab compiler. I was able to generate a C shared library dll set successfully using mcc command.
However, from the header file, I see that the inputs and outputs of the function prototype are in mxArray. I need to change this data type to whatever that LabView Call Library Function Node can recognize.
I have followed a few examples in the forum, but none of them went through.
I use LabView 8.5. I have Microsoft Visual C++ Version 6 and Microsoft Visual Studio 2005. The compiler is in C++. Should I use a C compiler only to generate the C wrapper dll so that Labview can recognize it in the Call Library Function Node?
If anybody has gone through this successfully, I would like to learn from you on how to do it.
Hello LabView developers,
I used LabVIEW to call Matlab m script to implement matlab MPC successfully. I wanted to use Matlab compiler to compile the matlab m script function into a c shared library .dll so that LabVIEW can call it without requiring Matlab installed ...How I calls DLL generated by LabVIEW in VB.NET2005?
How I calls DLL generated by LabVIEW in VB.NET2005?
I am loking forward for your help,thanks!
Thank you for your help,your information is very helpful ,thanks again!
...How can I calling LabView DLL within LabView and pass similar Data Types?
Content-Type: text/plain; charset=ISO-8859-1
I am trying to use an Instrument Driver, which is created in
LabView6.1 as a DLL. At this point I have only LabView to test this
DLL. I was wondering, is there easy way to find out what sort of
Parameter or Data Type I should be using.
How can I pass the following data with in LabView:
LVRefnum as Type?
LVBoolean as Type?
TD1 (a structure) as Type?
It is funny to see that I am able to create a DLL in labview but
having trouble calling it within LabView. I th...build a DLL in LabVIEW & Use the DLL in LabVIEW
I am trying to build a DLL for the simple vi with LabVIEW and want to use the DLL in LabVIEW. is it impossible?
I wrote a vi and it have 2 terminals. one is the input for numeric dbl data type and one another is the output for numeric dbl 1D array data type.
It was built with the Application builder for LabVIEW 8.0 and DLL was created successfully.
I want to use this DLL in new vi with LabVIEW.
Call library function used. I wrote a new vi to use that DLL.
In config dialog I config each parameter for dll and connected terminals. but it doesn't work
pleas refer to the attatched file and let me know what I missed.
...Using VB to call Labview DLL which uses HSDIO for generation and acquisition
I use VB to call Labview DLL which does the acquisition and generation using HSDIO card 6552.
For the generation and acquisition program, I run it successfully in Labview. I split the whole chain of generation and acquisition into two (to do downloading first for the first program A and program B is to activate the generation and acquisition).
In Labview it run well with the two program. I run A first and pass the parameters like the handler (for generation and for acquisition) and the error code over to B.
I compile them into DLL and use ...problem calling labview 8.2 generated DLL with microsoft c6.
I've a problem calling labview 8.2 generated DLL with microsoft c6.
The application is:
a dll generated with lv 8.2. The task of the dll is only to pass simple parameters (chars) from c to the fpga and backward.
Every time the c programs calls a dll function Windows Task Manager losses 2 handles. After minutes or hours the system crashes and other programs (for example nidaqmx) fail to make theyr tasks.
When I kill the application the system number of handles returns to the value it had before the run.
I'm sure the parameter passing and returning is correct.
Anybody has experienced this kind of memory loss? Shoud I make any type of HANDLE deallocation?
just wanted to ask you a question to understand where the problem is.
Did you already figured out if the problem is in the communication between the host and the FPGA target (running in LabVIEW) or if it's a problem generated calling the DLL in the C program?
Do you get some error code when the crash occurs?
...Matlab DLL vs Matlab script in LabView
I have some question for those who successed to import the Matlab DLL's to LabView :smileyhappy: :
Is there significant time difference between processing the matlab routine thru the DLL and between the Matlab script in LabView ?
For the RT program that I am doing in LabView the time is very impotent, and as I measured , the code writen in Matlab script
takes 10...Problem in creating the simulation dll using SIT 2.0.3,matlab 7.1,labview 7.1
I am currently using SIT 2.0.3 ,using this toolkit i am trying to create the simulation DLL for labview.but i am getting the following error in matlab command window
Error: File: C:\SimulationInterfaceToolkit\ModelInterface\basic.tlc Line: 117 Column: 7Undefined identifier ReleaseVersionError: File: C:\SimulationInterfaceToolkit\ModelInterface\basic.tlc Line: 117 Column: 25The == and != operators can only be used to compare values of the same typeError: File: C:\SimulationInterfaceToolkit\ModelInterface\basic.tlc Line: 260 Column: 26Undefined identifier ReleaseVersionError: File: C:\SimulationInterfaceToolkit\ModelInterface\basic.tlc Line: 260 Column: 44The == and != operators can only be used to compare values of the same type
Is this a version problem?
I am using
Simulation interface toolkit 2.0.3
Matlab 18.104.22.168(R14) Service pack
Real time workshop V.6.3
Microsoft visual C++ 6.0
Can anybody help me to solve this issue.
Hi, Unfortunately, it looks like the versions you are using are indeed not compatible. Here is an excerpt from the <a href="http://ftp.ni.com/support/softlib/labview/labview_toolkits/simulation_interface/2.0.3/sit_2_0_3_readme.html" target="_blank">Read Me file</a> for Simulation Interface Toolkit 2.0.3:
To use the Simulation Interface Toolkit 2.0.3, you must
be a properly licensed user of and have the following software
installed on the host computer.
- The MathWorks MATLAB ver...How to generate pulses in Labview
Thank you all friends for your help and support.
I am rellay try hardly to use two counters to generate for me 6 rectangular pulses (0,15m sec high and 7,35m sec low)and then two wait 2 seconds and again generate 6 pulses...etc, but all of my work do not give any result.
I try to search and find the examples also but I could not, so please, I ask any one who has the time, please write this program to me and send it to me or at least send me the example program or any program, which I can copy it and use it directly with a littel of modification.
Pleae help me.
I think it is the same problem like in your other two posts: "How to use pulse generation function" and "Also help in pulse generation".
So if you couldn't find the examples, descriped in the thread "How to use pulse generation function", you maybe doesn't have DAQmx installed on your system. So the next question is, do you have any hardware? The solution with two counters only works with hardware, otherwise you will not be able to to reach 0.15ms because of the windows timebase of 1ms.
Here is the link for downloading the <a href="http://digital.ni.com/softlib.nsf/websearch/4C9E45F6EE5C29F98625708900712CBC?opendocument&node=132060_US" target="_blank">NI-DAQmx Version 8.0 for Windows 2000/NT/XP</a>
Kind Regards, Christian
...Is LabVIEW Runtime required for a DLL created by LabVIEW ?
Could some one advice me on this matter please.
I am trying to build a DLL for a set of functions created in LabVIEW. Now I am wondering if I need to use it with some other language like VB or C++, do I need to install the LabVIEW runtime of the same version as the original functions ?
Any settings required while creating the DLL ?
I am trying to create it in LV 7.0
Thanks in advance
yes, if you want to use a dll, which is created with LabView you have to install the runtime engine.
I was hoping it would work without the LabVIEW runtime. Anyway, thanks for the quick reply.
...Display Matlab messages when the function is called by Labview via Matlab script
I use Labview (version 6.1) to send variables to Matlab (version 7.0.4) via Matlab script and I would like to display some message on the command window of Matlab.
The messages are displayed when I call my Matlab function from the command window of Matlab but not when the function is called from Labview.
Do you have any idea how to solve this problem ?
...calling matlab code in labview 5 using call library function
hai i have a problem...........
i want to call matlab code through call library function or cal
interface node and execute it in my labview 5.but as i configer the
dll. file in my CLF, it shows error saying function not found in
library. i want brief explanation of how to create dll.in matlab and
how to call it in labview5 CLF.can anybody help me?
divya shetty. :?:
...Re : C++ Call to DLL made in LabVIEW Fails the second time it is called
Five years later, I have exactly the same problem with LabVIEW v.6.1 :
It is impossible to call a function from a DLL which was loaded in a previous (ended) thread.
Do you know if something had been solutionned in newer releases ?
Thanks in advance.
Yes, this issue has been fixed in LabVIEW 8.0. Now, instead of using the first thread we spawn our own thread to handle the UI message pumping. I also wrote up an article on this with regards to getting the LabVIEW DLL to work in ASP.NET (where you have little control over threading). The same technique could be done by other applications. I'm not certain whether this works with LabVIEW 6.x as it is well before my time on the team...but it's something to try.
<a href="http://detritus.blogs.com/lycangeek/2005/05/labview_and_asp.html" target="_blank">http://detritus.blogs.com/lycangeek/2005/05/labview_and_asp.html</a>
...Use a wrapper to build a C++ Dll that calls a C++ .lib and Use the Dll is LabView
I need to access some functions in a C++ .lib within LabView, but has no source code for the library. Can I build a Dll in Visual C++ that calls this library, then have LabView calls the Dll? If so, how different is building this Dll compared to building a Dll from a .cpp file? I am new to C++, could some one suggest how to use the .lib in Visual C++ 6.0 studio to build the Dll?
Thanks for your help.
Thank you for the help. Sorry for the late reply here, got caught into a few busy projects. I do have a difficult LabView problem and hope get some help. I need to move a pop up window by using lvuser32.llb. Are pop up windows from labview or other application such as written by C++ are the same with regular windows? Also, is there a way to find the window names of all open windows including not only labview vi windows but also windows from other applications? Some of my non labview applications will have their names changed dynamically during execution. I need to know their exact name to access them in a vi.
BryanL wrote:Hi Emilie,
Also, is there a way to find the window names of all open windows including not only labview vi windows but also windows from other applications? Some of my non labview applications will have their names changed dynamically during execution...Calling a LabVIEW DLL from Delphi
I have created a DLL in LabVIEW 7.1.1 which communicates over seriel line with a tester. This DLL is an interface of a "device driver" which is used in an LV app successfully. This driver is built as Active-X server and DLL. I have created example programs in LV, Visual Basic and Visual C++ single thread and multi threaded. All those examples work fine. For the DLL version I have used the delay load feature of MS Visual Studio. One of my customers is programming in Delphi and he get an error whenever he is starting his application. It seems the error occurs during loading the DLL. He can ignore the error and the DLL is working fine afterwards.What must I change or my customer change within his Delphi project to avoid this error? Is there a similar project setting as the delay load feature in MS Visual Studio?
I don't think it helps you a lot, but I have just the other week delivered a LV prototype dll to my customer. They are using it in Delphi.One important thing is that your customer needs to have the correct runtime engine installed, in this case 7.1.1.I've heard no complaints about loading delays, but I would have to check. They did complain (small bug) about the close function, so I know they tested it.I used LV 8.5 by the way.Message Edited by andre.buurman@carya on 05-19-2008 10:53 PM
I don't know If the customer has the really exact runtime. He downloaded it by himself and it maybe 7.1 or 7.1.1. I didn't checked if both are av...Calling a LabView DLL from VB
I am running an NI example which is here
<a href="http://zone.ni.com/devzone/cda/epd/p/id/3990" target="_blank">http://zone.ni.com/devzone/cda/epd/p/id/3990</a>
and when I run it the new VB environment converts the program to the new .net structure ok.However, when it runs it gives this error
Loader lock was detectedAttempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.Any ideas?
<a href="http://zone.ni.com/devzone/cda/epd/p/id/3990" target="_blank"> </a>
...calling LabVIEW dll from C#
Could somebody post a fully working C# example of calling a function
from a LabVIEW generated dll with passing strings and integers in and
a couple of strings out?
What should be settings when creating the dll, of course (which
convention, how to pass)?
...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.
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: - Create 3 wrapper VIs. One for eac...