NI XNET XNET PDU Properties - ni/grpc-device GitHub Wiki

XNET PDU Properties

Cluster

Data Type Direction Required? Default
nxDatabaseRef_t Read Only N/A N/A

Property Class

XNET PDU

Property ID

nxPropPDU_ClusterRef

Description

This property returns the reference (nxDatabaseRef_t) to the parent cluster in which the PDU has been created. You cannot change the parent cluster after creating the PDU object.

Comment

Data Type Direction Required? Default
char * Read/Write No Empty String

Property Class

XNET Signal

Property ID

nxPropSig_Comment

Description

Comment describing the signal object.

A comment is a string containing up to 65535 characters.

Configuration Status

Data Type Direction Required? Default
i32 Read Only No N/A

Property Class

XNET Signal

Property ID

nxPropSig_ConfigStatus

Description

The signal object configuration status.

Configuration Status returns an NI-XNET error code. You can pass the value to the nxStatusToString error code input to convert the value to a text description of the configuration problem.

By default, incorrectly configured signals in the database are not returned from the XNET Frame Signals property because they cannot be used in the bus communication. You can change this behavior by setting the XNET Database ShowInvalidFromOpen? property to true. When a signal configuration status becomes invalid after the database is opened, the signal still is returned from the Signals property even if the ShowInvalidFromOpen? property is false.

Examples of invalid signal configuration:

  • The signal is specified using bits outside the frame payload.
  • The signal overlaps another signal in the frame. For example, two multiplexed signals with the same multiplexer value are using the same bit in the frame payload.
  • The frame containing the signal is invalid (for example, a CAN frame is defined with more than 8 payload bytes).

Frames

Each cluster can contain an arbitrary number of frames. A frame is a single message that is exchanged on the cluster. In NI-CAN, this is equivalent to an NI-CAN message.

The basic properties of a frame are its identifier (Arbitration ID for CAN, Slot ID for FlexRay) and the payload length, which can be any value between 0 and 8 for CAN and any even value between 0 and 254 for FlexRay.

In addition, several protocol-specific properties exist. You can use the NI-XNET Database Editor to edit these properties in a protocol type-specific way.

Name (Short)

Data Type Direction Required? Default
char * Read/Write Yes Defined in nxdbCreateObject

Property Class

XNET Subframe

Property ID

nxPropSubfrm_Name

Description

String identifying a subframe object.

Lowercase letters (a–z), uppercase letters (A–Z), numbers, and the underscore (_) are valid characters for the short name. The space ( ), period (.), and other special characters are not supported within the name. The short name must begin with a letter (uppercase or lowercase) or underscore, and not a number. The short name is limited to 128 characters.

A subframe name must be unique for all subframes in a frame.

This short name does not include qualifiers to ensure that it is unique, such as the database, cluster, and frame name. It is for display purposes.

You can write this property to change the subframe's short name.

Signals

Each frame contains an arbitrary number of signals, which are the basic data exchange units on the network. These signals are equivalent to NI-CAN channels.

Some of the signal properties are:

  • Start bit: the signal start position within the frame
  • Number of bits: the signal length within the frame
  • Data type: the data type (signed, unsigned, or float)
  • Byte order: little or big endian
  • Scaling factor and offset: for converting physical data to binary representation

Mux:Data Multiplexer Signal

Data Type Direction Required? Default
nxDatabaseRef_t Read Only N/A N/A

Property Class

XNET PDU

Property ID

nxPropPDU_MuxDataMuxSigRef

Description

Data multiplexer signal in the PDU.

This property returns the reference to the data multiplexer signal. If data multiplexer is not defined in the PDU, the property returns 0. Use the XNET PDU Mux:Is Data Multiplexed? property to determine whether the PDU contains a multiplexer signal.

You can create a data multiplexer signal by creating a signal and then setting the XNET Signal Mux:Data Multiplexer? property to true.

A PDU can contain only one data multiplexer signal.

Mux:Is Data Multiplexed?

Data Type Direction Required? Default
bool Read Only No False

Property Class

XNET PDU

Property ID

nxPropPDU_MuxIsMuxed

Description

PDU is data multiplexed.

This property returns true if the PDU contains a multiplexer signal. PDUs containing a multiplexer contain subframes that allow using bits of the payload for different information (signals), depending on the multiplexer value.

Mux:Static Signals

Data Type Direction Required? Default
nxDatabaseRef_t * Read Only N/A N/A

Property Class

XNET PDU

Property ID

nxPropPDU_MuxStaticSigRefs

Description

Static signals in the PDU.

Returns an array of references to signals in the PDU that do not depend on the multiplexer value. Static signals are contained in every PDU transmitted, as opposed to dynamic signals, which are transmitted depending on the multiplexer value.

You can create static signals by specifying the PDU as the parent object. You can create dynamic signals by specifying a subframe as the parent.

If the PDU is not multiplexed, this property returns the same array as the XNET PDU Signals property.

Mux:Subframes

Data Type Direction Required? Default
nxDatabaseRef_t * Read Only N/A N/A

Property Class

XNET PDU

Property ID

nxPropPDU_MuxSubframeRefs

Description

Returns an array of references to subframes in the PDU. A subframe defines a group of signals transmitted using the same multiplexer value. Only one subframe is transmitted in the PDU at a time.

You can define a subframe by creating a subframe object as a child of a PDU.

Payload Length

Data Type Direction Required? Default
u32 Read/Write Yes N/A

Property Class

XNET PDU

Property ID

nxPropPDU_PayloadLen

Description

Determines the size of the PDU data in bytes.

This property is required. If the property does not contain a valid value, and you create an XNET session that uses this PDU, the session returns an error. To ensure that the property contains a valid value, you can do one of the following:

  • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property.
  • Set a value using the nxdbSetProperty function. This is required when you create your own in-memory database (:memory:) rather than using a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session.
⚠️ **GitHub.com Fallback** ⚠️