DBL to binary indicator/array?

Hi, I have a DBL data type value that is 2^48 & I need to convert it to bits (form of; a binary array?)& display "LED" indicators on the front panel. All LabVIEW array/conversion tools only allow 32 bits @ the most. The ideal display form would be 6, 1 byte lines with the 1st byte being the MSbyte & the last byte being the LSbyte. Can you help?

I have attached an example that illustrates how you can accomplish this task. I just threw it together so you may want to clean it up a bit. I should also warn you that floating point numbers are inherently not exact. So although you enter 2^48 as a double, it isn't stored precisely as this number.
Matt Kisler
Applications Engineer
National Instruments
Attachments:
3351.vi ‏35 KB

Similar Messages

  • Read indicator array

    Hello,
    I save my measurement values in an indicator array, first measure (1000 values) in row one, second measure (1000 values) in row tow and so on.
    After my measuarments I want to read the array, for example to select one part (function array subset). How can I read an indicator array?
    Thanks

    You are right, I can save it. I only thought there is a way to hold the values in an array and using later. I knew this kind of old fashion programming form other languages, but labview is diffrent. I think my question is answered. Thank you.
    I used shift register and I think it works. You can look at the picture. Maybe there are some other ideas.
    Attachments:
    Bild1.jpg ‏103 KB

  • Binary Indicator for Digital Output Device

    This probably simple question to most of people but there is always a first time to do a new thing/thing that we never have done.
    I have NI 9472 which is a digital sourcing device, I have no problem to control it using LABView to output the result (line 00000000).  I also would like to have some indication on the computer screen using LED array.  I am able to create an binary array indicator but fail to connect the decimal input to the binary array.
    Please help/provide some hints, it is appreciated.
    Solved!
    Go to Solution.

    I'm with Dennis.  Just use a numeric indicator.  Set the representation to U8.  Right-click on it and select Visible->Radix.  Right-click again and choose Display Format.  Choose the Advanced editing mode and put in %08b.  The result will give you an indicator like this.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    binary numeric.png ‏2 KB

  • Binary String to numerical binary array

    Hello,
    I initially created binary strings from numerical numbers using the
    "%03b" command on the 'Format into String' block. I then concatenated
    the various strings into one string that is now composed of 16bits.
    However, I need to convert this string that I created back to a binary
    numerical array for further processing.
    Can you help me with this?
    Thanks,
    Rajesh.

    triniboy wrote:
    I initially created binary strings from numerical numbers using the
    "%03b" command on the 'Format into String' block. I then concatenated
    the various strings into one string that is now composed of 16bits.
    In general, you are out of luck, because the number of characters for each value when formatted to binary with "%03b", will be variable. Any number greater than 7 will use more than 3 digits. (since you use "03" instead of 3", smaller numbers will have three digits with possible leading zeroes for padding).
    After you concatenated all the formatted strings, you loose all boundary information unless ALL numbers are less than 8, but in this case they result would be a multiple of 3 and would not add up to 16 bits, right?
    My best suggestion would be to NOT create a binary formatted string in this way, because it is a one-way operation and cannot be undone because you loose information in the process.
    Back to square one!
    Maybe we can backup a few steps and you can explain to us what you really want to do with your original numbers. Why would you even consider formatting them this way? Do you need to save them to a file for later retrieval, for example?
    LabVIEW Champion . Do more with less code and in less time .

  • Binary 2D image array

    I'm lookking for a solution for this problem: I have a binary 2D array of an image. Now I want to search for and count all "1" (= high) values in the 2D array. Please help me to solve this problem. Thx.

    I don't know what a "binary image array" is, but if you mean a 2D boolean array, you can wire it into Boolean to (0,1) and wire the output of that into Add Array elements (Boolean and Numeric palettes).
    If that doesn't help, you should post your VI so we can see what your array looks like.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • Array blink indicator

    Hi,
    Basically I have two same size arrays for control and indicator.
    If I enable some elements in "array", and I like to see "indicator" array to blink
    during the execution.
    Labview version used: 8.6.1
    I attached test case for your reference.
    Can someone help me on this?
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    indicatorblink.vi ‏10 KB

    Two hacks for the price of one.  Even after customizing the Blink foreground color, I found that blinking boolean arrays were annoying at best to downright buggy on my system (LV8.2.1).  Just moving the mouse over the indicator would cause trouble.  Plus, I sometimes like to change the blinking color programatically.  Hence hack #1, the old standby of using a timing loop to alternate the True color of the boolean elements. 
    The second hack is just there since it was a convenient starting VI to implement the first hack, the control array allows at most one true element.  If you don't want this behavior, simply remove the boolean mess in the event case and wire NewVal to the indicator array. I have an alternative which forces at least one element to be true.
    Attachments:
    BlinkingArrayHack.vi ‏110 KB

  • How to display an array in a VB form

    I am new to Measurement Studio. This could be a silly question.
    I am so used to the front panel in Labview where you can have control/indicator arrays. You can expand an array to see several values at the same time. Plus you have an index display to scroll.
    Is there any similar feature in Measurement Studio for Visual Basic or Visual C? If not, why not.
    cheers

    No, there isn't currently a tabular or array control provided with Measurement Studio. There are a few reasons for this. First off, remember, LabVIEW is a graphical language, there isn't anything that isn't a control or indicator on a front panel. The array control in LabVIEW is mainly there as the datatype for arrays, not specifically as a UI object, although it is frequently used that way.
    In Measurement Studio, the focus of the User Interface components is adding the controls to Visual Studio that are needed for test and measurement applications. Visual Studio comes with a tabular type interface called the DataGrid control for displaying numeric and string data in a table format built-in. This is what you would want to use to display arrays. We
    would definately consider adding a table type interface if our users needed a lot more functionality than was provided by the Visual Studio DataGrid control.
    I know it can be frustrating going back and forth between the tools and seeing different things available. Remember, they are designed for different users though. Measurement Studio is designed to equip Visual Studio programmers to do Test & Measurement programming easily, it isn't designed to provide LabVIEW type functionality to Visual Studio users. So some LabVIEW functionality won't exist in Measurement Studio purposefully, and also some functionality in Measurement Studio that isn't in LabVIEW since it doesn't suit graphical programming.
    Try the DataGrid control, and let us know if it doesn't meet your needs.
    Best Regards,
    Chris Matthews
    National Instruments

  • Digital Input VI boolean indicator

    I am using the Example VI Digital Input as part of Fieldpoint.
    It works fine on its own.
    That is, I can place a voltage across the terminals of the DI module and the respective Boolean LED lights up on the front panel.
    I'd like to use the VI as a subVI for another program.
    I wired the connectors of Digital Input.VI connector pane such that the Fieldpoint IO Input and Boolean indicator array have connectors.
    I placed the Digital Input.VI in the block diagram of another VI and created an indicator on that VI to see the status of the array within the Digital Input.VI.
    Running the higher level VI and the boolean array on it is disabled (greyed out) but the boolean array on the Digital Input.VI is working properly.
    Any ideas?
    I'm just looking for a way to obtain a status bit type response to be used elsewhere.
    If one of the DI module channels is set high then the bit would be set (LED on) in my higher level VI.

    Alright, found that if I just take out the guts (Fieldpoint IO, FP Read, Type, Boolean indicator) and use that in my VI all works well.
    Now all I need to do is determine what bits are set and act on set bits.

  • "You have connected two terminals of different types" Index Array won't work

    So I have a 3D array finally. Now I want to index that array and display the contents of a certain element on a new array. When I index a 2D array, this method works just fine. But when I change it to 3D array, Labview gives me the following error:
    You have connected two terminals of different types. The type of the source is string. The of the sink is 1D array of string.
    So I'm assuming the 1D arry it speaks of is referring to the indicator array that the index should spout out the contents of the element I'm looking for. And the source string is the 3D array. I've tried changing the dimensions of the 1D array to match that of the source 3D array, but nothing is working yet. I've attached a pic of the problem below.
    Attachments:
    LVerror.JPG ‏20 KB

    This might be another problem of understanding what the data represents.  You are telling the code that you have a 3D array, and you want to pull out a single element, a scalar string, by specifying the row, the column and the page to find the data.  But then you are trying to display this single item into a indicator that is a 1D array.  You are trying to display a single cell of data, into a column of data.  Either replace your 1D array with a scalar string, or when you index your array specify a row or column to display.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Passing arrays from matlab to vi-controls by activex

    Dear specialists,
    I am trying to set an array of doubles that is defined as a control in my VI by using:
    invoke(VIhandle, 'SetControlValue', mlarray)
    where mlarray is defined in Matlab as an 1xn array of doubles.
    error: ??? Dispatch : Exception occurred
    in routine: actxcli
    Reading an indicator array in the VI by 'GetcontrolValue' works fine.
    Also passing non-array variables works fine.
    How should I define my array in Matlab/Labview to make it work ?

    I do not have a copy of Matlab but I can help you search the web. Is your error from windows, matlab, or labview? I could find nothing on NI's site for actxcli. Is this the exact error message?

  • Array of buttons with different boolean text ?

    I'm looking for a method of displaying a 2D button matrix with
    different boolean text on each button. It seems an array of booleans
    must all have the same text. Perhaps a cluster could be used, but the
    array makes button alignment easy and easy to determine which had been
    pressed (radiobutton style with only one button true at a time).
    Steve

    On 6 Dec 2002 05:31:21 -0800, [email protected] (humenik) wrote:
    >[email protected] (Steve Parus) wrote in message news:<[email protected]>...
    >> I'm looking for a method of displaying a 2D button matrix with
    >> different boolean text on each button. It seems an array of booleans
    >> must all have the same text. Perhaps a cluster could be used, but the
    >> array makes button alignment easy and easy to determine which had been
    >> pressed (radiobutton style with only one button true at a time).
    >It's easy to make them individuals in a cluster, and on the block
    >diagram use Cluster To Array to get it into array form for
    >manipulation. This can be superior to an array of buttons, not merely
    >because the buttons can thereby have differing colors and text. An
    >array of buttons cannot have the buttons Latched When Pressed; when in
    >a cluster, however, the latching action is available.
    When might that Latched When Pressed behavior be useful ? Using a 2D
    array of buttons (not cluster), in LV 6.1, a Value Changed event for
    the array can be used as you mention below to XOR the event's OldValue
    and NewValue and wire that to a local variable copy of the array.
    This easily gives a radio button effect for the entire 2D button
    matrix. The array control automatcially arranges the visual
    alignment of the buttons.
    For the cluster method, I'd like to programmatically change which
    button is true. All the approaches I come up with end up using
    Array-to-Cluster which then requires the cluster size to be specified.
    I may end up wanting to programmatically vary the number of buttons in
    both dimensions and hence the cluster size. LV's Align Objects and
    Distribue Objects ends up making the button visual alignment not
    difficult (for a 12 x 8 matrix).
    >Try this: take a cluster of four PB's (latched when pressed) put
    >inside a while loop. Initialize a boolean array of 4 to FALSE outside
    >the while loop, and attach it to a shift register input on the left
    >side of loop. Inside the loop, convert your cluster to an array. XOR
    >the shift register with this array from the buttons, and wire this to
    >the output shift register and to an indicator array. Set the boolean
    >to the loop so it will run free and start it up; on the control panel,
    >click on the PB's and you will see the outputs toggle.
    >
    >Greg

  • 1D Index Array Extraction

    Hey all,
    I'm relatively new to using LabView and cannot figure out how to get this done.
    I have 2 arrays, aray A and array B. I want to look up the specific values from Array B by analyzing Array A first and noting what locations, indexes, they are. 
    From Array A I am able to locate the locations, but it is in the form of a 1-D array of double. Now that I know the indexes of locations in interest,how do I extract the data from Array B? 
    When I try to use Index Array LabView gives the following error, 'source is 1-D array and sink is long'. Any help would be greately appreciated on how I can extract the data points from Array B by having an array of indexes of interest.
    Example of what I'm trying to do
    Input:
    Locations / Indexes: 1  3  4
    Waveform Array: 0  2   4  6  8  10
    Output:
    0  4  6 
    Thank you for your time
    Solved!
    Go to Solution.
    Attachments:
    progress.vi ‏28 KB

    Arrays are 0 indexed so locations 1,3, & 4 should be 0, 2 & 3 if you want those output values.  Attached is a pic of the code to do this. Be sure to disbale indexing on the data set and allow indexing on the 'location/indices' array. 
    Attachments:
    ex code.png ‏17 KB
    ex code.jpg ‏41 KB

  • Lock elements of array true when the input element becomes true

    I am working on a project in which I want to create an alarm for any number of inputs.  Any time that there is a input that is out of range, an alarm will be indicated.  I would like the indicated alarm to persist until the user pushes a reset button, even if the out of range condition is removed.  In addition, new alarm indication may occur and should also persist. 
    In the VI below, the Alarm Dummy Control is used to generate alarm(s).  I want the Alarm Indicated array to maintain any element that had or currently has a true (alarm element).  Every alarm will persist until the manual reset is pushed.  
    I am sure there is a simple solution, but I am drawing a blank right now.  
    Solved!
    Go to Solution.
    Attachments:
    Alarm Test.vi ‏21 KB

    You can operate on the array directly, no FOR loop needed.
    Here's a very quick draft. See if it can give you some ideas.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Alarm TestMOD.vi ‏13 KB

  • How to control string indicator?

    我想将一个1D string array 或2D string Array的元素按顺序逐个读出并按行显示在面板的string indicator里面,
    新的显示不要覆盖旧的,最后可以在string indicator里面看到array 的所有元素..请指教..

    Please see attached as reference...
    For posting in Chinese Language, please go to NI LabVIEW,CVI,数据采集等产品讨论区
    NI 的中文论坛... NI LabVIEW,CVI,数据采集等产品讨论区
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    1D or 2D to String.vi ‏39 KB

  • 2 parts: 1) integer array to string 2) string out to a jTextField

    I am completely new to Java and Netbeans, but I'm writing my 1st
    application that takes a "hex" character input from a jTextField,
    then converts it to an "binary" integer array. I then do a lot of bit
    manipulation, and generate a new "binary" integer array.
    String myhex = jTextField1.getText();
        int len = myhex.length();
        int[] binarray = new int[len*4];
            for (int i = 0; i < len; i++) {
               if (myhex.charAt(i) == '0'){
                  binarray[4*i]=0;
                  binarray[4*i+1]=0;
                  binarray[4*i+2]=0;
                  binarray[4*i+3]=0;
               else if (myhex.charAt(i) ==
               // repeat for '1 to 9' and 'a-f/A-F'
               // generate new integer array(s) using various bits from binarrayI realize it might not be the best way to do the
    conversion, but my input can be of arbitrary length,
    and it is my first time trying to write Java code.
    All of the above I've completed and it works...(thanks Netbeans
    for making the gui interface design a real breeze!)
    So I end up with:
    binarray[0]=0 or 1
    binarray[1]=0 or 1
    binarray[2]=0 or 1
    binarray[n]=0 or 1
    Where n can be any number from 0 to 63...
    I then manipulate the bits in binarray creating a new integer array
    and for the sake of expediency let's call it "newbinarray".
    newbinarray[0]=0 or 1
    newbinarray[1]=0 or 1
    newbinarray[2]=0 or 1
    newbinarray[n]=0 or 1
    Where n can be any number from 0 to 63...
    I first need to know how to convert this "newbinarray" integer array to a string.
    In the simplest terms if the first three elements of the array are [0][1][1],
    I want the string to be 011.
    Then I want to take this newly formed string and output it to a jTextField.
    string 011 output in JTextField as 011
    I've scoured the net, and I've seen a lot of complex answers involving
    formatting, but I'm looking for just a simple answer here so I can finish
    this application as quickly as possible.
    Thanks,
    Thorne Kontos

    Here's an example, not using NetBeans:
    import javax.swing.*;
    public class TextDemo extends JPanel
        public TextDemo()
            int[] newbinarray = {0, 1, 1};
            StringBuffer sb = new StringBuffer();
            for (int value : newbinarray)
                sb.append(value);
            String st = new String(sb);
            this.add(new JTextField(st));
        private static void createAndShowGUI()
            JFrame frame = new JFrame("TextDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add(new TextDemo());
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args)
            javax.swing.SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShowGUI();
    }

Maybe you are looking for

  • Logical Port

    Hi. I have downloaded a wsdl file from a BAPI in r/3 4.7. I have created a Proxy object in neatwever 2004s client. I created the logical Port for the Proxy Class. When I tested the Proxy class I get the followinf error <CODE>ERROR_WEBSERVICE_RUNTIME_

  • Flex 4: How 2 Set Application Height/Width with Script?

    I am new to Flex 4 and going through the 3 to 4 migration pain. I need to set the size of my application programmatically. In Flex 3, I did it this way: mx.core.Application.application.width  = theWidth; (equivalent for height). I can not figure out

  • Number of messages in issue output invoice

    Hi developpers, there is a method for the determination of default for user of the numbers of copies to print. Thanks in advance!!!! Domenico

  • Change photo album view to filmstrip

    Hello, I am very new to using dreamweaver and fireworks. I created a photo album in fireworks and have created a link to it from my webpage, I now want to modify it to show in filmstrip as opposed to the thumbnails that were set up by default, any id

  • Centering a photo when printing

    I've cropped a photo (constrained as "square") and would like to print it as a 5" by 5" square centered on an 8-1/2" by 11" page. I can't seem to find the proper Print Setting to accomplish this. Am I missing something, is there a simple work-around,