How to use matlab program in formula node in labview?

hi,
i've got one equation of voltage regulation. so i did create program for that in matlab.and want to use it in formula node in labview.but i don't know how to do that.can someone please help me for that?
regards
bhavin

If you have already written Matlab code it is easier to import it straight into a Mathscript node. If you use a Formula node you need to translate m- syntax to c-syntax which may take longer. Note that the Mathscript node
may not support all the functions you used in Matlab so you may need to replace them with native LabVIEW functions. If you want to add inputs/outputs in your program you can just right-click on the border of the node to do that.
These structures can be on the block diagram under Programming>> Structures.
KostasB
NI UK Applications Engineering
Message Edited by KostasB on 05-28-2008 08:39 AM
Attachments:
mathscript-form node1.PNG ‏8 KB

Similar Messages

  • How to use (to program) a Scheme in Xcode? (novice programer needs help!)

    How to use (to program) a Scheme in Xcode?
    i have been using Aquaemacs (GNU emacs) with Guile extensions. but i really would like to do all that in Xcode. is it possible? thanks.

    I believe that Scheme is not a language natively supported by Xcode. Maybe there is a way to write a plugin for it, but I don't really think so and in particular I haven't seen one for LISP or Scheme.

  • How to use the program RHMOVE30

    Dear Gurus,
    One of our consultant has created organisation structure in one client of development system and wants to transport the same to another client in the same system and also to another system Quality.
    Came to know that by using program RHMOVE30 it can be done, but can anyone tell me how to use this program, I mean what are the inputs to be given and how to get the transport request.
    Regards,
    Sharath

    Hi Ali,
    Yes, normally transports will be moved from DEV to PRD and hope the same configuration is there in u r setup. But if you want to move the transport from PRD to DEV there is a way, but for this you may need to open the client restriction in u r production system (which is not recommended or u have to do this when no user is logged on to the production system).
    First make changes in the client settings for enabling transport request generation and execute the program RHMOVE30 and give u r inputs and generate a transport request. Once the request is generated it wil create two files(cofile and datafile folders) in trans folder (/usr/sap/<SID>/trans or <drive>:\usr\sap\<SID>\trans)
    Based on the request number copy the cofile and data file from production system and paste it in the same path in development system. Then login to development system from SAP and go to the import queue of development server and then choose EXTRAS->OTHER REQUEST->ADD and this will add that request to development queue and u can transport it normally.
    Hope this clarifies. Award points if helpful
    Regards,
    Sharath

  • How to use the program called ZSAPLINK to import Function Name

    How to use the program called ZSAPLINK to import Function Name

    Not sure why you posted into this forum?
    Note the header for this forum:
    This forum is dedicated to all other development-related questions which are not directly addressed by other forums. This includes Business Objects SDKs, products, or technologies which do not fall under BusinessObjects Enterprise, BusinessObjects Edge, Crystal Reports Server, or Crystal Reports (for example Desktop Intelligence SDK, Universe Designer SDK, Portal Integration Kits, Java User Function Libraries, and other third party technologies or development languages).
    Ludek

  • How to difine global variable in Formula node?

    I want to access the same vailable in different formula nodes, so I need to define a global or external vailables? How can I do this?

    Formula Nodes are distinct environments from each other.  You will have to define the global constant in each node.  Or make it a variable and wire  your values to the variable input node on each of the formula nodes.

  • [Q]: How to put MatLab 5.2 code (*.m) in LabVIEW 5 ?

    Hi,
    Is there somebody who know if it is possible (and how)
    to put MatLab 5.2 code (*.m) in LabVIEW 5.0 ?
    I use LabVIEW for my Audio sound and graphical Interface
    and I use MatLab for sound mathematic calculation....
    Thanks in advance.
    Best regards.

    Try to read this.
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/2f8ed0
    f588e06be1862565a90066e9ba?OpenDocument
    Paul
    In article <[email protected]>,
    [email protected] wrote:
    >
    > Hi,
    >
    > Is there somebody who know if it is possible (and how)
    > to put MatLab 5.2 code (*.m) in LabVIEW 5.0 ?
    > I use LabVIEW for my Audio sound and graphical Interface
    > and I use MatLab for sound mathematic calculation....
    >
    > Thanks in advance.
    > Best regards.
    >
    >
    Sent via Deja.com http://www.deja.com/
    Before you buy.

  • Req any examples of how to use a USB midi controller​/keyboards with Labview TIA

    Req any examples of how to use a USB midi controller/keyboards with Labview TIA

    Hi,
    To access the MIDI ports you will need to call the Windows SDK. To send MIDI commands is relatively easy, here is an example that shows you how to send data to a MIDI controller or keyboard.
    As far as input goes, this is the hard part. There are a series of functions that you need to call to open up the device, set some buffers and and possibly a callback to get notifications on the incoming data.
    Reading MIDI data will not be an easy task, your best bet will be to implement this in a DLL and call that DLL in LabVIEW, there should be some code available o the web.
    = "http://msdn.microsoft.com/library/default.asp?url​=/library/en-us/multimed/htm/_win32_multimedia_... is a link to the Windows multimedia functions that you could use for MIDI input.
    Let me know if you have any further questions.
    Regards,
    Juan Carlos
    N.I.

  • How to use matlab codes in a stand alone application without matlab license?

    Hi,
    I am not an expert in programming and i don't know about C++, i have a program using matlab codes and now i want to transfer it to a computer without matlab license. I've read something about using DLL, but i think i have to know C++ programming  to wrtie "WRAPPER" and add some lines to the program, now transformed in C++.
    I just would llike to know that really isn't any other way to integrate matlab for a stand-alone application? i read somethings in Matlab help about using COM (Common Object Model ) but i am not sure that labview works with it, and also about runtime engine and "mglinstaller.exe".
    my labview version is 8, matlab is 2006, and the real problem is using matlab codes in another computer without matlab license.
    Thanks
    Amir

    Hello Amir,
    There is a MatLab script node in the LabVIEW function palette (see screenshot of the help topic) but as you can see this structure is not in the "Base LabVIEW", you might need to purchase the FDS (Full Developpment System) or the PDS (Professionnal Developpment System) of LabVIEW...
    Do you know which one you have ?
    Hope this helps
    Message Edité par TiTou le 11-24-2006 06:38 PM
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    mlab.png ‏71 KB

  • How to change content in the formula node of the current vi

    Actually I want to give formula with array index. 
    My formula p=a[0]-30; But i couldnot give array index in the formula expression..
    Please help me in this issue.

    Muthu92 wrote:
    Thank you for your reply. It is very useful for me.  But i can't give conditional operator in that operator. It is showing error.
    My Test cases
    A[0]+A[1]>150
    A[31]-50 <100.
    If those are your exact statements, then they don't make sense in a formula node.  You have to use them in an if-statement or some other type of control logic.  This mimics text-based programming languages such as C... See here for instructions on formula node syntax: http://zone.ni.com/reference/en-XX/help/371361G-01​/lvhowto/formula_node_syntax/
    For instance, you COULD say something like:
    **In this example, let A[0] == x, A[1] == y, A[31] == z**
    if(x+y>150)
    /* do something if this is true */
    else if(z-50 < 100)
    /* do something else */
    EDIT: 
    It should also be noted that Variable Names MUST be lowercase!! I just discovered this
    EDIT2:
    I stand corrected.  After trying to create an example and digging through the LabVIEW Help, I stumbled across this:
    Differences between the Parser in the Mathematics VIs and the Formula Node
    The parser in the Mathematics VIs supports all elements that Formula Nodes support with the following exceptions:
    Variables—Only a, a0, ..., a9, ... z, z0, ..., z9, are valid.
    Logical, conditional, inequality, equality—?:,, &&, !=, ==, <, >, <=, and >= are not valid.
    Functions—atan2, max, min, mod, pow, rem, and sizeOfDim are not valid. You can use these functions in a Formula Node or use their corresponding LabVIEW functions.
    So it DOES NOT seem like Eval Formula Node can do conditionals like you want.  I would just implement them using a LabVIEW based algorithm after all.  Trying to out smart the formula nodes to avoid simple LabVIEW code is just too much of a hassle
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!

  • How to use Oracle OAB Fast Formulas in Discoverer-desktop [ for reporting]

    Hi,
    Can anyone tell me how to use a fast formula in discoverer-desktop [for reporting]. Currently, we have a disco-report that calcuates the 'monthly salary', but we don't want to use that. Instead, we have a custom fast-formula [xx_oab_monthly_salary] which has the conditions and calculations that we need.
    I want to use that formula in discoverer-desktop directly and get the monthly-salary.. i.e., someone needs to create a folder under the business area and add it i believe.. the formula internally calls a function.
    when i checked about this with my dba - he said, he can add the 'function', but not the formula. and i need to write the calculation part...
    does anyone know how to add it...there shud a way right...
    i do not have access to the technical-stuff here..
    someone said ["you can wrap the FF_EXEC.run_formula call into your own pl/sql function and map this function into the EUL so that the formula can be called from a workbook.", but this talks about pl/sql-do we need pl/sql
    for this].
    also, someone else said [ some fast formulas need specific contexts to be set. Depending on whether the fast formula below the only fast formula that you want to recreate in Discoverer.
    For a single formula, in general my recommendation is to recreate the fast formula instead of using the ff_exec call].
    any quick answers greatly appreciate..
    thx,

    Hi,
    That's right you need to develop the pl/sql function outside of Discoverer using a pl/sql tool or just SQL*plus. I haven't an example to hand, but can dig one up if you need it. Once you have the function developed you can map it into the EUL using Discoverer Administrator. It will then be available to Discoverer Desktop/Plus as a database function when creating calculations. So you can then just add the calculation to an existing or new report.
    Alternatively, you can build the pl/sql function into a view and load the view into a new folder using Discoverer Admin.
    Rod West

  • How to use java programe in oracle form

    Hello Expert,
    My Config is : -
    Forms [32 Bit] Version 11.1.1.3.0 (Production)
    Jdeveloper - 10.1.3
    I want to use the java programe in form builder. I create the one java class in Jdeveloper -
    package demo;
    import java.net.InetAddress;
    import java.net.NetworkInterface;
    import java.net.SocketException;
    import java.net.UnknownHostException;
    public class get_info{
       public static void main(String[] args){
       ch_add();
       public static void ch_add()
      InetAddress ip;
      try { 
      ip = InetAddress.getLocalHost();
      /*System.out.println("Current IP address : " + ip.getHostAddress());  */
      NetworkInterface network = NetworkInterface.getByInetAddress(ip);
      byte[] mac = network.getHardwareAddress();
      /*System.out.print("Current MAC address : ");   */
      StringBuilder sb = new StringBuilder();            
      for (int i = 0; i < mac.length; i++)
      sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : ""));
      System.out.println(sb.toString()); 
      } catch (UnknownHostException e) {
      e.printStackTrace();
      } catch (SocketException e){
      e.printStackTrace();
    and this into Formweb.cfg and default.env and also add into Form_class_path. After that i import this java into forms.
    Code genertated -
    PACKAGE BODY get_info IS
      -- DO NOT EDIT THIS FILE - it is machine generated!
      args   JNI.ARGLIST;
      -- Constructor for signature ()V
      FUNCTION new RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN (JNI.NEW_OBJECT('demo/get_info', '()V', args));
      END;
      -- Method: main ([Ljava/lang/String;)V
      PROCEDURE main(
        a0    ORA_JAVA.JARRAY) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'main', '([Ljava/lang/String;)V', args);
      END;
      -- Method: ch_add ()V
      PROCEDURE ch_add IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'ch_add', '()V', args);
      END;
      -- Method: wait (J)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(J)V', args);
      END;
      -- Method: wait ()V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '()V', args);
      END;
      -- Method: wait (JI)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER,
        a1    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(2);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.ADD_INT_ARG(args, a1);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(JI)V', args);
      END;
      -- Method: equals (Ljava/lang/Object;)Z
      FUNCTION equals(
        obj   ORA_JAVA.JOBJECT,
        a0    ORA_JAVA.JOBJECT) RETURN BOOLEAN IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, 'java/lang/Object');
        RETURN JNI.CALL_BOOLEAN_METHOD(FALSE, obj, 'demo/get_info', 'equals', '(Ljava/lang/Object;)Z', args);
      END;
      -- Method: toString ()Ljava/lang/String;
      FUNCTION toString(
        obj   ORA_JAVA.JOBJECT) RETURN VARCHAR2 IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'demo/get_info', 'toString', '()Ljava/lang/String;', args);
      END;
      -- Method: hashCode ()I
      FUNCTION hashCode(
        obj   ORA_JAVA.JOBJECT) RETURN NUMBER IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_INT_METHOD(FALSE, obj, 'demo/get_info', 'hashCode', '()I', args);
      END;
      -- Method: getClass ()Ljava/lang/Class;
      FUNCTION getClass(
        obj   ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'demo/get_info', 'getClass', '()Ljava/lang/Class;', args);
      END;
      -- Method: notify ()V
      PROCEDURE notify(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notify', '()V', args);
      END;
      -- Method: notifyAll ()V
      PROCEDURE notifyAll(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notifyAll', '()V', args);
      END;
    BEGIN
      NULL;
    END;
    Now i want to call the o/p of Java programe in oracle text item. Please help me. It's very urgent. I am not good in Java.

    Sir i use java importer.
    PACKAGE BODY get_info IS
      -- DO NOT EDIT THIS FILE - it is machine generated!
      args   JNI.ARGLIST;
      -- Constructor for signature ()V
      FUNCTION new RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN (JNI.NEW_OBJECT('demo/get_info', '()V', args));
      END;
      -- Method: main ([Ljava/lang/String;)V
      PROCEDURE main(
        a0    ORA_JAVA.JARRAY) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'main', '([Ljava/lang/String;)V', args);
      END;
      -- Method: ch_add ()V
      PROCEDURE ch_add IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'ch_add', '()V', args);
      END;
      -- Method: wait (J)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(J)V', args);
      END;
      -- Method: wait ()V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '()V', args);
      END;
      -- Method: wait (JI)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER,
        a1    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(2);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.ADD_INT_ARG(args, a1);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(JI)V', args);
      END;
      -- Method: equals (Ljava/lang/Object;)Z
      FUNCTION equals(
        obj   ORA_JAVA.JOBJECT,
        a0    ORA_JAVA.JOBJECT) RETURN BOOLEAN IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, 'java/lang/Object');
        RETURN JNI.CALL_BOOLEAN_METHOD(FALSE, obj, 'demo/get_info', 'equals', '(Ljava/lang/Object;)Z', args);
      END;
      -- Method: toString ()Ljava/lang/String;
      FUNCTION toString(
        obj   ORA_JAVA.JOBJECT) RETURN VARCHAR2 IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'demo/get_info', 'toString', '()Ljava/lang/String;', args);
      END;
      -- Method: hashCode ()I
      FUNCTION hashCode(
        obj   ORA_JAVA.JOBJECT) RETURN NUMBER IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_INT_METHOD(FALSE, obj, 'demo/get_info', 'hashCode', '()I', args);
      END;
      -- Method: getClass ()Ljava/lang/Class;
      FUNCTION getClass(
        obj   ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'demo/get_info', 'getClass', '()Ljava/lang/Class;', args);
      END;
      -- Method: notify ()V
      PROCEDURE notify(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notify', '()V', args);
      END;
      -- Method: notifyAll ()V
      PROCEDURE notifyAll(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notifyAll', '()V', args);
      END;
    BEGIN
      NULL;
    END;
    I read both document which is given by you.
    Basicaly i don't know how to call java program in form builder.
    I wrote this code on When-button-pressed
    DECLARE
    jo ora_java.jobject;
    rv varchar2(1500);
    ex ora_java.jobject;
    BEGIN
    jo := get_info.new;
    rv:=get_info.ch_add(jo );
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
      message (' Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR );
      message('');
    WHEN ORA_JAVA.EXCEPTION_THROWN then
      ex := ORA_JAVA.LAST_EXCEPTION;
      message(' Unable to call out to Java ' ||Exception_.toString (ex ) );
      message(' Unable to call out to Java ' ||Exception_.toString (ex ) );
    END;
    No error comes and no output comes. I want the client MAC ID. please guide me where i need to change the code.

  • How to use shell program parameters in java program??

    Hai all,
    I am writing a java program which must read strings from a file and must assign to variables.these strings are nothing but the output of ls -l command in shell. i need to have all those 9 fields in a file as variables.
    I cant find any method that will read only string.I came accross read line but that is not what i need.So, i thought of writing a shell script and by using awk, storing those 9 fields in 9 variables.. but how to use that variables in java programming???
    the shell script is executed by exec() but i need that variables also.
    Help me please:(
    thanks in advance

    i now changed the code... and closed the output file and then i read.Later i splited with the line i read.. but the same happened...
    this is the code:
    while ((l = inputStream.readLine()) != null)
                        op=new FileOutputStream("op.txt");//output of exec goes to this file
                        String[] cmd= {"/bin/sh","-c","ls -l "+l};
                        rt = Runtime.getRuntime();
                        proc = rt.exec(cmd);
                        // any error message?
                          StreamGobbler errorGobbler = new
                          StreamGobbler(proc.getErrorStream(), "ERR");
                        // any output?
                          StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "",op);
                        errorGobbler.start();
                               outputGobbler.start();
                        op.close();//the file is closed now
                        ip = new BufferedReader(new FileReader("op.txt"));     //now i opened to read
                        p=ip.readLine();
                        a=p.split("\\s");
                        ip.close();
                   }where i went wrong?

  • How to use the program "Generate test data for BAI bank statement" ?

    Hi all,
    I use the program RFEBKAT5 to create an Electronic Bank Statement file in BAI format ,but it doesn't generate the file .
    I don't know how to generate the file.
    Please help me !
    Thanks all !

    You need to suitably adjust your GL accounts for "Posting Offset Account" (Whisch is defaulted as ++++++++19" and Checkout/Funds Out/Funds IN GL accounts to your configuration.
    Once you do this try generating the file again.

  • How to use ABAP program as datasource

    I want to use one program as datasource. Pls let me know if it is possible and how to use it. Many thanks!

    Hi Awa,
    It's regarding your questions..
    Yes you can make it ..
    You can create your data source program in your source system such as R/3, CRM, etc.
    There is template function that can be used for your program:
    RSAX_BIW_GET_DATA_SIMPLE.
    You can use that template, and alter the code as your business requirement.
    There are also blog, and tutorial as your references:
    Generic Extraction via Function Module
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/86/1c8c3e94243446e10000000a114084/frameset.htm
    Hopefully it can help you a lot.
    Regards,
    Niel.

  • How to use BAPI Program for change workcenter in co02?

    Hi  Abapers.
           Anybody please tell me how to change the workcenter in CO02 using BAPI Programe.
          Please give me sample of this.
           I will give urs reward of points.
    Thanks
    Regards,
    S.Muthu.

    Hi,
    Use the Function module CR_WORKCENTER_UPDATE
    for workcenter change.
    It is an update function module so you have to call it in update mode with a COMMIT statement to trigger it.
    CALL FUNCTION CR_WORKCENTER_UPDATE IN UPDATE TASK
    exporting...
    imporing..
    COMMIT WORK.
    Note: only after the commit statement the function module will be called in update mode.
    Regards,
    Raj.

Maybe you are looking for