Matscript node void ouputs when calling user-defined functions

Hi,
I have a (for most of you, probably simple) problem with calling user defined function within a mathscript node.
I have a script inside a MathScript node which calls three UD functions. When I try to output variables, LabView sets their type to void, so I cannot use them further. this would imply, that the script is nondeterministic, (since the types would get set at runtime). However, if I replace the call to the UD function with the actual contents of the function, the variable becomes deterministic. Now, since I have several call to these functions, I have no desire in writing all of them many time, introducing many variables etc. What would you advise me to do?
Find attached my scripts and functions.
I need this script running on a RT Target, and have been battling this for weeks, with almost no success!
Thanks, Regards,
Luka
Attachments:
Scripts.zip ‏2 KB

MArtin, hello!
As far as I know, LabView checks the syntax as you write in the MS Node, and since there is no X mark next to the line number, it indicates, that the syntax is correct. Since i have set the path to the UDF in both the VI options and in the general MAthScript setting, how does adding the path command help? even if I add path('directory') command, a yellow exclamation mark appears, saying the command is slowing down performance.
(this is the original help explanation:
The warning glyph indicates that LabVIEW operates with reduced error checking at edit time and slower run-time performance for the MathScript Node. The following conditions cause the warning glyph to appear. To remove the warning glyph from the MathScript Node and improve run-time performance, modify your script as follows to resolve the condition in your script:
Your script calls addpath or pathremove (legacy name rmpath), or calls cd, path, or userpath with one or more inputs, which change the MathScript search path list at run time. Remove these functions and use the MathScript page to configure the default search path)
 Could you please post a screenshot of your VI, just to see, if you've got anything different set up?
I am running LV2012.
Luka

Similar Messages

  • Calling user defined functions in Matlab Script Node

    Greetings!
    I am not successful in calling a user defined function inside a Matlab Script Node.
    The path has been added to Matlab, but the Matlab script node is not calling my function.
    I am calling it as follows:
    a= fcd(b,c);
    and the fcd.m file is calculating the 'first central difference' - works in Matlab, but not in LabVIEW:
    function MtxOut=fcd(MtxIn,dt)
    %MtxOut=fcd(MtxIn,dt)
    %first central difference method of finding instantaneous
    %first derivatives
    %MtxIn = MxN matrix of inputs
    %dt = time change between inputs
    %MtxOut = MxN matrix of first derivatives of inputs
    r=size(MtxIn,1);
    c=size(MtxIn,2);
    MtxOut(1,=(MtxIn(2,-MtxIn(1,)/dt;
    MtxOut(r,=(MtxIn(r,-MtxIn(r-1,)/dt;
    for i=2:r-1
        for j=1:c
            MtxOut(i,j)=(MtxIn(i+1,j)-MtxIn(i-1,j))/(2*dt);
        end
    end

    Matthew:
    What version of MatLab, LabVIEW are you using?. Also, what type of errors are you running into?.
    Thanks,
    Rudi N.

  • How to call User defined functions in Mathscript Node ?

    Hi,
    I have created a user defined function and saved it to Search path of Labview as an M file. If I run my program in Math script window, the function is recognized and the program works properly. If I do the same with MathScript node , the user defined functions are not identified.
    Kindly help me with this problem. Thanks in advance
    Cheers
    Lenord Melvix

    This page may help:
    http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmathmain/caveats_recommendations_ms_search_...
    Kevin C.

  • Calling user defined functions through OBIEE

    Can anyone tell me how I can call the user defined functions on database through the new BI tool.
    The idea is to collect certain parameters through the prompt when launching the request, the function is supposed to pick up the parameters, make a certain calculation, and return a value.
    I wrote the function, I just need help over how to call the function through the BI tool - that was pretty easy in the old Discoverer.
    Thanks.
    Message was edited by:
    user611377

    Hi Kresimir ,
    You can use EVALUATE function to call a user defined function.
    EVALUATE('FUNCTIONNAME(%1,..)' As DATATYPE,parameter1,...)
    Here DATATYPE is the returntype of function.
    Hope this will help.
    Thanks
    Ashok

  • Calling user defined function in Oracle BI Answers?

    Hi
    I am new in Oracle BI . I want to use the user defined function in Oracle BI Answers as a column,function written in Oracle database to calculate the Sales Revenue.
    I am using Oracle BI Standard Edition One and Oracle 10g database.
    Please suggest me.
    Thanks
    Nusrat

    Search for EVALUATE function you can call function and pass parameters
    Example:
    EVALUATE Function
    This function is intended for scalar and analytic
    calculations.
    Syntax: EVALUATE('DB_Function(%1)', {
    Comma separated Expression})
    Example: SELECT
    e.lastname,sales.revenue,EVALUATE('dense_rank()
    over(order by %1
    )',sales.revenue) FROM sales s, employee e;

  • Error when use User-Defined Function

    I just create User defined function "getfilename" and I put there:
    "DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return ourSourceFileName; ".
    But In test mapping I have worning:
    "Runtime exception during processing target field mapping /ns1:Z_KBFI_INPUT_FILE/IS_IFILE/FILE_NAME. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._KBFIMsgMapping_ method get_fname$[com.sap.aii.mappingtool.tf3.rt.Context@37d4662c] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns1:Z_KBFI_INPUT_FILE/IS_IFILE/FILE_NAME. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._KBFIMsgMapping_ method get_fname$[com.sap.aii.mappingtool.tf3.rt.Context@37d4662c] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:284) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:238)...."
    And in RWB in Communication Channel Monitoring I can not see file name in the payload.
    Maby I do something wrong, please tell me.

    my source file 200610.txt is like this:
    HR 0610 061030 061021
    DR 03 C 0610 820114 00010111 0000015000 PLN descr...
    DR 03 D 0610 403201 00010111 0000015000 PLN descr..
    TR 0000000002
    Then in sxmb_moni in inbound message (payload) I have:
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:KBFIMsgTypeSource xmlns:ns="http://p4.org/xi/KBFI/Interface">
    - <FIRecordset>
    - <HeaderLine>
      <LineKey>HR</LineKey>
      <PostingPeriod>0610</PostingPeriod>
      <PostingEndDate>061030</PostingEndDate>
      <PostingDate>061021</PostingDate>
      </HeaderLine>
    - <PostingLine>
      <LineKey>DR</LineKey>
      <ServerID>03</ServerID>
      <DCFlag>C</DCFlag>
      <PostingPeriod>0610</PostingPeriod>
      <GLAccount>820114</GLAccount>
      <SubAccount>00010111</SubAccount>
      <NetValue>0000015000</NetValue>
      <Currency>PLN</Currency>
      <Description>descr...</Description>
      </PostingLine>
    - <PostingLine>
      <LineKey>DR</LineKey>
      <ServerID>03</ServerID>
      <DCFlag>D</DCFlag>
      <PostingPeriod>0610</PostingPeriod>
      <GLAccount>403201</GLAccount>
      <SubAccount>00010111</SubAccount>
      <NetValue>0000015000</NetValue>
      <Currency>PLN</Currency>
      <Description>descr..</Description>
      </PostingLine>
      </FIRecordset>
      </ns:KBFIMsgTypeSource>
    But I don't have payload for Response (black and white flag).
    In DynamicConfiguration i have:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Response
      -->
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">141</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">txt</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20061212T121622Z</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileEncoding">ISO646-US</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">200610.txt</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/usr/sap/PXD/put/archive</SAP:Record>
      </SAP:DynamicConfiguration>

  • How to call User Define Function

    Hi,
    I need a help....
    In my Project I have Login.jspx page in which there is a textbox Username.
    I have second success.jspx page which has its success.java bean class in which i have define a method "display()".Now i want to cal display() in my success.jspx page.
    can anyone help me out what is the way to do this.
    Thanks in advance...
    Thanks,
    Nehal

    Hi Abhijit,
    Sure i can give you more details on the same:
    I have written a displayVal method in ForgotPassword.java bean class
    public String displayVal() {    
    String txtVal = AdfFacesContext.getCurrentInstance().getPageFlowScope().get("testValue").toString();
    nameID.setValue(txtVal);
    return txtVal;
    Now in ForgotPassword.jspx page i have one input text box named "nameID" in which i want to display some value from the user-define method called displayVal()
    now i am trying to call my user-define method in my ForgotPassword.jspx page:
    <af:inputText label="Name"
    binding="#{backingBeanScope.backing_FrgtPwd.nameID}"
    id="nameID"
    value="#{backingBeanScope.backing_FrgtPwd.displayVal}">
    </af:inputText>
    but is is showing an error that: backingBeanScope.backing_FrgtPwd.displayVal is not a property as this a method.
    So now my query is : Is there any way by which i can call my user-define method on the jspx page from the bean class of the same page.

  • Strange errors when using user defined function in where clause

    Hello,
    I am having trouble with a function that, when used in the where clause of a select will cause an error if the first column selected is of type INTEGER. Not sure whether I am doing something wrong or whether this is a bug.
    Here is a very simple test case:
    create table test(
    col1 integer not null,
    col2 varchar(20) ascii default ''
    insert into test values(1,'2011-03-15 05:00:00')
    insert into test values(2,'2011-03-15 07:00:00')
    CREATE FUNCTION BTR_TAG  RETURNS VARCHAR AS
        VAR ret VARCHAR(20);
      SET ret='2011-03-15 06:00:00';
      RETURN ret;
    Select * from test where col2 >= BTR_TAG()
    Select col1,col2 from test where col2 >= BTR_TAG()
    =>  Error in assignment;-3016 POS(1) Invalid numeric constant
    Select '',* from test where col2 >= BTR_TAG()
    Select col2,col1 from test where col2 >= BTR_TAG()
    => works as it should
    MaxDB V 7.7.07.16 running on Windows Server 2003
    I can replicated the test case above with Sql Studio and other ODBC based tools.
    Thanks in advance,
    Silke Arnswald

    Hello Siva,
    sorry, but I don't understand your reply:
    This is not right forum to posting this question.
    You are from which module or working any 3rd party application.
    MaxDB 7.7.07.16 is the community version of MaxDb,
    we are not using it for SAP
    and no 3rd party software is required to reproduce my problem,
    Sql Studio or Database Studio will do.
    Regards,
    Silke Arnswald

  • Calling User-Defined Function in SELECT

    Can I do something like:
    SELECT my_func(col_1) from tab_1

    SQL> CREATE OR REPLACE TYPE varchar2_pair_ot AS OBJECT
      2  ( var1 VARCHAR2(1000)
      3  , var2 VARCHAR2(1000) );
      4  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION my_func
      2      ( p_blah VARCHAR2 )
      3      RETURN varchar2_pair_ot
      4  AS
      5  BEGIN
      6      RETURN varchar2_pair_ot(LOWER(p_blah), UPPER(p_blah));
      7  END my_func;
      8  /
    Function created.
    SQL> CREATE TABLE blah
      2  ( b1 VARCHAR2(10)
      3  , b2 VARCHAR2(10) );
    Table created.
    SQL> CREATE TABLE xyz
      2  ( abc VARCHAR2(10) );
    Table created.
    SQL> INSERT INTO xyz VALUES ('Blah');
    1 row created.
    SQL> INSERT INTO blah(b1, b2)
      2  SELECT v.f.var1, v.f.var2
      3  FROM   ( SELECT my_func(abc) AS f
      4           FROM   xyz ) v;
    1 row created.
    SQL> SELECT * FROM blah;
    B1         B2
    blah       BLAH
    1 row selected.

  • User-defined function in package

    Hi all,
    is it possible to return more than 1 value when using user-defined function in package?

    I'll try to describe my situation. My need is to find correct client type by its cid number. If it's individual (ct.officialtype = 3) then function returns 3. If it's not individual (ct.officialtype <> 3) then function should check ENTERPRISETYPE.id, 910 is small business (function should return 1), else it returns 2. You can find my try below, it returns
    ORA-24344: success with compilation error
    13/29   PLS-00201: identifier 'US1' must be declared
    13/34   PL/SQL: ORA-00904: : invalid identifier
    13/1    PL/SQL: SQL Statement ignored
    17/4    PLS-00201: identifier 'US1' must be declared
    17/1    PL/SQL: Statement ignored
    9/13    PLS-00323: subprogram or cursor 'F_CLIENTTYPE' is declared in a package specification and must be defined in the package bodyCould you please give me solution on how do I write this procedure? It should be procedure, because I need to use it in SELECT statement.
    CREATE OR REPLACE PACKAGE creator.marco_function_clienttype
      IS
      -- 0 - not found
      -- 1 - small business
      -- 2 - corporate
      -- 3 - individual
       FUNCTION f_clienttype
         (cid number
         RETURN NUMBER;
    END;
    CREATE OR REPLACE PACKAGE BODY creator.marco_function_clienttype
    IS
    FUNCTION f_clienttype
         (ccid number)
         RETURN NUMBER
    IS
        Us NUMBER;
    Begin
    --officialtype = 2 - corporate, officialtype = 3 - individual
    select ct.officialtype into Us1
    from contragenttype ct, contragent d
    where d.id = ccid and ct.cid = d.contragenttypeid;
    IF Us1 = 3 THEN
    select '3' as t into Us from dual;
    ELSE
    --ENTERPRISETYPE.id = 910 - small business
    select dd.enterprisetypeid into Us2
    from contragent dd
    where dd.id = ccid ; 
    IF Us2 = 910 THEN
    select '1' as t into Us from dual;
    ELSE
    select '2' as t into Us from dual;
    END IF;
    END IF;
    Return nvl(Us,0);
    END;
    END;
    /

  • CALL USER DIFINED FUNCTION IN SQLLDR

    Is is it possible to call User defined function in SQLLDR ?
    COL1 COL2 COL3
    1 2 06
    1 2 06
    1 3 06
    1 4 06
    2 1 06
    2 1 06
    I have to ignore 2nd and 6th row while loading the data . because it is duplicate records .
    Is it possible in SQLLDR.

    If there is a unique index on the columns the duplicate rows are not loaded and sqlldr makes a *.bad-Datei (Parameter BAD=...) with the rows which are not loaded.
    What should the user defined function do?

  • Calling PL/SQL user defined functions from ODI Constraints

    Hi All,
    We are trying to call user defined PL/SQL functions from ODI. We are able to call them from ODI's User functions. But when we are trying to call them from ODI Constraints under Models, it is throwing an error 'ORA-00920 invalid relational operator'. Kindly let me know if anyone has faced the same issue and got the resolution for the same. Thanks in Advance.
    Regards,
    Abhishek Sharma

    Hi Ace,
    Thanks for the response, the same error was coming in operator also.
    I am able to call PL?SQL user defined functions from ODI Constraints. We have to first call ODI User functions from the ODI constraints as we cant call PL/SQL function (compiled in database) directly.
    From the ODI User functions, we can then call the PL/SQL functions.
    Please reach out to me if you need further details reg this.

  • How to implement a user-defined function in a mathscript node

    I am trying to use a mathscript node that includes self-defined functions, but I always get an error. I tried to run an NI-example: MathScript using Riemann Zeta.vi ,and I got the same error I get when I run my own programmes:MathScript Node'MathScript Node' (zeta): User-defined function contains an error. I didn't change anything in that example, so what could be wrong?

    Try the Mathscript forum instead. Good luck.
    (Maybe start reading this, for example)
    Message Edited by altenbach on 11-18-2009 01:48 PM
    LabVIEW Champion . Do more with less code and in less time .

  • BUG in DB XML? (when dealing with modules, user-defined functions)

    Hi,
    this post can be related to Different results for the semantically the same queries but here examples are even simpler.
    I have the module with one user-defined function:
    module namespace tnt = "http://tntbase.mathweb.org/ns";
    declare function tnt:filter-path($docs as document-node()*, $path as xs:string) as document-node()*{
      $docs[dbxml:metadata('tnt:path') = $path]
    };Then I have a query:
    import module namespace tnt = 'http://tntbase.mathweb.org/ns'  at 'file:/path/to/module/user-func.xq';
    (: this variable is IMPORTANT in the query:)
    declare variable $len := 3;
    (: here goes the same function as in the module, but with different name :)
    declare function tnt:filter-path2($docs as document-node()*, $path as xs:string) as document-node()*{
      $docs[dbxml:metadata('tnt:path') = $path]
    (:the query itself :)
    tnt:filter-path(collection("xml_content.dbxml"), substring("a:/doc.xml", $len)) If I execute the query I get *0* results, if I use function tnt:filter-path2 (instead of module's tnt:filter-path) then I get the expected *1* result.
    Also I experimented a bit with a query and got the following observations (independent from each other):
    1) If I substitute $len by value *3* or *3.0*, then I get right results in both cases, i.e. if the query itself looks:
    tnt:filter-path(collection("xml_content.dbxml"), substring("a:/doc.xml", 3)) 2) If I change the module's function so that it uses value comparison instead of general comparison, then I get the right results in both cases as well:
    module namespace tnt = "http://tntbase.mathweb.org/ns";
    declare function tnt:filter-path($docs as document-node()*, $path as xs:string) as document-node()*{
      $docs[dbxml:metadata('tnt:path') eq $path]
    };Please, help me out! I'm pretty sure it's a problem of DB XML and I'm struggling with it for a long time in this or that shape.
    Thanks a lot in advance,
    Vyacheslav

    I upgraded from 2.5.13 to 2.5.16 and the bug disappeared. The reason why I didn't do it before was that I hadn't seen any relevant for me fixes in the release notes of 2.5.16 comparing to 2.4.13 (Actually I already have had two patches for two relevant issues in the 2.5.13 version)
    Sorry for the false alarm.
    Vyacheslav

  • Calling a user defined function as default value for a column

    Hi All
    Can we call a user defined function as default value for a column ??
    for example:
    create or replace  function test1  return number is
    begin
    return 10;
    end;
    create table testt
    (id  as test1,
      name varchar2(20));
    getting error:
    Error at line 1
    ORA-02000: missing ( keywordThanks
    Ashwani
    Edited by: Ashwani on Jan 16, 2012 1:19 AM

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » SQL and PL/SQL which you can get more quick response
    Regard
    Helios

Maybe you are looking for

  • How do I fix my Macbook's sleep issue (OHC2)?

    I have a Macbook unibody (2.4GHz from 2010) with the OS 10.8.5.  After updating to the latest operating system and software updates, my Mac will not stay asleep for more than 5 seconds whether or not it's running plugged in or not nor will it stay as

  • Multiple Digital Signatures - each signer enters their comments then signs

    Background / Problem:  I currently have a Microsoft Word Document I print out (multiple pages). Everyone reads the first page, puts their comments in their section, then signs under their comments. The same group of papers (2-3 pages) gets signed by

  • DW 8.0 OS 10.4.6 Network Home Folder unable to save

    We have clients running 10.4.6 and MM DW8.0. The users have home folders on windows servers running Extremezip. The clients connect to ad using the Active Directory plugin in directory access and mount the home folders using AFP. When creating a site

  • Data Query combining GL, AP & AR

    Hi Guys, I work in a support project and having a hard time for finding the solution for the following request. Please help: "The information requested is as follows: - Number of GL entries per period - Number of manual GL entries per period - Number

  • Log & Transfer

    I am having trouble with log and transfer. the camera I use is a Cannon HF10. When I log & Transfer all my clips appear in the log screen, but when I transfer to que I get an ! in a red box and the clip won't transfer.Never had this before. Can someo