LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rt Is it possible to use DHCP to configure two ethernet ports in Labview Realtime?

I would like to use the ethernet port on a PXI SBC as the normal ethernet connection, and use the ethernet port on a PXI Ethernet Card as a redundant ethernet connection.  The PXI SBC will use Labview Realtime.  Also, I would like to use the DHCP to automatically assign the IP addresses to each of these ethernet ports.  The DHCP server will run on a Linux-based machine.  The importance of using DHCP is so that IP addresses can be re-assigned by the DHCP server, and for the DHCP server to send additional information in the DHCP Response packet.  Is this possible in Labview Realtime?  During development, I don't care if I have to use static IP addresses to interface from my desktop to the PXI SBC, but after development, I would like the Labview realtime application to receive its IP addresses from a DHCP server.
 
Solitude
0 Kudos
Message 1 of 8
(4,620 Views)

Dear solitude,

It is possible to configure more than one ethernet adapter on your RT target. Please read the following KB for suggestions "Can I Use Multiple Network Adapters in a PXI or Desktop Real-Time System?"

Hope this answers your question.

Kalin T.
0 Kudos
Message 2 of 8
(4,589 Views)

Hi Kalin,

Thanks for the information.  I have configured the first ethernet card to use DHCP services, and the second ethernet card to use a static IP address.  I am able to ping the first ethernet card, but I can't ping the second ethernet card.  The Labview RT target does see both ethernet cards:

Device 1 - MAC address: 00:XX:XX:BD:XX:29  -  10.21.4.19 (primary)

Device 2 - MAC address: 80:XX:XX:91:XX:80  - 10.21.4.230

I need two active ethernet cards for my application.

Solitude

 

0 Kudos
Message 3 of 8
(4,432 Views)

The note from the link Kalin posted reads;

"

You cannot configure two Ethernet devices for an RT target on the same IP subnet. If you configure an RT target to use two Ethernet devices on the same IP subnet, the second device is unusable.

"

So try changing the IP to a different subnet.

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 8
(4,429 Views)

Hi Ben,

I'm using the MAX to configure the network settings.  I have changed the following:

"Obtain IP address from DHCP server" for the primary Ethernet card, and

IP Address : 10.21.58.19, Subnet Mask : 255.255.240.0 for the redundant Ethernet card.

When the Labview RT system reboots, the following is reported by MAX for the primary Ethernet  card:

IP Address : 10.21.4.19, Subnet Mask : 255.255.224.0, Gateway : 10.21.0.1, DNS server : 10.21.16.11

I hooked up a monitor on the Labview RT and it reports:

Device 1 - MAC address: XX:XX:XX:XX:XX:XX - 10.21.4.19 (primary)

Device 2 - MAC address: XX:XX:XX:XX:XX:XX - 10.21.58.19

Also, the Labview RT reports:

ETS TCP/IP: device ether1: another host has the same IP address!

ETS TCP/IP: device ether 2:another host has the same IP address!

If I ping 10.21.4.19, it is successful.  But if I ping 10.21.58.19, it fails.

 

Why do I get the "... same IP address" errors, and why can I not ping the redundant Ethernet card 10.21.58.19?

Solitude

 

 

 

0 Kudos
Message 5 of 8
(4,426 Views)

Hi Solitude,

You are pusshing my knowledge limit but what if you changed your mask to

255.255.0.0

?

If there is anyone else out that can help with this, please feel free to step in and teach me a thing or two!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 8
(4,423 Views)

Ben,

I talked to Janell at NI.

I need to have two Ethernet cards on my host machine.  Since I don't have two Ethernet cards on my host machine, I changed my IP address back and forth from one subnet to another.  For example, I setup my target machine that runs Labview RT as follows:

Target Ethernet Card #1 : 10.21.4.242

Target Ethernet Card #2 : 10.21.58.242

I setup my single Ethernet card on my host machine as follows:

Host Ethernet Card : 10.21.4.168

After rebooting, I can ping from my host machine to card #1 on the Target machine, but not card #2.  I then switched my IP address on my host machine as follows:

Host Ethernet Card : 10.21.58.168

I can ping from my host machine to card #2 on the Target machine, but not card #1.

So, both Ethernet cards on the Target machine are active.  The subnet mask is the same for all four IP settings:

255.255.224.0

The IP addresses for the Target Card #1 and Host Card #1 must be on the same subnet.  For example, the subnet for the first set of cards is:

10.21.0.0

The IP addresses for the Target Card #2 and Host Card #2 must be on the same subnet, but on a different subnet than the first set of cards.  For example, the subnet for the second set of cards is:

10.21.16.0

Both Ethernet cards are active on the target machine.

Solitude

 

0 Kudos
Message 7 of 8
(4,411 Views)

So are you good to go?

The following is subject to correction by anyone who knows better.

From what I understand....

The subnet mask is intended to tell the TCP layer what part of the TCP/IP address the driver level should process. In the case of the standard setting 255.255.255.0, the driver only looks at packets that have the same configuration of the 24 most significant bit of the address. The 24 bits is indicated by the 255.255.255. The "255" is the decimal equivalent of an 8 bit pattern where all of the bits are set.

The mask is intended as a way of pre-screening packets.

So looking at your address indicates that a mask of 255.255.254.0 is only screen the top 23 bits of the address. Since 10.21.58 differs from 10.21.4.242  in the third 8 bit sub-address in bits 6,5,4,3,1 (zero based) a subnet of 255.255.X.0  where X = 192 193 or 0 would work.

All of the above is based on my very old recollection of how the subnet mask was to be used. I can not be certain this is correct and if switch gear supports masks other than 255.255.255.0.

Just trying to help,

Ben

Message Edited by Ben on 03-15-2007 05:26 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 8
(4,408 Views)