MathScript / formula precision of node



Tags: NI Products

Similar Questions

  • Formula bug tag node?

    The last one for this week (I hope)...

    Remove a node formula on the comics and him show the label:

    Now resize the formula from the top node:

    Oops! The crux of the formula is stuck in its original position. I don't know of another brand of objects behave like that.

    Tested in LV 2011.

    This was reported to R & D (CAR # 339805) for further investigations. Thanks for the comments!

  • Not found MathScript in Labview 8.6

    Hi all

    I am a user of the labview 8.6, full version development. I want to use my script containing the mathscript node that I made on the labview 8.5, the full version of the development, but I can not open this script on version 8.6. When I eliminated the mathscript in the script node, I opened it successfully on the labview 8.6. I can't find the mathscript function in the function block diagram palette, although it does not exist on USING the software. To my knowledge, the mathscript function exist in version 8.6, as well as in version 8.5. I can't understand my problem. Plese give me suggestions.

    Thank you

    Hey,.

    I guess that LV 8.5 you activated 'Full development with MathScript system', in LV8.6 only 'Full Development System '.

    Please check your License Manager (start > program > National Instruments > License Manager).

    If you do not have the MathScript your content of contracts might have changed from 8.5 to 8.6

    In any case, I would say contact your local office of OR then, they may know what the content under your serial number.

    Christian

  • Boolean index in the array

    In Matlab, often use a Boolean array to access the specific values in a table.

    It is a good way to reduce the itterative loops and improve the speed of the code.

    I'm trying to find a way to do this in a Mathscript node, otherwise the code takes forever to run.

    Common code in Matlab and Mathscript:

    a = [1,2,3,4,5]; % This is normally a much larger range

    b = [1,0,1,0,1]; %I whether Boolean, but by default it's double

    c = b > 0;  b change % to boolean

    d = [9,9,9,9,9];

    The Matlab code is:

    d (c) = a (c);

    d

    > d = [1 9 3 9 5]

    If I run the above in Mathscript, I get the following error:

    In Mathscript, to achieve the same result "d" I currently have this:

    for i = 1:length (d)

    If c (i) == 1

    d (i) = a (i);

    end

    end

    d

    > d = [1 9 3 9 5]

    A slightly faster version is:

    for i = 1:length (d)

    j = 1;

    If c (i) == 1

    e (j) = c (i);

    j = j + 1;

    end

    end

    d (e) = (e);

    d

    > d = [1 9 3 9 5]

    Any ideas?

    Thank you

    Hello

    The code you have posted works fine in the MathScript in LabVIEW 2009 node as well as in the MathScript window and the MathScript node in LabVIEW 8.6.  As such, I'll assume that you have found an error in the window of MathScript in LabVIEW 2009.  We have already identified this problem and currently filed the bug report 151999 for her.  You see error message did not come through in your post, so I guess it is-90026: ' indexes for an indexing operation matrix must be real and positive integers. "  The problem is that we do not treat the indexing variable 'c' as a boolean type.  As a result, it reports an error when it tries to use the index 0 instead of a fake.  We are working on a fix for a future version.

    To work around the problem in the MathScript window, you can use find instead of any Boolean indexing command.  It should integrate more quickly than the implementation of loop that reference you.  Instead of
    d (c) = AC;
    use
    d (Find (c)) = a (find (c));

    Grant M.
    Staff software engineer | LabVIEW MathScript | National Instruments

  • Frequency Modulation thing. How to solve it?

    Hello!

    I have a VI that is frequency modulation using two nodes of formula. A node is for the generation of Message signals and the second node form - generation of FM resulting. Equations of observation of FM, the position within the equations of FM - should be instegrated and FM is like:

    FM (t) = A * cos (2 * pi * Fc + 2 * pi * D * Integral (shrub);)

    , where A - amplitude; PI - 3,14; CF - carrier, shrub - message signal frequency; D - frequency deviation.

    That's why I use external integration, then pass signals integrated into the equation of the FM.

    The problem is - Signal has very low voltage (amplitude) after integration - and it no longer works.

    Should I multiply signals part until it is the same amplitude as the original signal?

    What could I have done wrong here?

    Thanks in advance.

    I created a polymorphic VI 'Generation FM'. This frequency-modulated signal output generates VI according to wired signal Message. Generation VI FM accepts two types of Message report entered - waveform or a table. If you wire up a table for Message intput - you will also need to "Sampling frequency" input wire. Now everyone can put this polymorphic function on their pallet pattern and use it.

    Note: You need to put on a VI block diagram called "FM Generation.vi", two other files ".vi generation FM (table)" and "Generation FM (waveform) .vi" are instances of function that are responsible for entries or entry level waveform.

    This feature is designed for LabView 7.1 or higher.

    Do not hesitate to write feedback.

  • Replace formula MathScript node

    For some reason, module Script of Math is only a license for my 32-bit LabVIEW 2014, but not for my 64-bit version that is installed on the same machine.

    Therefore, I need to replace a routine MathScript with formula node. Here is the code:

    j = 1

    for i = 1:2: n-1

    Odd (j) = a (i)

    j = j + 1

    end

    j 1

    for i = 2:2: n

    (J) = a (i)

    j = j + 1

    end

    The code simply takes in an array 'A' size ' n "and the outputs of the two tables, one of the odd indexes and one for those even. I tried to do in the Forumla node but I keep getting errors when odd definition [n], LabVIEW only accepts Odd [10] or any specific number, which is not very useful.

    Simply use the array decimate function:

    http://zone.NI.com/reference/en-XX/help/371361M-01/Glang/decimate_1d_array/

  • If/else statement in the MathScript node

    I want to write if/else statement in MathScript node.

    If (Yes is Yes)

    {

    a = 0;

    }

    other (no = no)

    {

    b = 1;

    }

    'Yes' and 'No'--> of Type String

    'a' and 'b'--> Type Double

    Hi johndoe.

    Thank you for contacting National instruments.

    I would like to highlight a number of items which you may find useful for the implementation of an if-else statement in a MathScript node.  The first is a book white tutorial, which the second part explains how to use LabVIEW MathScript node. The second is an article describing the required syntax to write functions and scripts in the MathScript node, including instructions for the use of the If-Else statements.

    I hope that these help. Please let me know if you need additional assistance.

    Kind regards

    James

  • Is it possible to print the mathscript with color-coding text node?

    MathScript nodes lie down, I need to be able to make temporary annotations on paper.  Currently, the only way I can find to print the MathScript node is by screen capture and printing an image.

    While I can copy the text and put it in a word processing program, I would lose all the useful color coding.

    Y at - it a tip to copy as text and preserve color-coding?

    Download and install the notebook of the programmer.

    Copy all the text of the Mathscript node and paste it into Notepad to the programmer.

    In the menu bar - view - check syntax highlighting

    In the menu bar - display - regime change - select Matlab

    In the menu - Tools - Options - fonts and colors - bar you can select a larger font size

    (Although my vision is corrected to 20/10 and I have a lot of difficulty to read tiny fonts in the Mathscript node on a screen high resolution after a couple of hours.)

    This software is free and has a full set of features for serious programmers.

  • Array of strings 1 d out of MathScript node

    I use arrays of cells inside a MathScript node and want to display an array of strings D 1.  I can't get output with this data type by selecting a column of string elements.  He seems to treat the strings as arrays of characters that are extremely difficult to work with.

    I've seen references 2008 who say that MathScript nodes cannot not out of arrays of strings,

    Is this always true?  Is there an example of how to get a string or some kind of workaround?

    My boss came up with a way to do it, as shown in the attached VI.

  • '' If '' dosnt works at the mathscript node

    Hello

    I have a strange problem in mathscript node, can u help me?

    I just wrote a simple conditional style in the mathscript node, but it dosent work and have attached the error! my software has problem?

    Best Regarsd

    Behzad

    The problem is that your "out" is not defined, as executed in your script. Maybe it's what you want instead

    out = - 1; % define value as default for the

    If in == 7

    out = 6;

    end

    Kevin C.

  • How to share a variable between the Mathscript Windows and a Mathscript node

    Hello

    I'm trying to share (just) a variable between the Mathscript Windows and a Mathscript node. I don't know why, but the use of the "global" Matlab function makes the mathscript node output formats change.

    I'm looking for a "Mathscript RT V9.0.1 module" as it may seem, there is. French technical support have some difficulty to find...

    Hi patrick33,.

    The code that you have attached should not report an error, so it seems that something has gone wrong with your installation of MathScript. My best guess is that it is the problem that is described in this knowledge base article. Your signature says that you use f3 patch, which is a good start. But the KB lists some other steps to take when you see errors about MathScript, impossible to compile. Can you try the procedure described in the article and let us know if that fixes the problem?

    Thank you

    jattas

    LabVIEW MathScript R & D

  • Change the working directory of the MathScript node in the working directory of the VI in which the node is added

    Hello

    I want to automatically change the working directory of the node Mathscript in a VI in the working directory of the VI, while I don't have to specify every time where is my file ".m", as most likely, it will be in the same folder as the VI.

    Thank you

    Walid F. van

    Hi Wade,

    The following picture illustrates how to add the directory to your VI to MathScript search paths.

  • For the question of loop/formula node/Maj register_Beginner

    Hello

    I am a beginner of Labview and have a newbie question. I think that's most of you very easy, so please try to help me soon

    I (X, Y) datavalues... I calculated the average arithmetic using a formula node and a loop for and got (X', Y') out. Now, I want to take the output X' and Y' and calculate an average value in reference to X and Y. Thus, the same calculation in the loop for, but I want to take the output values and feed values again under the entry name. This should be played N times and routes.

    I tried using shift registers, but failed to connect properly as I can get what I want. I have attached here this part of my vi where I have the problem. I hope you can help me. Thanks in advance.

    Hi Sarah,.

    If you need to put the X "-paintings in a registry change, while the original X table remains constant:

  • calculation using the formula node needs two clicks

    Hello

    I want to use this piece of code for a larger program. My goal is to take 10 values and calculate two values using a formula. I used the formula node as the calculation functions digital ordinary would be too heavy. If I click on save, it saves two values to a file.

    The problem that I am facing is that when I start the program, it works very well for the first time. The second time however, if I change the values, and then click on save, it still displays the previous values, or some altered values. I have to click on save twice to get the correct values. I don't understand the reason why this happens. Can anyone help?

    File attachment: Capture screen and VI.

    P.S. If the solution can help with the problem, I'm ready to change any part, but please, not irrelevant to suggestions on how to * improve my code *, because I've worked hard to make it work with another major project.

    I don't completely understand the description of your problem.  But I see two problems.

    1. the "Save" button actually belongs to the event that handles the record button.  And the case of the event should really be Jean-Claude Value Change of mouse down?

    2. your STOP at the bad mechanical action.  Since it happened so this just released, it is only true while you're pressing it.  It stops the upper loop, but can't stop low loop because your loop will also be waiting to save button to press.  Stop will always be false because you cannot press two buttons at the same time.

    Try to make your action to stop button to be changed when released.  You must return the button to false programmatically born of two loops.  In fact, it would be better to have a case of events for the stop button to stop the lower loop.

    I don't understand what you're trying to do in the upper loop.  You read a file as soon as possible, and it seems to be the same file that you create in the lower loop.  Why?

  • Formula node error: lack the right parenthesis

    Community salvation OR,.

    I work with the structure of nodes formula for the first time and I came across this error that I can't fix.

    He says he finds a character #, but the strange thing is that there is no character. Is there someone who can help me with this one please?

    Kind regards

    Thomas Ruts

    On your first long form you are missing a closing parenthesis.  It is in the last half of the formula.  You have two left parenthesis, but only a right.

Maybe you are looking for