f



Matlab and C++ in LABVIEW

dear all!
Plz help me out that how can i implement Matlab code in LABVIEW.i am using matlab 7.0 and LABVIEW 7.1.
is there any method so that i dont have to change the Matlab code and it runs in LABVIEW.
secondly can i run a C++ code in formula node exactly as it runs in C++ compiler
thnx for ur time
Manzoor
0
x9561 (148442)
2/6/2007 11:10:08 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

1 Replies
558 Views

Similar Articles

[PageSpeed] 31

manzoor,
In version 7 and 7.1, LabVIEW have the "MATLAB Script Node" that allows you to run m-scripts from within LabVIEW. Since you have communication between both products, minimal change (if any) is necessary, but you have to have both produts installed on the same machine for this interface to work. In LabVIEW 8.20,&nbsp;NI introduced the Mathscript node and this requirement is not necessary. Please look into this site: <a href="http://www.ni.com/labview/mathscript.htm" target="_blank">http://www.ni.com/labview/mathscript.htm</a>&nbsp;to learn more about mathscript node. 
In the formula node, you can use C-like convension to develop your equations. However, you can't use object-oriented programming in there. So, you need to remove the objects from the formula and use stricted types. You should be able to obtain more information in the help of the Formula Node.
Hope this helps.
0
x9561 (148442)
2/7/2007 2:10:15 PM
Reply:

Similar Artilces:

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. &nbsp; 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 &amp; 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). &nbsp; 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...

Debugging a C++ dll from LabVIEW
Hello all, &nbsp; What I want to get a feel for is how easy it is to set up the ability to debug code both in labVIEW AND in a C++&nbsp;compiler, say Visual Studio. &nbsp; If we have a situation where we have a c++ dll which we are accessing from labVIEW is it possible to attach the process so that you can set breakpoints in both environments. Hence run labVIEW app and when dll gets called hit a Visual Studio breakpoint? &nbsp; This is a new area to me and I have not found anything regarding debugging. Any comments would be appreciated. &nbsp; Regards &nbsp; Kevin Hi,...

Labview from C/C++
Hi My question is about how to call Labview VI/Global variables from C/C++. We have a cRIO-9012 that runs under the VxWorks operative system. Up to now, we were calling C functions from Labview, but we also need to do the opposite. - Can I call a VI from C/C++? - Can I access Labview global variables from C/C++? - Or is there a passive diagram, mapped to a C function, to be placed in a VI that is triggered by the C function? Alain -- _________________________________________________ Alain Migeon Please reverse alain and migeon for replying. On Oct 15, 9:20 am, Alain Migeon <migeon.al...@tdcspace.dk> wrote: > Hi > > My question is about how to call Labview VI/Global variables from C/C++. > > We have a cRIO-9012 that runs under the VxWorks operative system. > > Up to now, we were calling C functions from Labview, but we also need to > do the opposite. > > - Can I call a VI from C/C++? > - Can I access Labview global variables from C/C++? > - Or is there a passive diagram, mapped to a C function, to be placed in > a VI that is triggered by the C function? > > Alain > > -- > _________________________________________________ > Alain Migeon > Please reverse alain and migeon for replying. The two main methods for accessing the functionality of a Labview VI from external C/C++ code are ActiveX and Application Builder. ActiveX is available only on the Windows Platform. Application Builder comes with the P...

C/C++ in matlab and matlab in C/C++ ?
Is it possible to read C/C++ code in matlab and the other way around too? Hi, as long as C or C++ are written in text files you can edit them in the matlab editor. To see the special character of C or C++ coding language, in the editor go to menus: file>preferences>Edito/Debugger>language and on popup "Language" select "C/C++". This does not allow you to run the C/C++ code, just to view it i nicer way... regards, chris saneman <asdfsdf@asd.com> wrote in message <frl846 $f8i$2@news.net.uni-c.dk>... > Is it possible to read C/C...

change a LabVIEW array outside LabVIEW and keep updated in LabVIEW
change a LabVIEW array outside LabVIEW and keep updated in LabVIEW hi, I am Interfacing a FrameGrabber with LabVIEW using a frame grabber SDK(dll). The memory managment of this FG allow you to allocate your own Array and to give a pointer to this Array to the memory manager. Then when you acquire with the frame grabber, the acquired image will be directly accessible in your array. 1.I give to the FG memory manager a pointer to the Labview array through a SDK Dll function. 2. I run the acquisition 3. I display the array My problem is that the Array is allways displayed with it initial val...

Problem for calling a Matlab generated C DLL with Labview
Hello everybody, 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: - Initialize - InitializeWithHandlers - PrintStackTrace - Terminate - mlf - mlx 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...

methods to call matlab in C C++ and call C C++ in matlab
Hi, I am reading the help documents about how to program matlab and C C++ together and my questions are a little bit general. It seems that are several ways to call matlab in C C++ and another several ways to call C C++ in matlab. Please correct me if I am wrong or missing something when I try to list them. To call matlab code in C C++, are there two methods available? The first one is Matlab engine and the second one is to use MATLAB Compiler mcc to create C or C++ shared libraries from your MATLAB code. To call C C++ in matlab, are there also two methods? The first one is to call funct...

matlab labview
hi i am a new Labview user i try to run a working function that i wrote in matlab on labview and i get&nbsp;error 1048 can u help me solve this problem ? ty &nbsp; error.jpg: http://forums.ni.com/attachments/ni/170/244007/1/error.jpg hi i have tried to chenge the variables, but it didnt help i have notice that when i try to lanch reserve matlab function as "ones(1,5)" it's work fine but when&nbsp;i chenge it back to Load1 it fails &nbsp;the m.file is located in the directory used by matlab so this isnt the problem where i need to put the m.file in order that matlab will call it from labview? ty ...

LabVIEW and MATLAB
Hello I am intersted in being able to "call" a certain MATLAB function (lets call it calculate_touch_point.m- the function returns one parameter - touch_point) and I am wondering how the whole interface between LabVIEW and MATLAB works. If anyone can answer me shortly or has any documentation such as web links or pdf files regarding ti that issue&nbsp;that he can tell me about will help me a lot. Thanks, Lavi&nbsp; Hello again I am having a problem with sending the variables from LabVIEW to the script node. I am getting an error: Error 1047 occurred at LabVIEW:&nbsp; LabVIEW failed to send variable to the script server. Server:"" in Working with MATLAB - sending variable 18 04.vi Do you know what am I doing wrong??? Lavi &nbsp; question.doc: http://forums.ni.com/attachments/ni/170/242496/1/question.doc The version I am using is 8.0 Thanks Lavi &nbsp; Working with MATLAB - sending variable 18 04.vi: http://forums.ni.com/attachments/ni/170/242505/1/Working with MATLAB - sending variable 18 04.vi Hello again &nbsp; I removed : clear all; and also removed clc; and close all; just in case, but it still doesn't work. &nbsp; by the way - The MATLAB version I am using is R2006a, and the LabVIEW version I am using is 8.0) &nbsp; Do you have any other suggestions? &nbsp; Thanks, Lavi Working with MATLAB - sending variable 18 04.vi: http://forums.ni.com/attachments/ni/170/242637/1/Working with MATLAB - sending variab...

Re: LabVIEW and LabVIEW RT?
Hello Iman, I will try to illustrate it with an example since it all will depend on the type of application you would like to implement. Let's say you would like to implement an application where you log data, maybe exchange data with databases and you acquire a bunch of data points at a time not performing any type of control and where high determinism is&nbsp;not needed. In this case LabVIEW for Windows work great. If you on the other hand would like to implement a closed-loop application where you need high determinism and reliability and will acquire data point by point you would use LabVIEW RT which is an add-on to LabVIEW. I.e. you need LabVIEW + LabVIEW RT when developing an RT application. ...

C to Labview
Hi all, &nbsp; I am fairly new to Labview and I have been given a project at work to convert an existing c code to labview. I will provide the section of the code That is giving me problems to see if any of you could assist me in writing it in labview. &nbsp; void CPokey2Dlg::FindN(unsigned char Channel) { double FreqOne,NFrac; int NReg; int iDividend; NFrac = FreqOne/(double)2.8e6; NReg = int(NFrac+.5); m_EditChannelTwo = NReg; UpdateData(false); // if (NReg &gt;= NFrac) NFrac = (double)262144*(NFrac - (double)NReg); // else // NFrac = int((262144*((double)NReg-NFrac))+.5); if (NFrac &lt;0) NFrac = int(NFrac -.5); else NFrac = int(NFrac +.5); // m_EditChannelTwo = NFrac; // UpdateData(false); &nbsp; NReg = NReg - 32; iDividend = (int)NFrac; m_EditChannelTwo = NFrac; UpdateData(false); // format for register SKY72300[0] = (unsigned char)(NReg &gt;&gt; 8); SKY72300[0] = SKY72300[0] &amp; 0x01; SKY72300[1] = (unsigned char)NReg; SKY72300[2] = (unsigned char)(iDividend &gt;&gt; 16); SKY72300[2] = SKY72300[2] &amp; 0x03; SKY72300[2] = SKY72300[2] | 0x10; SKY72300[3] = (unsigned char)(iDividend &gt;&gt; 8); SKY72300[4] = 0x20; SKY72300[5] = (unsigned char)(iDividend); } &nbsp; Thanks ...

LabView with Matlab
Hello! I am trying to write a subVI which does a lot of iterations like the Newton-Raphsody. I have tried using Newton-Raphsody but it seems to crash for some iterations. So now I am trying to use Matlab Script or C for that program. Of the two, writing a program in C seems to be a lot of work for me as everytime I write it, I need to compile it as dll and run and save it and then reload it. I would like to know if Matlab is a good option or if you have any ideas to suggest, please let me know. Also, I would like to know any good books to learn Matlab script. Thanks! Here's the scoop. I ...

How to interface the Labview and Simulink (Matlab) without using the &quot;NI LabVIEW Simulation Interface Toolkit&quot;?
Hello, I've been using the Labview for the data aquisition. And I also developed a controller in the Simulink (Matlab) environment. I'd like to control my application using both&nbsp;programs. How&nbsp;could I&nbsp;interface the Labview and Simulink (Matlab) without using the "NI LabVIEW Simulation Interface Toolkit"? thank you, Kostya. Hi Kotsya, Thank you for posting to the National Instruments Discussion Forums. If you are not using the Math Interface Toolkit, you may be interested in using the MATLAB� Script Node. This allows you to call MATLAB� commands using ActiveX and I you can call your Simulink model from MATLAB� that way. Here are some resources on how you can do this: <a href="http://zone.ni.com/reference/en-XX/help/371361B-01/gmath/matlab_script_node/" target="_blank">MATLAB � Script Node LabVIEW 8.2 Help</a> <a href="http://digital.ni.com/public.nsf/websearch/4475BC3CEB062C9586256D750058F14B?OpenDocument" target="_blank">How Can I Resolve MATLAB� script node and Xmath Script Node Issues in LabVIEW?</a> Hope this helps! Hi, Abhinav, thank you for your reply. I will try to explore the option with the Script Node. regards, Kostya. &nbsp; &nbsp; ...

If i have a labview .vi file(and labview) but i want to open it in a computer that doesn't have labview, how would i do it??
Okay, i have a made a labview program and save it as.vi. &nbsp; Let's say that it is a program that when opened and you hit run it shows a sine wave. &nbsp; Now if i wanted to open up the program without Labview, ( i don't need to modify it) on a computer that doesn't have labview. How would i go about doing this?? &nbsp; Thanks, K ...

LabVIEW
Hi ALL, I am a new user of LabVIEW. I have been assigned to acquire a signal from a sensor at a car. However, all these signals must be filtered. But I am not sure, what type of filter most powerful. Besides, as I know, different type of signal needs differenct type of filter. Anybody can help me to solve my problems. Your kind cooperation is highly appreciated. Regards, M. Firdaus, France Fird wrote: > Hi ALL, > I am a new user of LabVIEW. > I have been assigned to acquire a signal from a sensor at a car. > However, all these signals must be filtered. ...

Matlab DLL vs Matlab script in LabView
Hello, &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;I have some question for those who successed to import the Matlab DLL's to&nbsp; LabView&nbsp; :smileyhappy:&nbsp;: &nbsp;Is there significant time difference between processing the matlab routine thru the DLL&nbsp; and between the Matlab script in LabView ? &nbsp;For the&nbsp; RT&nbsp;&nbsp;&nbsp;program that&nbsp;I am doing in LabView the time is very impotent, and&nbsp;as&nbsp;I&nbsp; measured , the code&nbsp;writen &nbsp;in Matlab script &nbsp;takes&nbsp;10...

C/C++ in MATALB or MATLAB in C/C++?
Hi I've been asking on the net how to use MEX properly so that I can use C/C++ in MATLAB, but information is not forthcoming. There seems to be a lot on using MATLAB in C/C++ but not the other way around. I understand Mathworks is trying very hard to sell the Matlab Compiler, but even so, why is it SO hard to get information about MEX? Or is it that I've missed something very fundamental, meaning that I'm struggling over something that is actually quite easy? Any thoughts and info would be great. Thanks BullDog BullDog wrote: > Hi > > I've been asking on the net ...

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, &nbsp; 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&nbsp;shared library&nbsp;.dll so that LabVIEW can call it without requiring Matlab installed on the PC. &nbsp; I used MatLab R2007b with matlab compiler. I was able to generate a C shared library dll set successfully using mcc command. &nbsp; However, from the header file, I see that the inputs and outputs of&nbsp;the function prototype&nbsp;are&nbsp;in mxArray. I need to change this data type to whatever that&nbsp;LabView Call&nbsp;Library Function Node can recognize. &nbsp; I have followed a few examples in the forum, but none of them went through. &nbsp; 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? &nbsp; If anybody has gone through this successfully, I would like to learn from you on how to do it. &nbsp; Thanks, &nbsp; Kimberly yw wrote: Hello LabView developers, &nbsp; 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&nbsp;shared library&nbsp;.dll so that LabVIEW can call it without requiring Matlab installed ...

[ann] C/C++ interpreter Ch for labview released
Ch is a free C/C++ interpreter. The source code for embeding Ch into labview is now available from the link below http://iel.ucdavis.edu/projects/chlabview/ More about C/C++ interpreter Ch can be found at http://www.softintegration.com Any comments or suggestions are welcome That's realy cool thanks, ...

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, Dan ...

how to make my labview codings as a package for labview
Hello NI, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I made drivers for some thrid party instruments, which is compatable for serial port and&nbsp;Ethernet.&nbsp;I have several vi's for that i cant able to share these vi's to my friends. i just want to build one package of my driver, also i want to install these package to labview user library. &nbsp; Tell me some good suggestion for this. &nbsp; With&nbsp;warm regards, Balaji DP Application Engineer, Gantner&nbsp;Instruments.&nbsp; The easiest way is to do a development distribution (File&gt;&gt;Save As. If your needs are more complex, you can also try <a href="http://jkisoft.com/vipm/" target="_blank">VIPM</a>. I don't&nbsp;think the free version can do this, but it's worth it just for getting the OpenG code. where i can find this development distribution ? is there option available in labview? If you re using LV versions &gt; 7.x, you can create an LLB by using the option Save As... in the Files menu. You have to just open the top-level VI of that driver (or something) &amp; go on to build the LLB. All other VIs will get added/bundled into it automatically. :smileyhappy: In LV 7.x, I think it ll be under the Tools &gt;&gt; Build Source Distribution menu... balaji_dp@yahoo.com wrote:Hello NI, &nb...

Labview.lib was not calld from a labview process
I am working with our labview programers to create a Labview DLL that will be called from Labview and VB6. The code works fine with Labview but I keep getting Fatal Error: Labview.lib was not calld from a labview process. I have checked the versions of development software and the runtime versions that we are using and they matche 8.0.1. We have also preformed a mass compile of the DLL with no change. &nbsp; Are there any other steps that we can take to solve this problem??? &nbsp; &nbsp; <a href="http://digital.ni.com/public.nsf/allkb/A4C3AEF93240280A86256931006FB66C?OpenDocument" target="_blank">http://digital.ni.com/public.nsf/allkb/A4C3AEF93240280A86256931006FB66C?OpenDocument</a> &nbsp;Just to make sure you know of this article, I hope its a new one and else we can look further.<a href="http://www.groupsrv.com/computers/about566915.html" target="_blank">http://www.groupsrv.com/computers/about566915.html</a> Another discussion regarding the same error message.<a href="http://digital.ni.com/public.nsf/allkb/A4C3AEF93240280A86256931006FB66C?OpenDocument" target="_blank"></a> Message Edited by andre.buurman@carya on 06-04-2008 08:02 PM <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=127655&amp;query.id=62975#M127655" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=...

Installation of LabView 8 after LabView 6
Good afternoon everybody, &nbsp; I've got a big problem with LabView. The fact is that I begin with this software... I've just installed LabView 8 on a computer where LabView 6 was installed. Once the installation finished, I tried to launch a VI That was developped under the old version. &nbsp; The problem is that two VI can't be found : - AI Sample Channel.vi - AI Acquire Waveform.vi Therefore, I can't use anymore the program that was working before... What is the solution to get everything ok please ? Thank you very much ! SylvianTriquigneaux, the VI will now...

Is .NET DLL better to use than C/C++ DLL in labview?
I was wondering which one runs more natively in LabView8.5. C/C++ DLL or DLL by .NET ?Thank you. You can use either kind, but .NET assemblies are much easier to work with. You can find some tutorials on working with&nbsp;both by searching this site. ...

Web resources about - Matlab and C++ in LABVIEW - comp.lang.labview

LabVIEW - Wikipedia, the free encyclopedia
LabVIEW (short for Laboratory Virtual Instrument Engineering Workbench) is a system-design platform and development environment for a visual ...

LabVIEW - Geekosystem
Don we now our gay apparel, and why shouldn’t that apparel be primarily composed of Christmas lights synchronized to flash with music ? Andy ...

National Instruments - LinkedIn
Welcome to the company profile of National Instruments on LinkedIn. It's not what we make. It's what we make possible. National Instruments is ...

Open Directory - Computers: Programming: Languages
about dmoz - dmoz blog - report abuse/spam - help the entire directory only in Programming/Languages Description Top : Computers : Programming ...

Products / Home - g.tec - Guger Technologies
g.tec medical and electrical engineering produces biosignal amplifiers, data acquisition systems, real-time processing systems and EEG Processing ...

School of Electrical & Electronic Engineering - Computing Facilities
In particular, we have technical interests in common with the other Engineering Schools (Chemical, Civil & Environmental, Mechanical and Computer ...

Handy Arduino Uno R3 Pinout Diagram
Loading... « Missed the Maker Faire? Catch the pictures! Music + Floppy = Moppy » The original post from Nick Gammon is old, but I’m pretty sure ...

Curriculum Vitae - Stefano Meroli
Curriculum Vitae - Stefano Meroli

Testing Engineering Supervisor
Testing Engineering Supervisor job. Read the Testing Engineering Supervisor job description and find other Division 10 Personnel jobs at Monster. ...

Knowledge and Content Management: A Foundation for Business Success
Knowledge management and enterprise content management are increasingly at the center of a successful business strategy.

Resources last updated: 3/19/2016 4:43:17 PM