ncConfigCANObj.vi
Purpose
Configure a CAN Object before using it.
Format
Input
ObjName is the name of the CAN Object to configure. This name uses the syntax "CANx::STDy" or "CANx::XTDy". CANx is the name of the CAN network interface that you used for the preceding ncConfigCANNet VI. STD indicates that the CAN Object uses a standard (11-bit) arbitration ID. XTD indicates that the CAN Object uses an extended (29-bit) arbitration ID. The number y specifies the actual arbitration ID of the CAN Object. The number y is decimal by default, but you also can use hexadecimal by adding "0x" to the beginning of the number. For example, "CAN0::STD25" indicates standard ID 25 decimal on CAN0, and "CAN1::XTD0x0000F652" indicates extended ID F652 hexadecimal on CAN1.
The special virtual interface names "CAN256" and "CAN257" are not supported for CAN Objects. The 847x and 847x with Sync series CAN and LIN interfaces do not support ncConfigCANobj.vi. | |||||||||||||||
CAN Object Config provides the core configuration attributes of the CAN Object. This cluster uses the typedef ncObjAttr.ctl. You can wire in the cluster by first placing it on the front panel from the NI-CAN Controls palette, or you can right-click the VI input and select Create Constant or Create Control.
|
Examples of Different Communication Types
The following figures demonstrate how you can use the Communication Type attribute for actual network data transfer. Each figure shows two separate NI-CAN applications that are physically connected across a CAN network.
The following figure shows a CAN Object that periodically transmits data to another CAN Object. The receiving CAN Object can queue up to five data values.
Example of Periodic Transmission
The following figure shows a CAN Object that polls data from another CAN Object. NI-CAN transmits the CAN remote frame when you call ncWriteObj.vi.
Example of Polling Remote Data Using ncWriteObj.vi
The following figure shows a CAN Object that polls data from another CAN Object. NI-CAN transmits the remote frame periodically and places only changed data into the read queue.
Example of Periodic Polling of Remote Data
Error in describes error conditions occurring before the VI executes. If an error has already occurred, the VI returns the value of the Error in cluster in Error out.
|
Output
Error out describes error conditions. If the Error in cluster indicated an error, the Error out cluster contains the same information. Otherwise, Error out describes the error status of this VI.
|
Description
The CAN Object provides read/write access to a specific ID on the network.
You normally call ncConfigCANNet before this VI in order to configure the Network Interface attributes, then call ncConfigCANObj for each CAN Object desired.
If you intend to use RTSI features to synchronize the CAN Object with other National Instruments cards, refer to the ncConfigCANObjRTSI VI.
When a network frame is transmitted on a CAN-based network, it always begins with the arbitration ID. This arbitration ID is primarily used for collision resolution when more than one frame is transmitted simultaneously, but often is also used as a simple mechanism to identify data. The CAN arbitration ID, along with its associated data, is referred to as a CAN Object.
The NI-CAN implementation of CAN provides high-level access to CAN Objects on an individual basis. You can configure each CAN Object for different forms of communication (such as periodic polling, receiving unsolicited CAN data frames, and so on). After you configure a CAN Object and open it for communication, use the ncReadObj and ncWriteObj VIs to access the data of the CAN Object. The NI-CAN driver performs all other details regarding the object.