Coverting a boolean array to a digital waveform

Hello,
   I have a 20 bit Boolean array that I need to convert into a digital waveform. Is there a easy way to do that?
Regards,
Kaspar
Regards,
Kaspar

Hi xdaf,
The reason why this VI takes in a 2D array is because this is often used to create digital waveforms with multiple channels and therefore, every row would correspond to data for each channel. To go around this problem, you may simply increase the dimension of your 1D array to a 2D array by feeding it in a Build Array function. Note that although you are increasing it's dimension, you are not adding any new data.
I hope this answers your question.
Message Edited by S_Hong on 12-03-2008 02:03 PM
S_Hong
National Instruments
Applications Engineer
Attachments:
Digital Waveform.png ‏2 KB

Similar Messages

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

  • 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

  • Equivalent of Split Signals for digital waveform

    Hi , I read multi digital waveforms in a loop and I would like to split the channels. For analog waveform I can simply use split signals control. How about digital waveform, is there any equivalent for digital channels?

    You can use firstly "Digital to Boolean Array VI" to get a 2D boolean aray equivalent of Digital Waveform samples...!!
    But remember at this step, the sampling rate information (dt) will be lost (after you've converted the digital waveform to 2d array of boolean)...
    Now next, if I'm not wrong, here each column would represent different waveforms...!!
    At last, you can use "Boolean Array to Digital VI" to convert 2d array of boolean back to digital waveform...!! You will require dt (sampling rate info) here at this step...!!
    Additionaly to extract sampling rate info from the digital waveform, before you convert it to boolean array, you can use "Get Waveform Components (Digital Waveform) Function"
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • 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

  • Digital waveform to boolean value

    Hi, I have a digital waveform and I want to be able to light up an LED on the front panel every time the waveform is high...
    What is the best way to do this?
    I know there is a vi that converts a digital waveform to a 2D boolean array, but I just want a single boolean value.
    Thanks!
    Sunny

    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

  • Invert Digital Array, or Invert Boolean Array

    Is there an elegant way to invert a digital array so that every 0 becomes 1, and every 1 becomes 0? Or is it possilbe to invert a Boolean array so that every True becomes False, and every False becomes True?
    Thanks,
    Ron
    (I'm currently using a "Select" too and placing a "F" on the top, and a "T" on the bottom.
    Solved!
    Go to Solution.

    rsi77,
    You can Xor the array with TRUE:
    Rgs,
    Lucither
    "Everything should be made as simple as possible but no simpler"

  • ASC file to 2D boolean array

    Hey guys,
    I was wondering if there is a method of uploading an *.ASC or *.DAT file to convert into a 2-D boolean array.
    For example, I would create an .asc or .dat file composed of strings using MATLAB to generate
    1 1 0 1 1 0 1 1
    0 1 0 0 1 0 0 1
    1 0 0 1 0 0 1 0
    and it would convert the string to a 2-D boolean array of
    T T F T T F T T
    F T F F T F F T
    T F F T F F T F
    so that I can ultimately use it to create a modified Digital waveform graph like this:
    The purpose is because I will be using sample rates of 0.1 second intervals that spans to 2-5 minutes.
    So to sum it up:
    1. upload a *.ASC or *.DAT file with a 2-D array strings
    2. convert the file to create a 2-D boolean array for use to create the digital waveform
    Any help will be appreciated. I know it isn't much but I've uploaded the 2-D array to waveform *.VI for testing purposes.
    Solved!
    Go to Solution.
    Attachments:
    boolean_array.vi ‏14 KB

    sdkpark wrote:
    However, when I tried that first, it doesn't know how to separate each column of the *.asc file
    1 0 0 1 0 0
    0 1 1 0 1 1
    turns out just to read the first column
    Please attach your VI instead of a meaningless picture.
    Read from spreadsheet file will read all 2D data if used correctly. The defined delimiter is separating items, and linefeed separating rows. For example if you don't wire the delimiter, it will assume "tab" and only one value will get read per line if it is actually a space character. Try a delimiter of "space".
    LabVIEW Champion . Do more with less code and in less time .

  • 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

  • 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

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

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

  • How to do a digital waveform subtractio​n

    i am trying to subtract two digital waveform using subtract operation, but it seems that the subtraction opertation doesn't like digital waveform.
    error message:"You have connected two terminals with different types. the type of the source is digital waveform, the type of the sink is double"
    anybody can help? please.

    Hello,
    See the attached modified example. Now you can access data in a 2D array .
    Software developer
    www.mcm-electronics.com
    PS: Don't forget to rate a good anwser ; )
    Currently using Labview 2011
    PORTUGAL
    Attachments:
    dither tech2.vi ‏57 KB

  • How to change the elements number in Number To Boolean Array Function VI

    Hi, I'm working on using the DAQ digital output to control the digital input of a DAC, and I used the Number To Boolean Array Function. VI to convert the number to a Boolean array. The maximum number should be 4096, therefore it should consist of 12 elements.
    For the description of the VI, it says Boolean array returns an array of 8, 16, 32, or 64 elements, depending on the number of bits in the integer. Therefore, I change the number of the channels in task to 16, but it still doesn't work. Any suggesitions are greatly appreciated.
    Thanks!
    Possible reason(s):
    Write cannot be performed, because the number of channels in the data does not match the number of channels in the task.
    When writing, supply data for all channels in the task. Alternatively, modify the task to contain the same number of channels as the data written.
    Number of Channels in Task: 12
    Number of Channels in Data&colon; 32
    Task Name: _unnamedTask<1B>
    Solved!
    Go to Solution.
    Attachments:
    DAC test.vi ‏47 KB

    Once you have the boolean array, you can resize it using array tools. For example you can use "reshape array" with a lenght of 12 to trim the array to 12 booleans elements (you can also use array subset).
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for