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 |

Similar Messages

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

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

  • Digital Waveform graph with a lot of samples

    Hi,
    I have to display in a Digital Waveform Graph a lot of data read from a file(2.000.000 of samples for 36 signals). If I read the file and I try to display all the data, the Vi became unusable. For example, to zoom a graph region, it may take 30-40 seconds, scroll is impossible ecc, ecc..
    Apparently LV doesn't perform a decimation of points. In measurements studio 8, this problem doesn't exist...but I have to use LV 7.1..
    any suggestion ?
    At the moment I have developed a DLL in VC++ that perform a decimation of samples, but performance are not very good !
    Thank you for any idea.
    Regards.

    Hi Garraty,
    Excuse me but I have several questions for you.
    1)     Have you tried some kind of incremental approach, starting from 1 waveform and increasing towards 36? Do you experience some kind of on/off degeneration between, les’s say, 34 and 35 waveforms?
    2)     How can you decimate a digital pseudorandom sequence of 2M samples without loosing information?
    3)     Is this 2M samples an unavoidable constraint for your application?. Actually, it seems very difficult to extract some kind of visual information from a pseudorandom pattern of this length?
    Thank you very much.
    Kind Regards
    FiloP
    FiloP
    It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
    Richard P. Feynman

  • Digital waveform editor sample size limit?

    Hi,
    Can anybody please tell me the sample size limit of the Digital Waveform Editor? Thanks!
    Jing

    Hello,
    1) You can actually acquire as many points as you want. You may be worried about the throughput of all this data from the DAQ board into computer memory, but I don't think this will be much of a concern for your application. You're limited only by how much memory your computer has. Mainly, you should be concerned about what you are doing with all those samples after they are acquired. Are you just using them once then throwing them away? (Such as the "Cont Acq&Graph Voltage-Int Clk.vi" shipping example.) Or are you streaming them to disk? If you just keep them all in computer memory, then there would be some maximum number of samples you could hold but that number would be system dependant and you'd just have to experiment to find that number.
    2
    ) That's a great idea to take those voltage signals and make them digital inputs. This way you'll also free up some more bandwidth giving you the option to increase the sample rate on your other channels. However, you won't be able to include any DIO channels in the same task with your other analog channels. You need to create a separate task for these digital input channels. Lines 0,1,2, and 4 will be reserved for communication with your SCXI chassis by the way. You also won't be able to do any buffered sampling like you can with the analog channels. The DIO for the PCI-6024E is only immediate and software-timed. (You must poll the status of the line with a software loop.)
    Let me know if you have any other questions.
    Russell
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • How to get Digital waveform with Time.

    Hi
    I have 3 channels , each of which have ON/ OFF cycles specified with milliseconds as shown below.
    Channel 1       OFF(3000)   ON(2000)  OFF(1000)  ON(500)  OFF(4000)  ON(300)
                         The number in the bracket is the time in milliseconds for which the channel has to be ON or OFF.
    Channel 2      OFF(800)   ON(1000)  OFF(6000)  ON(2000)  OFF(5000)  ON(400)
    Channel 3       OFF(1000)   ON(700)  OFF(500)  ON(800)  OFF(400)  ON(600)
    So i need a digital waveform plot with Y axis showing the highs and lows for the channel  and X- Axis showing the time in  milliseconds.
    All the channels can be plotted in one graph or separate graphs.
    I tried plotting with each OFF as False and ON as TRUE and built a boolean array. then converted to digital.  but was not able to get the time (X-axis ) correctly. Is there any way to get Time on X axis for the Digital channel.
    Thank you .Regards. Hema.

    Hi Dennis,
    I have done the same way as you suggested.but the sample rate is common to all the channels.( that is each channel is one boolean array column in the 2D boolean array which is fed to the Digital function , but i need separate sample rate for each channel(1-D array).
    The Boolean array to digital takes 2D array as input, so i was not able to get different Time on X-axis.
    But i found out a solution( very long method)  by building time array separately and plotting the waveform without using sample rate.
    Now i want to get rid of the '1' and '0' which gets displayed on the digital waveform by default . That is for every high there is number 1 shown and every low number 0 is shown on the graph. Please can I know how to remove this number display.
    I saw digital waveform example too, but  on all digital  waveform, the numbers are shown.  Is there any property to be set to disable 1 and zero display.
    Thank you.

  • How can I programmat​ically detect transition times in a digital waveform

    Hi, I have a digital waveform and at certain times I have transistions and glinches , how can I programmatically detect and record the time stamps of the transitions
    Thanks  

    Let me see if I understand you. You are reading 14 bits in parallel and you want to know how long between transitions of just one of those bits - say bit 11. Is this bit number constant or can the number of the bit in which you are interested change?
    Well, you could XOR the value from each read of the digital bits with the 14 bits you got from the previous read. If the resulting value of bit 11 is true, the state of bit 11 has changed. Use that flag to read/restart an interval timer. Of course the resolution of your measurement will be dependent upon the rate at which you are reading the 14 bit input. If you are only sampling the 14 bits every 500 msec, you obviously won't be able to measure intervals of less than 1/2 sec.
    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

  • How can I get a digital WDT that includes all samples, not just the one for the current time step...?

    See block labeled ''digital data'' in my attachment for reference. Currently, only the digital data point for the current time step can be seen (it is deleted before the next one appears). However, I would like it display all the samples in the table like in the example found at this link under ''Digital Waveform Control'':
    http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/fp_controls_indicators/ 
    Many thanks for any suggestions! I am new to Labview, so I appreciate your help.
    Solved!
    Go to Solution.
    Attachments:
    myproject.vi ‏220 KB

    Hey westerman111,
    If you're looking to produce have your display include the solution information from previous solver steps, you will need to buffer the previous data. The way to implement this in a Control Design & Simulation Loop is using the Memory.vi found under Control Design & Simulation > Simulation > Utilities > Memory.vi. It will allow you to save previous information generated in the simulation environment for letter solution steps.
    I've attached an example that should get you started in using the Memory.vi.
    I would also make sure that what you're looking to accomplish is suitable for the Control & Simulation Loop. I know you mentioned you were new to LabVIEW so I wanted to make sure you were heading off in the right direction. Is there a particular reason why you are using the Control & Simulation Loop instead of a standard While or For Loop? The Control Design & Simulation loop is unique in that it calculates the solution of a dynamic system at a prescribed time step and ODE solver. It also provides the tools to interact with the model you are solving during execution. However, if you are simply looking to perform data acquisition and measurements (instead of dynamic model simulation) I would recommend using standard LabVIEW functions.
    Here are some useful references for getting start with both LabVIEW and the Control Design and Simulation Module.
    Tutorial: Getting Started with Simulation (Control Design and Simulation Module)
    http://zone.ni.com/reference/en-XX/help/371894G-01/lvsimhowto/sim_h_gs/
    Getting Started with LabVIEW
    http://digital.ni.com/manuals.nsf/websearch/ba2fb433a7940e7a862579d40070cc2c
    Tim A.
    National Instruments
    Attachments:
    myproject_edit.vi ‏249 KB

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

  • 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

Maybe you are looking for

  • How to split video and extracted audio clip at same time?

    I imported 10 min of DV from my Sony HC96 camcorder to iMovie 6. I selected a video clip and split it using cmd-T but the extracted audio clip below it did not split. How can I split both the video and underlying audio clip so I can drag the edge of

  • What is a good book to help learn new iNumbers 3.0.1

    Is  there an instruction book out yet for iNumbers 3.0.1???? I need help with iNumbers. Senior citizen who keeps a strick budget in Numbers1 I will be 75 years young on Xmas day. Yeap some Dimension...so Help! Thanks Dennis

  • Firebird JDBC on Sun One Studio

    I am trying to use the Firebird JDBC with Sun One Studio. I put the firebirdsql.jar file on the \lib\ext directory, but when I run the JDBC wizard, It does not appear on the list of available drivers. So I put my connection string anyway but it shows

  • Date order iPhoto albums

    With the updated software, my iPhoto is very difficult to use from before.  First, when I look at Albums, they are no longer in date order.   It used to list the albums in date order and show the range of dates in each album.  How can I resolve this

  • URLs not matching the mappings I set in web.xml

    Below is what I observe, I would have expected the URL to match all 3 but it only matches for the first one , any ideas? Web.xml contains <filter>      <filter-name>MyFilter</filter-name>      <filter-class>HWfilter</filter-class> </filter> <filter-m