nixnet.database.pdu
- class nixnet.database._pdu.Pdu(**kwargs: int)[source]
Bases:
DatabaseObjectDatabase PDU
- check_config_status() None[source]
Check this PDU’s configuration status.
By default, incorrectly configured PDUs in the database are not returned from
Cluster.pdusbecause they cannot be used in the bus communication. You can change this behavior by settingDatabase.show_invalid_from_opento True. When a PDU configuration status becomes invalid after the database is opened, the PDU still is returned fromCluster.pduseven ifDatabase.show_invalid_from_openis False.- Raises:
XnetError – The PDU is incorrectly configured.
- property cluster: Cluster
Get the parent cluster in which the PDU has been created.
You cannot change the parent cluster after creating the PDU object.
- Type:
- property comment: str
Get or set a comment describing the PDU object.
A comment is a string containing up to 65535 characters.
- Type:
str
- find(object_class: Type[DatabaseObject], object_name: str) DatabaseObject[source]
Finds an object in the database.
This function finds a database object relative to this parent object. This object may be a grandparent or great-grandparent.
If this object is a direct parent (for example,
FrameforSignal), theobject_nameto search for can be short, and the search proceeds quickly.If this object is not a direct parent (for example,
DatabaseforSignal), theobject_nameto search for must be qualified such that it is unique within the scope of this object.For example, if the class of this object is
Cluster, andobject_classisSignal, you can specifyobject_nameofmySignal, assuming that signal name is unique to the cluster. If not, you must include theFramename as a prefix, such asmyFrameA.mySignal.NI-XNET supports the following subclasses of
DatabaseObjectas arguments forobject_class:- Parameters:
object_class (
DatabaseObject) – The class of the object to find.object_name (str) – The name of the object to find.
- Returns:
An instance of the found object.
- Raises:
ValueError – Unsupported value provided for argument
object_class.XnetError – The object is not found.
- property frms: Iterable[Frame]
Returns a list of all frames to which the PDU is mapped.
A PDU is transmitted within the frames to which it is mapped.
To map a PDU to a frame, use the
Frame.pdu_propertiesproperty. You can map one PDU to multiple frames.- Type:
list of
Frame
- property mux_data_mux_sig: Signal
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 raises an
XnetErrorexception. Use thePdu.mux_is_muxedproperty to determine whether the PDU contains a multiplexer signal.You can create a data multiplexer signal by creating a signal and then setting the
Signal.mux_is_data_muxproperty toTrue.A PDU can contain only one data multiplexer signal.
- property mux_is_muxed: bool
Returns
Trueif 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 value of the
SubFrame.mux_valueproperty.- Type:
bool
- property mux_static_sigs: Iterable[Signal]
Returns a list of static signals in the PDU.
Returns an list of signal objects in the PDU that do not depend on value of the
SubFrame.mux_valueproperty. Static signals are contained in every PDU transmitted, as opposed to dynamic signals, which are transmitted depending on the value of theSubFrame.mux_valueproperty.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 list as the
Pdu.signalsproperty.- Type:
list of
Signal
- property mux_subframes: DbCollection
Collection of
SubFrameobjects in this PDU.A subframe defines a group of signals transmitted using the same value of the
SubFrame.mux_value. Only one subframe is transmitted in the PDU at a time.- Type:
- property name: str
Get or set the name of the PDU object.
Lowercase letters, uppercase letters, 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 PDU name must be unique for all PDUs in a cluster.
- Type:
str
- property payload_len: int
Get or set 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 at runtime using this property.
This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session.
- Type:
int
- property signals: DbCollection
Collection of all
Signalobjects in this PDU.The collection includes all signals in the PDU, including static and dynamic signals and the multiplexer signal.
- Type: