How do I convert an array of BYTES (where each BYTE represents a bit) into a single Hex number?

I am reading a signal from a USB-8451. This signal is stored as an array where each element represents a bit in the signal, but is stored in the array as a byte. How do I convert this array into a single Hex number. I attatched what I have so far, there are a few extra things to help me see what ia going on. One code uses Queue and the other uses arrays, let me know if you can help.
Attachments:
845x_EEPROMarrays.vi ‏27 KB
845x_EEPROM.vi ‏26 KB

mkssnwbrd wrote:
... so we can't introduce any other forms of signals or power into the circuit other than what the circuit already has. Trithfully I don't really know how I2C devices work, but my mentor here says that we can't use an I2C method becuase it will introduce voltage into the circuit and may damage out TCON chip.
That makes absolutely no sense. What do you think is happening when you write the digital lines? You're setting a pin high. That voltage is being generated by the 8451x. I think you're not understanding what your mentor is saying. If it's an I2C device then you should be able to use the I2C function to simply talk to it. You still have not indicated what the device is, so there's little more I can say about that aspect of it.
As far as the conversion is concerned, you basically need loop through your array of "bits", taking 16 at time since you said you have 16-bit values. It's not clear from your code whether your eventual goal is to get a numeric value or a string. This does not appear to be a subVI, so a simply numeric indicator formatted to display in hex format should be quite adequate. The array you are generating is an array of rings, whose datatype is I32, but they will have values of 0 or 1. You can use the example just posted, or you can use the attached variation.
Attachments:
Bits to Hex 2.vi ‏17 KB

Similar Messages

  • How can I convert an array off byte into an Object ?

    Hi folks...
    I�m developing an application that comunicates a PDA and a computer via Wi-Fi. I�m using a DataStream ( Input and Output ) to receive / send information from / to the computer. Most off the data received from him is in the byte[] type...
    How can I convert an array off byte ( byte[] ) into an Object using MIDP 2.0 / CLDC 1.1 ?
    I found on the web 2 functions that made this... but it uses a ObjectOutputStream and ObjectInputStream classes that is not provided by the J2ME plataform...
    How can I do this ?
    Waiting answers
    Rodrigo Kerkhoff

    There are no ObjectOutputStream and ObjectInputStream classes in CLDC. You must know what you are writing to and reading from the DataStream. You should write the primitives like int, String to the DataOutputstream at one end and read those in exactly the same sequence at the outher end using readInt(), readUTF() methods.

  • How can I convert an array to image(8bit)

    I can convert an array(acquire from usb camera)to a picture,but not images(8 bit grayscale),how can I do it.many thanks!
    Attachments:
    array to image.vi ‏249 KB

    Sorry, this is the kind of thing that happens when you have been out for too long.
    Message Edité par chilly charly le 10-22-2006 11:09 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    array%20to%20image[1].png ‏3 KB

  • How can I convert an array with varying length into a cluster

    Hi,
    I need to convert an array of n elements into a cluster. Usually, it only involves the "Array to Cluster" function. But since the array length is not constant and the number of elements in the function is constant and can not be changed programaticaly, I need to find another way to do that.
    Any ideas?
    Thanks.

    Hi,
    I also tried to do this but without success. I think that's not possible.
    For me it's a general problem using labview. I often wanted to generate standard controls dynamically which is not possible (or I haven't found the solution yet). So I think that's the reason why you can't create a cluster during runtime (the program would have to add controls dynamically to the cluster).
    Do you have an upper limit for your array-size? Although it needs a lot more memory, it would be a possibility to create the cluster with the maximum number of elements.
    If you don't have a maximum, you will have to look for another way, I'm afraid.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How can I convert (or switch) the RGB percent values from the LR histogram into RGB values which are shown e. g. in PS/CameraRAW?

    In LR 5.5 (same in previous versions) the RGB values in the histogram are shown in percent (relativ) values. I prefere to see the absolute values, but I can`t find any way to switch. Maybe this option is intentional disabled, because LR works in 16-Bit mode this would result in values up to 2^16. But as i compared the relativ values from LR with the absolute values from PS i run into a conversion problem. The following example shows the differences:
    CameraRAW : RGB, 128,0,0
    Lightroom: RGB, 43,8%, 19,0%, 6,2%
    CameraRAW: RGB, 0,128,0
    Lightroom: RGB, 29,8%, 47,5%, 17,5%
    Mainly i have two questions:
    1. Is there any possibility to change the percent RGB values in LR to absolut values?
    2. How can i convert CameraRAW values to LR values (see above)?

    TThe reason that a design decision was made from the beginning of LR to show only the percentage values was that RGB values are dependent on the color space and the LR histogram and numerical readout are derived from the Develop module's display space which is a hybrid color space with ProPhoto RGB primaries and the sRGB TRC. Thus the numerical values in the display would be different from the exported RGB image (in an orthodox space) and it was feared that this would be misleading. When soft proofing was introduced, because it involved converting the display to an orthodox space, it became possible to use the 0-255 scale in that mode.

  • How can I convert an array to a waveform in signal express

    hello friends,
    I have imported a labview VI in signal express. After processing the data in VI , I have stored the result in a form of array. Now I want to see this array in a form of waveform in signal express. How to go about it. 
    Vipin

    Sorry, this is the kind of thing that happens when you have been out for too long.
    Message Edité par chilly charly le 10-22-2006 11:09 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    array%20to%20image[1].png ‏3 KB

  • How can I convert an array into a .wav file?

    I have an array of points that I need converted and written into a .wav file. Any help?

    Indeed there is!
    Look at the attached vi....that's about all there is to it!
    Good Luck..
    Eric
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705
    Attachments:
    ARRAY_TO_WAVE.vi ‏17 KB

  • How To Read/Modify/Write Array?

    Ive got a bunch of switches, where each switch represents a bit in a
    word...
    So from each switch, in the control panel, it goes throu a boolean to
    integer vi, and then to a x*2^n vi.
    I then set a constant for each n.. so that if the switch is true (x=1
    after the conversion) and n = 5 for that switch,
    then the output will be 1 * 2^5.
    Finally, I add all 16 outputs together (x*2^0 to x*2^15) to create a
    word.. I actually have so many switches
    that I have a couple of words (each made up with the above scheme)!
    So far, this works fine, however, my question is, I would like to have
    a global array that contains these words. I
    dont want to insert this word into the array, but rather, I'd like to
    sort of latch the values...
    If in the array's word, the n bit was already one (i.e. that switch at
    one point was on), then I dont want to reset it
    to 0, even though the switch is off now.
    This probably sounds confusing, I know I am confused just reading that
    back, anyhoot, if I could make a global
    array (ten 16-bit unsigned words), that I can read any word from,
    modify it and set it back to its same place,
    that would be great!

    Hi Anonoymous
    Here's one quick example that does what you want, it functions like a function global and relies on boolean logic.
    For your own experience I challenge you how to reset just one bit or word.
    Also you have to connect the connector pane.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    quickbitregister.vi ‏20 KB

  • How to convert an array collection instance to a complex object for interaction with webservice

    Hi there,
    I have a stubborn problem that I am trying to work out the best way to solve the problem.  I am interacting with a WebService via HTTPService calling a method called find(String name) and this returns me a List of ComplexObjects that contain general string and int params and also lists of other Complex Objects.  Now using the code:
    ArrayCollection newOriginalResultsArray = new ArrayCollection(event.result as Array)
    flex converts my complex objects results to an arraycollection so that I can use it in datagrids etc.  Now up until this part is all good.  My problem is when getting a single instance from the results list, updating it by moving data around in a new datagrid for example - I want to interact with the webservice again to do an create/update.  This is where I am having problems - because these webservice methods require the complex object as a parameter - I am struggling to understand how I can convert the array collection instance back to my complex object without iterating over it and casting it back (maybe this is the only way - but I am hoping not).
    I am hoping that there is a simple solution that I am missing and that there is some smart cookie out there that could provide me with an answer - or at least somewhere to start looking. I guess if I have no other alternative - maybe I need to get the people who built the service to change it to accept an array - and let them do the conversion.
    Any help would be greatly appreciated.
    Bert

    Hi Bert,
    According to my knowledge you can use describeType(Object) method which will return an XML... That XML will contain Properties and values just iterate through the XML and create a new Object..   Probably u can use this method...
    public function getObject(reqObj:Object,obj:Object,instanceName:String,name:String=null,index:int=-1):Obj ect
                if(!reqObj)
                    reqObj = new Object();
                var classInfo:XML = describeType(obj);
                var className:String = instanceName;
                if(name!=null)
                    className=name+"."+className;
                if(index!=-1)
                    className=className+"["+index+"]";
                for each (var v:XML in classInfo..accessor)
                    var attributeName:String=v.@name;
                    var value:* = obj[attributeName]
                    var type:String = v.@type;
                    if(!value)
                        reqObj[className+"."+attributeName] = value; 
                    else if(type == "mx.collections::ArrayCollection")
                        for(var i:int=0;i<value.length;i++)
                            var temp:Object=value.getItemAt(i);
                            getReqObject(reqObj,temp,attributeName,className,i);
                    else if(type == "String" || type == "Number" || type == "int" || type == "Boolean")
                        reqObj[ className+"."+attributeName] = value; 
                    else if (type == "Object")
                        for (var p:String in value)
                            reqObj[ className+"."+attributeName+"."+p] = value[p];
                    else
                        getReqObject(reqObj,value,attributeName,className);
                return reqObj;
    Thanks,
    Pradeep

  • Problem converting U8 array to date-time string

    Hi All,
    How can I convert U8 array (time_t data type from C dll) to date time string?
    A dll function that I am calling has a structure of string, integer and time_t as one of the parameters. Instead of passing cluster, I pass an array of U8 of the size that the structure should be. All the members of the strcuture and parsed correctly except the date/time.
    Function Parameter:
    typedef struct {
    Int AlarmState ;
    Int AlarmGrade ;
    TCHAR AlarmMessage [100] ;
    time_t AlarmTimeStamp ;
    } WV_ALARM_INFO ;
    Total size = 4 + 4 + 100 + 4 = 112
    Using Call Library Function, I set the parameter type to Array of U8 and size 112.
    After the array is populated when the function is called, I have done the following to interpret date and time.
    1) Using Extract Zero Terminated String.VI I converted U8 array (of size 4) to string.
    2) Type casted string to integer (I32).
    3) Swap bytes
    4) Swap Words
    5) Format Date/Time String.
    Please see the attached screenshot for visual display of the above.
    Ideas on why the year is incorrect?
    Mimansa
    Attachments:
    Time.JPG ‏102 KB

    Hi Mimansa,
    Is it only the year that is incorrect? Also, where did you find that ABC\0 VI that you use 3 times? Did you make it or is it in a labview library somewhere?
    Thanks,
    Laura

  • Want to convert an array to image in gray scale

    i have an image that i have read into the vi. using the draw unflattened pixmap , i have an array of numbers .after some mathematical computations on the array i should be able to convert the array back to the image. how can i convert from array to image.and then from image to gray scale?

    I am not sure what you are doing. Can you post a simple example program?

  • How to adjust a "control array" size

    I have a program that creates a digital PWM signal with variable duty cycle. The duty cycle changes every 50 ms, but the overall wave frequency stays at a frequency determined by the user. I have the VI attatched.
    My problem is this...I need to be able to control the overall cycle time. This means the size of my array of duty cycles needs to adjust based on the cycle time (i.e. a cycle time of 1 second would require 20 of the 50 ms slots, while a 1.3 second cycle would need 26).
    I currently have only 4 slots in my array, meaning the total cycle time is .2 s. I understand how to manually add and remove elements to the array, but I can't figure out how to add a control to it so that the array size changes automatically, allowing much quicker entry of data. As of now I can make it work, it just takes super long to add or delete array elements. The ideal situaton would have a constant control for cycle time divided by 50 that would change the array size.
    I can't find any info on this, and I think I even saw a post asking that this kind of feature be added. I'm relatively new to this program.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    var_duty_cycle.vi ‏25 KB

    Currently, your VI is a one-shot deal. What you need is a state machine that updates the pct duty cycle array control as a function of the frequency while the current I/O code is idle.
    I would use an array of clusters, where each cluster contains e.g. a sequence number, a duty cycle, and a string as element label. Show the scrollbar and set the size whenever the relevant inputs change. Do you want to reset the current setting when the number changes or do you want to retain the current settings as much as possible? You could just use the existing values, reshape to the larger or smaller size, and write it back to the control via a local variable. Set all elements  except the percent to disabled so they act as indicators and cannot be changed by the user.
    (You also need to program around it if the operator tries to manually add more elements. A better solution would be this idea, so vote for it .)
    Some more general comments bout your code:
    Why do you use extended precision floating point. All your waits are internally just integers. EXT makes no sense
    There is a primitive for 1/x. However, you could just do a 1000/x and eliminate the multiplication afterwards. SInce you are dealing with integers, you can even do the division using quotient&remainder. Depending on the allowed frequency range there are possibly no orange data needed at all.
    Make the diagram constant representation match the rest of the code.
    The pulses/50ms indicator belongs before the loop. No need to recalculate and refresh it over and over from the same input values.
    LabVIEW Champion . Do more with less code and in less time .

  • How do i output multiple arrays from a case structure to create one larger array

    I currently have a vi that has one hardware input that i needed to take a measurement then be moved and take a similar measurement at a different point.  To accomplish this i used a while loop inside a case structure.  The while loop takes the measurement  and finds the numbers i need while the case structure is changed per the new measurement location.  I want to take the data points i have created in each case and output them into a single table.  I assumed to do this the best way would be to get the data from each case into its own built array and build a larger array but I cant get the information out of the case structure so that it all inputs at different places.
    thanks for your help
    Attachments:
    Array.vi ‏30 KB

    Hi Ross,
    attached you will find a solution for your table building problem.
    I would suggest thinking about program design - having the same case content in several cases doesn't make sense. I also would not want my user to press several stop buttons depending on choosen measurement...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Array.vi ‏45 KB

  • How can i combine an array of string and an array of integers ?

    i have an array of string data [to be used as header], and an array of multiple column integer vakues;i need them together in one file. 
    Am not able to combine them so that i can write them into a single file.
    Solved!
    Go to Solution.
    Attachments:
    string file input.txt ‏1 KB
    Test build_1.vi ‏13 KB

    There are a few ways you can do this.  What I recommend is:
    Open the file
    Use the Array to Spreadsheet String to turn your headers into a single string
    Write this to the file.
    Use the Array to Spreadsheet String to turn your numeric data into a single string
    Write this to the file.
    Close the file
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can I convert digitally signed PDF's so I can combine them into a single multi-page PDF?

    We are an architectural firm and we receive drawings from consultants as PDF's that are digitally signed.  In order to combine all of our drawings into a single PDF, we currently send the PDF's to a printer, have them printed, and scan them as new PDF's.  This process reduces the clarity of the PDF and re-printing the scanned PDF's reduces the clarity even further.  Is there a way to "flatten" or otherwise convert the digitally signed PDF's so we can combine them into a single multi-page PDF?  Making a portfolio is not an option.  We need an actual multi-page PDF for a variety of reasons.  This problem is actually preventing our office from using digital signatures so any help would be greatly appreciated.

    You can't. There was a discussion on this Forum a few months ago on this subject. Look it up for more info.

Maybe you are looking for

  • Using SET COUNTRY in SMART forms

    Hi All, We have used SET COUNTRY 'GB' in the smart forms initialization code editor. But it is not reflecting currency formats & date formats in the country specific formats. I have to change the setting only in smart forms code only as i will not be

  • HT5177 So, does it support video with .MTS format?

    Just dont understand why it cannot be more clear about supported format.  Its cofusing for non professional on video editing.

  • Moving iweb/mobileme archive files to wordpress

    I was able to pull my more current posts from my iweb/mobile me site to my new site using an xml import. However, the xml file for older posts in the archive only contains headlines - no copy which means it facilitates importing a bunch of headlines

  • 3D Chart Angle

    I have six charts on one page...all bar charts... how do I make the 3D angle on all of them match each other? Right now they are all kind of crazy... thanks, ~r

  • Multiple header pages

    I am creating a large report where the header section spans 2 pages. Currently, reports prints just the first page in the header section. How can I get the other page to print? I tried the vertical panels per page property, but that doesn't seem to w