CogEthernetPort InterfaceUp EventCognex VisionPro 9.8
This event is raised whenever the interface comes up. The event args contain the currently active settings.

Namespace: Cognex.VisionPro.Comm
Assembly: Cognex.VisionPro.Comm (in Cognex.VisionPro.Comm.dll) Version: 75.1.0.0
Syntax

public virtual event CogEthernetPortInterfaceUpEventHandler InterfaceUp

Value

Type: Cognex.VisionPro.Comm CogEthernetPortInterfaceUpEventHandler
Remarks

Ethernet settings are written to the Comm Card using WriteSettings(CogEthernetPortSettings). These settings are stored in flash memory directly on the Comm Card.

When a VisionPro application first connects to a Comm Card, the Comm Card automatically attempts to bring the Ethernet port interface "UP" using the stored settings. Later, when the VisionPro application exits, the Comm Card will automatically bring the Interface "DOWN", removing the card from the network.

Both the Link (physical connection present) and the Interface (IP settings activated) need to be in the "UP" state for the Ethernet port to participate in an IP network. When the link or interface is "DOWN", the Ethernet port cannot communicate over an IP network.

Use IsLinkUp to see if the Link is in the "UP" state. When the Link is up, the Ethenet port is physically connected to a network and can physically transmit and receive data.

Use IsInterfaceUp to see if the Interface is in the "UP" state. When the Interface is up, the Ethernet port has been activated with IP network settings and can participate in an IP network.

Use WriteSettings(CogEthernetPortSettings) and ReadSettings  to read and write network settings to the Comm Card.

Use BringInterfaceUpAsync  and BringInterfaceDownAsync  to manually bring the interface "UP" and "DOWN" using the settings stored on the Card.

Use ReadActiveSettings  to read the currently active settings while the Interface is "UP". The currently active settings may be different from the settings stored on the card in cases where the card is configured for DHCP, or if something (i.e. PROFINET) changes the active settings without also writing them to the storage location on the card.

Note that CogEthernetPort does not have exclusive control over the Ethernet port hardware. The Ethernet port interface may already be "UP" when a CogEthernetPort is created. Furthermore, the state of the Ethernet interface may report changes and events that were _not_ initiated from user calls into its own properties and methods.

Note also that the lifetime of this object is not related to the state ("UP" or "DOWN") of the Ethernet port interface. Disposing the CogEthernetPort object will not affect the state of actual Ethernet settings running on the card (even though exiting the _process_ will bring the network interface "DOWN").

See Also