How to do complex engineering calculation in labview.I tried using MATLAB script

Hello,
I am trying to use matlab script node to solve two complex equation.But i get different  errors everytime i run my program.sometimes 1048 sometimes 1050 and sometimes it says LABVIEW could not extract variable from Matlab.I am attaching  my MATLAB script node with this thread.Please Help me out to get rid of this problem.
I am  using LV-8 and MATLAB R-2006a.
Attachments:
matlab.vi ‏10 KB

Hi Praween,
beside my little MatLab knowledge I tried to replace your formula with equivalent LV code...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
matlab_lv80.vi ‏18 KB

Similar Messages

  • Using Matlab script in Labview

    Hello,
    I am trying to use matlab script in labview to post process the sampled signals from DAQ(attached is the vi I tried)
    After every 10 seconds I want to the send the sampled voltage data to matlab scritp block which does 1) detection of peaks using peakdetection function and plots the obtained peaks on the sampled signal 2) calculates standard of 10 secs data and plots on chart.
    But I am confused of 1) how to call the peakdetection function inside the matlabscript block
    2) How to send the 10secs data of voltage and time values to the matlab script block
    3) How to plot the signal and detected peaks on the same plot (which can be done in matlab using holdon as shown in the atached vi).
    Can someone suggest for implementing these .
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Labview&Matlab.vi ‏55 KB

    Thanks  GabeG,
    Now, Labview&Matlab_TestNoAq.vi  is woking Good and for the second one  Labview&Matlab_TestAq.vi it is showing error as shown in the attached image when these ines of code are present in the matlab scrtip 
    subplot(2,1,1),plot(maxtab(:,1),maxtab(:,2),'*r');
    SDN=std(maxtab(:,1));
    and SDN output of the Matlab script
    but when I removed these it is working fine(but not showing the detected peaks).
    Can you suggest me a solution for the above and also can I know the best method to add one more channel that samples another device signal which has to be processed in this same way(Signals sampled from 2 devices have to be porcessed in this same way).
    Thanks.
    Attachments:
    Script_Error.JPG ‏133 KB

  • How to load a variable using MATLAB Script?

    I need to load a selected variable from .mat file, using MATLAB script , and analyse it.
    the attched shows my vi, there are two inputs nodes 'file' contains the .mat file path, and 'varn' contains varibale name in that .mat file which can be selected by user. Using " load(file)" the whole .mat file is loaded in the workspace and become avaiable at output node, however I am not able to pass a selected variable name through string "varn" input, MATLAB script does not recognize the variable.
    any idea to reslove it is realy appreciated.
    Attachments:
    load a variable.JPG ‏18 KB

    Download the VI and .MAT file. Run the VI, and it'll plot the data inside of the .MAT file.
    Andy Chang
    National Instruments
    LabVIEW Control Design and Simulation
    Attachments:
    testfile.zip ‏5 KB

  • How to  build a  Calculator in WAB Template  by using  Java Script......

    Hi ,
    I am  trying   to build a dynamic  calculator in WAD which is as  similar to one in Executive view in Cognos. The  problem i am  facing  is,  i can  able to build a normal  calculator  by using  java script  but  i am  unable  to read the  key figure  values from  the  analysis  item  on from the  data  provider  in to  by  calculator  by using  on click  function. I wanted  to get the all  the  values in to a internal excel , so  that  my calculator can read the  values from  that. can  any  one  help  me  on getting  values in to internal excel by using   java before the  executing the  web template ?...
    Thanks in advance....
    Jhon.
    Edited by: sap bw on Jul 31, 2008 5:51 PM
    Edited by: sap bw on Jul 31, 2008 5:52 PM

    I might not be understanding your question completely since you mention WAD and then Excel, but if you are asking how to get the key figure values using Javascript in WAD, you can go to the Dataprovider properties and enable 'Output Result Data'.  This will embed an XML element into the HTML output that you can then parse using standard Javascript DOM navigation.
    Hope this helps.

  • How to pass values to variables in WAD 7.0 using java script

    Hi.,
    My requirement is based on WAD 7.0.
    The sales value has to displayed in WAD using graph with various chart types.
    I have created variables for plant and material group in a query.
    I have created drop down box for plant with all plants in it, check box for material group and a Submit button in WAD in FORM tag of HTML coding.
    Once all the values are set in drop down box, checkbox and if the user clicks on submit button, the values has to captured by the variables for which I have created and the graph has to be aligned to the new values in variables.
    Kindly help me how to use java script to get the values from FORM and pass it to variables.
    Regards,
    Selva

    Hi Selva,
    You do not need to use Javascript for this. Instead you can achieve this by using API Commands in WAD 7.0.
    Please configure Action on the ButtonGroup webitem to use 'Commands'.
    ->Choose Command 'Set Variables Values / SET_VARIABLES_STATE' under Commands for Web Templates
    ->Set Display Variable Screen setting to OFF
    ->Choose Query Variable for Plant, Select Variable Type as 'Binding Type', Binding Type as 'Data Provider Selection', Data Provider as the one you have assigned to the Dropdown webitem, Characteristic as 0PLANT or as that assigned to the Dropdown webitem
    ->Repeat above steps for Query Variable Material Group
    Now when you make a selection from the Dropdown webitems, the Chart output will change accordingly. Let me know if this helps.
    --Priya

  • How to write CLOB parameter in a file or XML using shell script?

    I executed a oracle stored procedure using shell script. How can i get the OUT parameter of the procedure(CLOB) and write it in a file or XML in UNIX environment using shell script?
    Edit/Delete Message

    SQL> var c clob
    SQL>
    SQL> begin
      2          select
      3                  DBMS_XMLGEN.getXML(
      4                          'select rownum, object_type, object_name from user_objects where rownum <= 5'
      5                  ) into :c
      6          from    dual;
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> set long 999999
    SQL> set heading off
    SQL> set pages 0
    SQL> set feedback off
    SQL> set termout off
    SQL> set trimspool on
    // following in the script is not echo'ed to screen
    set echo off
    spool /tmp/x.xml
    select :c from dual;
    spool off
    SQL>
    SQL> --// file size
    SQL> !ls -l /tmp/x.xml
    -rw-rw-r-- 1 billy billy 583 2011-12-22 13:35 /tmp/x.xml
    SQL> --// file content
    SQL> !cat /tmp/x.xml
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <ROWNUM>1</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>BONUS</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>2</ROWNUM>
      <OBJECT_TYPE>PROCEDURE</OBJECT_TYPE>
      <OBJECT_NAME>CLOSEREFCURSOR</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>3</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>DEPT</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>4</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>EMP</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>5</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>EMPTAB</OBJECT_NAME>
    </ROW>
    </ROWSET>
    SQL>

  • Windows 8.1 - How to enable "Require additional authentication at startup" for bitlocker using powershell script?

    I need help to do this using powershell scripts on Windows 8.1?
    OS : Windows 8.1 Enterprise
    TPM Chip : None
    Enabling bitlocker on OS drive with a password at boot time is a 2 step process.
    1) Edit the Group Policy (gpedit.msc) - Administrative Templates -> Windows Components -> BitLocker Drive Encryption -> Operating System Drives ->
    Require additional authentication at startup -> Allow bitlocker without a compatible TPM
    ref : http://www.7tutorials.com/how-enable-bitlocker-without-tpm-chip-windows-7-windows-8
    2) Enable Bitlocker on c driver using manage bitlocker snapin
    I need help to do this using powershell scripts?
    I researched on the forums but ran into an issue.
    I found that Group policy commandlets can be used to do step 1.  
    I am getting the error : "ins have been registered for Windows PowerShell version 4" when I try to do the following in windows 8.1
    Add-PSSnapin GroupPolicy
    Import-Module GroupPolicy -Verbose

    Hi TinkerBotFoo,
    I’m writing to just check in to see if the suggestions were helpful. If you need further help,
    please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards
    Anna
    TechNet Community Support
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Need help on complex math calculation in labview

    I need some help by being pointed in the right direction.  I have a piece of old lab equipment that I will be connecting to labview.  In order to send commands to the hardware, I have to calculate a checksum.  The checksum algorythm requires me to take alphanumeric characters, convert them to binary, perform binary addition, perform an Xor, mask certain digits, and convert the resultant binary string back to an ascii character.  Does labview have the capabilities to do this on it's own, or should I look at connecting to something like an external dll? 
    I have Visual Studio 2008 and some previous VB experience, so I think I could write a program that would do the calculation, but don't really know exactly what type of project (dll, etc.) is best.  Are there any specific settings for the dll so that labview can use it.  I see an example for C++ for Visual Studio 2005, but that is as close as I can get.  I only know VB, not C# or C++
    Can someone please point me in the right direction?
    Tron
    Solved!
    Go to Solution.

    You basically need some logical shifts and ANDs.
    Check version 2.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV
    Attachments:
    Checksum ver 2.vi ‏10 KB

  • How to display images in life on labview 6.0 using an acquisition toolkit"matrox meteor pulsar"

    please send me ready VIs doing that

    Please post more information on what you are trying to do, and which software you have.
    Are you using any Image Acquisition (IMAQ) software?
    Which toolkit do you have?
    Are you trying to display animated .jpeg or .gif images in LabVIEW front panel?
    Animating LabVIEW Controls
    http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/6a44b4dccc2f435d86256afe0070265c?OpenDocument
    Are you trying to display live images of LabVIEW front panels in a web browser?
    Publishing Front Panels to the Web
    http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/aad6b634e63adabe86256921004c7edd?OpenDocument
    Are you trying to display live web page images in LabVIEW front panel?
    Building a Simple Web Browser Using ActiveX
    http://zone.ni
    .com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/a17ad4e3a1eafe7086256775007827b6?OpenDocument
    Please give more information so we can better assist you.
    Zvezdana S.
    National Instruments

  • AppleScript: How to pass control to dialog when it is opened using do script

    I am running the following AppleScript:
    tell application "Adobe Acrobat Pro" to activate
    tell application "Adobe Acrobat Pro"
              do script "app.execMenuItem(\"GeneralPrefs\");"
      delay 2
              tell application "System Events"
                        tell process "Acrobat"
                                  click button "OK" of window "Preferences"
                        end tell
              end tell
    end tell
    This properly opens the Preferences dialog/window. This part does work. However, then, the script gets stuck and waits until the window closes for continuing. And then, it is no longer possible to click the OK button…
    Am I missing something, and how can I get controls back to the AppleScript when the dialog window has opened?
    Any advice is highly appreciated.
    Max Wyss.

    I am running the following AppleScript:
    tell application "Adobe Acrobat Pro" to activate
    tell application "Adobe Acrobat Pro"
              do script "app.execMenuItem(\"GeneralPrefs\");"
      delay 2
              tell application "System Events"
                        tell process "Acrobat"
                                  click button "OK" of window "Preferences"
                        end tell
              end tell
    end tell
    This properly opens the Preferences dialog/window. This part does work. However, then, the script gets stuck and waits until the window closes for continuing. And then, it is no longer possible to click the OK button…
    Am I missing something, and how can I get controls back to the AppleScript when the dialog window has opened?
    Any advice is highly appreciated.
    Max Wyss.

  • How do i mute the sound in a movie clip using action script?

    assuming my movie clip is named "movie"

    You should use SoundTranfrom object and soundTransform property of your movieClip.
    At first you have to instantiate soundTransform object and assign value of 1 to it's volume property:
    var soundTr:SoundTransform = new SoundTransform();
    soundTr.volume = 1;
    Than a simple toggle function, which changes volume property of soundTr and assigns the object soundTr to your movie's soundTransform property.
    function toggleMute():void
        if(soundTr.volume == 1)
            soundTr.volume = 0;
        }else{
            soundTr.volume = 1;
        movie.soundTransform = soundTr;
    Regards,
    gc

  • PM Scripts: how to get into "Document setup" - "Compose to printer"option using PageMaker scripts?

    Hi
    I wonder if there is any way to set appropriate printer in "Document setup" -> "Compose to printer" option using PageMaker scripts.
    Going through the PageMaker Script Guide I couldn't find such functionality.
    I will appreciate your help
    /Joanna

    This is what you need: http://www.amazon.com/Pagemaker-Scripting-Guide-Desktop-Automation/dp/tech-data/1568303181
    If the script is not in that book, then it doesn't exist.
    There used to be PDF version, but I can't find it.

  • How to add 15 bit can crc calculation to labview polynom is x15 + x14 + x10 + x8 + x7 + x4 + x3 + 1 .

    how to add can crc calculation to labview polynom is x15 + x14 + x10 + x8 + x7 + x4 + x3 + 1
    for 15 bit calulation
    thanks for any assistance

    Hi there,
    Here you can find the explanation of how the CRC calculation is done (see page 15). Now, if you are planing to do this with NI hardware/software it does not make sense since the calculation it is already taken care by the driver. In case you want to do this on your own using digital lines be careful with impedances and any other electrical consideration.
    I hope this helps
    Alejandro | Academic Program Engineer | National Instruments

  • Matlab code much slower in Labview MatlabScript than in Matlab

    I was using an algorithm written in Matlab that executed in less than 2 seconds. Now I need to use it within a Labview program and I am using Matlab script with the same algorithm, but it lasts 10 times longer than in Matlab. Is this normal? Thank you!

    How do you know that it is 10 times? Did you create a benchmark?
    What are the conditions for the benchmark? Can you provide the code for it?
    I am asking this because if you create the VI and put the m-script in the script node, and then press run (looking on the watch) and wait for the VI to finish, you "benchmarked" compile times, memory allocation as well as the complete VI's execution (including the script node of course). I doubt that this will ever be comparable to the "benchmark" in MatLab.
    If you provide your VI, we might also be able to give some hints to increase performance.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Same code gives different results in Matlab Script in Labview and Matlab

    I am implemeting a Matlab code into a LabVIEW application using Matlab script. When I import the exactly same code to the Matlab Script in LabVIEW it gives a different result than it is in Matlab. This code is a simulation code including first kind bessel functions. Using LabVIEW 7.1 and Matlab R14 service pack 3.

    Labview 8.5
    Matlab R2009b
    Attached are the graphs produced by matlab script in labview and in matlab.
    The minimum of graph produced by matlab code is below 1 and that in labview is above 1.
    Thanks a lot for your reply.
    Sorry, I haven't quantified the "sometimes" yet. 
    Attachments:
    matlabsResult.jpg ‏29 KB
    LV.png ‏84 KB

Maybe you are looking for