Convert IPv6 address to decimal

How do we convert an IPv6 address to its decimal equivalent using java?
I could find different tools on Internet but not the java code for the same.
Any help would be much appreciated.
Thanks.

Hello EJP
Please visit the following URL:
https://www.ultratools.com/tools/decimalCalcResult?ipAddress=805b%3A2d9d%3Adc28%3A0000%3A0000%3Afc57%3Ad4c8%3A1fff
This converts the IPv6 address (which is in hexadecimal format) to a decimal number.
I need to implement this functionality. I could not find any method in java.net.Inet6Address class for this.
To convert an IPv4 address which is in String format to its decimal equivalent, we can use following method:
<code>
long stringToLong(String ipAddress) {
          String[] octets = ipAddress.split("\\.");
          long intValue = 0;
          long currentOctet;
          for (int i = 0; i < octets.length; i++) {
               currentOctet = new Integer(octets[(octets.length-1)-i]).intValue();
               intValue = (currentOctet << i*8) | intValue;
          return intValue;
</code>
Edited by: 803674 on May 26, 2011 12:22 AM

Similar Messages

  • Convert IPv4 address to IPv6 subnet on AD Sites

    Hi,
    We currently run IPv4 on our network. However, it looks like it's recommended to enable IPv6 on DFS servers according to this:
    http://blogs.technet.com/askds/archive/2009/10/28/dfs-referrals-and-ipv6-outta-site.aspx
    I'm having trouble creating an IPv6 subnet in AD Site and Services for my DFS servers since I'm note very familiar with IPv6. I think the IPv6 I see on the servers is the "converted" to IPv6 (see warning message below)??
    DC and DFS servers are Win 2008 R2 Datacenter. It looks like the IPv6 address of the DFS servers are not "matching" the subnets I have created and therefore DFS is not associated with the correct sites causing clients to go over the WAN
    to other DFS servers.
    For example:
    The IPv4 for my DFS servers are:
    156.124.92.202/23
    156.124.78.202/23
    I created these IPv4 subnets:
    156.124.92.0./23 --> SA-Site
    156.124.78.0/23 --> AU-Site
    IPv6 DHCP service is not enabled. No Static IPv6 set for the network connection. The "converted" IP seems to be
    2002:9c7c:5cca::9c7c:5cca
    2002:9c7c:4eca::9c7c:4eca
    I created these IPv6 subnets
    2002::9c7c:5c00/119
    2002::9c7c:4e00/119
    This is what I see on the DFS servers:
    Validating the site associations on every domain controller of the following: SA-DFS-01
    Warning: The server has IP addresses with conflicting site associations
    Host name: SA-DFS-01
    Site: SA-Site
    Domain Controller: SA-AD-01
    Host IP address
    fe80::2c27:42f8:1294:ef4c%10
    2002:9c7c:5cca::9c7c:5cca
    Subnet-Site Mapping in AD
    No mapping exists
    No mapping exists
    Host name: SA-DFS-01
    Site: SA-Site
    Domain Controller: AU-AD-01
    Host IP address
    fe80::2c27:42f8:1294:ef4c%10
    2002:9c7c:5cca::9c7c:5cca
    Subnet-Site Mapping in AD
    No mapping exists
    No mapping exists
    Validating the site associations on every domain controller of the following: AU-DFS-01
    Warning: The server has IP addresses with conflicting site associations
    Host name: AU-DFS-01
    Site: AU-Site
    Domain Controller: SA-AD-01
    Host IP address
    2002:9c7c:4eca::9c7c:4eca
    Subnet-Site Mapping in AD
    No mapping exists
    Warning: The server has IP addresses with conflicting site associations
    Host name: AU-DFS-01
    Site: AU-Site
    Domain Controller: AU-AD-01
    Host IP address
    2002:9c7c:4eca::9c7c:4eca
    Subnet-Site Mapping in AD
    No mapping exists

    Hi,
    We currently run IPv4 on our network. However, it looks like it's recommended to enable IPv6 on DFS servers according to this:
    http://blogs.technet.com/askds/archive/2009/10/28/dfs-referrals-and-ipv6-outta-site.aspx
    I'm having trouble creating an IPv6 subnet in AD Site and Services for my DFS servers since I'm note very familiar with IPv6. I think the IPv6 I see on the servers is the "converted" to IPv6 (see warning message below)??
    DC and DFS servers are Win 2008 R2 Datacenter. It looks like the IPv6 address of the DFS servers are not "matching" the subnets I have created and therefore DFS is not associated with the correct sites causing clients to go over the WAN
    to other DFS servers.
    For example:
    The IPv4 for my DFS servers are:
    156.124.92.202/23
    156.124.78.202/23
    I created these IPv4 subnets:
    156.124.92.0./23 --> SA-Site
    156.124.78.0/23 --> AU-Site
    IPv6 DHCP service is not enabled. No Static IPv6 set for the network connection. The "converted" IP seems to be
    2002:9c7c:5cca::9c7c:5cca
    2002:9c7c:4eca::9c7c:4eca
    I created these IPv6 subnets
    2002::9c7c:5c00/119
    2002::9c7c:4e00/119
    This is what I see on the DFS servers:
    Validating the site associations on every domain controller of the following: SA-DFS-01
    Warning: The server has IP addresses with conflicting site associations
    Host name: SA-DFS-01
    Site: SA-Site
    Domain Controller: SA-AD-01
    Host IP address
    fe80::2c27:42f8:1294:ef4c%10
    2002:9c7c:5cca::9c7c:5cca
    Subnet-Site Mapping in AD
    No mapping exists
    No mapping exists
    Host name: SA-DFS-01
    Site: SA-Site
    Domain Controller: AU-AD-01
    Host IP address
    fe80::2c27:42f8:1294:ef4c%10
    2002:9c7c:5cca::9c7c:5cca
    Subnet-Site Mapping in AD
    No mapping exists
    No mapping exists
    Validating the site associations on every domain controller of the following: AU-DFS-01
    Warning: The server has IP addresses with conflicting site associations
    Host name: AU-DFS-01
    Site: AU-Site
    Domain Controller: SA-AD-01
    Host IP address
    2002:9c7c:4eca::9c7c:4eca
    Subnet-Site Mapping in AD
    No mapping exists
    Warning: The server has IP addresses with conflicting site associations
    Host name: AU-DFS-01
    Site: AU-Site
    Domain Controller: AU-AD-01
    Host IP address
    2002:9c7c:4eca::9c7c:4eca
    Subnet-Site Mapping in AD
    No mapping exists
    Hi,
    The format seems to be incorrect. Please change them as following and check the result:
    2002:9c7c:5cca::/48
    2002:9c7c:4eca::/48
    For more information about 6to4 address, please see:
    http://technet.microsoft.com/en-us/library/cc756770(WS.10).aspx
    http://technet.microsoft.com/en-us/library/cc757359(WS.10).aspx 
    Hope it helps.
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
    This can be beneficial to other community members reading the thread.

  • IPv6 address  comparison

    Hi,
    How to do a comparison between two IPv6 address.
    Like I have a address range 1080::8:800:200C:417A to 1080::8:800:200C:417D
    Now user enter a IP address 1080::8:800:200C:417C
    How to find that this lies between the above range ??? How to claulate.
    Please help
    Regards,

    Here is some code (working but inefficient? Also, errors are not handled):
    import java.math.BigInteger;
    * @author talha
    public class IPV6Compare {
        public static void main(String... args){
            String lowerBound="1080::8:800:200C:417A";
            String upperBound="1080::8:800:200C:417D";
            String addressToTest="1080::8:800:200C:417C";
            BigInteger lowerBoundInt=new BigInteger(convertToStdForm(lowerBound).replace(":", ""), 16);
            BigInteger upperBoundInt=new BigInteger(convertToStdForm(upperBound).replace(":", ""), 16);
            BigInteger addressToTestInt=new BigInteger(convertToStdForm(addressToTest).replace(":", ""), 16);
            if(addressToTestInt.compareTo(lowerBoundInt)>=0 && addressToTestInt.compareTo(upperBoundInt)<=0){
                System.out.println("Address within range.");
            }else{
                System.out.println("Address out of range.");
        private static String convertToStdForm(String address){
            StringBuilder stdForm = new StringBuilder();
            address=address.trim();
            String[] splitted=address.split(":");
            for(String str:splitted){
                if("".equals(str)){
                    for(int i=0;i<8-splitted.length;i++){
                        stdForm.append("0000:");
                }else{
                    while(str.length()!=4)str="0"+str;
                    stdForm.append(str+":");
            return stdForm.substring(0, stdForm.length()-1);
    }Thanks!
    Edit: A little more efficient code (there is no need to convert to BigInteger :-)
    * @author talha
    public class IPV6Compare {
        public static void main(String... args){
            String lowerBound="1080::8:800:200C:417A";
            String upperBound="1080::8:800:200C:417D";
            String addressToTest="1080::8:800:200C:417C";
            lowerBound=convertToStdForm(lowerBound);
            upperBound=convertToStdForm(upperBound);
            addressToTest=convertToStdForm(addressToTest);
            if(addressToTest.compareTo(lowerBound)>=0 && addressToTest.compareTo(upperBound)<=0){
                System.out.println("Address within range.");
            }else {
                System.out.println("Address out of range.");
        private static String convertToStdForm(String address){
            StringBuilder stdForm = new StringBuilder();
            address=address.trim();
            String[] splitted=address.split(":");
            for(String str:splitted){
                if("".equals(str)){
                    for(int i=0;i<8-splitted.length;i++){
                        stdForm.append("0000:");
                }else{
                    while(str.length()!=4)str="0"+str;
                    stdForm.append(str+":");
            return stdForm.substring(0, stdForm.length()-1);
    }Edited by: T.B.M on Aug 4, 2009 12:43 AM

  • Regarding the ipv6 address handling in oracle pl/sql

    Hi,
    This is regarding the ipv6 address handling in pl/sql.
    Can we use any c program inside the oracle as C/C++ provides more buitl in function for address handling.
    Are there are any similar functions in pl/sql.
    Kindly let me knoe if there is a way to calculate ipaddress masking.
    Are there any system functions in oracle similar to inet_ntop/inet_pton to validate ipv6 addresses.
    If not kindly let me know if there is any alternate way.
    Thanks and Regards,
    Anantha.

    Billy  Verreynne  wrote:
    Sven, he means converting a numeric network address to a presentation (character) address - and vice versa.Ok I understand. Validating for me had been either
    a) validate that the IP address does really exist. This could have been implemented by executing some kind of ping command.
    or
    b) validate that the string that hold the human readable IPv6 address is correct same a as string like "[email protected]" looks like a valid email address. This of cause would be implemented with some kind of regexp expression.
    However it seems he wants a conversion of the string (human readable ipv6) into a machine readable (hex) representation. Not sure why this is needed, But I agree that simply reusing the OS C routines seems to be the best way to do it.
    I strongly doubt that the result is very useful in Pl/sql. So the big question (as so often) would be what is the business case behind this requirement. Maybe some part of the logic needs to be implemented outside the database anyways. Then it could be useful to add this conversion to this outside part as well.

  • 6to4 Addresses vs Regular IPv6 Addresses - Confusion

    Hi All, (Apologies if this question appears twice. Apparently I had an interface problem)
    I'm finishing up my studies on the IPv6 portion of the CCNA material, and my book seems to completly ignore the fact that 6to4 addresses seem to look different than how the rest of the chapter portrays IPv6 addressing. I've done google searches, and unfortunately I don't have anyone at work who is versed enough in this who will know, so I'm hoping someone can help.
    1. A normal IPv6 address:  2001:0db8:3c4d:0012:0000:0000:1234:56ab
       The same address in shorthand:  2001:db8:3c4d:12::1234:56ab
       A /64 of this space with autoconfiguration:  2001:db8:3c4d:12::/64 eui-64
       All of these addresses have, or will have 8 octets if written in long-hand, in other words - a valid IPv6 address.
    Here's my problem:  The addresses in the 6to4 section look like this:
       ipv6 address 2001:db8:2:2::1/64
    The book fails to mention what the "1" before the /64 is for, but I am assuming that it is an identifier and not part of the IPv6 address due to the " :: "   However, if this is the case, I only see 4 octets, and no eui-64 command, directing that the other 4 will be populated by the MAC padded.  And the "ipv6 address" syntax leads me to believe that this is a host address, and not a block/space statement (i.e. "ip address 192.168.0.1. 255.255.255.0," as opposed to "network 192.168.0.0 255.255.255.0)."
    If someone could shed some light on this, it would be most appreciated, as it is very confusing.

    Also, 6to4 IPv6 addresses have the IPv4 address of the 6to4 gateway embeded in them as well.  That is why they have a whole reseved block of 2002:/16.  Any gateway can algorithmically extract the IPv4 address for forwarding.
    2002:0b0c:0205:5/48 for example, would be correlated to IPv4 address 11.12.2.5 (which is the decimal of the IPv4 address 0b0c:2025 shown in hex)
    Earl Carter wrote a nice blog article on the general topic of IPv6 addresses at http://blogs.cisco.com/security/ipv6-addressing/
    And the commonutiy has settled on calling the 16-bit numbers between the colons "hextets."  In IPv4, each 8-bit portion between dotrs is called an "octet."  The truly pedantic will object taht a hextet should be 6 dits, bit "hextet" is easier to say than "hexadecitet." :-)
    Anotehr trivia point:  The letters in an IPv6 address should awalys be lower case.
    More arcana can be found at http://tools.ietf.org/html/draft-hartmann-6man-addresspartnaming-01, which is on track to become an RFC.

  • Convert a String to Decimal Format in European format

    Hi Experts,
    I am having a string as a context type for a input field, where the user can enter the Price, I need to convert the same into European format "###.###,00", I am using this below code to convert the string to decimal format
    User will enter the input as 10 as it needs to be converted into 10,00. Also, 1000 which has to be converted as 1.000,00
    String Str1 = wdContext.currentvn_temptable.getVa_TempUnitPrice();
    Locale mylocale  = Locale.GERMAN;
    String pattern="###.###,00";                    
    NumberFormat nf = NumberFormat.getNumberInstance(mylocale);
    DecimalFormat df = (DecimalFormat)nf;
    df.applyPattern(pattern);
    String output = df.format(Str1);
    wdComponentAPI.getMessageManager().reportSuccess("Unit Price" + " " + pattern + " " + output);
    When I execute the above code, i am getting an error called "Malformed Pattern ###.###,00"
    Please let me know, how to convert a String to Quantity in European format
    Thanks & Regards,
    Palani

    Hello!
    Try to change your pattern to this one 
    Locale mylocale  = Locale.GERMAN;
    String pattern = "#,#00.00";                    
    NumberFormat nf = NumberFormat.getNumberInstance(mylocale);
    DecimalFormat df = (DecimalFormat)nf;
    df.applyPattern(pattern);
    String output = df.format(1111111.222);
    Pattern has an influence on number of digits between separators, but you have to use ',' for grouping and '.' for decimal. Character values for separators correspond to your Locale object.
    Thanks, Mikhail

  • IPv6 Addressing Point to Point Links in the enterprise

    For an enterprise, it doesn't seem to make sense to use Global addressing for point to point, transit-only links and loopbacks.
    Link-local only addressing breaks debugging tools like traceroute, DNS, etc.
    Is Unique Local the correct choice for this?
    I've searched quite a bit and I've not found a lot of discussion about scope selection for point to point links.  Some RFCs such as 6164 imply Global scope vs Unique Local scope usage is a preference.  Most discussions of point to point addressing focus on bit length.  I'm assuming this means design concerns are agnostic toward scope selection.
    Is anyone aware of documentation I've missed or have any recommendations in this area?
    If ULA was the correct choice, address hierarchy might look like this:
    DataNetwork1 -- Router1 -- ULA.1.1 -- Link -- ULA1.2 -- Agg Router -- Core
    DataNetwork2 -- Router2 -- ULA.2.1 -- Link -- ULA2.2 -- Agg Router /
    DataNetwork3 -- Router3 -- ULA.3.1 -- Link -- ULA3.2 -- Agg Router /
    The network core would have summarized entries for DataNetwork[1|2|3] and ULA[1|2|3].  IE, there would be a Global hierarchy and a ULA hierarchy.

    Scott,
    Let me break this down into some categories for you.
    Address selection:
    I believe that best practice is to use Global Unicast Addressing everywhere (coupled with a proper security policy at your edge). ULA was a compromise for Site Local never being properly defined and whilst it can be used in the same way as GUA I don't believe it is worth it. Irrespective of what you use (GUA or ULA), subject to your security and routing policy traceroute will work from both ends (e.g. you tracing out, someone tracing in)
    Address masking:
    The general rule of thumb is that you allocate /64s to eveything and then mask down to the appropriate mask for the function you are expecting (P.S. Forget everything you learnt about IPv4 address conservation). If you are using /127 masks then in theory every p2p link in your network is either a 0 (::) or a 1 (::1)
    e.g.
    traceroute HostB:
    1     2001:1234:abcd:1::1
    2     2001:1234:abcd:2::1
    3     2001:1234:abcd:3::1
    4     2001::4:10
    The only exception to this is loopbacks, you can sequentially allocate /128s from the same /64 block
    NOTE: /127 support is recent and may not be supported by some vendors, in this case use /126 masking (same as you would use /30s in IPv4)
    If you have a /48 ( a normal enterise allocation) or larger then this should not be an issue ( you have access to 65536 x /64s) the only reason you would consider ULA for infrastructure numbering is because you have a small IPv6 pool. I would still argue you should get more IPv6 addresses than use ULA.
    I hope this helps
    Cheers

  • Connect to server using IPv6 address in afp URL

    I'm not sure whether this is the correct forum for this question, but does anyone know whether I can specify an IPv6 address in the "Connect to Server" dialog?
    I've setup IPv6 over direct-wired ethernet between my MBP and Mini. Using ping6, I can ping one from the other (but only when I specify -I en0)
    I've tried the following URLs:
    afp://[fe80::0216:cbff:dead:beef]
    afp://[fe80::0216:cbff:dead:beef%en0]
    I think the problem might be because I don't have an IPv6 router between the two hosts.
    Thanks.
    MacBook Pro 15 2.0GHz   Mac OS X (10.4.8)   mini 1.83GHz

    I have the same problem and for me it extends to everything from SSH to HTTP. I think that mac has a bug in it networking. I can't get it to work on any mac I've tried. Can your mini connect to your laptop?
    I've been googling for 3 days and can't find any solution.
    MBP   Mac OS X (10.4.9)  

  • Can't get ipv6 address assigned correctly.

    I use NetworkManager and dhclient for auto-configuration but it has some weird problems.
    When I boot up my laptop, I only have chance to get access to ipv6 network, when I fail, I tried to delete the connection in Network Management Settings, and then added a new profile, disable and then enable the network again. Sometimes it works well, but sometimes it failed to auto-config.
    If I use the command:
    $ ip -6 rout
    then I'll get the following message:
    unreachable fe80::/64 dev lo proto kernel metric 256 error -101
    fe80::/64 dev wlan0 proto kernel metric 256
    default via fe80::2e0:2ff:fe54:59 dev wlan0 proto static metric 1
    every time the default gateway is configured well, sometimes the address the address is missed , and if I do the following:
    $ ping6 -I wlan0 -c 4 fe80::2e0:2ff:fe54:59
    It responses normally.
    PING fe80::2e0:2ff:fe54:59(fe80::2e0:2ff:fe54:59) from fe80::1034:56ff:fe78:9124 wlan0: 56 data bytes
    64 bytes from fe80::2e0:2ff:fe54:59: icmp_seq=1 ttl=64 time=5.32 ms
    64 bytes from fe80::2e0:2ff:fe54:59: icmp_seq=2 ttl=64 time=6.64 ms
    64 bytes from fe80::2e0:2ff:fe54:59: icmp_seq=3 ttl=64 time=10.6 ms
    64 bytes from fe80::2e0:2ff:fe54:59: icmp_seq=4 ttl=64 time=3.60 ms
    --- fe80::2e0:2ff:fe54:59 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3005ms
    rtt min/avg/max/mdev = 3.603/6.546/10.617/2.587 ms
    do the following:
    $ ip -6 addr
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:250:4400:d000::161/128 scope global
    valid_lft forever preferred_lft forever
    inet6 fe80::1034:56ff:fe78:9124/64 scope link
    valid_lft forever preferred_lft forever
    I found I just sometimes can get the ipv6 address start with 2001:
    If the address is assigned, then:
    $ ping6 ipv6.google.com
    PING ipv6.google.com(ipv6.google.com) 56 data bytes
    ^C
    --- ipv6.google.com ping statistics ---
    11 packets transmitted, 0 received, 100% packet loss, time 10008ms
    response nothing!
    Then I switch into Windows 7, if something like above happened, then I managed to set the MAC address to a random value such as 12-34-56-78-91-23, soon, the problem will be corrected, I'll get a new ipv6 address assigned by DHCPv6 server. If I switch back to arch, set the MAC address in NetworkManager, it didn't have function at most time, and the ipv6 address even won't change!
    Can anyone help me with this problem?
    by the way, I never get ipv6 address when I use dhcpcd.

    bernarcher wrote:
    Hello and welcome to the forums heliumhgy.
    Just in case you are wondering where your post has been gone: The moderators board received this message from you:
    I dont need tunnel to access to ipv6, My univ use dual-stack to get both ipv4 and v6 work around all campus.
    This is because you inadvertently used the "Report" link. But don't worry this happens rather often.
    Just cause I caught the glimpse of re-blabla, and mistaken it as reply
    Last edited by heliumhgy (2012-11-29 03:16:11)

  • Convert binary data to decimal in CAN XNET

    I am using NI-XNET Read function to read CAN frames from port CAN1 , the data out put comes in cluster in binary format is there any function that I can use to convert the binary to decimal ? I prefer not to write another sub-vi to do conversion but using the existing functions that can use my .dbc file and parse all frames in decimal format.
    Thanks.

    Yes Doug You are correct. We have a PCB and we have connected two inductive  sensors over the PCB which are measuring the distance and transpose it to voltage. The PCB has a software which transpose this voltage through an ADC and through the Can Bus we are reading the sensors .To communicate with the PCB  we are using a USB to Can device from IXXAT to communicate, we have build the Labview drivers and our problem as you mention is that we want to transpose this data to voltage. How we can do this? I try several times to upload photos or even the program we have create but for some reason the site is not letting me to do that. If you have an email i can send you the program we have create to tell us your opinion in this problem we have, we can also send you the Labview drivers and the datasheet of the sensor we are using.
    Attachments:
    Read from Can.vi ‏37 KB

  • Convert hexadecimal output to decimal (number)

    I am reading hexadecimal format from the output of the VISA read block and I want to convert it to the decimal preferably exponential format.
    Example of what I read is 76 00 02 (in dec: 7.600 E+2).
    I know there is "type cast" block that converts nicelly but I am not sure what to specify for a type input.
    Can you show me how to apply this type cast block for in my VI so that it converts hex string (76 00 02) into exponential string/number (7.600 E+2)?
    I attached my VI so it is more clear.
    Thanks everybody,
    Pedja
    Attachments:
    MultiGauge.vi ‏64 KB

    Coop wrote:
    > I am reading hexadecimal format from the output of the VISA read block
    > and I want to convert it to the decimal preferably exponential format.
    > Example of what I read is 76 00 02 (in dec: 7.600 E+2).
    > I know there is "type cast" block that converts nicelly but I am not
    > sure what to specify for a type input.
    > Can you show me how to apply this type cast block for in my VI so that
    > it converts hex string (76 00 02) into exponential string/number
    > (7.600 E+2)?
    Looking at your code I see that you have not a hexadecimal string coming
    back but instead a binary string. The fact that you display the string
    as hexadecimal in the string indicator is just showing you the ASCII
    codes of the string characters as hexadecimal numbers.
    The funct
    ion From Hexadecimal String expects a clear text string with
    hexadecimal characters but that is something entirely different from a
    binary string you choose to display as hexadecimal numbers.
    An example: the binary string 7600 02 you receive from the device is in
    fact the character 'v', a null character and a 02 character (or in ASCII
    terms a start of text character).
    So assuming your example is right (which I have to admit seems very
    strange and therefore suspicious to me) you would have to do something
    more like included example. But as I said I have little understanding
    why the hexadecimal interpretation of the binary values should
    correspond to the decimal value you want to have!
    Also as you can see there is not really clear where the 00 character
    belongs to. The two methods where it is either part of the multiplier or
    the exponent both produce the same result for this particular example.
    Which one is right if any, should be tested.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions
    Attachments:
    Binary_(Hex)_to_Decimal_Numeric.vi ‏51 KB

  • 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

  • Is it normal?(NetworkManager applet's strange output & 3 IPv6 address)

    1) label ppp0 appears in NetworkManager applet every time when I up vpn-connection
    2) Also something strange with enp5s0. Output of "ip addr":
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 10:bf:48:20:61:a4 brd ff:ff:ff:ff:ff:ff
        inet 10.0.122.144/8 brd 10.255.255.255 scope global dynamic enp5s0
           valid_lft 9283sec preferred_lft 9283sec
        inet6 2002:5be2:8e63:b:12bf:48ff:fe20:61a4/64 scope global noprefixroute dynamic
           valid_lft 2592003sec preferred_lft 604803sec
        inet6 fec0::b:12bf:48ff:fe20:61a4/64 scope site noprefixroute dynamic
           valid_lft 2592003sec preferred_lft 604803sec
        inet6 fe80::12bf:48ff:fe20:61a4/64 scope link
           valid_lft forever preferred_lft forever
    3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
        link/ether 00:08:ca:67:17:e9 brd ff:ff:ff:ff:ff:ff
    9: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UNKNOWN group default qlen 3
        link/ppp
        inet 91.226.141.81 peer 1.1.1.1/32 scope global ppp0
           valid_lft forever preferred_lft forever
        inet 91.226.141.81/32 brd 91.226.141.81 scope global ppp0
           valid_lft forever preferred_lft forever
    Is it normal that this interface has three IPv6 addresses?

    Hi,
    We are hitting the software bug and the bug ID is CSCsz56711
    http://tools.cisco.com/Support/BugToolKit/search/getBugDetails.do?method=fetchBugDetails&bugId=CSCsz56711
    The issue is related to PCI componenet on the AP hardware and log that points to that is..
    bsnInitRcbSlot: slot 0 has venus radio(UNSUPPORT)
    The Replacement is the resolution and please contact your reseller or partner and if ur are the partner then RMA ids the resolution..
    Lemme know if this answered ur question and please dont forget to rate the usefull posts!!
    Regards
    Surendra

  • Regarding the ipv6 address handling

    Hi,
    Are there any built-in functions in pl/sql for handling ipv6 addresses?
    The functions similar to inet_ntop and inet_pton in c++ are available in pl/sql?

    The closest I get to it is maybe dbms_network_acl_utility
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_networkacl_utl.htm#ARPLS67249
    Subprogram     Description
    CONTAINS_HOST Function
    Determines if the given host is equal to or contained in the given host, domain, or subnet
    DOMAIN_LEVEL Function
    Returns the domain level of the given host name, domain, or subnet
    DOMAINS Function
    For a given host, this function returns the domains whose ACL assigned is used to determine if a user has the privilege to access the given host or not.
    EQUALS_HOST Function
    Determines if the two given hosts, domains, or subnets are equal

  • How to verify  if an IPV6 address entered in a textbox is valid ?

    Hi,
    How to verify if an IPV6 address entered in a text box is valid. I have a swing application. Until now we used only IPV4 address and we had a gui component with only four entries, which checked if the number entered is <= 255, so the user had to enter a correct address. Now with IPV6 there are IPV6 addresses, IPV4 mapped addresses, IPV6 zero compressed addresses and leading zeroes dropped kinds. We cannot supply a fix gui component.
    So if I provide a textcomponent which accepts strings - how do i check if the ip addresses entered by the user is valid. Can I use INET6Address to do this ? is there a way ?
    Thanks.

    InetAddress.getByName(String host)
    If it returns an Inet6Address without throwing an exception, I guess that would work.

Maybe you are looking for