Sine pattern and sine wave VI

i would like to give input arguments to Sine pattern VI and Sine wave VI. Input argument amplitude i would like to give in mm and frequency i would like to give in HZ and periods and i also want to give time as an input. Is it possible? and how? please tell me.
Regards

The amplitude input is without units. For example, if you specify 3, then the sine wave values will be from -3 to 3. If you want mm, there must be some kind of conversion. When you say mm, how does this relate to the sine wave? Are you generating a sine wave voltage signal that drives a motor or other actuator that moves a device by a number of mm? Of so what is the relationship between voltage and the mm displacement generated by your actuator?
Sine Pattern has an input for number of cycles instead of frequency. So you need to figure out how many samples you want in your waveform and how many cycles this should represent. All this depends on the update rate you use for outputing your waveform to the actuator.
For example, if you want to update your
output at 1 kHz, choose to have a 100 sample waveform, and want a 20 Hz sine wave -> 100 samples will represent 0.1 seconds of data (at 1 kHz). So 0.1 seconds of a 20 Hz sine signal will include 2 cycles, so you should specify 2 cycles and 100 sample on the Sine Pattern VI inputs.
The Sine Wave VI frequency input is a bit more complicated as it is a normalized frequency input. Basically, figure out how many cycles you want. Then divide the # of cycles by the number of samples in the waveform you are generating and that is the normalized frequency you should specify. In our previous example, take 2 (# of cycles) and divide by 100 (samples in the waveform we generate). This gives you a normalized frequency of 0.02. This is the input for f (normalized frequency) on Sine Wave VI.
Christian L
Christian Loew, CLA
Principal Systems Engineer, National Instruments
Please tip your answer providers with kudos.
Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

Similar Messages

  • How to modify Sine Pattern or Wave VI so that an offset can be applied to it.

    Hello,
    Is it possible to modify a the Sine pattern.vi or sine wave.VI so that a voltage offset can be applied to them? 
    If not, any ideas on how to build a VI that outputs an array with a sinusoidal pattern which can then be written to a channel?
    Suggestions for other options are definitely welcome.
    Thanks!
    Solved!
    Go to Solution.

    That is simple enough.
    Just think of it from a mathmatical point of view. If you have:
    y = sin(x)
    and you want to 'offset' the y-value, then you just:
    y = sin(x) + 'offset'
    I added a constant of 5, but you can change that to a numeric control if you want
    Cory K

  • Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??

    Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??
    How Do I generate those signals?

    Hello;
    You certainly can do that. The way to go about that is to use one of the Analog Output channels your board have available.
    If you are using Labview to program the board, you can find good examples at Search Examples->I/O Interfaces->Data Acquisition->Analog Output->Multiple Point (buffered) Analog Output.
    If you are using other Software language to program the board, you can fing examples at C:\Program Files\National Instruments\NI-DAQ\example\VisualC\AO.
    Hope this helps.
    Filipe

  • Phase shift between a pulse and sin wave

    Hello,
    I was wondering if there is any VI that I can use to get the phase shift between a pulse and a sin wave (they have same frequency).
    The Ideal case is that the pulse should go to 1 when sin wave is positive and goes to 0 when the sin wave is negative. I want to set this test to measure the phase shift between pulse going to one and sin wave going positive.
    We just bought labview full version with Signal processing package, and I was wondering if there is anything that would be useful for me.
    Thanks in advance,
    Baran.

    Hi Baran,
    Try this on for size and see if it works for you.
    Have a great day,
    Chris V
    Applications Engineer
    National Instruments
    Attachments:
    Phase Difference.vi ‏22 KB

  • Where would I find Uniform White Noise.vi, Square Wave.vi, and Sine Wave.vi?

    I am trying to open the Demo Scope.vi that is located in tutorial.llb that comes with the LabView installation. When I try to open Demo Scope.vi,LabView can not find Uniform White Noise.vi, Square Wave.vi, and Sine Wave.vi that are subVIs that Demo Scope.vi is looking?
    Has anyone had similar problems when trying to run Demo Scope.vi through the Getting Started with LabView manual? FYI, I have the LabView Version 6 Base package. Any help on this subject would be greatly appreciated. Thanks in advance.

    This issue also is mentioned in KnowledgeBase 21H8J2R2.
    In LabVIEW 6.1, the Demo Scope VI referenced in the LabVIEW Getting Started manual only uses VIs available in all LabVIEW development systems, including the base package.
    Kelly H
    LabVIEW Documentation
    National Instruments

  • To generate sine curve using sine pattern.vi

    I tried to generate sine wave to provide sine curve to the motor. I used sine pattern.vi and the vi located before the while loop. I could not put it inside 'while loop' to change the amplitude of the sine curve while the program runs. What do I have to make some changes in the program to provide different values in 'sine pattern.vi' while the program runs?
    Attachments:
    AO_command_sin_input_with_position_info.vi ‏165 KB

    Jae,
    Looking at your VI, it seems that what you want to do is update the sinewave generated on the fly. Try using the Point by Point functions to generate a sinewave, they will give your the most flexibility. I am attaching an example that generates a sinewave point by point. If you change the value of the frequency control, you will see that the frequency of the waveform will change on the fly.
    Attachments:
    Generate_Sinewave_PtByPt.vi ‏32 KB

  • How do I vary the voltage of a DC power source in a sine pattern around a certain voltage?

    Hello all!  I'm using a GW Instek PST-3202 DC power supply to apply a voltage to a cartridge heater to heat an aluminum block.  I want to apply a sine wave that varies the voltage by +0.05 V to -0.05 V centered around 15 V (from 14.95 V to 15.05 V).  I can manually set the voltage of my power supply to 15 V using the analog controls on the power supply itself, but as soon as I turn on my VI it resets to 0 V, which I don't want.  Also, it says there is a read timeout, and I'm not sure why.  I'm very new to LabVIEW so this may be a very easy fix, but any input would be greatly appreciated!  My VI is attached, as well as the VI I am using to monitor the temperature, just for completion.
    Attachments:
    temp_resolution.vi ‏21 KB
    LabVIEWTempLogger_new.vi ‏83 KB

    I've followed all of the advice ITT, but I'm still getting a timeout error on VISA Read.  I added a wait between the write and read functions, as a tutorial told me I should, but I'm still having a problem.  Also, I feel like the sine pattern function isn't creating a continuous sine pattern, but that may be because the VISA Read is timing out still.  My VI is attached.  I know I need to take a free tutorial, but I haven't had the time yet.
    Attachments:
    temp_resolution.vi ‏17 KB

  • Inverse sin cos and tan

    Hello,
    I was trying to use the the Math class in java but the sin cos and tan functions only take radians, not degrees and there doesn't seem to be any functions for finding the the inverse sin cos or tan. Is there another class for doing this or were sun just in a funny mood when they wrote it ?

    So you missed the methods "asin", "acos", "atan", "toRadians", and "toDegrees" in the API spec how?
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Math.html
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/StrictMath.html
    Note that the to* methods are fairly new additions to the API. Conversion between radians and degrees isn't hard anyway ... multip</B>r divide by 180/Math.PI.

  • ATAN2  geometric function and pasing DECFLOAT34 in Sin, cos and Tan.

    Hello,
    1) Is there any macro,Function module  or any way to use atan2 is a variation of the arctangent function in ABAP
    atan2 is available in C, C++, java but i don't seem to find it in ABAP.
    Further details : --- http://en.wikipedia.org/wiki/Atan2
    2) The current limitation for Sin , Cos and tan  geometric functions is Float.
    I am looking for a way to pass a double (DECFLOAT34) into SIn or Cos.
    I do not want to lose the accuracy by using Float.
    Can this be done ?
    Regards,
    Ajay Kulkarni

    Hello Alvaro,
    I have written the following code for atan2 accordingly but it is not as accurate as i wan't it to be.
    The results are not accurate.
    Regards,
    Ajay K
    method ATAN2.
      DATA :
           xsqr TYPE DECFLOAT34,
           ysqr TYPE DECFLOAT34,
           xysqr TYPE DECFLOAT34,
           xysqrt TYPE DECFLOAT34,
           tempa TYPE DECFLOAT34,
           tempb TYPE DECFLOAT34,
           tempc TYPE DECFLOAT34,
           x TYPE DECFLOAT34,
           y TYPE DECFLOAT34,
           atan2 TYPE f.
      data tempb_float TYPE f.
      data tempd_float TYPE f.
    x = iv_x.
    y = iv_y.
    if x = 0 and y = 0.
    ans not defined
    ELSE.
        xsqr = x * x .
        ysqr = y * y .
        xysqr = xsqr + ysqr.
        xysqrt = sqrt( xysqr ).
        tempa = xysqrt - x.
        tempb = tempa / y .
        tempb_float = tempb.
        tempd_float = atan( tempb_float ).
        tempc = 2 * tempd_float.
        ev_atan2 = tempc.
    ENDIF.
    endmethod.

  • How to draw a line of sin x and its area under the line?

    Hi,
    I know how to draw a line from two points. However, I do not know how to draw a line of function sin(x) and its area under the line. Anyone know where to read or how can I draw it, please help me. Thanks !!
    Calvin

    use Graphics2D:: draw(Shape)
    create a class that implements Shape, and specifically the getPathIterator methods, in these methods you should return a path iterator that follows the sin/cos curve.
    All fairly simple to do.
    rob,

  • Brify my account - looking for credit card info and sin number - how do I verify this is actually an apple request

    I have received a disturbing email about my account - how do I verify this actually came from apple before continuing when the site is requesting credit card and sin number information?

    Apple would never request such information through email.    If at all it would ask you to verify it in your own device.
    You can ignore it and consider it a phishing scam.

  • FFT on triangular and square waves.

    Hi,
    I have been computing FFTs on a some sinusoidal waves and have been doing fine, gett the right Y axis values in the units Vrms^2.  For example a 10V amplitude (20v peak to peak) wave at 100 htz would give a peak at 100 htz and 49Vrms^2 since the RMS value fo 10 is 7 and 7^2 is 49.  Now when I input a Square wave with the same characteristics I no longer get the same scaling instead getting a peak at a higher y value.  With a triangular wave I get peaks at lower values.  Can anyone explain to me why this is happening?
    Thanks.
    Intern NSWCCD Carderock.

    Actually RMS (Root Mean Square) value of periodic signal f(t) is defined as a square root of squared signal averaged over the period T, mathematically:
    f_rms = sqrt ( aver (f^2) ),
    where aver (f^2) = [integral of f^2 over the period T] / T
    It is easy to show that for pure sine wave f(t) = A*sin(2*pi*t / T), f_rms = A / sqrt(2) ~ 0.707*A – this is well-known result anyone can find in almost every textbook. It is not difficult to calculate exact value of f_rms for square and triangular waves. Results are as follows:
    f_rms (square) = A, where square wave f(t) = A, if 0<t<c*T and f(t) = -A, if c*T<t<T (here 0<c<1 and c=0.5 for 50% duty cycle wave)
    and
    f_rms (triangle) = A / srqt(3) ~ 0.577*A, where I assumed triangle wave that raises from 0 to +A over 0 < t <T/4, goes down to –A over T/4 < t < 3T/4 and returns to ZERO in the last quarter of the period T
    Parseval’s theorem (http://en.wikipedia.org/wiki/Parseval's_theorem) of Fourier analysis states that energy of periodic signal (=integral of f^2 over the period T) must equal to energy of its Fourier transform ( sum of squared amplitude of all harmonics for periodic signal). That’s why Fourier analysis in Labview is capable of producing signal’s RMS value in addition to its spectrum.
    Now, main harmonic of square and triangular waves carries majority of signal energy, but not all of it because of presence of other harmonics. That means that amplitude of main harmonic as reported by Labview will be close to but slightly less than signal’s RMS value. This explains the results you reported in your very first post.

  • I am using the pattern stamp tool. when i select my pattern it adds a hatching to teh source pattern and copies that hatching to the destination image

    I am using the pattern stamp tool. when i select my pattern it adds a hatching to the source pattern and copies that hatching to the destination image

    Please post screenshots to illustrate what you are talking about.

  • Object Oriented Patterns and Visio

    Visio question:
    Does anyone know if there are established shapes for each (or any) of the object oriented patterns? If not, is anyone working on that or interested in that?
    Since they all have names (Momento, Proxy, Iterator, Mediator, Observer, etc.) it seems like they ought to each have their own shape. Since Object Oriented is all about communication of intent, each pattern having its own recognizable shape would go a long way toward a more meaningful communication through diagram. Also, if they each had their own shape, then the super-patterns (based on commonly grouped patterns and interactions) could also be easily represented.
    Blaine

    I'm kind of making an assumption here and if it's in error then feel free to disregard the rest of this post.
    Assumption that you're thinking terms of shapes for representing in UML the various patterns. Everything you need is right there in front of you already regardless of whether you use Visio, Rational, Poseidon or some other UML tool.
    Patterns are not individual constructs. One does not make a Mediator class. One makes a Java class that is an implementation of the Mediator pattern. As such you would see in the static class diagram the same grouping of classes for an X Mediator as you would for Y Mediator. That is the image you're looking for. It's not a single widget that you drag onto the screen, it's in the pattern itself.
    If, however, you're talking about something like a graphical representation to give to managers that says "Here be Momento patterns", then I would postulate that you're trying to communicate information that they don't need nor should they concern themselves with. Patterns are an implementation issue. They deal with, "How" we will solve a problem, not what problem will we solve. Mangaers, IMNSHO, need only concern themselves with what problems we will solve, not how they will be solved.
    Just my 2 krupplenicks on the subject, your milage may of course vary.
    PS.

  • Pattern and Matcher of Regular Expressions

    Hello All,
    MTMISRVLGLIRDQAISTTFGANAVTDAFWVAFRIPNFLRRLFAEGSFATAFVPVFTEVK
    ETRPHADLRELMARVSGTLGGMLLLITALGLIFTPQLAAVFSDGAATNPEKYGLLVDLLR
    LTFPFLLFVSLTALAGGALNSFQRFAIPALTPVILNLCMIAGALWLAPRLEVPILALGWA
    VLVAGALQLLFQLPALKGIDLLTLPRWGWNHPDVRKVLTLMIPTLFGSSIAQINLMLDTV
    IAARLADGSQSWLSLADRFLELPLGVFGVALGTVILPALARHHVKTDRSAFSGALDWGFR
    TTLLIAMPAMLGLLLLAEPLVATLFQYRQFTAFDTRMTAMSVYGLSFGLPAYAMLKVLLP
    I need some help with the regular expressions in java.
    I have encountered a problem on how to retrieve two strings with Pattern and Matcher.
    I have written this code to match one substring"MTMISRVLGLIRDQ", but I want to match multiple substrings in a string.
    Pattern findstring = Pattern.compile("MTMISRVLGLIRDQ");
    Matcher m = findstring.matcher(S);
    while (m.find())
    outputStream.println("Selected Sequence \"" + m.group() +
    "\" starting at index " + m.start() +
    " and ending at index " m.end() ".");
    Any help would be appreciated.

    Double post: http://forum.java.sun.com/thread.jspa?threadID=726158&tstart=0

Maybe you are looking for

  • How to load jar file in one shot?

    I have a Java app refers some jar files on remote location. Loading class by class is very time consuming. Is it possible to load the jar files as a whole? like what applet does? Tried URLClass loading, even run java -jar, still those load class on d

  • Blank Screen after 703HP3 (Linux)

    Hi, after update a VMWare-SLES10SP2-Server with DOM and Webaccess HP703HP1 to HP703HP3 I got a blank screen after starting the machine. All logs look got but I can't login in. Only a blank web page. No login. No picture. Nothing. Any idea? Have anybo

  • Viewing text in filled-in form on Acrobat 6.06?

    h'lo all, first time here.... I'm using Mac Acrobat 6.06 on OS 10.6.3. I've downloaded a pdf tax form from Gov. and done a "save as"... I can enter text in to any form field and it will print, but when I re-open the pdf, all of the fields *appear* to

  • CREATE MANY USERS AT ONCE

    Hi, How do I create more than one user at once? Thanks

  • How to get the photos syned to iPad? I lost my laptop, the last copy I have is in the Pad, please help.

    Dear nice ppl in Apple, I have my last copy of my valuable photo in my iPad since I lost my laptop earlier. However, I don't know how to dig it out to my PC again. It is important to me, please heeeeeeeeeeeeeeeeeeeeeelp. Gabriel