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

Similar Messages

  • 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

  • Generating square wave with variable duty cycle

    We like to generate a square wave with variable duty cycle using LabView 6.1 and SCB-68 and this duty cycle comes from some PID controller programmed by LabView by reading a voltage and feeding back this square wave

    the story begins with some one called separately excited DC motor
    this thing sometimes changes its speed
    so we are trying to keep a constant speed
    irrespective of the load no matter how it changes
    this comes by reading the voltage out from
    the tackometer which represents the speed as voltage
    then comparing this with a reference set by the labview program
    the labview program will send a control signal to some chopper circuit
    which is connected to the field of the motor which controls the speed
    we are tending to make the labview program as pid controller
    that will generate our beatiful square wave with some duty cycle
    which will vary to increase or decrease the voltage across the field
    we tried "Real-Time PID Control.vi" example and other examples
    and we are discussing different solutions for this duty cycle thing
    but till now no output
    this is our whole story with this DC motor thing

  • 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

  • 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

  • Minimum sample rate for 10KHz square wave with MIO

    Need to display a 10KHz square wave input to a 16E MIO. Presently sampling 1 channel at 400KS/s. Gives me 2.5uS/sample. Even at 800KS/s-same thing. How come I can't get a decent picture of the waveform. Presently I see a ramp up-down akin to an RC time constant. At 1KHz I get a decent waveform. I'm wondering if I have something set wrong in my program. Did I miss something in determining the proper sample rate?

    Hi Steve,
    Are you sure you are sampling at 400 and 800 KS/s?
    I thought those boards only go up to about 100KS/s.
    (show your point on your plot. Are you getting 40 samples per period?)
    If you really are sampling that fast, then you have partially answered your own question. There is a small capacitance at teh input to the board. A high impeadance source will combine the input capacitance of the board to give you the charge ramp you mentioned. Only solution to this situation is ussing a low impeadance output buffer between your signal source and the AI.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to output square wave with pci 6110 from digital output

    and the frequency of the wave should be variable and quite precise.

    "from digital output" is not possible if
    your timing req's are less than a second
    and
    you are not running Real-Time.
    It can be done from the analog output port.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Creating 8 different waves with phase lag

    Hi,
    I am trying to generate 8 different sound waves to 8 loudspeakers from the attached VI. These loudspeakers are located around an annular tube. What I am trying to do is, add a phase lag to each loudspeaker and try to spin the soundwaves. So, I send a sine wave to the first loudspeaker. Then I add a phase lag to the sine wave of the second loudspeaker and keep increasing this phase lag for subsequent loudspeakers. Hence, I'll need 8 different signals.
    However, my problem is, I only have 4 AO channels on my DAQ device (PCI 6229) therefore I can't generate 8 different signals. I could split these 4 signals using the hardware and also invert them, but I don't know how I could generate the waves such that they have a phase lag I need. Is there any way to do this?
    Thanks.
    Attachments:
    SSW_Mode0_H.vi ‏241 KB

    Hi Imperial-Aero,
    What you are trying to do is going to be quite tricky because you need to have an array size of waveforms equal to the number of physical channels which you are emitting on. therefore, without more AO channels, you cannot do what you require in software.
    However, there is one possibility: If you have the speakers connected by 2 to each channel, you could please a low pass filter on one of the speaker connections and hence induce a phase delay in the hardware.
    How does this sound?
    Rob
    Rob L
    NI Applications Engineer
    UK & Ireland
    It only takes a click to rate this message ;-)

  • How to generate multiple digital outputs (square waves delayed) at 50 kHz?

    I would like to generate 3 digital outputs like the picture attached at 50 kHz. Using the "digital pattern generator (marching values).vi", I can generate 3 digital square wave but without the delay time. How can I do that?
    I'm using the card PCI 6034E.
    Thank you
    Attachments:
    digital outputs delayed.png ‏8 KB

    Hi,
    the digital pattern generator (marching values) only shifts the binary value of the first signal and sample to the next signal/sample.
    Have you tried generating your waveforms via build waveform and use t0 terminal to change the lead delay?
    In general, this DAQmx example could be helpful which you can modify to your needs.
    DAQmx Write Digital Channel- External Clock: https://decibel.ni.com/content/docs/DOC-11142
    Regards,
    Thomas

  • 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

  • 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

  • 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

  • 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 to generate a high freq square wave on NI-USB 62xx

    Hi,
    I am trying to generate a 50khz square wave with an AO channel on the NI-USB 6212 (rated at 250ks/s AO). I started with the Voltage - Continuous Output.vi example but when i go up toward 50khz square wave (100khz sample rate) the edges of the square wave become rounded. The slew rate for the card is 5V/us and my amplitude is just .5V so i feel like I'm doing something wrong with the task setup.
    I also tried setting continuous samples using the onboard clock for a source and then writing an array [1,-1] but that fails at anything higher than ~8khz. 
    What's the most efficienct/correct way to set up a task like this? Any help appreciated. Thanks.
    Matt

    Hello Matt,
    Right now, I think that shape of the signal that is being output is being controlled by the load on the AO. 
    If there is a very large impedance load attached between AO and ground, the RC time constant of the circuit is going to be very high.  This will result in a large amount of time required to charge and dissipate the voltage.  By increasing the frequency, the amount of time allotted for this is being reduced.  Potentially resulting in the waveform you are seeing.
    Can you please upload a picture of your waveform?
    Can you please try to reduce the load on the AO?  This can be done by disconnecting the current load and attaching a small resistor (50 Ohms should be good).  Does this result in the correct waveform?
    Regards,
    Thomas C.
    Applications Engineer
    National Instruments

Maybe you are looking for

  • How to read the TEXT TABLE (or) .CSV in HSQLDB Standalone using Java

    Hi, I like to use the text tables in our application. And like to use the HSQL Database Engine as Standalone. I created the text tables, those are stored in the disk as ".CSV" files. But i am unable to read that text table (.CSV) when i relogin and g

  • Can I install Tiger using an external DVD drive?

    My PowerBook is being repaired and I have to use an older G4/733 tower (OS 9.2; CD/zip drives only) from 2001 ASAP. I purchased Tiger and now need to load it, along with the new software. Rather than purchasing an internal dvd drive, can I buy and ex

  • OVMS - Local display cuts out after boot DMS 59 Video Card

    Hey All - We use OVM/OVS on what you might call 'desktop servers'. We have several setup. We recently purchased some more machines that I am installing OVS onto and will add them to the cluster. However, these machines only video connection is DMS 59

  • How to do a Dynamic Table?

    Hi, I would like to create dropdownlist & inputfield in a row but in different column in a UI table. When pressing a " Add new row " button, another row appears for user to key in data in the inputfield and able to select data from the predefined dro

  • Question about converting to 128kbps for iphone 4

    good day. i was wondering about the 'convert higher bit rate songs to 128kbps' option. i always import my bought cd's in apple lossless, and i guess the music i buy on itunes is 256, so that said i have a few playlists on my 16gb iphone 4 and with al