nixnet.database.subframe
- class nixnet.database._subframe.SubFrame(**kwargs: int)[source]
Bases:
DatabaseObjectDatabase subframe
- check_config_status() None[source]
Check this subframe’s configuration status.
By default, incorrectly configured subframes in the database are not returned from
Frame.mux_subframesbecause they cannot be used in the bus communication. You can change this behavior by settingDatabase.show_invalid_from_opento True. When a subframe configuration status becomes invalid after the database is opened, the subframe still is returned fromFrame.mux_subframeseven ifDatabase.show_invalid_from_openis False.- Raises:
XnetError – The subframe is incorrectly configured.
- property dyn_signals: DbCollection
Returns a collection of dynamic
Signalobjects in the subframe.Those signals are transmitted when the multiplexer signal in the frame has the multiplexer value defined in the subframe.
- Type:
- 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 frm: Frame
Returns the reference to the parent frame.
The parent frame is defined when the subframe is created, and you cannot change it afterwards.
- Type:
- property mux_value: int
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
- property name: str
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
- property name_unique_to_cluster: str
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