Creating a square wave

using mathematical formula without using square wave function. Is it possible?

Who said anything about manual operation?  Setup a loop.  Every so many iterations, you toggle the boolean.  If you toggle every iteration, it looks like a triangle wave.  But it should be a good start for you.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
triangle wave.png ‏22 KB

Similar Messages

  • Creating Digital Square Wave with DAQ

    Hi,
    I am a new LabView user and need some help in creating digital squarewaves using simulated DAQ, and output physical channel.
    Since I am only able to create a sine analog waveform using DAQ, I really need your kind help regarding this topic.
    Thank you very much.

    First: How strickt is your timing?
    Will software timing (delay of maybe up to 20ms) be good enough?
    Or do you need hardware clock based timing using the hardware timer of your 6251?
    I add a event structure based version, timing will lag the executiontime of the write to output
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    onofftimer2.vi ‏16 KB

  • How can I output a square wave to control a stepper motor using 7332 controller?

    I have the following system configuration for testing a linear actuator (LA):
    LabView 7.1
    NI FlexMotion 7332 Motion Controller
    NI Flex DMM 4070
    The LA is a stepper motor with Step and Direction of Rotation inputs, as well as some discrete I/O for Power Enable and other functions.
    The LA specification only requires that I send a 50% Duty Cycle square wave signal with frequency less than 300 Hz to it in order to make it step.  The LA has it's own power source.  I only need the 7332 to generate the drive signal and the DOR signal to the LA.  Using some of the example VI's, I can get the LA to work, but I will need to incorporate the functions in to a custom application. 
    How can I weed through the numerous advanced functions the 7332 offers and only generate a DOR signal and a step command at a user-defined frequency.  How do I set up the controller for this?
    Thanks

    Hello,
    All the VIs that you can use to create a pulse train and digital I/O from your motion controller are found in the "Analog & Digital I/O VIs" sub-palette in the "Flex Motion" palette. Use "Load PWM Duty Cycle" and "Configure PWM Output" VIs to create the square wave. Use the "Set I/O Port Direction", "Set I/O Port MOMO", and "Set I/O Port Polarity" VIs to create digital output. I hope you find this information useful. You can learn about the specifics of these VIs and their inputs/outputs in the NI-Motion VI Help.
    Regards,
    Aaron B.
    National Instruments

  • Custom high and low times for square waves

    Hi, is there a way to create a square wave that has an incremental HIGH pulse width and a fixed LOW pulse width?
    Sorry I'm quite new with labview, any help is appreciated, thanks!
    Solved!
    Go to Solution.

    Hi GBPC,
    My name is Jack and I work at National Instruments UK.
    I understand you are trying to output a square wave signal with a fixed low time and variable high time in labVIEW.
    The reply above works great if you want to use the signal internally. Alternatively if you are trying to output the signal with a piece of internal or external Data Acquisition (DAQ) hardware you will want to use LabVIEWs DAQmx Tool palette.
    I have created a quick example below for you to look at that should help you come to a solution. It uses the DAQmx VIs to create and initialize a channel and then runs it in a loop with controls to change the high and low times using a property node.
    Hope this helps
    Jack. W
    Applications Engineer
    National Instruments
    Attachments:
    Variable High Time Pulse Generator.png ‏37 KB

  • Multiplexed Square Wave

    Hy to all
    I'm working on a project where I have to build a sensor. I'm using 8 analogue outputs and 8 analogue inputs. On every output I have to send one square wave impulse positive and negative with various amplitudes. But they have to be multiplexed, that means first the impulse has to be on output 1 and all imputes have to read the data, then the first has to be 0 again and the next output 2 gets started.
    I've written a program and it logically works fine, but as soon as I run it on the FPGA noting happens. It takes 45 min to compile and I don't know what the problem is. I wanted to measure simply the output with an oscilloscope and the is no signal. 
    If you have time can you look at the program and give me some ideas what the problem could be.
    Thanks
    Attachments:
    Vire Mesh 3 (FPGA).vi ‏779 KB

    hello,
    it looks like a timing problem. Here are a few tips:
    1. the output is in the same loop as the input, but the inputs have their own loop afterwards. This means that the output is written a little too infrequently and is therefore not updated. You should probably separate input and output. Also check the calculations at the top to make sure they don't generate values that are out of the ordinary
    2. you can create the square wave in a separate loop and pass its value with a local variable to other places in your code. This is also good to test the output without interference from the inputs.
    3. you really don't need to connect the same wire in parallel to your sequence structure. Just pass it in once and reuse the same wire in every frame. It will make it easier to read.
    Regards,
    Joseph

  • Biphasic square wave with interpulsation intervals

    So I'm trying to get my graph to look like the copy and pasted image however I already have knobs and buttons to control duty cycle, amplitude, and frequncy.  Basically I just have created the square wave, I just need a way to insert an interval and display it on a waveform graph since there is no option when simulating the signal.  Thanks!

    It would be helpful to see your code. But if I were doing it I would define the waveform as a repeating series of three time intervals: a high time, a low time and an off time.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Mathscript square wave

    Hello,
    I am trying to figure out a problem in which I am supposed to use a MathScript Node to evaluate the given expression in the range t>=0, t<=3.
    The book I'm using says to input: y(t)=(4/pi)*(sin(2*pi*t)+(sin(6*pi*t)/3)+(sin(10*pi*t)/5)+(sin(14*pi*t)/7)), and that this formula should create a square wave.
    I have put in the following code:
    delta_t=1/f_s
    start=0
    step=delta_t
    stop=(N-1)*delta_t
    t=start:step:stop
    t>=0
    t<=3
    y=4*(sin(2*pi*t)+(sin(6*pi*t)/3)+(sin(10*pi*t)/5)+(sin(14*pi*t)/7))/pi
    However, the result I am getting is not a square wave at all.  I have attached the VI (I am using N=500 and f_s=10000).
    Any ideas?
    -Jill
    Attachments:
    Square Wave.vi ‏48 KB

    Hello Jill,
    Thanks for providing the code you're using- the signal you are currently seeing is because you are sampling the waveform quite fast compared to the signal frequency and you don't have a full period of the waveform to display; increasing the number of samples generated gives a waveform something like this:
    Which appears to be a square wave built with a sin function as you have described. With the values you specified (N=500), you're only seeing part of that initial curve (T=0 to T=0.05, or about 1/20th of the waveform's apparent fundamental period.)
    Regards,
    Tom L.

  • How do I Fix DDS Generated Sine Wave That Produces a Periodic Square Wave?

    Hello,
    I'm an undergraduate researcher with almost no experience dealing with FPGA semantics and other National Instruments hardware in general.  Part of my project revolves around creating a sine wave signal via the FPGA on an sbRIO-9632 that is output via the board's analog I/O pins, and I found it convenient to adapt the code provided by the National Instruments tutorials (http://zone.ni.com/devzone/cda/epd/p/id/6066) to have it run on an sbRIO FPGA.  The problem I'm encountering right now is that the actual output I'm seeing is a square wave as opposed to the smooth sine wave that was expected, and I've exhausted all my ideas on possible ways to debug this issue.  Can anyone please give me feedback if they've seen this problem before or offer other suggestions on fixing this?
    I'm currently running LabVIEW 2009 with the appropriate real-time and FPGA modules on a 64-bit Windows 7 machine.  Again, the hardware is an sbRIO-9632 complete with analog I/O.  I appreciate it everyone!

    I am also having this issue and have not been able to find a solution in the forums. I am somewhat of a rookie so pardon me if I seem ignorant in any way. I am working on a graduate project where I need to produce some sine waves and I am getting more of a square wave when I output it and measure on the scope. The program I am running is quite simple at the moment to attempt to discover any errors by process of elimination. I have the sine wave generator in a while loop outputting to an AO port. I am using the cRIO 9022 with the 9269 AO module. I will attach screen shots of my code and my oscope image
    Attachments:
    sine wave.jpg ‏76 KB
    code for project.PNG ‏169 KB

  • How to send a SQUARE WAVE to PXI-6259 over the LAN

    howcan I  send a SQUARE WAVE  to PXI-6259 over the LAN, is
    there any example or link any one can send me , thanx in advance.

    Dear HaI L,
    I managed to send a test signal (sine wave) to the device by choosing
    the test panel option and choosing Analog output. In the analog output
    I could many channels to choose from. ai0, ai1.ai2 and ai3.
     I did this by right clicking NI PXI-6259, in the NI DAQmx devices
    located in the Devices and Interfaces and choosing test and saw it on
    an Oscilloscope without using the NI DAQ OPC capabilities, and I cannot
    understand this thing.
    1)How can it be possible without  making a NI DAQmx  channel and Variable?
    2) I cannot create any channels in the devices and interfaces located
    in My system but I can create NI DAQmx Global Virtual channels easily
    in Data neighbourhood in the remote system, Plz tell me why?
    3) I  want to create a program and choose a channel to send the
    signal,  can I choose the channel that i create in the remote
    system device ? and if yes how can I choose this ?
    Thanx in advance.
    Sincerely,
    Munir Afzal Bhatti.
    Attachments:
    max.jpg ‏2305 KB

  • Why do i get ringing when i am generating Square Wave using PCI 4461 DSA Card

    Hi,
    when i generate square wave form DSA card PCI 4461 i am getting ringing effect as per my observation of waveform generated in CRO.Can anybody tell me why is this effect seen and how can it be rectified and removed from the signal in LabVIEW.
    Regards,
    Sneha

    The analog outputs on the 4461 (and the analog inputs, for that matter) are band-limited by digital lowpass filters. These low-pass filters have a brick-wall response in the frequency domain, which results in Gibbs-phenomenon ringing in the time domain. See this discussion, among others:
    http://en.wikipedia.org/wiki/Gibbs_phenomenon
    The ringing will be excited whenever there is significant signal power near the abrupt band edge, because the abrupt cutoff will result in signal power being located just below an absence of power in the spectrum. Whenever signal power appears in spectral isolation like that, you can expect ringing in the time domain response. Your square wave consists of a series of harmonics at frequencies below, near, and well beyond the digital filter's cutoff. When the digital filter cuts off the higher harmonics, the ringing is created.
    To prevent the ringing, you must create a waveform mathematically that is bandlimited already. The result will be a square wave with slower rise and fall times, but no ringing.
    Hope this helps,
    Ed

  • Building a square wave by adding harmonics

    Hi,
    I'm trying to create a Fourier Series to build a square waveform by adding the harmonics. But, after I implement the functions into the software, there are some errors in the output and i cant get the square wave output.
    I've attached the vi and the document containing the expected output from the vi.
    Please take a look
    Thanks,
    Edward
    Attachments:
    Fourier Series1.vi ‏101 KB
    Fourier Series1.doc ‏47 KB

       hi, i can't see the VI cause i've 8.0 and the version of your vi is higher, but i built this little vi I've attatched based on the word's document, maybe it's what you need. Bye.
    Paul
    Mechatronic engineer
    Lima-Perú
    Attachments:
    fourier.vi ‏20 KB

  • Custom square wave duty cycle in signal express

    Hey everyone,
      I am using an USB X Series Multifunctional DAQ Model 6361, with labview signal express 11 on windows7 (version 9.3.5) and I am trying to figure out if i can change the duty cycle of a square wave.  I need to have one period be at 75% duty cycle and another 25% or something along these lines.
    thanks!
    Adam 

    Hi Adam,
    I believe another Applications Engineer has corresponded with you concerning this issue already. If you are looking to generate a truly custom square wave where the duty cycle changes from one period to the next then you will need LabVIEW as this functionality is not supported in SignalExpress. 
    Using the Analog Output along with the Create Analog Signals options will allow you to specify one fixed duty cycle for your square wave, but this will remain constant throughout the generation. 
    Regards,
    James D.
    Applications Engineer
    National Instruments

  • Using pulse width modulated signal (square wave) to control when a signal is turned on or off

    Using pulse width modulated signal (square wave) to control when a signal is turned on or off
    Greetings All
    I'm trying to use a labview created pulse width modulated signal (square wave) to control when a signal is turned on or off.
    Here's my logic and graphic example:
    1) The source wave signal is continuous
    2) Use a PWM (square wave) created in labview to control when the signal is turned on or off
    3) If PWM signal (amplitude) is greater than 0 play signal if PWM is not greater than 0 don't play signal.
    I'm actually using this to step sequence / pulse several separate magnetic coils using my audio card (which has several audio output channels), I have a signal in labview played constantly.  Than compare it to the PWM (square wave) which controls if the signal gets played on each separate channel or not.  That way I can control which coil is on and off and in what sequence they are activated. 
    I couldn't find an edge detection for a square wave created in labview so I tried Limits but that doesn't seem to work unless I change the phase manually and that only goes from 1 to -1.  I'm just trying to compare the PWM (square wave edges) already created by labview / play a signal if the pulse is greater than 0 and it turns off the signal if it's less than 0.
    Should I be doing this another way
    Tia
    Message Edited by sal22 on 08-16-2009 06:09 PM
    Message Edited by sal22 on 08-16-2009 06:10 PM
    Solved!
    Go to Solution.
    Attachments:
    PWM control signal block.png ‏23 KB
    PWM control signal front.png ‏48 KB
    pwm test.vi ‏36 KB

    Greetings,
    I tried it two ways using amplitude and levels and fft spectrum.  The values don't seem to update the way I need them to (basiclly showing a 0 or a 1).   I compare the Y values like you recommended but they don't ever seem to update.
    tia
    Message Edited by sal22 on 08-19-2009 10:05 AM
    Attachments:
    pwm magnitude not updating.png ‏29 KB
    pwm test.vi ‏41 KB

  • Measuring Amplitudes of 3 Mixed/Staggered Phase Square Waves

    I'm writing a vi intended to measure the amplitudes of three mixed signals.  These signals are generated by the DAQ already to drive 3 LEDs at 9kHz/ 50% DC combined. 
    I was able to modify an existing example vi to create the LED drive.  I was hoping to find a similar example for the data capture and analysis.  I haven't been successful thus far. 
    Could someone please suggest a good example to get me started?  Please forgive my inexperience as I have been teaching myself Lab View and thus have a very ignorant instructor.
    -Thanks in advance.

    Bad,
    Have you tried the analog data acquisition examples? The sample rate would need to be >18 kHz to meet the Nyquist criterion, but that assumes sinusoidal signals. Since you are talking square waves, you will need to sample quite a bit faster to recover the waveforms. 100 kHz or 250 kHz are probably good starting points if your device will sample that fast.
    Tell us what you have tried and specifically what does not work. Do you get error messages? Does the result look wrong?
    Posting you code with the data you have collected is very useful.
    Lynn

  • Generate Square Waves to SCXI 1161 Module

    Hello,
    I am a new user to Signal Express and I wanted to use signal express to generate two Square waves which I will ouput to my SCXI 1161 Relays
    Any quick ideas would be appriciated.
    Tim

    Hey there smoothdurban,
    Typically when you want to generate an output signal in SignalExpress you have to first create the analog/digital signal and then generate it. How this is done in SignalExpress is by first adding a step for "Create Analog/Digital Signal" and then adding a step for "Generate Signals". 
    I attached some pictures to help simulate this. The first picture "creategenerateunbound" shows how an unconfigured generate step does not link with the create signal. The second image "creategeneratebound" shows that after you specify the channel for the generate task, the create and generate will wrap up together and the square wave will match with the channel.
    Also, here is some additional information on why you have to first create and then generate and the SignalExpress Help file about creating signals,
    http://digital.ni.com/public.nsf/allkb/94AC3A0662C8388586256F4700721739
    http://zone.ni.com/reference/en-XX/help/371268J-01/expresswb/create_signal/
    Hope this helps!
    Tim A.
    National Instruments
    Attachments:
    creategenerateunbound.PNG ‏8 KB
    creategeneratebind.PNG ‏7 KB

Maybe you are looking for

  • How do I transfere my apps from my old computer to a new one

    I have an old computer with ALL  my itunes items on there (music, games,music videos ect.). I want to transfer my itunes to a different computer, and dont want to lose anything. I already got the music tranfered but I dont know how to move all my app

  • Complete Removal of Stream Configuration in 9.2

    Could any one send me the script for complete removal of streams configuration in oracle 9i database. I faces a lot of error while creating stream configuration.

  • Data needed from emp and dept tables

    Wondering if somebody can querry the emp table and dept table that comes with some versions of oracle already built in. I need the data produced from these two querries select * from emp select * from dept

  • Burning Basics/Tivo Troubles

    Dear Folks, Please excuse me if this is in the wrong forum. If it is maybe someone can point me to the right one. I started out rather naively trying to transfer programs from My Tivo and burn them using my DVD burner on my laptop. I was able to mayb

  • Iphoto hang while importing

    I have 2700 photos on my iPhone 5S. i tried to import them all at once but iPhoto hang every time at different photo number, for example photo number 1950 and next time at photo number 700. when it hangs it seems that it's importing but stops at one