nixnet.database.subframe¶
-
class
nixnet.database._subframe.
SubFrame
(**kwargs)[source]¶ Bases:
nixnet.database._database_object.DatabaseObject
Database subframe
-
check_config_status
()[source]¶ Check this subframe’s configuration status.
By default, incorrectly configured subframes in the database are not returned from
Frame.mux_subframes
because they cannot be used in the bus communication. You can change this behavior by settingDatabase.show_invalid_from_open
to True. When a subframe configuration status becomes invalid after the database is opened, the subframe still is returned fromFrame.mux_subframes
even ifDatabase.show_invalid_from_open
is False.Raises: XnetError
– The subframe is incorrectly configured.
-
dyn_signals
¶ Returns a collection of dynamic
Signal
objects in the subframe.Those signals are transmitted when the multiplexer signal in the frame has the multiplexer value defined in the subframe.
Type: DbCollection
-
find
(object_class, object_name)[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,
Frame
forSignal
), theobject_name
to search for can be short, and the search proceeds quickly.If this object is not a direct parent (for example,
Database
forSignal
), theobject_name
to 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_class
isSignal
, you can specifyobject_name
ofmySignal
, assuming that signal name is unique to the cluster. If not, you must include theFrame
name as a prefix, such asmyFrameA.mySignal
.NI-XNET supports the following subclasses of
DatabaseObject
as arguments forobject_class
:nixnet.database.Cluster
nixnet.database.Frame
nixnet.database.Pdu
nixnet.database.Signal
nixnet.database.SubFrame
nixnet.database.Ecu
nixnet.database.LinSched
nixnet.database.LinSchedEntry
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 argumentobject_class
.XnetError
– The object is not found.
-
frm
¶ Returns the reference to the parent frame.
The parent frame is defined when the subframe is created, and you cannot change it afterwards.
Type: Frame
-
mux_value
¶ Get or set the multiplexer value for this subframe.
This property specifies the multiplexer signal value used when the dynamic signals in this subframe are transmitted in the frame. Only one subframe is transmitted at a time in the frame.
There also is a multiplexer value for a signal object as a read-only property. It reflects the value set on the parent subframe object.
This property is required. If the property does not contain a valid value, and you create an XNET session that uses this subframe, 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
-
name
¶ Get or set the name of the subframe 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 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.
Type: str
-
name_unique_to_cluster
¶ Returns a subframe name unique to the cluster that contains the subframe.
If the single name is not unique within the cluster, the name is <frame-name>.<subframe-name>.
You can pass the name to the find function to retrieve the reference to the object, while the single name is not guaranteed success in find because it may be not unique in the cluster.
Type: str
-