LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why would the 'STR to IP' function only find the first 4 ip network addresses? Is there any other way to list all the local IP addresses?

Solved!
Go to solution

Hi, I'm running a PXIe 8840 with two 8234 cards (totaling 6x ethernet ports).  All six are listed on the RT monitor and I know all six work.  

My problem is that when I list all the local ports using Str to IP (no input wired and multiple outputs selected) it only returns the first 4 addresses.  I know its not a 8234 card that is at fault as the last two ports missing from the list is one on the CPU card and one on the one 8234 card.

Is this a known bug in the Str to IP function?  

Does anyone have any other way of listing all the local ip addresses?

0 Kudos
Message 1 of 17
(3,646 Views)

What do you see if you type ipconfig into the command prompt?

0 Kudos
Message 2 of 17
(3,610 Views)

I'm using RT on the Pxi so i cannot run ipconfig. However the RT display on the connected monitor lists all 6 addresses.

Any other ideas?

0 Kudos
Message 3 of 17
(3,596 Views)

AntonV,

You need to look at the Help option for this primitive and see the representation.  The input consists of a string while the output is a single U32.  Seeing how an IPv4 is 4 bytes in length, it can easily be represented by a U32 while an IPv6 being 6 bytes in length cannot.  This will pass out the defined IPv4 address.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 4 of 17
(3,587 Views)

@Minions wrote:

The input consists of a string while the output is a single U32.

I assume that the OP has it configured for "multiple output", i.e. an array of U32. I don't know if there is a limitation on the number of results.

(Sorry, I currently only have four local IPs, (some are virtualbox adapters))

 

 

Message 5 of 17
(3,558 Views)

Yep it is configured for multiple output. Seems to be internally limited to 4 addresses? Has anyone ever gone over 4? In case this is a bug, is there any other way to get a list of addresses on the host computer in RT? 

0 Kudos
Message 6 of 17
(3,554 Views)

Yes, trying with e.g. microsoft.com, I get more than four (Windows 10, LabVIEW 2016).

 

Not sure if there is a limit on local IPs, though.

 

 

 

 

 

 

 

0 Kudos
Message 7 of 17
(3,547 Views)

My point was that the number between each '.' of the IP address is a number from 0 to 255 - essentially a [U8].  If you were to take four of these and merge them together, you would get a [U32].  As the output of this primitive is limited to a [U32], it cannot handle the IPv6 addresses.  Perhaps these primitives should be labeled with the IPv4 to limit their usage.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 8 of 17
(3,544 Views)

@Minions wrote:

Perhaps these primitives should be labeled with the IPv4 to limit their usage.

LabVIEW does not currently support IPV6 so all this is irrelevant. (An IPv6 address is also 16 bytes, not 6).

 


@Minions wrote:

My point was that the number between each '.' of the IP address is a number from 0 to 255 - essentially a [U8]. 


This definition is backwards. An IPv4 address is defined as a U32 number, but it is often conveniently formatted as a period delimited set of four decimal octets. (see also)

0 Kudos
Message 9 of 17
(3,537 Views)

I wonder if it is specifically my RT system that shows this behaviour or if it happens for all RT desktops.

As for an alternative method to get a list of system ip addresses, i recall that there is a file in system folder somewhere that lists the network configuration (basically all the network settings as set up in Max). I could parse that file for all the addresses but I'm hoping for an explaination of why STR to IP doesnt behave as expected.

0 Kudos
Message 10 of 17
(3,527 Views)