Sinusoidal Signal Generator

Hi everyone,
I want to make a program in LabView, in which the output from the VI will be of the type Analogue Waveform and be capable of being displayed on an appropriate Waveform Graph. The Analogue waveform will represent a continuously adjustable sinusoidal function.
The inputs to the VI will perform the following functions:
1) Set the frequency (1Hz to 1KHz). Default 1 Hz.
2) Set the Phase Shift (-180 to 180). Default 0.
3) Set the Amplitude (0 to 20). Default 1.
4) Set the Offset (-5 to 5). Default 0.
5) Set the number of samples per cycle (20 to 1000). Default 100.
6) Set the number of waves (1 to 50). Default 1
7) Set the start time t0. Default 0.
I want to use Sine trig function.
I would greatly appreciate any advice or hint that would help me doing this program.
Thank you,
pontios
[email protected]

OK. So you need help, but YOU have to write the program.
Let's do that in several steps.
1/ analyse the example program given. It is a rather poor triangular curve generator. I say poor because it only generates the max and min points, and the rest is simply interpolated. There should be additionnal points in between, if the plot has to be generated using an IO card for instance.
The only reusable things here are :
1a/ the idea of using a loop that runs the proper number of times to generate an array of Y data
1b/ the setup of the waveform from the Y array.
2/ the only thing to be done is therefore to generate a table of Y values that correspond to the equation y = amplitude . sin(t/(2.PI.frequency) + phase)+ offset
That should be straight forward, using the basic math functions. If not, I'm afraid that you'll have to do some personnal preliminar work. There are a number of tutorials available around. See for instance http://cnx.rice.edu/content/col10241/latest/
The only tricky part here is to generate the t values.
There are two possible solution :
2a/generate one t value and calculate the corresponding y. Put everything in the loop to generate the Y array
2b/ generate an array of t values, and calculate the corresponding Y array.
Solution b is better because it allows to replace easily the function, without being obliged to dig into the diagram. And since the mathematical functions in LabVIEW are mostly polymorphics (they accept either single values as input as well as arrays...), it is as easy to calculate the sin of the t array.
Accordingly, you should use the loop to create a t array. Remove the stuff inside the loop, use delta t time (required in the build waveform) and multiply it by the loop index. That's all.
Hope this helps. Good luck
CC
Chilly Charly    (aka CC)
         E-List Master - Kudos glutton - Press the yellow button on the left...        

Similar Messages

  • Can i connect an external signal generator to the NI7344 to...

    Can i connect an external signal generator to the NI7344 to use its
    PID characteristics to precisely control the output
    I am using the flex motion board (NI7344) to control the force output
    of a linear motor. Using contouring and buffer operations i have
    successfully created a system which can output a controlled force
    which sinusoidal in form. I can achieve a reasonable output for
    waveforms of 10Hz, the use of higher frequencies is limited by the
    contouring operation ( a frequency of 10 Hz means i can only describe
    one period of a sine wave with 10 points ( 10ms between each point =
    10Hz). Can i therfore connect an external anologue wave generator to
    the NI7344 use and use its PID characteristics to output wave
    forms of
    higher frequency ??? .....could i output an anolgue wave form from an
    E-series DAQ via the RTSI cable to the NI7344 and control this ???.any
    ideas or advice would be much appreciated.

    Duncan,
    You can use a DAQ card to output an analog waveform, but it will be a software call not part of an onboard program. RTSI can be used to pass clocks and trigger signals, so if you want to route a clock signal to do the control you could.
    A. Talley

  • How to measure the phase of a sinusoidal signal?

    I need to measure the frequency and the phase of a sinusoidal signal. I tried to use the Advanced Single Tone Measurements.vi but the phase measured in each iteration (each second) keeps changing (the measured frequency is not in integral Hz, so the first point of the next iteration is at a location different from the location of the first point of the current iteration...I guess this is the reason). How can really measure the phase of a signal (not always changing with time)? When I change the phase of the input sinusoidal signal, the measured phase should be changed though.
    I'm using LabVIEW 7.1 and PCI-6110.
    Thank you very much!
    Marlon

    Marlon,
    Without DAQ hardware I cannot run your VI. DAQmx is not supported on my platform (Mac OS X), so I cannot examine your VI in detail.
    1. The AI VI will wait until it has the amount of data specified. So if you are collecting one second's worth of data at a time, it will wait one second before completing. The 50 ms Wait will run in parallel, so it has no effect on the timing in this case.
    2. Continuous AO is possible, depending on the hardware you have. However, I have no experience with implementing it. Since your frequency is such that you do not end the AO data segment at the end of a signal cycle, you need to be careful to avoid discontinuities in the signal sent to the AO.
    3. There is no data dependency between the AI and the AO. It is possible that the AO could run after the AI in any given iteration of the loop.
    4. Your phase reference should be the excitation signal. The best method of evaluating the response of the beam would be to use two sensors, one at the shaker and one at the tip. Then measure the phase shift of the signal at the tip with respect to the shaker signal. If two sensors cannot be used, either measure the voltage sent to the shaker or use the simulated signal that you send to the AO as the reference. In either case you would need to compensate for the response of the shaker.
    5. Consider the phase shift in the filter. The steady state phase shift is about 14 degrees. The initial transient lasts about 5 cycles of the input waveform.
    6. Your simulation sampling rate is 1000 samples/second. While this satisfies the Nyquist criterion for a 379 Hz signal, it does not give you much data to work with for the phase information. If the hardware will handle it, I would go to 10000 samples/second.
    Lynn

  • Question about the customized FPGA signal generator.

    I connected the AO0 and AO1 ports to the oscilloscope. But I got nothing. What should I do?
    Attachments:
    Customized FPGA Signal Generator.lvproj ‏2159 KB

    Hi CZ_Kevin,
    When attaching a project, it might be best to zip the project folder, or attach your VIs, so that we can look at your code. As for the screenshot, it looks like you might be using too many resources on the FPGA but again it is hard to determine without looking at your code.
    Since you are using a myRIO, you might get better responses by posting to the Academic Hardware Products forum as this handles many myRIO questions.
    Also, there are many pre-built project templates and examples within LabVIEW that might be worth exploring as well as a project guide that includes many tuturials. You can find the latter here.
    David C

  • How do I read in a 1 Hz pwr level file and send it out at 1Hz to the signal generator?

    I would like to be able to read in a 1 Hz file and use the format into string and send it out at 1 Hz to a signal generator to vary the levels to match a timestamp. I was trying to use the format into string but I can't figure out how I could read in this file.
    00:00.0
    -113.586
    00:01.0
    -113.598
    00:02.0
    -113.61
    00:03.0
    -113.622

    If the file is a .csv file as you said in your other post, then you should just be able to use Read From Spreadsheet File, making sure to set the delimiter to comma rather than tab. If it's a small file, you can just read in the whole thing, then use a loop with a Wait For Millisecond Multiple node (the metronome) to send the data once every second.
    If the file is very large, and you don't want to read it all at once, you can tell the Read From Spreadsheet File node to read only one line at a time. Put the read node and the data sending node in the same While loop, and use a shift register to carry the Mark After Read value from one iteration into the Offset or Mark At Start terminal in the next iteration. That way, you start reading each line at the end of the previous one. Use some form of flow control (such as a Stacked Sequence Structure) to make sure things happen in the right order - read data, wait for the right time, send data. 

  • System Identifica​tion Assistant Signal Generator

    Hello,
    I am using a GW Instek power source to heat a graphite rod within a vacuum chamber.  I am detecting the temperature with a K type thermocouple connected to a thermocouple input module.  I have written a labview program with a PID and have everything running, yet i force tuned the PID. I would like to use the signal identification tools labview provides to identify the transfer function and model the process.  I have used the system identification assitant in attempting to send a step signal and acquire a response, yet I have been running into difficulties.  The only way I can perform a step function is to manually generate an output of a specified power and then measure the response, as the signal generator within the system identification software is not identifying the GW Instek PSW 30-108 power source. With manual input and importing both input and output data i am able to get a parametric model, yet the transfer function provide me PID values which are 5 orders of magnitude greater then the ones i am currently using. Ideally i would like to use the software to generate the signal and measure the response continuously rather then using data i collect through my program.  If possible, I would also be interested in perhaps directly integrating VI's to perform signal analysis directly into my process program.
    Problems and what I have done:
    I have the drivers for the power source and my process program recognizes the device yet system ident assist cannot find the hardware. I have attempted to creat a task in NI-MAX yet the hardware is also non-identifiable. 
    Port module input works with VISA and this is how my VI is communicating with the power source.
    Goals:
    I would like to use the system ident assist to generate power ouput and collect temperature input, and generate a process model, so that I may tune my PID more accuratly.
    Also, I may be interested in integrating VI's directly into my process program, yet I am new to the LV language...
    I have attached  my Labview program below.  I would like to thank you in advance for your time and look forward to responses.
    Cheers
    Attachments:
    Test1_RT.vi ‏186 KB

    Double post, for further Information see http://forums.ni.com/t5/LabVIEW/System-Identificat​ion-Assistant-w-o-NI-Signal-Generator/m-p/3014731#​...

  • Displaying a graph from a signal generator

    I am extremely new to labview and I am still trying to navigate my way around the basics.
    How do I display a graph using a signal generator?  I am using NI USB-6251 and I have connected the signal generator to AI.0.  I used the input daq which turned into a task.  Used the read component and wired it to a graph indicator, but I am not showiing the waveform. What am I doing wrong?

    Hello eckhartp, 
    My recommendation if you are just getting started would be to begin with one of the analog input examples included with LabVIEW.  From within LabVIEW, you can select "Find Examples..." from the Help menu, which will bring up the Example Finder.  I would recommend taking a look at "Voltage - Continuous Input.vi", which can be found by searching in the finder.  You should be able to select your analog input channel from the pull down, and see your data on the graph.  Use one of these examples as a template for your project.
    Alternatively, here is a good reference page for DAQmx general information:  http://www.ni.com/white-paper/5434/en
    Feel free to post any follow-up questions you may have!
    Kevin W.
    Applications Engineer
    National Instruments

  • Calibrating Agilent N5183 Signal generator for specific output level

    Hi,
    Newbie to labview enviornment!  I am trying to write a VI to calibrate Agilent N5183 to a specific output.  For e.g. if I want to have -4.5 dBm output from my setup (as displayed on my power meter) I will have to set the sig gen to say 7dBm taking into account my losses etc.
    Any pointers how do I start tacking this?  I think I will have to create a while loop to check power levels, however I do not know how to increment and decrement the sig gen amplitude and stop at the desired level!
    Thanks in advance for any help.
    PS: Using Labview 2013, on win XP machine!
    Solved!
    Go to Solution.

    mkossmann wrote:
    3. Adjust pout to sign Gen to desired level while monitoring power on power meter
    Why do you need that step at all ?  Its not clear from your description what makes the difference between the readout of the power meter and the output level setting of the sigGen.
    I have had to do this plenty of times.  Especially in the RF realm, you want your tests to have a certain power level AT THE UUT.  So you have to adjust your signal generator to overcome the losses in the couplers, cables, etc.
    For this, all you need to do is set your signal generator to the level you want.  Then measure with the power meter.  Subtract the measured from the desired and add that much more to the set output.  Repeat as needed.  I would recommend using a conditional FOR loop so you can easily set a limit to how many times you adjust (I have been in endless loops due to weird situations here).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How interface N5181A MXG signal generator with labview by using LAN Interface????????????

    hai every one ...i have a doubt how  to interface N5181A MXG signal Generator with Labview by using LAN Interface???? and
    how to find IP Address of N5181A MXG signal Generator????????
    when i connect instrument with labview it shows that no instrument connected and what are the requirements for LAN interfacing with that instruments in labview and please help me?????? 

    You can set the IP Address on the instrument.  You may need to be in the same subnet of your controlling computer, so you may need to set your computer's IP Address to something static.
    Use VISA.  It makes life easier if you decide to use another bus (like GPIB, USB, serial, etc).  In MAX, create a network session with the static IP address you set the instrument to and use that as the VISA Resource.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • 1/0 Signal Generator

    Does somebody know if there is a 1/0 signal generator in Labview 5.1 where I can specify the length of the durtion of 1(true) respectively 0(false)?

    Hi,
    if I understand you right you can use "Pulse pattern.vi" or "square wave.vi" from "functions->analyze->signal processing->signal generation" palette. Set the value of amplitude to 1 and you will get what you want.
    Good luck.
    Oleg Chutko.

  • Using labview to operate a signal generator

    Hey everyone,
    My name is Jake, I currently work in a lab at my university where we are trying to develop medical imaging via thermoacoustic tomography
    The problem I am facing is that we are trying to use LabVIEW 2010 to "talk" to an SML-01 Rohde and Schwarz signal generator. I have very little LabVIEW experience anmd have basically been teaching it to myself for the past month. I have downloaded a driver for the sig gen and have a GPIB cable to run from an oscilloscope (which we run labview on) to the sig gen.
    Would anyone be willing to help me figure out how to do this?

    An existing Instrument Driver exists here
    Edit{ ahhh you have the driver}  What  exactly are you having trouble with?
    Jeff

  • LabVIEW drivers for Agilent Noise Source 346B and Signal Generator E8257C-520

    Could anyone please tell me where to find LabVIEW drivers for Agilent Noise Source 346B and Agilent Signal Generator E8257C-520. I did not find them on NI's web site. Thank you!

    To my knowledge, the Agilent 346B Noise Source is not a programmatically controllable instrument and therefore we can't create an instrument driver. I suppose it is possible to be controlled through an instrument (like the PSG) but I don't see any documentation on this.
    As for the E8257C, we are insterested in providing a LabVIEW driver for this instrument series. Let me know if you are interested in assisting our development effort by loaning us the instrument.
    Jason Hobbs
    Instrument Drivers

  • Agilent signal generator and labview code

    Hi all
    I have Agilent 33220A Signal Generator.I want to generate square signal and convert this signal to a graph in labview with proper code but i dont know how to do.Please help i have limited time
    Regards

    sgirgin wrote:
    Hi all
    I have Agilent 33220A Signal Generator.I want to generate square signal and convert this signal to a graph in labview with proper code but i dont know how to do.Please help i have limited time
    Regards
    Limited time on your part is not our problem.
    Learning how to program in LabVIEW isn't something that can be done overnight.

  • Using external RF signal generator

    Hello.
    I would just like to ask how do I remove the frequency offset if I use an external RF signal generator (instead of the NI PXIe-5652 RF Signal Generator module). I understand that in the case of using the NI to generate RF signal, frequency offset is removed by setting the same reference clock source for the transmitter and receiver (setting the reference clock source to PXI_CLK in the front panel of both generation VI and acquistion VI).
    Thank you very much.
    Solved!
    Go to Solution.

    Hello, Sir!
    In that kind of setting, what master reference clock source should I set in the front panel? I tried both the onboard and RefIn and I got  some errors (see attachments). And do I still have other adjustments/settings to make?
    Thank you.
    Attachments:
    onboard.jpg ‏141 KB
    RefIn.jpg ‏135 KB

  • Synchronous arbitrary signal generator

    I have Labview 7.0, PXI-1042, pxi 6070E, scb-68, windows xp.
    Is it possible to synchronize an arbitrary signal generator and a simulated signal generator?
    So far I have been unsuccessful.

    Hi Cool,
    The hardware output of the PXI-6070E board is independent of the software running in LabVIEW. Once LabVIEW sends the command to write the output buffer, the hardware will work independently of the software.
    There is a certain degree of synchronization that can be accomplished using DAQ Occurrences, which uses an interrupt to indicate when a certain amount of output has been achieved. However, the difference between the DAQ board sending the interrupt and LabVIEW processing that interrupt, amounts to a period of time that doesn't enable you to perform tight synchronization.
    If you are looking for output rates in the kHz, this might, however, do the trick. The problem is that there is always going to be a difference since the OS (Windows) control
    s the multitasking of applications and LabVIEW. This causes LabVIEW not to run deterministically. The hardware will always output at a specific rate where as the LabVIEW will not be able to simulate completely at a specific rate.
    I would take a look at DAQ Occurrences in the LabVIEW Help File. This will give you your tightest synchronization. Hope that helps.
    Ron

Maybe you are looking for

  • ITunes 7.5 and Nike+

    When upgrading to iTunes 7.5 certain pieces of key functionality for Nike+ users have been removed. The section at the bottom of the Nike+ iPod tab used to have a "Create Account" button for users who have not set up a nikeplus.com account and a "cha

  • I can't import portal307 application into a new machine, why?

    i export application using the Navigator(Oracle9iAS102 Portal307 -> Navigator -> Applications tab -> Export next to APP_CRM), and then i save this sql file to app_crm.sql. After i have installed another machine with win2000server, oracle816, and orac

  • How do I find out how many times a date is in and array collection?

    Hi there, I have an arrayCollection that has a bunch of articles in it. I am trying to figure out how many articles there are each day to power a line graph. Any thoughts on how I could easily do this? basically I need a method that will return how m

  • My backup/sync function doesn't run

    I am running PSE 8 on a Windows 7 computer.  I ran out of room online so I purchased more.  I have 4 gig of photos awaiting backup.  I try to run backup/sync.  The icon appears in the task bar for a few seconds then disappears.  Nothing gets backed u

  • Cannot import  and work with the files from Canon 6D and Panasonic GH4

    Thanks for your answer, but it is not really helpful. Perhaps my question was not exactly enough-sorry but my english is not in the best condition. I dont need trials I have some applications and my Intel MAC Pro 2009 is strong enough. For instance P