Scientific equation in Labview

Hi all,
       I have an equation which i have to code it in Labvew how can i do this. It includes functions etc .Can anybody do this VI for me.
Regards
Gita
Message Edited by AutoTEC on 10-18-2008 12:12 AM
Attachments:
Mathe.PNG ‏5 KB

Hi Gita,
you want to use LabView as a calculator? Ever tried to calc to +infinity using your small handheld calculator??? 
Either use some MathCad/Maple/similar software, that is made to work with such formulas or try to solve that equation on a sheet of paper (as you surely learned in some classes of math )...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • Implementing Differential Equations using Labview fpga modules on PXI-7811R

    Dear,
        I am working on   implementing dynamic systems modeled ordinary  differential equations on PXI-7811R FPGA using labview FPGA. Is there any body who can help me how to implement differential equation on PXI devices uding Labview FPGA, please? Is there any integrator in Labview FPGA, module. I used Discrete Integerator in LAbview FPGA  module in Maths palette, but i hesistated if it really works . I really appreciate your help,
                                        Gammee

    Thank you for posting on the discussion forum.
    You can solve differential equations using LabVIEW FPGA but you may run into some significant difficulties in doing so. If you are not tied to using FPGA, you could try using LabVIEW real-time, which may make things much easier. But if you would like to stick with FPGA, see the link below for a list of examples that may be helpful:
    http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/ssnav:ipn/q/differential%20e...
    Below is a link that you can review to better understand the functionality of the discrete integrator should you choose to go that route:
    http://zone.ni.com/reference/en-XX/help/371599B-01/lvfpga/discrete_normalized_integrator/
    I hope that helps.
    Best,
    Rachel
    Rachel D.
    Applications Engineer
    National Instruments

  • How to implement logical equation as LabView?

    Hi,
    I have this bit test logic I need to implement as a Labview code.
    Should I use formula node or either something similar to this already in Labview?
    "((var & (1<<bit)) != 0)"  where 'var' may be 8, 16, or 32bit, 'bit' is a number 0 - 31 representing
    a bit number. 0 is the least significant bit.
    Thank you,
    Do
    Solved!
    Go to Solution.

    Rotate, And, Not equal to zero
    Message Edited by Ravens Fan on 08-10-2009 09:36 PM
    Attachments:
    Example_VI_BD.png ‏2 KB

  • Can labview solve this equation?

    Hello,
    I need to solve this equation in labview to t. X and Y are known values.
    And if this part can't be larger then 1. If it is, it should be made 1.
    I have really no idea where to begin to solve this problem.
    Thanks in advance!

    If you are actually trying to solve it recursively, then Newton's Method should work.
    Actually after checking it, it's obvious the that any value of t at the
    input will give you the correct value of t at the output.
    Message Edited by rpursley8 on 11-21-2005 12:09 PM
    Randall Pursley

  • How do I solve simultaneous equation with 3 unknowns ?

    I need to solve simultaneous equations with 3 unknowns . Can any body help out on how to go about this? Thanx.

    You did not specify what kind of equations you have....
    Are your equations linear? Check the linear algebra palette and a look at "solve linear equations:.
    LabVIEW Champion . Do more with less code and in less time .

  • Controlling water level of spherical tank using labview.

    Hi, I'm trying to control the water level of a spherical tank model using PID in labview. The model is a non-linear equation as follows:
    Qi(t-L)-Qo=pi*R^2(1-(R-y)^2/R^2)dy/dt
    where Qi=inlet flow
    Qo=Outlet flow
    R=tank radius
    y=height of water
    t=time
    In order to get y, i have shifted the right hand side to the left and integrating it. However, i can't implement the integration of this non-linear equation in labview. Pls advise. Thank you.
    Attached are the files that i've tried.
    Attachments:
    plant.vi ‏31 KB
    integration3.vi ‏18 KB

    I've never seen this approach before and don't really know what you're doing
    from this snippet.
    What you essentially have is a system where the proportionality term varies
    depending on the current height of the water. This isn't too different from
    heater controls where the heater can operate anywhere between 70 and 450K.
    What we do here is to simply have a table of a handful of PID values
    appropriate to a range of levels and simply linearly interpolate between
    them to obtain an approximate value appropriate to the current level.
    Control wrote in message
    news:[email protected]..
    > Hi, I'm trying to control the water level of a spherical tank model
    > using PID in labview. The model is a non-linear equation a
    s follows:
    > Qi(t-L)-Qo=pi*R^2(1-(R-y)^2/R^2)dy/dt
    > where Qi=inlet flow
    > Qo=Outlet flow
    > R=tank radius
    > y=height of water
    > t=time
    > In order to get y, i have shifted the right hand side to the left and
    > integrating it. However, i can't implement the integration of this
    > non-linear equation in labview. Pls advise. Thank you.
    > Attached are the files that i've tried.

  • Differential Equations - Data from file

    Hi
    I am trying to solve a differential equation in LabVIEW. I have tried to modify an example from NI help and attached my VI to this email.
    I have a set on constants for the equation but I also have variables to which the values are stored in a lvm file V and dV. i want to use the value of V for each iteration of t and also the derivitive of V for each value of t. This does not appear to be working.
    Thanks
    Message Edited by scottcolston on 02-27-2008 04:08 AM
    Message Edited by Support on 02-28-2008 08:40 AM

    Hi Ravi,
    I think you need to use this.
    DATA:
            server type string VALUE 'Read the data.
    Server Path'.
      CLEAR itab.  REFRESH itab.
      OPEN DATASET dsn FOR INPUT IN BINARY MODE.
      DO.
        READ DATASET dsn INTO str.
        IF sy-subrc = 0.
          APPEND itab.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET dsn.
    If you mean application server by network drive.
    Thanks,
    Sai
    Edited by: Sai Krishna Kowluri on Dec 3, 2008 11:13 AM

  • Solving a system of nonlinear equations

    Hey guys,
    I am currently trying to solve a set of nonlinear equations in LabView with the help of MathScript and MATLAB code. I'm trying to create a working code since hours, but I haven't achieved this goal yet.
    System of equations:
    x^2 + y^2 + z^2 - R1^2 == 0
    x^2 + (y-Y0)^2 + z^2 - R2^2 == 0
    (x-X0)^2 + y^2 + z^2 - R3^2 == 0
    R1, R2, R3, X0, Y0 are known.
    Possible solution in MATLAB (assuming X0 = Y0 = 100, R1^2 = R3^2 = 11000, R2^2= 9000):
    Create myfun.m with content:
    function F = myfun(x);
    F = [x(1)^2 + x(2)^2 + x(3)^2 - 11000;
    x(1)^2 + (x(2)-100)^2 + x(3)^2 - 9000;
    (x(1)-100)^2 + x(2)^2 + x(3)^2 - 11000];
    end
    Set intial value for iteration:
    x0 = [50 50 50]
    Solve:
    fsolve(@myfun, x0)
    => Works fine!
    Now I tried to just plug all of this stuff into a MathScript Node:
    function F = myfun(x);
    F = [x(1)^2 + x(2)^2 + x(3)^2 - 11000;
    x(1)^2 + (x(2)-100)^2 + x(3)^2 - 9000;
    (x(1)-100)^2 + x(2)^2 + x(3)^2 - 11000];
    x0 = [50 50 50];
    Sol = fsolve(@myfun, x0);
    This is where the problem starts.
    When I try to run the program, I get the follwing error message:
    A function is defined in this script. You must save and call the
    function with appropriate input values to execute the function.
    I can't really figure out, what I did wrong and I would be very thankful, if somebody could help me.
    Regards,
    fuchrist
    Solved!
    Go to Solution.

    Hi,
    MathScript does not support inline user-defined function (UDF). What you need to do is
    Define the UDF in a .m file. Give that .m file the same name as your UDF.
    Save the .m file in MathScript Search Path. By default, the search path is the LabVIEW Data folder.
    Pass the name of .m file as the first string input to function fsolve in MathScript Node.
    I attach my .m file and snapshot of MathScript Node. The result I got is [50, 60, 70] which should be correct.
    Attachments:
    myfun.zip ‏1 KB

  • Strange color change in graphic when ID file exported to pdf  ID CS3

    I open a pdf of some special graphic or scientific equation in Photoshop, put it into grayscale, discard layers, and save as a Tiff. I then import it into a two-color InDesign document. With the selection tool, I choose a swatch of one of the two colors in the document at 10% tint, to be a background color (where there is no content in the Tiff). With the direct selection tool I then choose from the swatches the other color of the two-color document for the actual content of the graphic (text, drawing, etc.). On-screen this looks exactly as it should. However, when I export the InDesign file as a pdf, the color of the background of the graphic is a 10% tint of the second color, not the first color. I have tried redoing the graphic in Photoshop in different ways, but no matter what I do the export to pdf from InDesign changes the color of the background of the graphic to the other color. How can I fix this problem? I am on a new MacBook, 2.4 GHz Intel core 2 Duo; 4 GB 1067 MHz DDR3 memory; OSX 10.5.6.

    mrgoodguy_in wrote:
    I previously posted this issue in InDesign forum, where I was said that it seems to be Acrobat issue. Therefore I am posting here.
    Thanks in advance
    Well this is the Reader forum. You cannot check colors using Reader. Are you using Acrobat? If so, you will want to ask in the Acrobat forum for your OS. Good luck.

  • How can i find a tutorial to simulate analog circuits?

    i have to make a full wave rectifier. how can i find any tutorial to do that

    yascen;
    Very simply, a full-wave rectifier is the absolute value of your waveform. I attached an example that shows how to do a full-wave rectifier and a half wave rectifier.
    LabVIEW is not a circuit simulation program. It is a powerful software development environment. Of course, you can create a circuit simulator with LabVIEW, but is something you have to create.
    To simulate circuits in LabVIEW, you just need to know and understand the mathematical equations that govern the circuit you want to simulate. Then, you just "wire" those equations in LabVIEW.
    If you are looking for a circuit simulation software, you can check MultiSIM from Electronics Workbench.
    Regards;
    Enrique Vargas
    www.visecur
    ity.com
    www.vartortech.com
    Attachments:
    full_and_half_wave_rect.vi ‏32 KB

  • Serial port: Input/output signal errantly combined

    I am currently in the process of using LabView to replace another user interface for a scientific instrument.
    LabView is connected to this instrument through a serial port.  The instrument streams 25 bytes of binary data every second to the computer.  I can read the binary string (VISA Read) and save contiuously to disk using a while loop.  In addition, there are a few instructions I can send to the instrument that will do various functions (start logging, turn LEDs on/off, etc).  I can successfully send these instructions to the instrument using the previous interface, and in a stand-alone vi using VISA Write, but when I place the VISA Write function into the larger interface vi, signals go haywire.  Specifically, there are two separate LEDs that I can toggle with two different commands, but when in the larger interface vi, both commands toggle the same LED.  Also, it appears that the singal I send to the instrument (a single ASCII character) immediately bounces back to the computer into the 25 bytes of streaming binary data.  In other words, after I press the LED "on" key, one column of my streaming data changes when it is not supposed to (ex: after Binary to ASCII conversion, it changes from a single digit to a twenty digit value).
    Initially, I thought the problem was the sequence of VISA Read/Write.  In the current configuration, I read all data, then allow for Write commands.  Both the VISA functions are within the same While loop to continuously monitor the data.  Is it possible the Write signal output is not leaving the while loop and being read as input?  What would make the instrument read two different commands as the same one?  My goal is to run an interface that displays the streaming data as ASCII, and allows for a few different toggle options while the interface is running - is there are more efficient/elegant way than a while loop?
    ~Going Bananas
    Solved!
    Go to Solution.

    New replies now in gray.
    CodeMunkee wrote:
    1.  If you keep giving me good advice like this, I'll be tempted to change the background to Baltimore prison purple.
    I'll ignore this statement.
    2.  The buffer now lives outside the loop.  I understand clearly.  Part of the problem might be my instrument - when I cycle power the 19 digit number that was 'echoed' disappears.  Forget about that display stuff, it works properly - I accidentally removed the time delay when editing the vi.   But you do bring up an interesting point...
    Without the delay, the loop ran much faster.  If the bytes weren't at the port, the read statement would have returned nothing when it read zero bytes, thus blanking out the indicator rather quickly.
    Yes, Hexadecimal display shows 04 to indicate the end of the 25-byte data sample.
    Doing a bytes at port read is not always a good idea.  If not all the bytes had arrived yet when you ask for the read, you won't get all the data.  The remaining data being sent in that stream from the instrument will show up at the front of the buffer on the next read command. 
    While this isn't a common occurence, it does happen.  How can I prevent this from ever happening?
    Since you know each commands ends with a hex 04 (ASCII character for EOT), you could enable the termination character when you configure the serial port.  Set the termination character to be 4.  Then when you execute the VISA read, read a large number of bytes such as 25 or more.  The read will terminate at either the timeout, the requested number of bytes, or when the termination character is read.  With this setup, you could eliminate the wait statement and also not request the number of bytes as the port.  The VISA read will control the pacing of the loop.  Any extra bytes after the termination character are part of the next frame of data and will wait around until the next time you read the VISA port.
      3.  Implementing your ideas for the latch button works better.  I am still encountering issues with these commands however.  Attached is the new vi.  There are two commands I want to send, 't' turns on the LED light (they blink for 30 sec then time out), and the latch works perfectly for that, 'p' turns on the magnetometer light (an additional 'p' is required to turn it off), but I cannot get the command sent to the mag while the loop is running.  It turns on either at the beginning of the vi, or at the end of the vi (after Finish button is pressed).  This leads me to think the command 'p' is stuck inside the loop.  I tried adding another film strip (see attached vi) for the toggles to force the issue, but it didn't work. Additionally, the 'p' command effectively works as a 't' command, and the LED lights begin to blink when I press the 'p' button.  This isn't supposed to happen, and leads me to believe the 'p' command does in fact exit the loop but in the wrong manner.
    The "film strip" is another frame of a flat sequence structure.  It enforces the order of execution.  The next frame can't execute until everything in the prior frame has completed.  It isn't necessary in your case because the Error and VISA wires determine the order of execution with respect to the other VISA statements.  But it shouldn't hurt.
    There is no reason the "p" case structure should behave any differently than the "t" case structure.  Although you should wire the error wire through in the False case of the "p" structure like you did for the "t" structure.  There is no "exiting of the loop" in either case.  The loop runs until the stop button is pressed.  I would check the manual to see that t and p commands do what you think they should do.  Do they need a termination character of their own when they are sent?  Should they be upper case letters rather than lower case?  You can run NI Spy on your serial port and see the operations occurring with it and see the data coming in and what data is going out.  I would be suspicious that the device is not handling the command properly.
    Any ideas?  I think I've tried to put the toggle buttons outside the loop before, but then could only toggle once before the loop took over.  Ideally, these toggles would be available at any time while the data is streaming, so therefore inside the loop?
    The toggle buttons need to be within the loop so that they can be read on every iteration of the loop.  Outside the loop, as you discovered, they are only read once at the very beginning before the loop is started.
    4.  Thank you for the suggestion about the Selection Mode for the Open/Create File option.  It is annoying to create a file first.  I made the change, but I still get error messages when I use a file that does not yet exist.  LabView takes me to the first Open/Create/Replace vi when the error occurs.  Is there something else I must do?
    On the open file VI, there is an input that is Open as default when unwired.  Create a constant there and change to Replace or Create.
    Remember, if you have any questions about the way LabVIEW is handling something with serial ports, close the port within LabVIEW.  Open Hyperterminal and try the commands from there.
    Message Edited by Ravens Fan on 01-13-2009 03:55 PM

  • Thresholding an image in order to determine areas

    Hey everyone,
    I'm somewhat new to Labview and I've only recently gotten the Vision Development Module and the Vision Acquisition software. It's extremely new to me and I'm at a loss. I searched around and couldn't seem to find exactly what I'm looking for, or maybe I didn't understand it enough to know. I'm really just looking for something to get me started.
    I am wanting to create a VI that thresholds an image that is inputed from a previous VI that I have already created in order to determine the area (number of pixels) the objects take up on the picture.  The picture will have several metal objects on top of a colored background and will be later compared to another similar image.
    What would be the best way to threshold this? Based on the colored background (most likely blue or green)? What I picture is for this to turn the image into black and white and then count the white pixels and group them by each object.
    Attached are the image capturing VI which uses a webcam to take a picture and a test VI to try to figure out what thresholding is about.
    Thanks in advance for the help.
    Attachments:
    ImageCaptureVI.vi ‏61 KB
    TestThesholdingVI.vi ‏22 KB

    Hello,
    if you background is for blue for example, you could extract the opposite (complementary) color plane i.e. red to reinforce the contrast before thresholding:
    BEFORE:
    AFTER:
    You can then manually or auto threshold. Manual threshoding needs to know the threshold values. The below part in your code is (probably) not correct:
    Thresholding the image will convert the image to binary, no matter what value you specify, but the output is greatly dependant on this. The equation for Labview threshold function is (check the documentation to be sure):
    IF f(u,v) >= Tlow AND f(u,v) <= Thigh, then f(u,v) = 1, otherwise f(u,v) = 0!
    where f(u,v) is the value of the pixel at (u,v) location and Tlow is the lower threshold, Thigh is the upper threshold.
    The range specifies this two threshold values. After you threshold the image, you can use morphology operations to reduce noisy data, fill holes etc... and use for example particle analysis (on binary image). If you use count and measure objects, you do not need to threshold the image before, since the function does this for you, again by specifying the threshold value(s).
    Hope this helps.
    Best regards,
    K
    https://decibel.ni.com/content/blogs/kl3m3n
    "Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."

  • Settings for stepper motor

    Hi all,
              I am trying to control a 1.8 deg step motor of Pacific scientific(N33HRHJ) using Labview 8.2 . I am using it to pull a incremental load ( upto 400 lb)  in velocity control mode - however beyond a certain load the motion of the motor is becoming jerky. I have been using microsteppings of 50,000 for making my moves.
    Is there a way to overcome this using the MAX settings - specially the trajectory / control loop settings ?
    With regards.
    Partha

    Hi Brian,
                   The motor is connected to a ball screw actuator through a double helical bearing joint. The maximum rot'n speed I am using is 1 rpm. I can clearly feel that the motor is stopping for split seconds, and then again starts working at higher loads.
    The drive I am using is Pacifc scientific P70530.
    Regards,
    Partha  

  • Feedback loop for taking integral

    Hello. I'm trying to model some mathematical equations in LabVIEW and trying to the find the integral using feedback node.
    Here is the equation I'm trying to model:
    i = integral([VBATT - i*R - i*(dL/dt)]/L), where L is a function as well.
    At the output of i I get 0. I'm assuming I have to put an input into the feedback loop but I'm not sure what to do here. Any help would be appreciated. Attached is my VI as well.
    Attachments:
    project3.vi ‏24 KB

    OriolesFan wrote:
    Why are you using a feedback node?
    Feedback nodes are for storing information from one iteration and using it in the next.  Since you don't have any loop and your VI runs once, it will return the default value that the feedback node is initialized with.  Thuse zero.
    The i I solved for is needed as an input. Those are differential equations.
    I think I did this wrong actually. I modeled these equations in Simulink but used a transient response to get the results, so I think I need some other module in my LabVIEW to do this. I was trying to take my equations from Simulink and trying to model it in LabVIEW.

  • How do get raw spdif output in games onboard sound K8T Neo

    I'm betting that the reason  my front channels are only working is because I need to use spdif/raw not spdif/pcm but how do I get games to do this or windows in general  when i play dvd's the othe channels work fine ???????????????

    oh.. fyp = final year project.
    I have no idea what SVS stands for.. the entire .vi is as follows, "SVS Scale Voltage to EU.vi" .EU would be engineering units here i suppose.
    here is the scenario: Labview logs the sound pressures received by the microphone via converting the microphone voltages to pascals. my question is, how does labview do it? is there an equation that labview uses in the conversion? I understand that values acquired via a data acquisition device usually have a linear relationship with the voltage coming from the sensor; raw data comes in regular voltage units. Hence, i would need to scale the signal to the appropriate engineering units.
    So how would i go about converting this voltage to pascals and finally dB? Or is there a direct conversion between voltage to dB? I cant find it anywhere on the web, and i dont have the Labview VI that does the conversion for me.
    Hope you understand what im asking for now. Thanks!

Maybe you are looking for

  • CC runs under Mac OS 10.6.8; not under Yosemite 10.10.2

    We are on a secure network via a proxy server. Adobe CC desktop app installs and works fine on Win 7 machines and on our older Macs running OS 10.6.8. However, on our new Macs running Yosemite 10.10.2, and the same proxy config as the older Macs and

  • The 2014 ASUG Data Quality Survey is Live

    This is the third ASUG survey from the Data Governance Special Interest Group (SIG)/ Metric Working Group. Like the other two surveys from 2009 and 2011, this survey is polling how companies are managing quality control for their master data, in part

  • Right file adapter Content Convers Parameter needed ?

    In text file to text file I have the following given input/output Input structure is this: <?xml version="1.0" encoding="UTF-8"?> <ns:MT_SEND xmlns:ns="http://comp.com/sap">   <Recordset>     <Record>       <FIELD1>       <FIELD2>       <FIELD3>    

  • After system restore on iphone no vpn configured

    ok i restored my iphone 3gs (3.1.2fw) because i wanted to delete all the trash music i copied on it... then i surfed a bit the internet, called the 2000 and there the woman said i have 2,80€ more than yesterday... then i looked up the network setting

  • Only eleven web gallery templates in Adobe Bridge?

    Only eleven web gallery templates? If possible, how and where can I get more templates? Thanks in advance.