How do I output three digital waveforms at once?

I posted this in Digital I/O, but now I think it's actually more appropriate here because it's not a hardware question. I need to output three digital waveforms at a relatively low frequency, 71.9 Hz. I have a PCI DAQ card, the 6024E and am using the NI-DAQmx functions to try to do this. My program basically generates the square wave that I want, and converts it into a digital wave. I do this 3 times for the three separate waves, and then I combine them into an array and send them to my DAQ functions, which are in a while loop so I can get continuous output. My problem is that the waveform that the DAQ is actually outputting is not what I want. It's outputting a wave that has the same duty cycle (approximately) but the frequency is over 2 kilohertz. It's not like this all the time; after it outputs about 7 cycles of this wave, it goes to logic low for a long time, and then repeats itself. When I probe the digital waveform right before it goes into the DAQ functions, it's running correctly at 71.9 Hertz. Am I doing anything wrong with the DAQ functions or the sampling information? Thanks in advance.
-- Josh Matloff

Hello Josh,
I'm pretty sure that the reason that your digital waveforms are not being produced at the correct frequency is because your digital output is not associated with any sort of timing. Unfortunately, with an E series board you can only do software timed digital operations. This means that the frequency at which the values on your digital lines will be updated depends on how fast/often your computer executes the DAQmx Write that is inside of your while loop. If you have an M series board, you can actually correlate the DIO operations with another subsytems clock (AI/AO sample clock, etc.) which means that you can acheive hardware-timed DIO. In the event that you do not have access to an M series board, I think that AnalogKid2DigitalMan was spot on that you would want to use counters to generate pulse trains (that is if your digital waveforms have a constant duty cycle and period). Depending on what the DAQ board is outputting to, you might also want to consider using the Analog Output channels to generate your digital waveform. As long as you continue to use the digital lines on the 6024E, there is not really a way to guarantee the timing of when the digital lines will be updated. You might be able to get close, but you will probably see some "hiccups", especially if your computer needs to service interrupts or give processing time to another application. And lastly, heed geckoee's advice and don't forget to properly close out your tasks! Putting in some error handling may also help in the debugging process.
Take care,
E.Lee
Eric
DE For Life!

Similar Messages

  • Real-time - how to control speed of digital waveform

    Deploying the VI attached to my RT desktop target I generate digital waveform on 8 channels on port0 and acquire data on AI [PXIe-6358].
    The digital output frequency and analog input sample frequency are 10000 Hz therefore I expect that while one 8-bit digital code is active [valid] for 100us, one single analog sample is acquired. That means that I would expect one cycle of the while loop to finish in 100us x 2^8 = 100us x 256 = 25600us = 25.6ms.
    However what happens is that the while loop finishes in 6ms regardless the set frequency. The loop finishes in 6ms even if I set 5/10/15kHz or if I put a 100us delay into the while loop. I also tried to set the source of the analog input sample clock to 'Dev/do/SampleClock' but nothing seemed to work so far.
    How can I force the digital generation to be in correlation with the analog acquisition? I need to acquire 1 data point per channel while the respective digital code is active.
    Thanks,
    Krivan
    Attachments:
    RT_ai_dig_wave_gen.vi ‏56 KB

    Hello krivan,
    Thank you for your post on the forum.
    Do you want the digital generation to start at the same time as the analog acquisition?
    Shalini B
    Applications Engineer
    National Instruments UK & Ireland

  • How to input/output a digital signal and acquire an analog signal at the same time?

    Dasylab, version: 8.0.04
    Acquirement Card: PCI1002L
    When I use DasyLab to acquire the analog signals is no problem without digital inputs and outputs,
    and when I use DasyLab to input or output a digital signal is no problem also, but when I do that at the
     same time, DasyLab tell me the rate is too high and stop.
    so, I searched the manual book1 (user guide) for that, it showed me :
    To internally equalize measurement time and system time in the analog input, digital input and counter
    hardware modules, use the following settings:
       Synchronization: PC Clock
       Sampling rate: <= 5Hz
       Block size: =1
    the problem is, if I set the Sampling rate to 5Hz, the speed of the acquirement datas is not enough for my
    application.
    so, how to improve it? who can give me a example programm for me. thanks!
    by the way, I come from China, my English isn't good, I'm sorry.
    Allen, China.

    Hi,
    Have things changed over the years?
    I need to syncronise a digital output (Modul NI9474) and an analoge input (AI-Modul NI9203) module. I need to measure time intervals from a flank in signal A to a flank in signal B. I would like accuracies of the order of 1 ms. Currently, the signals are not synchronised, with errors of the order of 2 times the block length (block size x sample rate), sometimes much higher. The best I got so far was a block size of around 20 with a sample rate of 1 kHz.
    If I use the master and slave settings on the RTSL settings, my program doesn't run properly.
    If I use digital signals for input and output, I can syncronise them with RTSL settings and everything is good, but I can't always do that.
    Also, if I do anything in the GUI (such as scrollowing something or going to another window), my output gets screwed up properly.
    1. What can be done to synchronise AI with DO?
    2. Is there something that can be done to avoid messing up the output when something happens in the user interface? (I know that I am messing up the outputs as they make some valves switch and that is loud).
    Thanks in advance!

  • How do I sample a digital waveform?

    I have a digital waveform that represents a 1-bit data stream.  The bit rate is 1Mbit/s (i.e. For a value of '1' the line is high for 1us, for '0' the line is low for 1us). 
    I want to create a numeric array representation of the line by taking a sample of it every 1us and appending it into an array.
    How do I set it up in LabVIEW to sample the line at 1MHz and create a 1-D numeric array of the bits?

    Hi Raine,
    It sounds like you're trying to keep data from previous samples in memory through the next iteration of the sampling loop, then append the new sample to the array.
    Using shift registers is the most reasonable option. To create a shift register, wire your sample data to the edge of your sampling loop then right click and select Replace with Shift Register. You can then use a Build Array function to connect the shift register data with the current sampling data.
    Cheers.
    | Michael K | Project Manager | LabVIEW R&D | National Instruments |

  • How can I output a digital value (0 or 1) directly with a VI on the RTSI-bus?

    The Device is a PCI-MIO-16XE10.
    Thanks.

    The RTSI bus is designed for sharing timing and control signals between boards. By timing and control we mean clock signals, digital triggers, etc. RTSI is not meant to pass I/O signals, even digital I/O signals. Thus, it is not possible to connect one of the digital I/O lines on your board to a RTSI line. A way to accomplish what you would like to do might be to toggle GPCTR0's Output and connect that signal to the RTSI bus. You would do this by configuring the counter to perform event counting and counting down from a specified number of pulses on the source pin and configuring the counter's output to toggle on terminal count. You could also configure the counter to perform pulse train generation or single pulse generation. To connect the output to the RTSI bus, yo
    u will need to call the Route Signal VI from the DAQ Calibration & Configuration Function Pallette with Signal Name set to RTSIn and Signal Source set to GPCTR0 Output.
    Regards,
    Erin

  • How to split digital waveform channels?

    Hi , could you please let me know how can I split the digital channels of a digital waveform(Let's say the digital waveform has 6 channels ) and graph them seperately.
    It is very easy to split analog waveform signals ( acquired using N channel N sample) but I don't know how to do it for digital waveforms. 

    tintin_99 wrote:
    Let's say I have acquired the digital signal at 1MS/s / Now I want to decimate the number of samples to 1kS/s. Again I know how to do it for analog signal using the decimate function. Do you know a way to do it on a digital signal?
    Decimation make sense only to ANALOG signals, as ANALOG signal are continuous and can have any value (within defined range) on the other hand, DIGITAL signals can have just two states (0 or 1), so when you talk about decimating a DIGITAL signal, you need to come up with an algorithm, how you want to knock off the sample data points (say every alternate sample)....!!
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Digital waveform to 1-d digital waveform?

    Hello I am new to LabVIEW and wondering how can I convert a digital waveform to a 1-D Digital Waveform? Also how can I post my code and errors?

    Just wire it to the Build Array function.
    You should see the Attachment option right below the message body.

  • How to output the digital clock and synchronization signal from the NI USB-6211

    Hello,
    I need to connect the NI USB-6211 to control a digital to analog convertor chip (AD5541). However, this chip requires three input signals :1) Clock input, 2) Logic input or a synchronization signal  and 3) Signal Serial Data input (CS, SCLK, DIN).
    how to output the digital clock and the synchronization signal from the NI USB-6211?

    Hi SaberSaber,
    You should be able to use the counters to generate a pulse train that could be used for clock and synch purposes.  
    Hope this helps.  Let us know if you have more questions.  
    Dave C.
    Applications Engineer
    National Instruments

  • How to send digital waveform to the DAC?

    How to send digital waveform, obtained by Function Generator.vi to the Digital-Analog Converter? What kind of subVIs I have to use for this? I have LabView_5.0 on MacOS.

    The 6032 is not a GPIB board. It is a DAQ board board and has 2 16-bit analog outputs, 8 16-bit outputs (16 single-ended), and 8 digital i/o lines. I don't know what you mean that a MIO16/LPM16 is connected to it. There are a lot of example VIs that ship with LabVIEW. Select Find Examples from the help menu and look under Hardware Input and Output. LabVIEW 7 has some under DAQmx>Analog Generation and older versions of LabVIEW have them under DAQ>Analog Output.

  • How plotting on a digital waveform graph the bit transition in function of the time

    Hi everyone,
    I am using LabView 6.1 on a Windows XP computer. I am to plot output bits sequences on a digital waveform graph just before sending the information to a board.
    So far I can see the transitions for my 16-bit port (16 plots) but the width of a pulse is always identical, no matter what times I enter. I wired my 1-D array timestamps to the property node Xscale.MarkerVals[] of my digital waveform graph... but it doesn't seem to affect my plotting...
    Thanks in advance for any help concerning this problem.
    Jonathan Sabah

    Well here is piece of my VI with the necessary sub VI.
    I also want to hide/unhide plots... I have found how to hide.. but cannot figure out how to unhide.
    Any help please ?
    Thanks again
    Jonathan
    Attachments:
    Exemple.vi ‏58 KB
    Setup_DIO64_for_Output_1.0.vi ‏111 KB

  • How to pass digital waveform to a raised cosine filter

    so i have a digital waveform like this for example
    and i want to pass it through a raised cosine filter (which i can generate its coeeficents by having the digital design toolkit)
    below is the shape of the VI (it only outputs
    and after passing the digital through the filter i want the analog signal to look like this
    So my question is how can i pass the digital signal through that raised cosine VI ??

    Coninued from here http://forums.ni.com/t5/LabVIEW/Please-any-help-would-be-appreciated-how-can-i-implement-a/m-p/30998...

  • How can i output a square wave from one of the digital lines of NI 9401

    hello,
    i m very much new to the LABVIEW environment and NI. please help me guys. i am using cDAQ 9172 and NI 9401 which i believe is a digital I/O device. i want a square wave of amplitude 4 to come out of it so that i can use that to control the speed of a DC motor by pulse width modulation technique by varying the duty cycle. how do i output a continuos square wave?
    Thank tou for reading.
    hoping for a reply at the earliest
    Regards
    ashutosh

    The DIO ports on a MIO will not satisfy your needs (unless you move to LV RT).
    They do not support buffered outputs.
    Your update rate (how often you can set the port and clear it) is going to be limited by how fast (a-hem slow) windows will let you iterate,
    and,
    be non-determinstic.
    You could use,
    1) LV RT with the existing board, or
    2) FieldPoint PWM module, or
    3) Arbitrary waveform generators, or
    4) HS DIO board, or
    5) use the analog output of your baord where you que-up a 0 -5V waveform of the proper shape (i.e. make sure that the duty cylce fraction of the update values are high, the rest low).
    This is just to get a PWM signal out.
    Now there is another issue. Determinism. How often do you plan on reading your inputs and making a change to you
    r PWM? If you plan on doing more often that 10/second, write your code to handle windows going out to la-la land when you expect it to be working.
    Can you tell I like LV-RT.
    I hope my ramblings have helped.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to set the AppleTV to output PCM DIGITAL via toslink

    how do you set the AppleTV to output PCM DIGITAL via toslink - my amp can only recieve PCM audio via toslink cable

    I am having the same problem. I bought an optical-analog convertor from Amazon (SANOXY) and had Onkyo try to help me set it up. No luck. I am going to try a Monoprice version. I was able to output audio through my DirectTV box to the Zone 2 speakers, so that isn't the problem. I was able to hear the music from my iMac through the AppleTV/Onkyo receiver on the 5.1 side but was unable to output it through Zone 2 to the speakers.
    Very frustrating!!!!

  • How to playback a digital waveform

    Hi I would like to do some post processing work on a digital graph data. I would like to use 2 seperate VIs for data acquisation and post processing. So first I acquire the data  then pass the whole waveform data as an input to the other subVI but I olways get the last waveform  . Could you please let me know how I can pass the whole information about a continous digital waveform without saving it on disk
    thanks

    You can do a variety of things, such as building an array of waveforms by auto-indexing them where you wire out of the aquisition loop.  Alternatively, if you want just a single long waveform, the Append Waveforms.vi (Functions -> Programming -> Waveform -> Analog Waveform) should do nicely.  You can also manipulate the waveform components directly and append the data arrays if you want some more control over it, but that's pretty much what the built in vi does.
    The Colex Group
    Lead Software Engineer
    Certified LabVIEW Developer

  • How can you add comments to a text file while using a Digital Waveform vi?

    Hi. I'm very new to Labview. I have a txt file of 1's and 0's wired to a "read from text file" which is then wired to a "spreadsheet string to digital.vi" ("digital waveform") and lastly to a graph. I want to add notes to the txt file that will not be read in the digital waveform. i.e. Like how you use // or /* in a C++ program to show that you are writing a comment and not code.
    Labview version: 8.5
    Thank you

    You will just need in your text file a line at a time.  Search the string for the characters // or /*.  If it finds them, then loop back and read another line.  If it doesn't find them, you must have a good line of data and you can pass on to the next part of your cod.

Maybe you are looking for

  • How do I move photos in a Smart Collection and keep folder structure?

    HI there I am on a trial of Lightroom and loving it so far.  One seemingly simple task I would like to try out is moving all my RAW files (which are all mixed up with JPGs and PSDs to a new location and keep the current folder structure. Currently I

  • Why can't I post a question from my new system?

    Hello All: I was just trying to post a question from my new mbp but it wouldn't allow me to do anything.  It continually gave me a message highlighted in 'red' that i was;t allowed to modify or post anything.  I've been asking questions for quite a w

  • Problem in search help view for Contact (BP_CONT_SEARCH)

    Hi, I am trying to create service order. There I have 2 fields ... Sold-to-Party and Contact. when I say F4 for Contact it is displaying the next screen with 4 parameters. There I have Account ID paramater. In the CRM 6.0, the Account ID is being pop

  • Urgent - Automatic Payment program

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. > Hello, The automatic payment program picks up the documents that have been clea

  • Print dialogue box not opening with HDR image

    I created an HDR image using HDR Efex Pro 2 a month ago and printed it.  It is saved as a psd file.  I went to print it yesterday and the print dialogue box won't open. I've tried alt tab to check the box isn't open and hidden.  I've re-created the i