How do I read a hex value and then convert to the binary equivalent?

I am reading hex values from a register on my unit under test. I only want to monitor certain bits in the hex value to check a status. I have everything down to run the program except how to read my hex values in binary form. Any suggestions out there?

If this is just a matter of display, then right click and choose "Format & Precision...". Beware, this works only with integer indicators (I8/16/32 and U8/16/32).
If the problem is to extract a bit value in a specific position, then go to the "Advanced >> Data manipulation" sub-palette where are all bit manipulation functions (rotate, shift, split...).
Don't forget either the logical functions (And, Or...) in the boolean sub-palette, where is also the "number to boolean array" function (to be used in conjunction with an index array node).
Another option is to use string conversion functions, in the "String >> String/Number conversion" sub palette.
Have a look to the attached image.
Enough ?
Chilly Charly    (aka CC)
         E-List Master - Kudos glutton - Press the yellow button on the left...        
Attachments:
Hex_&Bin.tif ‏20 KB

Similar Messages

  • How can i read every"number" value and not only the 1st?

    in the vi only the first "number" value(from the data acquisition)is read in the small loop.how can i make every value to be read?every value must be compared with the "numeric" constant,and,if greater the led must turn on.afterwards,when a value which is less than the "numeric" is found the led must turn off.please answer or send mail to [email protected]
    Attachments:
    oximet5.vi ‏152 KB

    The more I look at your program, the less I understand it.
    Why are you setting number = number in a case if SO2 = ""? number always equals number.
    In your sequence frames 1 and 4, you have no control over which write (date or time) happens first. Just placing one function to the left of another doesn't make it happen first if your wiring doesn't create data dependency. Review the section on Data Dependency in chapter 5 of the LabView User's Manual.
    It looks you're writing to and reading from the same file using Write File and Read Lines from File.vi. Why read back data you just wrote? You have the data on your diagram. If you want to convert it from string to numeric, use a Sring/Number Conversion function from the String palette.
    On Read Lines from File.vi (which I'm not sure you even need), you should use a shift register for the start of read offset rather than a local variable for mark after read (chars.). With a shift register, you can initialize it to 0 when the VI starts. Using a local, if you restart the VI, it will try to startup from where you left off the last time, but you just opened the file for create or replace.
    In your sequence frames 2 and 3, why do you wait for the number to be less than the numeric before writing a carriage return to the file? Also, LabView has a End of Line constant which adapts to the expected value for the operating system. That's generally more flexible than a Carriage Return.
    It looks to me like you're overusing control refnums. You don't need to use a control refnum and a property node to set or read a control's value if you can wire directly to the control's terminal.
    I really don't understand what you're doing with pause and variants. I may be missing the point, but it looks like you made this much more complicated than it needs to be. Why not keep it a boolean?
    For your pause-path, you open the file but never close it. You can lose data that way. You also open it using open function 3, create new file. You'll get an error if the file already exists.
    On a general note, your diagram would be easier to read if you were more selective in how you routed your wires: you have wires on top of wires, wires running under sub-VIs, wires running in the frame of a while loop, wires running under labels.
    I think there's a temptation to overuse sequences. I don't think you need one here. As I mentioned in my earlier message, case structures and shift registers will be more useful to you.

  • How can I change a hex value to normal without changing the characters

    How can I change "3932" (hex displayed string) to "39 32" (normal displayed string with space)
    Solved!
    Go to Solution.
    Attachments:
    Hex to Normal without changing value.vi ‏5 KB

    I think your VI works and if I understand what your input data looks like and the output that you want is, does it?I really can't see a better way. Does it not work for what you want? What form is the actual data in as you receive it? (not how it is displayed by the display setting of the string control) You have the string control set the “Hex display” and that may be confusing some of us as to what the actual input data is.
    And what you want your output to look like. Do you get a “stream” of bytes that are the actual numbers in the form of a string?or Do you get a “string” of ASCII char that represent numbers?
    These are two different things, but may look alike depending on the display setting of your controls are set.
     Changing the display mode of a control or indicator does not change the under lying data. It only changes the way your eye “see” it, not how LabVIEW “sees” it.  We need to know what your raw input string looks like.
    tbob's snipit assume your data is one way and your VI assumes another.
    Omar
    Omar

  • How do i read a text file and then display the content as a string

    I also would like to strip the string from a certain substring and convert the remaining string into an array of floating point numbers. I was thinking of using the read from spreadsheet vi but I'm not exactly sure if that is going to work. Any help would be greatly appreciated.
    Solved!
    Go to Solution.

    Here is what I have so far. What I am trying to do is to display the text file as a string and then strip the "curve" from the text file. I think I did this successfully. Now I want to convert the remaining string into an array of floating point numbers, and display the numbers into an array and on a waveform graph.
    Attachments:
    hw3datafile.txt ‏1 KB
    Q4.vi ‏7 KB

  • How can I load movie on (onPress) and then check if the invoked has not been called by any other members before? Thx

    Hello Everyone,
    I would highly appreciate your wisdom and advice on this
    functionality. Lets say I have two
    movieclips on the stage(ClipA, ClipB). I would like user to
    be able to click on any of them and, this click
    will invode a createclip function which pretty much creates a
    dynamic movieclip and loads
    whatever I assign to it such other existing clips within the
    library. The only problem I have
    makeing the functionality work is that I would like to limit
    the function call to one at a time.
    So if the user clicks on ClipA, function createclip would get
    invoke and will attach the assigned
    movie clip. And when user clicks on ClipB, I would like to
    end the function call that was invoked
    by the ClipA and then then allow ClipB to invoke the
    function.
    Pretty much it would a logic like:
    if(createClip = true)
    end it;
    else
    createClip();
    When a movie is attached, can it be unloaded or unattached?
    I don't know how to write a function that would check if
    function createClip() has
    already been invoked. I would highly appreciate any direction
    in this.

    If the objective is just to get a unique list of authors based on your key, you could use the REPLACE statement in MySQL which functions as an "insert on duplicate key update" type of construct.
    [http://dev.mysql.com/doc/refman/5.0/en/replace.html|http://dev.mysql.com/doc/refman/5.0/en/replace.html]
    Catching an exception to detect dupes is functional but not very elegant. If you use REPLACE then you know your statements will always work. The drawback is that the statement is not portable across databases.

  • How could I choose some bytes from HEX string and then convert it to a decimal value?

    Hi I am working with an OMRON E5EN temperature controller using VISA serial to get data, I send the Read from Variable Area command and get this string  in hexa 0230 3130 3030 3030 3130 3130 3030 3030 3030 3030 3041 3203 71 or .01000001010000000000A2.q in ASCII this string means:
    02 STX
    3031 3030 Node and subadress
    3030 End Code Normal Completion
    3031 3031 Command Read from Variable Area
    3030 3030 respt code Normal completion
    3030 3030 3030 4132 Hexadecimal A2 = 162  (this is the temperature data that I want to show in decimal)
    03 ETX
    71 Block Check Character
    I want to choose the eight bytes for the temperature data and convert it to a decimal number. I have seen the examples to convert a Hexa string to decimal but I do not know how to choose the specifics bytes that I need.
    I have look for a driver but i didn´t find any. I am a beginner so please include especific topics for me to study in your answer.
    Thanks
    Carlos Fuentes Silva Queretaro Mexico 

    If the response always has the temperature starting with byte 15 and is always 8 bytes in length, you can use the String Subset function to get those bytes out of the string.  Then use Hex String to Number to convert to a decimal number.
    Well someone already beat me to the solution:
    Message Edited by tbob on 01-04-2008 04:42 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    HexStr2Decimal.png ‏7 KB

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • How can I add three binary numbers and then convert to string (Hex format)?

    Hi All,
    I have my problem "half" resolved, but need some assistance on the final piece.  Overall, I need to take three string values (hex format), convert them to binary, add them and then convert back to a string (hex format).  If that doesn't make sense maybe this will:
    Final Result (My target) = 0xCC
     = 0x03 + 0x01 + 0x04
              = 0x03; 0011b
              = 0x01; 0001b
              = 0x04; 0100b
    For my app, we are dropping "masking" some of the bits so that we get 1 byte:
              = 0x03; 11b
              = 0x01; 001b
              = 0x04; 100b
    So...
    11001100b = 0xCC
    In my VI, I am taking each initial string [0x03,0x01 and 0x04] type casting them to U8.  Next I need to "mask" the binary values as shown above and then add them.  I am not sure how to do this in LV??
    Thanks for the help,
    Bryan

    Hi Bryan,
    there's a conversion palette in the string palette, ever looked at those functions?
    The rest is pure simple math:
    It's the straight-forward way, there are other possibilities too!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to create a matrix with constant values and multiply it with the output of adc

    How to create a matrix with constant values and multiply it with the output of adc 

    nitinkajay wrote:
    How to create a matrix with constant values and multiply it with the output of adc 
    Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • How to read two text files using the Read from spreadsheet.vi and then plot it

    I need to read two text files using the read from spreadsheet function and then plot these files over time.
    The file with the .res extention is the RMS values (dt and df) and the second file contains the amplitude of a frequency spectrum.
    I really appreciate any help..thanks
    Attachments:
    RMS.txt ‏1 KB
    FREQUENCY.txt ‏1 KB

    From NI Example Finder:
    Write to Text File.vi
    Read from Text File.vi
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp

  • I updated to 7.0.2 and read to close an icon to double click home and then sweep up the icon to close it. I need to know how to sweep up the icon since I can't seem to do it. Help  please???

    I updated to 7.0.2 on my iphone and read to close an icon to double click home and then sweep up the icon to close it. I need to know how to sweep up the icon since I can't seem to do it. Help  please???

    Not the icon. Swipe up the preview card.

  • How do I read a web page and extract text information from it with LabVIEW?

    Hello,
    I want to read a webpage (not Labview), extract the text from the page and then sort out the text to get the information I want. It would be like reading a weather webpage and wanting to extract the current temperature from the webpage usign labview. Any suggestions?
    Thanks

    The discussion below touches on the subject, it looks like it will do what you want.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=137315&requireLogin=False

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do this Excel but don't know procedure in Numbers.  Thanks.

    How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do it in Excel but I don't the procedure in Numbers.  Thank you!

    The only I way I can think of to modify a single value and have that value change in multipl locations is to have all "the other places" reference a single cell.  There is not way without a referene to modify a set of cells simulateously.
    This may be something like what you want:
    Enter a value in the table "Original Data" cell A1 and the A1 cells of tables Ref1, Ref2 and Ref2-1 will change

Maybe you are looking for

  • Apple Hardware Test Log?

    I'm trying to sell my PowerMac G5, and the buyer wanted me to run Apple Hardware Test and email the log so they know it doesn't have any problems, but I'm not able to find a log anywhere. Is there any way that I'm able to meet this request? Thanks in

  • On a GSS-4492-K9 what does the error logs or syslog messages mean ?

    Hi, I have a GSS-4492-K9 and have when i view the logs or syslog output. I cannot seem to find much information on CCO regarding the error. say for example, of the many errors i can see in the logs,the below is one. However, cannot decode what this m

  • How to use oracle TRIM functionality in XML messages

    When i am selecting data from XML message as per below query, it is returing values correctly. SELECT extractValue(x.column_value, '/DETAILS/EMPID') as emp_id, extractValue(x.column_value, '/DETAILS/NAME') as emp_name, extractValue(x.column_value, '/

  • PICTURE FILES gobble up backup drive?

    My photos are all imported--I do not own a camera. There are just too many copies of the same old, same old! I want to make DVD 's of some important backups on the TM amd DELETE all of the PICTURE BACKUPS on the TM. Then I intend to backup the Pictur

  • Delete just three items from the right clic menu of a waveform graph

    I would like to delete some fonctionnalities from the right click menu of my waveform graph. If i use the specific function "delete menu", it works only if I want to delete all the right clic menu. But if I write the name of the specific item that i