Generating a digital waveform sequence

I am trying to generate two 8-bit digital sequences and send them as an output command over two channels simultaneously. Sequence length of 80 microsecs. 1 Bit length of 10 microsecs. The first sequence is high on all the 8-bits its role is to trigger the recording of the sequence on the second channel. The second sequence is the same in length but I would like to be able to control what this sequence is. I am trying to come up with a VI that would send these two sequences simultanously.
Any suggestions?

Hi,
For us to be able to help you better, please describe what hardware you
are referring to. Are you using one of NI's DAQ products, if so which
one? If not, on what port do you want the data to be output?
Have Fun!
- Philip Courtois, Thinkbot Solutions

Similar Messages

  • How to control individual channel of signal generated from digital waveform generator?

    Digital waveform generator has 8 channels. I need to generate two different signals to HSDIO. How to modify and control two different channels? Also, how to translate pin outs from PXI-6541 to channels? I need to control signal into pin 1,3,29,and 31 individually.
    Thank you!!
    Solved!
    Go to Solution.

    You must combine your individual data into an array.  The digital waveform is simply a digital representation of the binary array.  It still boils down to bit 0 of each array element going to channel 0 (or the first channel you specify in Create Dynamic Channels).  The next bit goes to the next channel.  My last post is quite clear.  To display the array in binary, right click on an array element, then select Display Format, then select Binary.  You can also right click on the element, select Visible, then select Show Radix to display the small b before the number.  One more thing, in the Display Format window, uncheck the box next to Use minimum field width.  Then set the numeric just under the box to 8.  Then select Pad with zeros on left in the box below.
    You should not use waveforms until you learn more about how the HSDIO operates on input data.  It isn't hard to combine waveforms, but it also isn't as clear as using an array of U8 or U16 or U32.
    Trying to explain further.  The first number to be writen to the HSDIO will have this effect:  Bit 0 (LSB) of the number gets written to the first HSDIO channel you specify.  Bit 7 goes to the 8th channel you specify.  If you don't specify 8 channels, the bits get ignored.  So wiring in one number will produce only one bit on each channel.  In other words, the number already combines the bits of all the channels you specify.  You don't combine anything yourself.  Look again at my picture on my last post.  By wiring in an array, you cause a bit pattern to be generated.
    I hope this is more clear.
    - tbob
    Inventor of the WORM Global

  • Generating arbitrary digital waveforms

    Hello,
    I'm new to the world of hardware-timed digital signals, so I'm unsure of how to proceed. I have a cDAQ-9174 and a NI 9474, which I'd like to use to produce two periodic, synchronized digital signals:
    What's a good way to accomplish this? I found the DAQmx "Generate Signals" -> "Digital Output" task, but that seems to only generate uniform pulse trains, not the arbitrary waveform I'm looking for.
    Thanks in advance.

    Ok, one step closer to the answer. DAQmx Write.vi (Digital Wfm 1Chan NSamp) lets me define an arbitrary waveform for 1 channel. How do I specify waveforms for two channels?

  • Generate clocked digital waveform

    I'm using a USB-6221.  I need to generate a waveform synchronized to an external clock.  I need to generate it once when a button is pushed.  The data is in the form of an integer, 8 bits.  So if the integer is 12 I want to generate 00110000 on one output channel synced to a clock input on another channel.  I've gone through the examples but I couldn't find how to specify the value of the waveform.  Any help would be appreciated!

    I started with the Example in the example finder "Write Dig Chan-Ext Clk.vi".  That creates a square wave on 8 channels.  I changed it to just one channel and replaced the square wave (basically counter output) to my 8-bit value.  See the attached GIFs.  The first is my modified "Write Dig Chan" program and the second is the "Create Dig Waveform" SubVI where I read in the 8-bit number I want to output on the channel.
    Message Edited by mperdue on 10-23-2007 02:47 PM
    Attachments:
    1.GIF ‏16 KB
    2.GIF ‏12 KB

  • Generate digital waveform form a read from spreadsheet.vi

    Hi, I'm very new to LabView and am having some problems in completing what I believed would be a very simple task.
    I am using the Read from Spreadsheet.vi to read in an Ascii tab delimited file that I created in Matlab (the file is simple a vector of 1's and 0's that represent a binary stream) All that I want to do is take the output from this and generate a digital waveform corresponding to the 1's and 0's in the array but I cannot find a way of doing this.....
    Help much appreciated,
    Thanks.

    You should be able to just run your data straight  in to the digital write function as long as you select the correct port width of your hardware.
    If you want to do it with a digital waveform it's a bit trickier, the digital waveform data type is a surprisingly complex animal.
    There might be a better way to do it, but this is what I've had to do in the past...
    The "build digital data" function needs a 2D array in, so convert your 1D array into a 2D.
    Then the digital data can be input into a Build Digital Waveform.
    Then the digital waveform can be output with the write digital waveform.
    Message Edited by Troy K on 03-23-2008 11:37 AM
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle
    Attachments:
    array_to_digital1.png ‏4 KB
    array_to_digital.png ‏9 KB

  • MyDAQ - Generating a digital signal and displaying it on an analog waveform graph

    Hi,
    I am using the NI MyDAQ to generate a digital waveform with an adjustable frequnecy. This is being implemented into a program I have already written which generates a TTL "like" pulse out of the sound card. I am displaying the output on an analog waveform graph, and I'd like to be able to display the digital waveform generated by the myDAQ on the same graph. (Not at the same time, either one or the other, toggled by a button). I've been messing with arrays and conversions but I cant seem to really get anywhere with it all.
    This is the vi I have made to generate the adjustable frequency digital signal with MyDAQ. Any suggestions on the proper way to do this if the following is wrong would be great too as I just got the MyDAQ a few days ago. I would think there must be a better way but this is the best I could come up with so far.
    Solved!
    Go to Solution.

    Hi Jonny,
    The general logic you are using to create a digital pulse train is fine. This VI you've written should work and will create the pulse train based on software timing (which is fine because you don't have hardware-timed DIO on the myDAQ anyway). However, it is usually good practice to start the DAQmx task just before your while loop and then clear the task after the while loop when you press stop.
    For reference, there are some pretty good LV examples that I recommend looking at for this application too. If you are just trying to create a digital pulse train, the example Gen Dig Pulse Train-Continuous.vi is a good example that uses a counter to create a digital pulse train of your desired frequency. This is generally the prefered method to create a pulse train if you have the hardware available to do so (the myDAQ does have a counter). Alternatively, there are some DIO examples that continuously write to a digital line/port.
    If you're not familiar, you can find the examples by going to Help >> Find Examples... in LV. Then, navigate to Hardware Input and Output >> DAQmx >> Generating Digital Pulses or Digital Generation.
    Also, here is some additional information about the myDAQ and its counters:
    myDAQ Counters 
    myDAQ Manual 
    Hopefully this helps.
    Chris G
    Applications Engineer
    National Instruments

  • 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!

  • Convert digital waveform to array

    Hello,
    I posted a problem before Christmas regarding data acquisition and accessing the hardware buffer on a 6562 card. I managed to figure out that problem but now I'm stuck when I try manipulating the data I obtain. (The original problem can be seen here: http://forums.ni.com/ni/board/message?board.id=70&​thread.id=7926)
    Briefly, my application is clocking and synchronising an ADC board and then looking at the raw ADC data that comes back from the board. To provide synchronisation I am sending a sync pattern on one data line and using a second line to send a "start of frame" indicator, a '1' bit when I know that the board is synchronised. This line otherwise only sends ‘0’s. This cable is wired back into the NI card and LabView. All data sent uses the NI-SHDIO Generation Express VI and I'm using the Acquisition Express VI in parallel with the Generation VI to capture the raw ADC data when it comes off the ADC board. Since I am acquiring both the ADC data and the frame indication data (which I am looping by connecting that output DIO to an input DIO), the digital waveform essentially contains 2 arrays and I can view these from a graph indicator within LabView.
    No problems so far. In order to manipulate the data and look at individual frames I am writing the ADC data to file. To extract the digital data from the digital waveform I am using the following VIs:
    -Get Waveform Components
    -Get Digital Data Components
    -Write to Binary File
    To view and manipulate the data I read it into Matlab and this is where I can tell that something's not right. When I read the file into a variable in Matlab, the variable becomes a 1D double array of 40,008 elements. This seems very odd, considering the Acquisition VI only takes 20,000 samples. When I look at the 1D array more closely it looks like the two arrays have been cross added in some fashion. The 1D array certainly doesn't match either of the two arrays visible in the graph indicator inside LabView. I can understand if the file is reading one array after the other (20,000 + 20,000 almost equals 40,008 after all) but that doesn't appear to be the case.
    I would greatly appreciate some help on how I can extract the two data lines either using Matlab or LabView. Currently it looks like LabView is making a hash of things whenever I try to manipulate or extract the two arrays from the digital waveform. I have tried a multitude of different VIs and ideas but nothing appears to work.
    The most straight forward way would be using the "Converting Digital Waveform to Binary VI" but it can't handle two arrays within the same waveform. (The result looks like the two arrays exclusively OR’d together). To combat this I tried running two Acquisition Express VIs in parallel (one for ADC data, the other for the frame info) but got an error message referring to invalid handles. I presumed this meant that I can't run two acquisition VIs simultaneously, judging from forum posts of users facing the same error message.
    Sorry for the long post but I feel that I needed to fully explain the problem. I'm attaching my LabView code.
    Thank you for reading,
    Christian
    PS. GenAcq2.vi is my code. Waveform_GenAcq2_Cfg.hws is sent by the first Generation VI; Waveform_GenAcq2_shorter_frame_indicators.hws by the second Generation VI.
    Attachments:
    CodeAndWaveforms.zip ‏126 KB
    GenAcq_Screenshot.JPG ‏83 KB

    The extra "8" is being caused by the fact that the "Write to Binary File" VI has a "prepend array or string size" input. Its default is true, and in your case you have it unwired, so you get the array size prepended. As for the rest of your issue, what are your Matlab commands to read a file? The following example VI, which generates a digital waveform and saves it to file,
    can be correctly read into Matlab using the following commands:
    fid = fopen('c:\temp\digData.bin','r');
    F=fread(fid, [256,8], 'uchar');
    Message Edited by smercurio_fc on 01-18-2008 05:26 PM
    Attachments:
    Example_VI_BD.png ‏11 KB

  • Trouble outputting digital waveform to single line

    i want to output to a single digital line a digital pulse. my current attempt is to generate a digital waveform and then provide this as data to a digital line output. the vi runs, and the waveform appears as i want, but the digital line doesn't output anything? any help would be greatly appreciated!
    Attachments:
    digital pulse out.vi ‏32 KB

    Hi
    In reference to my previous post, you can just leave the inner for-loop, but you have to extract the 4 channels.
    Just have a look at the picture.
    Hope this helps.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    DigitalWaveform.png ‏6 KB

  • Digital waveform to DAQ

    Hi,
    I have generate some digital waveform by reading a text file. the graph that is connected to the waveform is what i wanted. But I need to output this waveform through one line digital output of USB6501. How do i go about doing it?
    Any help is appreciated. Thanks.
    Attachments:
    data.txt ‏1 KB
    test.vi ‏64 KB

    When one looks at the specifications for the USB6501, one notes that it cannot do hardware-timed output.  Therefore, you can't use a waveform datatype to generate output with this card.
    So, you will have to use software timing and a loop.  Since you specify a pretty slow transfer rate (0.5sec), it should work fine.
    Look at one of the examples that ships with LabVIEW to get you started.  Click "Find Examples...Hardware Input and Output...DAQmx...Digital Generation...Write Dig Chan".
    Of course, you only want one line.  So when you specify your physical channel, only specify one line.  Change the function inside the loop to "Single Channel...Single Sample...Boolean (1 line)".  Now the function will accept a single boolean value.
    You do a lot of screwing around with getting your data into the right format.  That can be simplified a lot.  See the attached picture.  This is not complete code -- you will need to look at the example I mentioned -- but this picture and the example, combined, should tell you what you need to know.
    Hope this helps get you started.

  • Digital waveform editor can not open hws file generated by niHWS store waveform

    Hi,
    I am using a simple VI to store the U32 array to a hws file in LabVIEW, however, the file generated can not be opened by Digital Waveform Editor. The VI used to be working well before I upgrade LabVIEW from V7 to V7.1.
    Meanwhile I also found out that the hws file generated by DWE can not be read out by niHWS. retrieve waveform.vi if the number of channels is not 32.
    I would be grateful if any one can give me some help. Please find the VIs and hws files as attached.
    The software I am using is
    Digital Waveform Editor 1.0
    LabVIEW 7.1
    Best Regards, YJ2003
    Attachments:
    question Get ArrayU32 from HWS Data.vi ‏108 KB

    Dear Brian,
    Thanks for your quick response.
    I tried again but still failed to open the hws file with my DWE V1.0. Since the version is the only difference between our software, I suspect the problem is caused by my DWE of old version.
    Would you please help me to check if the new attached questionretrievepattern.hws file can be opened by the HWS.VI? (Please change the extention from txt to hws as I can not attach file with hws format in this forum)This file is generated by DWE1.0 and contain only 16 channels. It can not be opened by the niHWS retrieve waveform.vi in my computer with erroe code "-21558", but if I added another 16 channels signals with DWE, the data can be read out properly.
    If we can confirm the problem is caused by DWE1.0, would you please also let me know how to upgrade my DWE? Thanks.
    Best Regards, YJ2003
    Attachments:
    questionretrievepattern.txt ‏35 KB

  • Converting digital waveform into bit sequence

    Dear friends,
    I am stuck with the task of converting a digital waveform (16 bit values) into
    the following waveform:
    each sample of the original waveform should be represented by a sequence of
    bits (or H and L analog values) in the second waveform,
    the duration of the bit sequence should be half (in general arbitrary fraction)
    of the sample clock period of the original waveform,
    the bit sequence should be padded by zeros so that the total duration of the
    bit sequence and the pad equals to the sample clock period of the first
    waveform.
    I tried to represent these two waveforms in the picture attached.
    It would be really great if someone could give me hints/suggestions to this
    problem!
    Thanks in advance!
    Attachments:
    waveforms.JPG ‏21 KB

    Hi SamboNI,
    Thanks for your reply!
    I have couple of notes:
    I tried to implement your instructions but the LabView gives error message
    (please see the screenshot attached).
    I guess there should be "Boolean to (1,0)" VI between "Number to
    Boolean Array" and "Build Array" VIs (?)
    The problem I have is a bit more complex:
    I have a digital waveform (16 bit integers). I need to transform the waveform
    in the easiest and fastest way into the following form:
    Each sample of the original waveform (16 bit integer number, i.e. 5) should be
    represented by a sequence of 0s and 1s corresponding to the bit sequence of that number (0000000000000101 for 5) padded
    by a sequence of zeros (i.e. 00000) in the final waveform. I will use the
    final waveform to drive single line of the 6534 board instead of 16 lines of
    this bopard in the case of the original waveform.
    More generally:
    I need to realize communication protocol with the AD5541
    Digital-to Analog converter from Analog Devices (
    http://www.analog.com/en/prod/0%2C2877%2CAD5541%2C00.html ) using 6534 NI
    board. Therefore I need also build SCLK and CS waveforms and synchronize
    them with the DATA waveform I was talking above. Is there a way to do this?
    By the way - do LabView have standard means to communicate
    with devices like AD5541? Does it require a special software module and/or
    hardware board?
    Thanks in advance!
    Attachments:
    NumToBoolErr.JPG ‏16 KB

  • Generating a digitized sine waveform

    Hi,
    I am trying to generate a digitized sine wave to feed into my 16 bit DAC. Basically, I am trying to create a sine wave that goes from 0 to 65535, with a frequency and amplitude that I can control.
    Any ideas how can I do it?
    Thanks!

    Thank you for your suggestion!
    Attached is what I have so far. I think it works. I digitized the sine wave, but my problem is that the sine wave is not "continuous/real time". Also I cannot change my sample size (default is 1000).
    Any other suggestions?
    I am planning of providing a digitized sine wave to a DAC and measuring SNR at the output of the DAC with an Audio Precision. That is why I needed a continuous/real time sine wave with more sample points.
    Thanks.
    Attachments:
    digital sine wave NI.vi ‏50 KB

  • Counting number of 1's present in digital waveform obtained by converting the pulse signals.

    Hello,
    I am using Analogtodigital.Vi for converting the pulse sequences into digital.signals.I am able to get the digital waveform representaion of the pulses.
    But how to count the number of 1's present in the converted digital waveform.I want to count the number of 1's present in the converted digital waveform.
    Thanks in Advance.
    Solved!
    Go to Solution.

    Did you try opening the block diagram of Analog to Digital.vi? 
    It creates an uncompressed 2D array of 1s and 0s which represents the 16-bit binary A/D conversion of each element in the Y array of the input waveform. You can use the DWDT Digital to Boolean Array.vi to convert to a 2D array of booleans. Then convert the booleans to 1,0 and sum the array of integers. The sum should be the count of 1s in the digital waveform.
    Lynn
    Note: The attached VI is saved back to version 8.6. When I saved it for Previous Version a warning was generated about possible differences in versions. Let me know if it does not work, and what version of LV you are using.
    Attachments:
    Count bits.vi ‏25 KB

  • 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

Maybe you are looking for

  • Multiple level headers in column of an ALV report

    Hi All, I have  a requirement . I need to display a two level coloumn in alv grid display . Example :                           | Cust no    |   Address        |                                                                                |        

  • Blank page after posting a reply?

    I'm getting a blank page after I post a reply. I have to go back to my bookmark for the whole forum manually. Is this a feature or a bug? (Im using Safari)

  • Duplicate schema System.String in BizTalk.System

    Hello, In BizTalk 2010 Administration Console, in BizTalk.System application, I have the schema System.String#string twice (Version=2.0.0.0 and Version=4.0.0.0). And I'm pretty sure that's what cause me this error in my orchestration : There was a fa

  • Severe problems with Keynote

    Hi there, I've got some trouble with keynote (on Ipad) What happens: My wife and myself often receive Powerpoint "presentations" from friends or relatives though e-mail, some of them from China. These presentations are usually displayed as slideshows

  • Cisco Wap300 access point

    I own a Cisco Wap300 access point . there are a pc, a netbook and a smartphone in my house. I want to connect to these devices my line of fiber internet with Cisco Wap300 access point. My modem brand and model is "ZTE - Zxhn H168N". This modem has 30