How to interface LabVIEW to Matlab?
Hallo everyone,
I have a function written in Matlab that does some calculations, the final result which is a number should be sent to LabVIEW to do something else. I want to know what is the best method to do this, ActiveX, TCP/IP or something else. why do I need this? because both programms were developed apart from each other, but know should be connected and it would take more time to rewrite either one in another software.
Thanks in advance!
Ive tried but it doesnt help. My matlab code is extremely complicated its all about fuzzy logic stuff and the labview program communicates with a microcontroller to control a pump.
to make it simple, Ive 2 programms one in Labview and the other in Matlab, i want to give the inputs of the "matlab code" in LabVIEW, then matlab code works, then the result is delivered to Labview to do sth else. does anybody have any idea how to do this or is it even possible?
Attachments:
pic.jpg 34 KB
Similar Messages
-
Hello, I want to interface LabVIEW with MATLAB using TCP/IP for data transfer. Can anyone, please give me a step-by-step instruction to how to do this? Or else can you point out where I can get them? Thanks.
Solved!
Go to Solution.Hi Sanchu,
As TCP/IP is such a generic protocol then you should be able to fairly easily build TCP/IP interfaces for both your LabVIEW and Matlab code and transfer data using ASCII, or variants etc depending on what sort of data you are trying to transfer. I'm not too familiar with Matlab, but on the LabVIEW end there are some very good TCP/IP server and client examples that ship with LabVIEW.
Another option that you may want to consider, and the reason I'm answering this is that I've recently done a project whereby we took some legacy Matlab code which we wanted to transpose into LabVIEW so that we could then fully automate a test system we have using TestStand. Much of it we were able to derive LabVIEW equivalent functions, but for some functions where LabVIEW didn't appear to have a suitable equivalent, or where it was simply more efficient, we simply copy and pasted the Matlab code into either in the first instance MathScript nodes (not dependant on Matlab) or Matlab script nodes (which will hopefully return to at a future date to fully transpose over to LabVIEW so that we are no longer dependant on a Matlab licence).
In both instances the relative ease of doing this was very impressive, and we were able to wrap huge amounts of Matlab code within LabVIEW with very few issues. As an idea, have you considered wrapping your Matlab functionality in this way and then keeping all the TCP/IP client and server comms within LabVIEW?
N.B. if you haven't found it search the palette for 'Matlab Script'
Best of luck,
David
David Clark
CLA | CTA
CLA Design Ltd
Hampshire, England -
Interfacing labview 8.5 with spectrum analyzer
can anyone tell me how to interface labview 8.5 with spectrum analyzer.............i am beginner ...i don't know much about labview
Solved!
Go to Solution.Why don't you tell us what you do know so we can better help you out? Do you know how to hook up the spectrum analyzer? Make/model of the spectrum analyzer? Do you know how to use it manually? Do you know what a spectrum analyzer is for?
I know some of these questions might sound almost insulting, but we have to establish a baseline so we know how much help you need, and how much detail to include.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
how to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and +i am a novice in interfacing(networking... jst know tidbits) skill ..so plzzzzz explain me in a litle detail
Sir
We were able to solve that problem...but now could you advice as to which DC power supply we should use (preferably avalable in India) so that it can be controlled by Labview (through a gpib/rs232/any other port) to give a square wave of desired frequency/other parameters.
Regards
Shivam -
How to create a DLL for LabVIEW in MatLab
I want to use MatLab-Code from an M-file in LabView without MatLab. So i decide to use external code in a DLL. Can anybody give me some hints - how to do? (How to create, how to use?)
Used System Windows 98, LabVIEW 6.1, MatLab 6.1 R12.1
ThanksHi,
I use Matlab-Code in Labview and it's don't need create a dll. The LV was a tool, matlab script, you can write your code Matlab here. see the examples of LV.I think the lV 6.1 have.
Dll it's very complicated -
How to generate and use Matlab(R2007) .dll's in Labview
Is there a step-by-step example on how to generate and use Matlab(R2007) .dll's in Labview.
Our experimenal hardware is LabView-controlled and we want to pass
images/2d intensity arrays to a more complex matlab program that will
return an array of extracted data which we want to use in LabView again.
Thank you
CarstenI recommend having a wrapper created around the matlab dll that converts the datatypes for you. There is a lot of fooling around with pointers involved which is very difficult in LabVIEW. btw, this got much more complicated after Matlab 7. Essentially, you need to convert your inputs into mxArrays, and then add those mxArrays to an mxArray list that you pass by pointer into the matlab dll. You also need to create a mxArray list for the outputs from the dll which you will need to extract your data out of before converting it back into a LabVIEW supported datatype. It's a big hassle. We do this pretty often, but we have created a c library that handles all the conversions, so it is feasible for us. Unfortunately, I can't share the library, but hopefully this information will help you get where you want to be.
Like I said, it would be easier if you can just get a c developer to write a wrapper for you to keep it simple in LabVIEW. Alternatively, you might try getting your m-code to work in Mathscript.
Chris -
LabVIEW St. 3.1Win: how to interface to Centronics
I'm a novice with LV
I made a simple ADC via centronics (ADC08831+LM35) and
I'd to test it using Labview.
I tried to use Serial Port Read VI
setting up port number to 10 (LPT1?)
with no success
Anyone can help me?
I haven't any DAQ card.
Thanl YouHallo, Delta_Force,
Du meintest am 15.11.00 zum Thema Re: LabVIEW St. 3.1Win: how to interface to Centronics:
>> Reading from the LP port is tricky. How is the port configured (in
>> the CMOS setup): SPP, EPP or ECP?
> SPP: it's an old 486
>> Do you know how to switch "base+0" from output to input?
> No I don't
From Vernon Buergs Interrupt list (port list):
--------P-P03BC03BF--------------------------
PORT 03BC-03BF - PARALLEL PRINTER PORT (MDA's LPT1)
Range: PORT 0278h, PORT 0378h, or PORT 03BCh
SeeAlso: MEM 0040h:0008h
03BC -W data port
03BC R- bidirectional port: input from connector
unidirectional port: last value written to port
03BD R- status port (see #P0658)
03BE RW control port (see #P0659)
Bitfields for parallel interface status port:
Bit(s) Description (Table P0658)
7 busy
6 NOT acknowledge (approx. 5us low pulse)
5 out of paper
4 printer is selected
3 *no* error
2 IRQ has *not* occurred
(PS/2) printer returned -ACK
1-0 reserved
Note: if bit 2 is clear (i.e. an interrupt has occurred), it is set again on
reading the status register
SeeAlso: #P0659
Bitfields for parallel interface control port:
Bit(s) Description (Table P0659)
7-6 reserved
7 (see PORT 037Bh bit 7)
5 (PS/2) enable bidirectional port
(also requires enabling via PORT 0102h)
4 enable IRQ (via -ACK)
3 select printer (SLCT IN line)
2 =0 initialize printer (-RESET line)
1 automatic line feed
0 strobe (must be set for minimum of 5 microseconds)
SeeAlso: #P0658
--------V-P03BF------------------------------
PORT 03BF - Hercules configuration switch register
Note: can also be found on EGA and VGA clones in Hercules emulation
03BF -W configuration switch register (see #P0660)
03BF -W (ET4000) Hercules compatibility register (see #P0661)
03BF RW (Genoa SuperEGA) miscellaneous register
Note: only available in MDA, HGC, and CGA emulation; should be
compatible with Hercules configuration register, but may contain
additional features
Bitfields for Hercules configuration switch register:
Bit(s) Description (Table P0660)
7-2 reserved
1 =0 disables upper 32K of graphics mode buffer
=1 enables upper 32K of graphics mode buffer
0 =0 prevents graphics mode
=1 allows graphics mode
SeeAlso: #P0661
He describes Port 03bch, Port 0378h ("LPT1") and 0278h ("LPT2") act in
the same way.
On a SPP port you cannot read from (base+0), you can only use some of
the status lines from (base+1).
Viele Gruesse!
Helmut -
How to use labview with the handyboard
Hi,
how to use labview with the handyboard
Thx...I'm assuming you're talking about this, since you didn't provide a link for those of us who don't know what you're talking about.
As the other poster said, you didn't say how you want to use LabVIEW with it. If you want to write LabVIEW programs than run on the microprocessor, then you're out of luck. If you want LabVIEW to interact with it, then you've got a couple of options, SPI probably being the best, but it also has DI and AI that you could use to communicate with it - the DI's could be used as a parallel interface.
Message Edited by Matthew Kelton on 12-17-2007 02:21 PM -
How to use labview with gpib to connect with Agilent PNA E8362B ?
how to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and +i am a novice in interfacing(networking... jst know tidbits) skill ..so plzzzzz explain me in a litle detail
Duplicate Post.
-
Interface labview program with real appliances
How do i interface labview program with real life appliances. For example: interface with light bulb
I suppose you could also find some kind of adapter to turn it into an IP based appliance and you could control it through the ethernet. Or you could wait a few decades and interface LabVIEW 2059 with your cranial implant to directly control your light bulb.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
How to Use LABVIEW charts with Mathscript
Hi,
I recently tried to work on Mathscript and it is really amazing. what I tried to figure out is:
Instead of plotting using traditional "plot" statement, how to use LabVIEW chart ( I know how to Add output but the graph were not as expected
Is there any mean to get rid of this "Lengthy" delay that "ALL MATLAB User know" for first time compilation?
Thanks in advance
Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & TechnologyWell Chris,
I was about to post the solution, but as I said, I'm in a middle of experts
It took me 3 hours to figure it out. I should've checked your answer . I resolved to the same suggesstion of yours. I only added some functionality to get the newbies like me being acquainting with how easy to work with LABVIEW mathscript based on MATLAB knowledge.
Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology
Attachments:
Play with Mathscript.vi 35 KB -
I'm trying to get Labview 8.6 to programatically launch and run MATLAB 7.5.0. We have routines currently written in MATLAB that interface with a third party's software to download data from some proprietary equipment. Is there an ActiveX example or a better way to get Labview and MATLAB to talk nicely? I've written a bare bones vi that will allow me to launch MATLAB but I keep getting an "Unexpected MATLAB operator" error when I try to use the Execute method on the MLAPP.DIMLApp Invoke Node. I'm not even sure if this is the right approach for what I'm trying to do.
I've searched the forums for hours and have found a couple of clues but most of the comments are to use MathScript or MATLAB Scripts and I don't think these will allow me to retain the comm functionality with the other software.
Ultimately, it would be nice if I could remotely launch MATLAB and run selected .m files. I would also need to pass small amounts of data back and forth from the Labview GUI to the MATLAB back end. Any help would be greatly appreciated!
LarryI agree, the VNC route is overkill. What I think you should do is write a standalone LabVIEW application that reads an INI file and executes the desired M-files. To control the program remotely over a network, simply incorporate a Remote Front Panel and webservices into theLabVIEW VI. Just go toTools --> Web Publishing Tool to add this functionality to your VI. Also make sure that the appropriate settings are enabled in the Web Services section of Tools --> Option. The LabVIEW help should have all the information you need to get going.
Then what you will have is a LabVIEW executable (only LabVIEW runtime engine needs to be installed on that machine, and MatLAB of course) running on the remote machine that you can control through your web-browser on the machine you are sitting at. Follow the links below for some more information.
Developing Remote Front Panel LabVIEW Applications
Web Publishing Tool Dialog Box
Chris Bakker
National Instruments
Applications Engineer
Check out LabVIEW 2009 and the New X-series DAQ! -
Interface labview with the test board to identify opamp pins automatically
is it possible to interface LABVIEW to a test board in such a way that the input, output pins of an op amp (8, 10, 14, 16 pin opamps) are identified automatically when DUT is placed in the socket
pratheek wrote:
Thanks alot. pin numbers are variable. I need to test the functional and test parameters for 8, 10, 14, 16 pin opamps.
The first thing you need to do is ensure that +VCC, -VCC, and GND are always connected to the correct pins. I think the best way to do this is have preset wire options that you manually select with some switches (reduces the complexity of the LabVIEW controlled wire switching).
pratheek wrote:
The desired out put for my project is to check the functionality of the opamps
I understand the end goal, but what you need for first specity is the test sequence.
1. Identify In/Out pins & number of op-amps. What is the sequence for this??? What voltages do you apply to the various pins and what is your desired outcome??? How do you identify each pin as in/out and whether they are for OpAmp1, OpAmp2, etc. Since this sequence will inevitabely apply voltage to the output pins, make sure your test sequence doesn't damage the chips.
2. After identfying each op-amp, what is the test sequence for evaluate its "functionality"?? Do you wish to evaluate the gain for various resistor combinations in an external circuit????
3. Now with your test sequences outlined, you can finally begin on getting LabVIEW to implement these functions. I'd use the DAQ digital outputs to a decoder (3-to-8 or 4-to-16). Use the outputs of the decoder to control switches (these switches control the connections between a second DAQ and the test pins). A third DAQ may even be necessary to control the selection of various test resistors. Keep in mind that each of these switches will add resistance to the path so your evaluation must be made measuring the voltages at the op-amp pins (not using the sourced voltage values). Planning the full measurement sequence and requirements before you start will not only help guide your program's development but it will tell you which DAQs are useful and how many you will need.
This is quite an undertaking and we can't really provide any help on the LabVIEW end until you have a full write up of what you want to happen and how (step-by-step details). Once you have that, start thinking about the sequence of events your code will have to follow to make it happen, then come back for guidance/help. -
Is there a way to interface Labview Web GUI with Fusion Charts?
Is there a way to interface Labview Web GUI with Fusion Charts for dynamic web presentation?
http://www.fusioncharts.com/I have a ballistics program which our clients can use (see attached). Basically there is a series of Cascading Combo boxes that the user must select for Bullet Manufacturer, Caliber, and Bullet ID. The program then goes out to the relevant data file (.CSV) and provides ballistic inputs for the selected projectile. The user is also required to enter in additional data, such as Sight Height, LOS Range, Temp, etc.. Once all data is input, the user either hits the Calculate Button or the Tab (I'm using Event Structures and I now realize this is an issue for Web UI Builder), and the data gets passed to a MathScript which then crunches numbers and spits output to fill a table and a series of Graphs based upon the tablulated data (if so desired).
I was hoping to use Labivew for the first two parts ( Data Collection and Number Crunching) and use something like Fusion Charts for the presentation. I tried learning Ruby on Rails. I was successful with the Ruby part (basically the Mathscript portion) but really got hung up on the Rails section and the need for something like JSON to interface with it. Could not find a useful source of information which really showed you how to combine the two effectively.
Attachments:
Ballistics1.JPG 144 KB
Ballistics2.JPG 265 KB -
Trasferire dati da Labview a Matlab e viceversa
Buongiorno, ho iniziato da un paio di mesi ad utilizzare Labview, e per un progetto universitario mi hanno chiesto di sviluppare un software che mi permetta di trasferira dati da Matlab a Labview e da Labview a Matlab. So che le stesse analisi che posso fare in Matlab le posso fare in Labview ma mi hanno chiesto proprio un software apposta per il passaggio dei dati. Qualcuno può aiutarmi?
How do I Transfer Data Between The MathWorks, Inc. MATLAB® Software Development Environment and LabVIEW?
http://digital.ni.com/public.nsf/allkb/2F8ED0F588E06BE1862565A90066E9BA?OpenDocument
Reading TDM/TDMS Files with The MathWorks, Inc. MATLAB® Software
http://zone.ni.com/devzone/cda/epd/p/id/5957
Il primo documento spiega le due opzioni a tua disposizione:
- o utilizzi il Mathscript Module per LabVIEW che ti consente di mandare in escuzione del codice MatLab, richiamandolo da LV e passandogli (o ricevendo) dati
- o utilizzi un file di appogio nel quale scrivere i dati acquisiti, leggendoli poi da Matlab
Maybe you are looking for
-
Unable to create SWC in Flash CS4
Hi, Im having trouble creating swc files, Ive tryed both by publishing and exporting individual movie clips from the library, no swc file is created. My work colleage is able to create them from the library but not by publishing, any ideas? Im using
-
Linking Multiple Resource Accounts via Active Sync
Ok guys/gals the scenario is... We have one idm account linked to accounts on one resource, and we want to be able to link them up via Active Sync...We don't care about the attributes, just want to make sure that if a another account for a user is cr
-
Username and Password Prompt Blocked Internet Explorer
I'm not sure that's IE behavior. I've never seen nor read about it before.
-
Http server run as services on win2k?
Hi, I have installed oracle 9i to my win2k and would like to setup the http server to run as services, but can't found any document about it. This is command line how I start OC4J from report 9i (startinst.bat): C:\work\programs\oracle\developer\jdk\
-
Can I buy the Ipod nano Red in any other stores besides the apple retail store?
Can I buy the Apple Ipod Nano RED in any other retail store other than the apple store? I want to get one today but I don't want to go to the mall to get it. Thanks!