ncConfigCANObjRTSI.vi

NI-CAN

ncConfigCANObjRTSI.vi

Purpose

Configure a CAN Object with RTSI features.

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 847x and 847x with Sync series CAN and LIN interfaces do not support ncConfigCANObjRTSI.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. (For more information, refer to ncConfigCANObj.vi.)
CAN RTSI Config provides RTSI configuration attributes for the CAN Object. This cluster uses the typedef ncCANRtsiAttr.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.

RTSI Mode specifies the behavior of the CAN Object with respect to RTSI, including whether the RTSI signal is an input or output.

Disable RTSI

Disables RTSI behavior for the CAN Object. All other RTSI attributes are ignored. Using this mode is equivalent to calling ncConfigCANObj.

On RTSI Input - Transmit CAN Frame

The CAN Object will transmit a frame from its write queue when the RTSI input transitions from low to high. To begin transmission, at least one data frame must be written using ncWriteObj. If the write queue becomes empty due to frame transmissions, the last frame will be transmitted on each RTSI pulse until another frame is provided using ncWriteObj.

In order to use this RTSI Mode, you must configure the Communication Type of the CAN Object to either Transmit Data by Call, Transmit Data Periodically, or Transmit Periodic Waveform. The Period attribute is ignored when this RTSI mode is selected.

On RTSI Input - Timestamp RTSI event

When the RTSI input transitions from low to high, a timestamp is measured and stored in the read queue of the CAN Object. The special RTSI frame uses the following format:

Timestamp:

Time when RTSI input transitioned from low to high

Data:

User-defined 4 byte data pattern (refer to UserRTSIFrame for details)

Note  When you configure a DAQ card to pulse the RTSI signal periodically, do not exceed 1000 Hertz (pulse every millisecond). If the RTSI input is pulsed faster than 1kHz on a consistent basis, CAN performance will be adversely affected (for example, lost data frames).

RTSI Output on Receiving CAN Frame

The CAN Object will output the RTSI signal whenever a CAN frame is stored in the read queue.

In order to use this RTSI Mode, you must configure the Communication Type of the CAN Object to Receive Unsolicited.

RTSI Output on Transmitting CAN Frame

The CAN Object will output the RTSI signal whenever a CAN frame is successfully transmitted.

In order to use this RTSI Mode, you must configure the Communication Type of the CAN Object to either Transmit Data by Call, Transmit Data Periodically, or Transmit Periodic Waveform.

RTSI Output on ncAction call

The CAN Object will output the RTSI signal whenever the ncAction VI is called with Opcode Output on RTSI line. This RTSI mode can be used to manually toggle/pulse a RTSI output within the application.

RTSI Signal defines the RTSI signal associated with the RTSI Mode. Valid values are 0 to 6, corresponding to RTSI 0 to RTSI 6 on other National Instruments cards.

Series 1 and 2 CAN cards each have limitations regarding RTSI. For information on these limitations, refer to Valid Combinations of Source/Destination in the ncConnectTerminals.vi function reference.

RTSI Behavior specifies whether to pulse or toggle a RTSI output. This attribute is ignored when RTSI Mode specifies input (always detected low to high):

Output RTSI Pulse: Pulse the RTSI output. For Series 1 CAN cards, the pulse is at least 100 µs. For Series 2 CAN cards, the pulse is at least 100 ns.

Toggle RTSI Line: If the previous state was high, the output toggles low, then vice-versa.

RTSI Skip specifies the number of RTSI inputs (low-to-high transitions) to skip for RTSI Mode On RTSI Input - Timestamp RTSI event, and On RTSI Input - Transmit CAN Frame. It is ignored for all other RTSI Mode values. For example, if the RTSI input transitions from low to high every 1 ms, RTSI Skip of 9 means that a timestamp will be stored in the read queue every 10 ms.

UserRTSIFrame specifies a 4-byte pattern used to differentiate RTSI timestamps from CAN data frames. It is provided as a U32, and the high byte is stored as byte 0 from ncReadObj. For example, AABBCCDD hexadecimal is returned as AA in byte 0, BB in byte 1, and so on.

This attribute is used only for RTSI Mode On RTSI Input - Timestamp RTSI event. It is ignored for all other RTSI Mode values.

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.
status is True if an error occurred. If status is True, the VI does not perform any operations.
code is the error code number identifying an error. A value of 0 means success. A negative value means error: VI did not execute the intended operation. A positive value means warning: VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
source identifies the VI where the error occurred.

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.
status is True if an error occurred.
code is the error code number identifying an error. A value of 0 means success. A negative value means error: VI did not execute the intended operation. A positive value means warning: VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
source identifies the VI where the error occurred.

Description

RTSI is a bus that interconnects National Instruments DAQ, IMAQ, Motion, and CAN boards. This feature allows synchronization of DAQ, IMAQ, Motion, and CAN boards by allowing exchange of timing signals. Using RTSI, a device (board) can control one or more slave devices.

If you are not using RTSI features to synchronize the CAN Object with other National Instruments cards, refer to the ncConfigCANObj VI.