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

Similar Messages

  • 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

  • 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

  • 1D Array of Digital Waveform

    I have a 1D array of digital waveform and I need to work with the data from it. I can't seem to get the "numbers" from it to work with any array function or any other type of function for that matter.
    I need to be able to convert these so I can find a particular value in the array.
    Thanks.

    Have you tried separating the array into individual waveforms using Index Array VI?  You should be able to use the Get Waveform Components (Digital Waveform) VI on each wavefrom once you separate the array into its component waveforms.  Then you can convert the digital waveform into a Boolean Array using the Digital to Boolean Array VI.  You can then use boolean logic to determine when both waveforms output 1s.

  • Simultaneous analog and digital waveform read with PXIe-6361 and BNC2120 ?

    Hi there,
    I am trying to collect both analog and digital signals from a PXIe-6361 linked to a BNC2120, using the attached VI. I am running Labview 2011 64bit. This is the first time I am working with digital input. On the 2120 board, I have the digital input BNC cable connected to User Input 1 and wire between the screw terminal of UserInput 1 and the P0.1 (Digtial I/O) screw terminal.
    I have two questions related to this:
    1) When I try to run the VI in its current state, I get the following error:
    Error -89137 occurred at DAQmx Start Task.vi:3
    Possible reason(s): Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
    Property: RefClk.Src
    Source Device: PXI1Slot2
    Source Terminal: PXIe_Clk100
    Required Resources in Use by
    Task Name: _unnamedTask<6>
    Source Device: PXI1Slot2
    Source Terminal: None
    Destination Device: PXI1Slot2
    Destination Terminal: RefClockInternal
    Can anyone point me in the right direction for troubleshooting this?
    2) I would like to combine my regular waveforms and the digital waveform into one array which would then be written to file. I can't figure out how to combine the two different waveform types...can anyone give me a hint on this?
    Thanks for your help,
    Claire.
    Attachments:
    Export Waveforms To Spreadsheet File (1D)_wo extra line.vi ‏33 KB
    Multi-Device Synch-Analog Input-Finite Acq-Analog Start_Claire_wDigitalin.vi ‏105 KB

    Hi ClaireJ,
    Sounds like a reference clock conflict. This KnowledgeBase (KB) talks about this error when using simultaneous sampling. Also, might want to check the device routes in Measurement and Automation Explorer (MAX) as discussed here. Finally, if you are routing your PFI line over a RTSI connection, this error can occur. This KB discusses it.
    As to your second question, this post should help.
    Bill E. | Applications Engineer | National Instruments

  • 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 convert waveform into complex number

    Hi,
    I need to convert the acquired voltage and current waveform through DAQ card into complex numbers in order to find the phase relationship
    between the waveform.Can u tell me is there any method to convert the acquired waveform into complex number array
    or is there any other method to find the phase??
    please help me in this
    Regards
    Meenatchi

    Dear Meenatchi,
    I am attaching two sample VI s for the issue you are facing. Hope this helps.
    The waveform in array format.vi gives you the values of the waveform obtained from your DAQ card in an array directly. You can choose this mode by selecting it from the options available on the DAQmx read vi. But if you still want to extract the array from the waveform data type please navigate to programming >> waveform >> get waveform components and extract the array component.
    The phase of the complex number created.vi gives you and array of the phases. Please specify the number of iterations of the for loop that determines the size of the array.
    If you need any further assistance, please feel free to contact us.
    Regards,
    Pavan Ramesh
    Applications Engineer
    NI India
    Attachments:
    Waveform array issue.zip ‏10 KB

  • How to convert digital array data into analog signal

    i want help to convert digital data array into analog signal

    shubham62 wrote:
    We are implimenting real time audio trans-receiver. We have converted input audio data(analog form) into digital data. At the receiver side we received digital data which is in the form of digital data array.But we are unable to recover back our original input data. So please help us to sort out the problem.
    Still no useful information.  How was the data converted to digital in the first place?  What conversion parameters did you use?  As was said, you just need to do the math backwards to get it back into the analog.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to convert a waveform signal into array of complex numbers

    How to convert a waveform signal into array of complex numbers.

    Hi Chaks,
    try this:
    (Get Waveform components, convert to complex DBL)
    Message Edited by GerdW on 01-28-2008 09:23 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    ToCDB.png ‏1 KB

  • Is there an easier way to convert bytes into bit(boolean) arrays?

    I am currently using this method to convert bytes into bit arrays:
    /*convert byte to int such that it is between 0-255 this is the bytes[] array
                        if ((bytes/128)==1)
                             bit[c+0]=true;
                        else
                             bit[c+0]=false;
                        if ((bytes[i]-bitInt[c+0]*128)/64==1)
                             bit[c+1]=true;
                        else
                             bit[c+1]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64)/32==1)
                             bit[c+2]=true;
                        else
                             bit[c+2]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32)/16==1)
                             bit[c+3]=true;
                        else
                             bit[c+3]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16)/8==1)
                             bit[c+4]=true;
                        else
                             bit[c+4]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8)/4==1)
                             bit[c+5]=true;
                        else
                             bit[c+5]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8-bitInt[c+5]*4)/2==1)
                             bit[c+6]=true;
                        else
                             bit[c+6]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8-bitInt[c+5]*4-bitInt[c+6]*2)==1)
                             bit[c+7]=true;
                        else
                             bit[c+7]= false;

    You can loop through and use a bitwise operator instead. Here is an example without the loop.
    byte b = 6 ;
    if( b & Math.pow( 2, 0 ) == Math.pow( 2, 0 ) ) ;
    // the 2^0 bit is on
    if( b & Math.pow( 2, 1 ) == Math.pow( 2, 1 ) ) ;
    // the 2^1 bit is onetc...
    You should get something like 110 when you're done.
    If you're wonder what & does (no, its not a boolean &&), it takes the bits in the two numbers you give it and returns a number with all the bits on that are on for each of them.
    For example:
    10011011 &
    11001101 =
    10001001
    So if we take
    110 (6) &
    010 (2^1, or 2) =
    010 (2 again)
    Which means that the number (6) has the 2^1 bit on.

  • HT4061 Hello, I was wondering if you could convert the IMEI # into the serial number using letters and digits?

    Hello, I was wondering if you could convert the IMEI # into the serial number using letters and digits?

    No the imei from what I understand is a randomly given number. to get serial number you must have it. you can try supportprofile.apple.com and login.

  • How do I graph more than 8 bits on the Digital Waveform Graph?

    Greetings,
    Does anyone know how have a Digital Waveform Graph that graphs Unsigned 16-bit numbers (rather than U8)?
    Thanks

    Just wire your array of U16 right to the bundler. The Digital Waveform Graph will just create 16 plots instead of 8.
    Alliance Members are here to help. We do this stuff every day.
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

  • Convert boolean numbers into waveform

    i am using PXI 7833R  and generate a clock using loop timer. I want to use a wave indicator to show the clock. However the output is a boolean number, I am wondering if there is a VI or something that can wave out the boolean value.
    Attachments:
    FPGA Clock Generation with Loop Timer.vi ‏575 KB

    Hello,
    I assume that you are talking about the need to display your data in the form
    of a digital waveform.  In LabVIEW you can plot digital waveforms on a
    Digital Waveform Graph much like other waveforms.  Remember, with a graph,
    you are not plotting updating points, so if you would like to keep a history of
    previous values you will need to continually append your new data points to the
    existing ones and redraw the graph.  I recommend starting out by examining
    the examples for Digital Waveforms in the NI Example Finder (Help->Find
    Examples->Fundamentals->Charts and Graphs).
    Thanks for posting, and please let us know if you have any other questions, or
    you would like to see some more examples.
    Regards,
    Travis M
    LabVIEW R&D
    National Instruments

  • Memory leak in Digital Waveform

    I have a program with a pretty serious memory leak that uses up all my system RAM and crashes my computer within a few hours of running the program.
    The program takes an array of U16s where each bit represents a digital signal. The VI converts each U16 to a digital array and groups the resulting 16 digital signals into different busses for display on a Digital Waveform Graph. The profiler doesn't show any excessive memory usage in the VI. I put the whole VI into a Diagram Disable structure and moved a few pieces out at a time, and eventually the only thing inside the disable structure was the Digital Waveform Graph indicator. When this indicator is enabled, the memory usage of my system rises slowly and steadily until it uses all available RAM and crashes the system.
    If I replace the Digital Waveform Graph indicator with a cluster, the memory leak still occurs (but much more slowly). I thought using the cluster fixed the leak until I reran the VI overnight while using the cluster instead of the Graph.
    If I stop the VI before all the RAM is used, the RAM will not release until I close LabVIEW entirely. Once LabVIEW closes, the memory is released slowly and exponentially unless I use the "End Process" option in Task Manager.
    This is a continuation of a previous post I made where I thought the memory leak was due to problems transferring data from an FPGA for display.
    I ran the MemLeak vi (attached) on two separate systems, both running LV 2013 SP1, and got the same results. The memory leak is noticeably fast when using the enable structure connected to the Digital Waveform Graph but still present when using the cluster of Digital Waveforms.
    Attachments:
    MemLeak.vi ‏33 KB
    LV shutdown.PNG ‏101 KB

    Thanks for the replies.
    In response to John's points:
    1. The attached VI is a simplification of an FPGA VI that read a fixed number of samples from a DMA FIFO using an FPGA Interface Invoke Method approach. I'm using a card (PXI-7842R) that doesn't allow use of the Acquire Read Region method. In order to allow people without an FPGA card to hopefully see the issue, I replaced it with the for loop. Assuming that this for loop does leak (which I don't believe it does; as altenbach said, it's a fixed size allocation that LV should be able to reuse), why would I see a difference in the leak magnitude depending on which indicator I connect to the array?
    2. I've previously reviewed the document you referenced, and I don't see any errors from it present in my code; do you? I have no global/local variables, strings/arrays displayed on front panel, property nodes, coercion dots, altered memory sizes, resizing/reallocations, etc. I don't see any weird buffer allocations. I used to have the conversion from U16 array to digital waveforms in a subVI but placed it on the same diagram to allow incremental use of the Diagram Disable structure.
    3. The forum post you referenced had many of the items discussed above, plus it was solved using an RT FIFO. I'm not passing data from a producer to a consumer; I'm just displaying acquisition results. I guess you could say I'm processing the data, but I'm really only converting it to a format that the indicator will take; I'm not operating on the data.
    It's good that the leak doesn't show up in 2014, but my SSP runs out in a couple of days; I never got an upgrade to 2014. This is the last item remaining on the development path, and we've already spent ~$4k to upgrade the controllers enough to display the acquisition without dragging down the CPU. I will be in hot water if I spent all that money and then end up having to scrap the display...

  • 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

Maybe you are looking for

  • Open external url dynamic link in new tab  (no new window) in Chrome

    Hello, We need to navigate to a external link in response to user double-click in a row table. We've succesfully created the code to invoking a managed bean as response of double-click user event. For that, we added a clientListener object to the tab

  • Can't print to Adobe PDF 7.0 on Mac OS, is it still supported?

    I use Adobe Acrobat Standard 7.0 on a PC running XP SP3 to create large format PDFs from JPEGs and TIF images; it works great for creating PDFs from technical drawings, etc. simply by "printing" to the Adobe printer from most any application. To the

  • Fscommand "exec" doesn't work in Mac (Flash Player 10.1)

    Hi All, I am trying to launch an external application using fscommand in Mac ('fscommand' works fine on Windows). I have done following things to make it work: Written an apple script to launch a pdf and saved it as "test.app" I copied "test.app" to

  • IPhone 4 (Orange UK)

    Well, I've made a mistake of buying a 3gs from Orange on May 2th. On a side note... Orange doesn't have any return policy! After using the Orange website, it's acknowledged that I'm not eligible to upgrade, obviously. But it's mentioned that I can bu

  • To Include link to URL in FORM_UIBB for Personal Deatil view

    Hi Experts, I have requirement to include the Link to URL in the Form UIBB for Personal Deatil . The form UIBB is built using the Fedder Class - CL_HRESS_PER_DETAIL. The Fedder class get the Structure in the - IF_FPM_GUIBB_FORM~GET_DEFINITION fom the