Table Of Contents

XNET Read (Frame » Ethernet) (G Dataflow)

Last Modified: September 16, 2019

Reads data from a session as an array of Ethernet frames. The session must use an Ethernet interface and a mode of Frame Input Stream.

connector_pane_image
datatype_icon

session in

The session to read. This session is selected from the LabVIEW project or returned from XNET Create Session. The session mode must be Frame Input Stream.

datatype_icon

error in

An error cluster that you use to check for errors or warnings.

datatype_icon

number to read

The number of frame values desired. If number to read is positive (or 0), the data array size is no greater than this number.

If number to read is negative (typically -1), all available frame values are returned. If number to read is negative, you must use a timeout of 0.

datatype_icon

timeout

The time to wait for number to read frame values to become available.

The timeout is a LabVIEW relative time, represented as 64-bit floating-point in units of seconds.

If timeout is positive, XNET Read (Frame Ethernet) waits for number to read frame values, then returns that number. If the values do not arrive prior to the timeout, an error is returned.

If timeout is negative, XNET Read (Frame Ethernet) waits indefinitely for number to read frame values.

If timeout is zero, XNET Read (Frame Ethernet) does not wait and immediately returns all available frame values up to the limit specified by number to read.

This input is optional. The default value is 0.0.

datatype_icon

session out

An output that is the same as session in, provided for use with subsequent nodes.

datatype_icon

error out

The error cluster created by this node. If error in contains an error, error out is error in unchanged. Otherwise, error out is the error cluster created by this node.

datatype_icon

data

This output returns an array of LabVIEW clusters.

Each array element corresponds to a frame that the session receives. The elements of each cluster are specific to the Ethernet protocol.

datatype_icon

type

The type of Ethernet frame (decimal value in parentheses).

Ethernet Data (0) Ethernet frame received or transmitted.
datatype_icon

local timestamp

A timestamp using XNET local time. The timestamp uses the LabVIEW absolute timestamp type.

The timestamp point in the Ethernet frame occurs at the beginning of the first symbol following the start of frame delimiter.

The location of the timestamp point depends on the Port Mode of the session interface. When Port Mode is Direct, the location of the timestamp point corresponds to time synchronization protocols, using the reference plane marking the boundary between the port's connector (copper wire) and PHY. When Port Mode is Tap, the location of the timestamp point is the midpoint between the connector/PHY reference plane of this session's interface and the connector/PHY reference plane of the tap partner.

datatype_icon

network timestamp

A timestamp using network time (clock of the network's time synchronization protocol, such as IEEE Std 802.1AS). The timestamp uses the LabVIEW absolute timestamp type.

The timestamp point in the Ethernet frame occurs at the beginning of the first symbol following the start of frame delimiter.

The location of the timestamp point depends on the Port Mode of the session interface. When Port Mode is Direct, the location of the timestamp point corresponds to time synchronization protocols, using the reference plane marking the boundary between the port's connector (copper wire) and PHY. When Port Mode is Tap, the location of the timestamp point is the midpoint between the connector/PHY reference plane of this session's interface and the connector/PHY reference plane of the tap partner.

datatype_icon

network synced?

Contains the value of the Synced property at the time that both timestamps are acquired, to specify whether the network timestamp is synchronized to the network (true) or not (false).

datatype_icon

receive?

A Boolean value that indicates whether the frame occurred due to receive (true) or not (false).

For XNET Read on the monitor path:
  • When Port Mode of this session's interface is Direct, this flag is true when a frame is received on the interface.
  • When Port Mode of this session's interface is Tap, the value true indicates that the frame was received by this interface, and will be transmitted on the tap partner.

For XNET Read on the endpoint path, this flag is always true.

datatype_icon

transmit?

A Boolean value that indicates whether the frame occurred due to transmit (true) or not (false).

For XNET Read on the monitor path:
  • When Port Mode of this session's interface is Direct, the monitor path echoes each transmit that was submitted to XNET Write on the endpoint path.
  • When Port Mode of this session's interface is Tap, the value true indicates that the frame was received by the tap partner and transmitted on this interface (i.e., not an echo of Write).

For XNET Read on the endpoint path, this flag is always false.

datatype_icon

error?

A Boolean that indicates whether an error occurred during the reception/transmission of the frame (false = good frame, true = bad frame).

datatype_icon

frame data

An array of bytes that provides the data of the Ethernet frame.

Using the terminology from IEEE Std 802.3, the frame data begins with the first byte of the destination MAC address, and ends with the last byte of the mac_service_data_unit (MSDU).

In order to obtain the payload data that is contained in the frame, your code must decode the layered headers in frame data. For example, for an IPv4 UDP packet, you decode the Ethernet header, including the EtherType, to determine that the remaining data is an IPv4 packet; then you decode the IPv4 header, including the Protocol, to determine that the remaining data is a UDP packet; and then you decode the UDP header and its payload data.

The maximum length of this array is provided in the Payload Length Maximum property.

datatype_icon

fcs

The IEEE Std 802.3 Frame Check Sequence (FCS) that was received with the frame.

datatype_icon

unused payloads

This parameter is empty. No user input is needed.

Description

The data represents an array of Ethernet frames. Each Ethernet frame uses a LabVIEW cluster with Ethernet-specific elements.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics