XNET I/O Names
- 更新日2023-09-14
- 5分で読める
XNET I/O Names
LabVIEW I/O names (also known as refnum tags) are provided for various object classes within NI-XNET.
I/O names provide user interface features for easy configuration. You can use an I/O name as a:
- Control (or indicator) : Use an I/O name control to select a specific instance on the front panel. NI-XNET I/O name controls are in the front panel Modern»I/O»XNET controls palette.Typically, you use I/O name controls to select an instance during configuration, and the instance is used at run time. For example, prior to running a VI, you can use XNET Signal I/O name controls to select signals to read. When the user runs the VI, the selected signals are passed to the XNET Create Session VI , followed by calls to the XNET Read VI to read and display data for the selected signals.As an alternative, you also can use I/O name controls to select an instance at run time. This applies when the VI always is running for the end user, and the VI uses distinct stages for configuration and I/O. Using the previous example, the user clicks XNET Signal I/O name controls to select signals during the configuration stage. Next, the user clicks a Go button to proceed to the I/O stage, in which the XNET Create Session VI and the XNET Read VI are called.You can build a standalone application (executable) that contains NI-XNET I/O name controls on its front panel. While running in an executable, the I/O name drop-down menu is supported, but the right-click menu is not operational.
- Constant : Use an I/O name constant to select a specific instance on the block diagram. NI-XNET I/O name constants are in the block diagram Measurement I/O»XNET functions palette. You can access I/O name constants only during configuration, prior to running the VI.
If you are using LabVIEW Real-Time (RT), you can right-click the RT target within a LabVIEW Project and select the Connect menu item. This connects to the RT target over TCP/IP, which in turn enables the user interface of NI-XNET I/O names to operate remotely. You can select names from the databases on the RT target and menu items to manage database deployments.
At run time, the VIs use I/O names to access features for the selected instance. The I/O name has two simultaneous LabVIEW types:
- String : When you wire the I/O name to a LabVIEW string, the string contains the selected instance name. Use this string to store the I/O name is a portable form, such as a text file.You can wire a LabVIEW string directly to an I/O name.
- Refnum : At run time, the I/O name contains a numeric reference to the instance for use with NI-XNET property nodes and VIs. The property node for the I/O name provides access to its configuration. The VIs provide methods for the instance, such as to change state (start/stop), or access data (read/write).
I/O Name Classes
NI-XNET includes the following I/O name classes:
Session
Each session represents a connection between your National Instruments hardware and hardware products on the external network. Your application uses XNET sessions to read and write I/O data.
The session I/O name is primarily for sessions created during configuration using a LabVIEW project. When you create a session at run time with the XNET Create Session VI , the I/O name serves only as a refnum (its string is irrelevant).
Database Classes
To communicate with hardware products on the external network, NI-XNET applications must understand how that hardware communicates in the actual embedded system, such as the vehicle. This embedded communication is described within a standardized file, such as CANdb ( .dbc ), FIBEX ( .xml ), AUTOSAR ( .arxml ), or LIN Description File ( .ldf ). Within NI-XNET, this file is referred to as a database. The database contains many object classes, each of which describes a distinct entity in the embedded system:
- Database : Each database is represented as a distinct instance in NI-XNET. Although the I/O name string can be the complete file path, it typically uses a shortened alias.
- Cluster : Each database contains one or more clusters, where the cluster represents a collection of hardware products all connected over a shared cabling harness. In other words, each cluster represents a single network. For example, the database may describe a single vehicle, where the vehicle contains one Body CAN cluster, another Powertrain CAN cluster, and one Chassis FlexRay cluster.
- ECU : Each Electronic Control Unit (ECU) represents a single hardware product in the embedded system. The cluster contains one or more ECUs, all connected over a network cable. Multiple clusters can contain a single ECU, in which case it behaves as a gateway between the clusters.
- Frame : Each frame represents a unique unit of data transfer over the cluster cable. The frame bits contain payload data and an identifier that specifies the data (signal) content. Only one ECU in the cluster transmits each frame, and one or more ECUs receive each frame.
- Signal : Each frame contains zero or more values, each of which is called a signal. For example, the first two bytes of a frame payload may represent a temperature, and the third payload byte may represent a pressure. Within the database, each signal specifies its name, position, and length of the raw bits in the frame, and a scaling formula to convert raw bits to/from a physical unit. The physical unit uses a LabVIEW double-precision floating-point numeric type. The signal is the highest level of abstraction for embedded networks. When you use an XNET Session to read/write signal values as physical units, your application does not need to be concerned with protocol (CAN/FlexRay/LIN) and frame encoding details.
- LIN Schedule : The LIN protocol is different than CAN or FlexRay, in that it supports multiple schedules that determine when frames transmit. You can change the current schedule at runtime.
- LIN Schedule Entry : Each LIN Schedule contains one or more entries, or slots. Each entry in turn contains one or more frames that can transmit during the entry's time slot. A single frame can be located in multiple LIN schedules and within multiple LIN schedule entries.
Additional database classes include PDU and Subframe.
System Classes
These classes describe hardware in your National Instruments system, such as PXI or a desktop PC containing PCI cards.
- Device : This represents the National Instruments device for CAN/FlexRay/LIN, such as a PXI or PCI card. Each NI-XNET device contains one or more interfaces.
- Interface : This represents a single CAN, FlexRay, or LIN connector (port) on the device. Within NI-XNET, the interface is the object used to communicate with external hardware described in the database. When you create an NI-XNET session, you specify a physical and logical connection between the NI interface and a cluster. Because the cluster represents a single physical cable harness, it does not make sense to connect the NI interface to multiple clusters simultaneously.
- Terminal : Each interface contains various terminals. The terminals are for NI-XNET synchronization features, to connect triggers and timebases (clocks) to/from the interface hardware. The terminal I/O name is for selecting a string input to the XNET Connect Terminals or XNET Disconnect Terminals VI, both of which operate on the session. Unlike the other I/O name classes, the terminal does not provide refnum features such as property nodes.
関連コンテンツ
- XNET Cluster I/O Name
- XNET Database I/O Name
- XNET ECU I/O Name
- XNET Frame I/O Name
- XNET Interface I/O Name
- XNET Signal I/O Name
- XNET Session I/O Name
- XNET LIN Schedule I/O Name
- XNET LIN Schedule Entry I/O Name
- XNET PDU I/O Name
- XNET Subframe I/O Name
- XNET Device I/O Name
- XNET Terminal I/O Name
- Getting Started with NI-XNET LabVIEW API