Running matlab program via switch in labview

Hi,
I had a basic question on integrating a matlab m file into labview. What I pretty much want is the ability to run a certain m file at a flip of a switch.
I essentially created a reset button and that reset button will reset my device. 
I attached my block diagram to my best guess to how it would work but when I tried to run it, it does not run the m file.
Any reason why? I tried while(y==1) and if(y==1) to run it but doesn't seem to work.
Thanks! Looking forward to hearing from you!
Justin
Attachments:
reset.JPG ‏24 KB

Just remember to put Wait statements in the loops so they don't run the CPU at top speed.
Message Edited by Ravens Fan on 03-28-2010 05:19 PM
Attachments:
Example_VI_BD.png ‏30 KB

Similar Messages

  • I have some software problems of running matlab script node in the LabVIEW program.

    Hi there,
    I wrote a simple matlab code, like x= 1, y = x*2. Then I tried to put them into matlab script node in LabVIEW.
    However, when I ran the program, I couldn't run and Labiew show some error. 
    Then I tried the method talked before on this forum. Please see the following link.
    http://forums.ni.com/ni/board/message?board.id=Mat​hScript&thread.id=571
    I followed the instruction and open the "command prompt," type some commands then I could run the program, and simultaneously, the LabVIEW program open "Matlab command line window" and run my labview code. However, if I didn't use the command prompt, the  "matlab command window" will not be opened by running the labview program. It would just show some error. And even if I turn on the matlab program in advance, I still couldn't run the labview program.
    Is there any effecient way to deal with this problem without using "command prompt?" Because I try another PC with both matlab and labview installed on it, I "can" run my simple matlab script node on it, and it will open the matlab command line window automatically by running my code. Therefore, I thought there might be some software linking problems in the previous PC I used . Do you have any ideas?
    Thanks in advacne.  

    This board is for Mathscript, but you seem to have a matlab problem. You should probably post in the LabVIEW forum instead.
    What is your LabVIEW version? What is you matlab version?
    LabVIEW Champion . Do more with less code and in less time .

  • Windows 7 is Error reporting when running a program generated with in Labview LV 7.1!

    Dear Labviewer's
    Once back in the yaers I'd generated a program with  - Labview 7.1.
    Now I'm informed that the version LV 7.1 is not supported by Windows 7.
    Now when i try to run the Program generated by Labview 7.1.  in windows 7 , I get communication error by the serial port. 
    Is there somehow somthing I can do to get this work. Is there any Runtime engines From NI for Windows 7.?
    Please Feed back if anyone got info for help.
    4 Stars ...
    HFZ
    Solved!
    Go to Solution.

    Have you installed a newer version of the NI-VISA runtime engine that will work with Windows 7?
    The most recent on the NI website appears to be version 5.0.3.
    http://joule.ni.com/nidu/cds/view/p/id/2257/lang/en

  • How do I write and run c++ programs via terminal?

    First off, if this is the wrong place to post, my apologies. I'm running arch off a raspberry pi, and sshing into it on my computer (a mac, if it makes a difference), and I was wondering how I could run c++ programs on it. I don't want to install a desktop environment, because I think using terminal is a cool challenge. I'm assuming I can just use nano or some other text editor to write them, but how do I get them to run, as well as get all the libraries I would need? I am thinking just things that run in terminal, no programs with a gui. Any suggestions?

    First, I am going to suggest you take Arch Arm questions to their forums.    They are the experts.
    But, what you ask is easy -- if the tools are installed on your ras-pi.  Here is some code I did not write that generates data that can be piped to gnuplot to animate a Lorenz  attractor. 
    ewaller$@$odin ~/devel/C/lorenz [130]1026 %cat lorenz.cpp
    #include <iostream>
    #define tab "\t"
    using namespace std;
    void lorenz(double *x,double *dxdt)
    dxdt[0]=10.0*(x[1]-x[0]);
    dxdt[1]=28.0*x[0]-x[1]-x[0]*x[2];
    dxdt[2]=-2.666666666666*x[2]+x[0]*x[1];
    int main(int argc,char **argv)
    int len=300;
    double x[len*3],dxdt[3],dt=0.01;
    x[0]=1.0;x[1]=1.0;x[2]=1.0;
    int cur=0,next=1;
    for(int i=1;i<len*10;i++)
    lorenz(x+3*cur,dxdt);
    for(int j=0;j<3;j++) x[3*next+j]=x[3*cur+j]+dt*dxdt[j];
    if(++cur == len) cur=0;
    if(++next == len) next=0;
    for(double t=0.0;t<100000000.0;t+=dt)
    cout<<"sp [-30:30][-30:30][0:50] '-' w l"<<endl;
    for(int i=cur+1;i<len;i++)
    cout<<tab<<x[3*i]<<tab<<x[3*i+1]<<tab<<x[3*i+2]<<endl;
    for(int i=0;i<cur+1;i++)
    cout<<tab<<x[3*i]<<tab<<x[3*i+1]<<tab<<x[3*i+2]<<endl;
    cout<<'e'<<endl;
    lorenz(x+3*cur,dxdt);
    for(int j=0;j<3;j++) x[3*next+j]=x[3*cur+j]+dt*dxdt[j];
    if(++cur == len) cur=0;
    if(++next == len) next=0;
    return 0;
    ewaller$@$odin ~/devel/C/lorenz 1027 %g++ lorenz.cpp
    ewaller$@$odin ~/devel/C/lorenz 1028 %./a.out|head
    sp [-30:30][-30:30][0:50] '-' w l
    -9.3252 -8.45882 29.0952
    -9.23857 -8.27211 29.1081
    -9.14192 -8.08701 29.0961
    -9.03643 -7.90593 29.0595
    -8.92338 -7.73113 28.999
    -8.80415 -7.56467 28.9156
    -8.68021 -7.40841 28.8105
    -8.55303 -7.26397 28.6853
    -8.42412 -7.13271 28.5417
    ewaller$@$odin ~/devel/C/lorenz 1029 %
    You may want to set up a cross compiler on your x86_64 Arch system for ARM.  That we can help you with....

  • Open a file in a running java program via double click

    I have already implemented opening my program with the corresponding file after a double click in windows explorer or from the cmd line but how do you open a file into the program if it is already running as MS Word will open a .doc file in the current word instance if you are running it.
    Thx,
    Jim

    Implement some sort of interprocess communication in your program. If you launch an instance, it can check whether another is running and pass a message to it telling it to perform the wished action.

  • Running Java Program via bat file

    Hi
    I have a bat file. I have compile the java files and the class files into the same folder.
    I am suppose to double click on the bat file and it is suppose to run (in the same manner as IDE)
    but it only appear the 1st line of the program. Whatever i type, it refuse to budge.
    What should i do to retify the problem?
    I have already set the classpath properly

    Hi
    I just realised that my program can only run halfway on the dos...
    This is my code sample
    try{
                pw = new PrintWriter("TS.log");           
                System.out.println ("hi");
            catch(IOException io){
                io.printStackTrace();
            try {
                StandAloneApplication = true;
                String[] a = new String[1];  
                System.out.println ("hi2");
                Settings settings = Settings.getInstance();
                StringTokenizer letterToken = new StringTokenizer(settings.get("letter"),",");
                Vector <String> v = new Vector<String>();
                while(letterToken.hasMoreTokens()){
                    v.add(letterToken.nextToken());
                String letter[] = v.toArray(new String[v.size()]);
                System.out.println ("hi3");
                DbConnection d = new DbConnection();
                String stocklist = d.getStockList();
                String mainFile ="";
                GenerateSLS sMain = new GenerateSLS("timeSales.sls");                                               
                String sessionID = d.createiFisSession();                      
                System.out.println ("hi4");
                for(int i=0;i<letter.length;i++){
                    System.out.println ("print");
                    mainFile = sMain.start("timeSalesGen"+letter[i]+".sls",d.getStockList(letter[i]+"%.SI"),sessionID);
                    a[0] = mainFile;       
                    staticArguments = a;       
                    Viewer viewerMain = new TSMainCapture();       
                    viewerMain.init();          
                    viewerMain.start();it stops printing after "hi4"
    btw, I have tried to run this on the bat file again.
    IDE side retest, re-compile and rerun, work well
    Pls help
    Thanks.
    Lots of appreciation

  • I cannot run the matlab script node in the labview

    Hi there,
    My LabVIEW version is 8.5, and matlab version is R2008a.
    I wrote a simple matlab code, like x= 1, y = x*2. Then I tried to put them into matlab script node in LabVIEW.
    However, when I ran the program, I couldn't run and Labiew show some error. 
    Then I tried the method talked before on this forum. Please see the following link.
    http://forums.ni.com/ni/board/message?board.id=MathScript&thread.id=571
    I followed the instruction and open the "command prompt," type some commands then I could run the program, and simultaneously, the LabVIEW program open "Matlab command line window" and run my labview code. However, if I didn't use the command prompt, the  "matlab command window" will not be opened by running the labview program. It would just show some error. And even if I turn on the matlab program in advance, I still couldn't run the labview program.
    Is there any effecient way to deal with this problem without using "command prompt?" Because I try another PC with both matlab and labview installed on it, I "can" run my simple matlab script node on it, and it will open the matlab command line window automatically by running my code. Therefore, I thought there might be some software linking problems in the previous PC I used . Do you have any ideas?
    Thanks in advacne.  

    Hi, and thanks for the post! I hope your well today.
    This may help,
    MATLAB® version 2006b (7.3) and version 2008a do work with LabVIEW
    8.20. This problem can occur if a new version of the MATLAB® software
    is installed along with a previous installation, which is then
    uninstalled. The uninstallation of the older MATLAB® software results
    in removing the ActiveX/COM components LabVIEW uses. This can cause the
    MATLAB® script node in LabVIEW to stop working. There are three
    solutions to this problem.
    Uninstall the MATLAB® software and reinstall it. This should install the necessary ActiveX component.
    Restore the MATLAB® automation server. Browse to the \bin directory (e.g. MATLAB\R2006b\bin) and type matlab -regserver ,
    which will reset the registry settings and start the server. The server
    can then be closed and the MATLAB® script node will work properly again
    in LabVIEW. LabVIEW may need to be restarted if VIs are open that
    contain MATLAB® script nodes.
    Leave both versions of the MATLAB® software installed.
    MATLAB® is a registered trademark of The MathWorks, Inc. Other
    product and company names listed are trademarks and trade names of
    their respective companies.
    Did you have an older version of MATLAB before 2008a?
    Kind Regards,
    James.
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Error -17600 when switching from LabVIEW Development System to LabVIEW Run-Time Engine in Adapter Configuration

    I receive an error message (code -17600) while loading my test sequence after switching from LabVIEW Development System (2009 f3) to LabVIEW Run-TIme Engine using the Adapter Configuration.
    ErrorCode: -17600,
    Failed to load a required step's associated module.
    LabVIEW Run-Time Engine version 9.0.1f3.
    When I switch back to the LV development system, everything is OK, and the sequence loads and runs perfectly.
    My TestStand Engine Version is 2012 f1 (5.0.0.262).
    I'd appreciate any help on this issue.
    Roman

    Hi Roman,
    There are a couple of things you can try:
    1) Determine if the LabVIEW RunTime Engine is corrupted in some way. Create a new simple VI with no sub-VIs, using the same LabVIEW Development system you used for mass-compiling the VIs. Create a TestStand step that calls this VI and ensure it runs correctly. Now switch your LabVIEW adapter to use the RuntimeEngine and choose the "Auto detect using VI version" option.
    Check if the simple VI is loadable and runs without errors in TestStand.
    If the step generates the same error, you should try a re-install of the LabVIEW development system.
    If not, its most likely that there is some VI you are using that is not loadable in the LabVIEW Runtime Engine because:
    1) Some sub-VI is still not saved in the right version or bitness. Open the VI heirarchy of the top-level VI that you are calling from TestStand and examine the paths of all the sub-VIs to check if they were in the folder you masscompiled and re-save any that are outside this directory.
    Also, when you try to close the top level VI, do you get a prompt to save any unsaved files? If so, they could be the sub-VIs that are not saved in the right version. Save all of them.
    Check if you are loading any VIs programatically and if these are compiled and saved in the right version as well.
    2) There is some feature you are using in your LabVIEW code that is not supported in the LabVIEW RunTime Engine. To check this, add your top-level VI to a LabVIEW project and create a new build specification and create a new executable from this VI.
        Right-click "Build Specifications" and choose "New->Application(EXE)".
        In the Application Properties window, select Source Files and choose the top level VI as the start-up VI.
        Save the properties.
        Right-click on the newly created build specification and choose Build.
    Run this executable (it will be run using the LabVIEW RunTime) and check if the VI has a broken arrow indicating that it cannot be loaded and run in the LabVIEW Runtime Engine.
    You might need to examine your code and find the feature which is not supported in the LabVIEW RunTime and find an alternative.
    Another thing i forgot to mention the last time around is if you are using 64-bit LabVIEW with 32-bit TestStand, then executing code using LabVIEW RTE from TestStand will not work since the 64-bit LabVIEW RTE dll cannot be loaded by the 32-bit TestStand process.
    If none of the above steps resolve the issue, consider sharing your LabVIEW code so i can take a look.
    Regards,
    TRJ

  • Problem with running a program under Labview 8.6

    Hello,
    I am writing you this to ask for your technical support to fix the problem I am facing at our Lab at University of California, Irvine.
    Ms. Vanessa Trujillo has kindly come to our lab a couple of times and tried different things to resolve the issue, but unfortunately the issue is not resolved yet. Here is a summary of the problem:
    We used to use Labview 6.1 for our fatigue testing and data acquisition.
    Our
    program worked just fine under the 6.1 version We recently upgraded our software to Labview 8.6. We have also purchased a new computer that has higher capacity than what your website requires for Labview 8.6. The new computer has Windows Vista We transferred our old program/subprograms from the old computer under Labview
    6.1 to the new computer with labview 8.6. However our program that worked fine with the 6.1 version is not working with the updated version (ver 8.6).
    There
    are 6 errors in the error list. It appears there are six files of my program missing under the new version, even though we transferred all files.
    The software searches for those files but can't find them.
            For example one the box pops up indicates:
            loading:
                        <vlib>:\Daq\lvdaq.dll
            searching:
                        C:\Program Files\National Instrument\LabVIEW 8.6\instr.lib\Agilent34401\public\utility
            I get several message like this. I have to cancel/ignore them all to be able to open the program.
    When we go to VI's under Measurement I/O there is nothing (empty).
    We use a PCI-MIO-16XE-50 for our data acquisition During Labview installation on the new computer, I was asked if I wanted to install the device drivers. I had two options, "Now" or "Later", I picked Now but I didn't have the DVD's/CD's for the device drivers. Therefore I had to select later to complete my software installation Later after Labview 8.6 installation, we installed the device drivers (traditional Ni DAQ and Ni DAQmx) from the two old CD's we had in our lab from a couple of years ago (the CD's were Ni DAQ 7). after installation, the PCI board on the computer was recognized by the device driver. However we still could not run our program under the new version of Labview (same situation and the same messages) I called 1-866-275-6964 on 9/2/08 and talked to Grant (service number:
    1228841). He recommended that I download and install the updated version of device drivers.
    Since I didn't have the DVD/CD for updated device drivers, I contacted Vanessa Trujillo. She gave me the DVD for the updated Ni DAQ (Traditional and mx).
    But
    when I tried to install the updated device drivers I got a message something like "some unsupported filed have been detected,..." so the updated device
    drivers were not installed. It should be noted that up to here we still had the Ni DAQ (traditional and mx) installed on the computer from our old CD's (Ni DAQ 7).
    Vanessa and I talked to Tom at the technical support department. He recommended that we download and install the Beta xx version for Ni DAQ since we were using Windows Vista. Mike put the Beta software on the Ni website/outgoing so I could download and install it. He asked me to uninstall the traditional Ni DAQ that we had on our computer from the older CD's. He
    asked me not to un-install the Ni DAQmx (that we had installed from the old
    CD). I was able to download the Beta software, however I could not install it since I got a similar message that some unsupported files were detected.
    Right now we don't have any version of traditional Ni DAQ installed on the
    computer but the NI DAQmx (from old Ni DAQ 7) is still installed on the computer. Vanessa let me borrow her new Ni DAQ DVD but as I explained I am not able to install the device drivers.
    Vanessa - Did I miss anything?
    Please advise. My cell number is 619-778-2033. I will be at our lab at UC,
    Irvine at 2:00pm (CA/Pacific time). Please call if you have any questions.
    Thank you

    To me, it looks like you are missing some of the drivers and subVI's used in your program.
    Whatever device you are using to measure fatigue or any other device probably came with a driver.
    You need all of these drivers installed on this new computer.
    Also, any subVI's and libraries you use in the program must also be installed on the new computer.
    Whenever you get a message that says you are missing some component (the ones that you said you press 'ignore'),
    see if you can find that library or subVI on the older computer. If so, save it to something so you can transfer them to the new computer. 
    Cory K

  • Can I get a 'timetable' of what labview does when it runs the program?

    Can I get a 'timetable' of what labview does when it runs the program? i.e. how long it spends doing each sub vi, and what order it does them in.
    Cheers 
    Solved!
    Go to Solution.

    Execution Trace Tool kit is an add-on. If you don't have it your pack of disks, ... maybe try a demo version?
    NI Spy get loaded with LV (or one of those things).
    Start >>> Programs >>> National intruments >>> NI Spy ?
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to use a Matlab Program within Labview

    Hi
    I saw in this forum that many users are using some matlab program
    executed in Labview program. I have actually Labview 7.1 and would like
    to use some of my matlab program in Labview. Is there an easy way to do
    it ?
    Thanks
    Thomas

    The MATLAB Script function is kinda buried in the function palette, and
    can be found under Functions >> Analyze >> Mathematics
    >> Formula.  Unfortunately this feature is not available in
    the LabVIEW Base package.  Hope this helps!
    Andy F.
    National Instruments

  • Safe to run music production programs via vm fusion?

    Hello hello,
    I have been running a windows-only music production progam via bootcamp for a couple months, but I'm frankly tired of having to reboot all the dang time and I'm worried frequent restarts is not healthy for the computer.  So, I want to try vm fusion to run this program on windows concurrently with whatever else I'm running on osx.  However, because music produciton programs tend to suck up a lot of the cup power...is this a good idea, given the fact that vm fusion will essentially allocate one core to windows and the other to osx?  Or do I have the wrong idea of how cpu is allocated via vm fusion? 
    I'm using the 2.7 Ghz dual-core i7 mac book pro (early 2011 model).  The music program I mentioned is FL Studio 9 XL Producers Edition.
    Thanks for any help in this confusing topic : )

    Try it. Seeing as you already have Windows installed using Boot Camp, just download the free trial of Fusion and tell it to use your Boot Camp installation of Windows as the target OS. You don't even have to re-install Windows.
    If it works for you buy the license and continue using it. If it does not work for you don't buy the kicense and uninstall Fusion. You don't have to change anything with respect to your Boot Camp installation.

  • Why does it report missing *.dll when running standalone programs on a separate PC without LabVIEW?

    I wrote a LabVIEW code to control GPIB, DAQ and Serial port. Then I built an installer including runtime engine. Everything works fine at the PC with the LabVIEW. I copy this installer folder to another computer without LabVIEW. I had no problem to install the program. But after I run the program, it started to ask for nilvaiu.dll. After I copied it under C\Windows\System32\, it started to ask for nimdbgu.dll, then niorbu.dll. Then it reported "The procedure entry point_pkgModulePackageEventLog@20 could not be located in the dynamic link library NIPALU.dll"
    I guess it missed some drivers. So I installed NI-488.2 for Windows on the PC. But it did not solve the issue.

    hi there
    i recommend to update to DAQ 7.4. the performance is much better.
    best regards
    chris
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Can Labview 5.1 Run 2 programs?

    I inherited a Labview 5.1 and it is running on one computer doing measurement. How can I use this labview to write another program to run either on the same computer (while the old one can still run) or on a different computer?
    Thanks in advance for your help.
    Kevin

    LabVIEW 5.1 has no problem running more than one VI (program) simultaneously. You can either just start the second VI by hand independently from the first, or make a new top-level VI that launches both at once, maybe using VI Server functions.
    One point to watch for is if you want to re-use subVI's (other than the built-in function blocks) that are used by the first program: if both programs need to run a subVI simultaneously you will need to make the subVI re-entrant, or make a second copy of it with a new name, otherwise one program will have to wait until the subVI call has finished in the other program. Read the help on re-entrant execution for more details.
    If you want to run two programs on different computers, you'll either need to buy another copy of LabVI
    EW or use the Application Builder to make one program into a stand-alone executable that can run without the development system. You may or may not have Application Builder already, depending on which LabVIEW package you have. See if there is a 'Build Application' entry in the Project menu. If not, ask your NI rep about your upgrade options.

  • Using LabView to run VB program with parameters

    Hi,
    It's my first message here so I hope I am doing things correctly. I tried to do some research before asking and I found a lot of good informations but right now, I seem to be stuck.
    I am quite new to LabView, I did few VIs here and there but nothing really "serious". I am currently working on a LabView interface that deals with VB, Excel macros and Data extraction from Text file.
    The VB program is in charge of a motor position, then, some Excel macros are used to do some measurement and the results are written in a text file that I use to plot some graphs.
    The VB program I made give the window I put in the picture in the attached files. Basically, you have to enter some values in those TextBox then click on Move and the motor will move. When you click on the button Home, the motor moves back to the position "0", no need of the two TextBox. In my labview interface, I created two ComboBox that contain all the possible values for both of the TextBox of my VB program. What I would like to do, when I click on my "Measure" button on LabView that initiates the VB program, is that it can fill the two TextBox from VB with the data entered in my LabView ComboBox and then run the program, simulating a "click" on the Move button.
    Right now, I found a VI (included in the attached files) that runs my VB program from LabView (I use it as a Sub-VI) but I still have to manually put the values in my VB program. My goal would be that when I click on my LabView button to start my measure, the motor moves but the VB program doesn't show up for the user to manually enter the values he wants.
    I hope I was clear but if you need any clarification.
    I did the the VB program myself.
    I can also link the LabView interface I already created if need be.
    Thanks for your help,
    Baptiste
    Attachments:
    Moteur.png ‏5 KB
    lancerEXE.vi ‏9 KB

    First, thank you for your answers.
    I know that I don't need to use VB or LabView. I just want for myself to be able to use LabView to manage a program in VB, one in VBA and use data from a text file. I know I could write everything in VBA and that would get the job done. The thing is I want to get away from VBA and Excel as much as I can. In the future, the plan would be to re-write my VBA program with LabView but as of now, I just want to use LabView to manage everything. I know I don't really need it but I want to learn how to do it and have something that works.
    So I would like to know if there is way to do what I wish to do, running my VB program with parameters coming from LabView.
    Thanks

Maybe you are looking for

  • Open URL from Java in a new browser tab

    Hi OTN, Surprisingly can't find the implimintation. In an ADF managed bean I retrieve String url. I need to open a new browser tab with this url. Found this thread Open a url in a new window in the backing bean which shows using javascript "service.a

  • SSOException for Netscape browser but not IE

    We are getting an SSOException (service URL not found: session) error when a user tries to log in using Netscape and they get bounced out with an invalid session message; however, the user is able to log in just fine if they are using Internet Explor

  • Non-domain machines cannot launch RemoteAPP

    Hi. I have Server 1 with RDS WEB and RD Gateway Role. And I have Server 2 with RDS Host, License Manager, RemoteApp installed and they are in collection. For test: I installed certificate of Enterprise CA on non-domain computer and now it connects su

  • Error Msg when trying to open PDF

    When i try to open the pdf I keep getting an error msg that states "Warning: This form is not supported with the current version of Acrobat or Adobe Reader. Upgrade to the latest version for full support" but I only just downloaded this app today.  I

  • HT1911 Hello I need to speak with customers services about charges on my iTunes account

    How can I talk to a live person on charges