ncGetHardwareInfo.vi

NI-CAN

ncGetHardwareInfo.vi

Purpose

Get CAN or LIN hardware information.

Format

Input

card number specifies the CAN or LIN card number from 1 to Number of Cards, where Number of Cards is the number of CAN and LIN cards in the system. You can determine the number of cards in the system by using this VI with card number = 1, port number = 1, and attribute ID = Number of Cards.
port number specifies the CAN or LIN port number from 1 to Number of Ports, where Number of Ports is the number of ports on this card. You can determine the number of ports on this card by using this VI with port number = 1, and attribute ID = Number of Ports.
attribute ID specifies the attribute to get.

Version Major

Returns the major version of the NI-CAN software in the number output. Use card number 1 and port number 1 as inputs.

The major version is the 'X' in X.Y.Z.

Version Minor

Returns the minor version of the NI-CAN software in the number output. Use card number 1 and port number 1 as inputs.

The minor version is the 'Y' in X.Y.Z.

Version Update

Returns the update version of the NI-CAN software in the number output. Use card number 1 and port number 1 as inputs.

The update version is the 'Z' in X.Y.Z.

Version Phase

Returns the phase of the NI-CAN software in the number output. Use card number 1 and port number 1 as inputs.

Phase 1 specifies Alpha, phase 2 specifies Beta, and phase 3 specifies Final release. Unless you are participating in an NI-CAN beta program, you will always see 3.

Version Build

Returns the build of the NI-CAN software in the number output. Use card number 1 and port number 1 as inputs.

With each software development phase, subsequent NI-CAN builds are numbered sequentially. A given Final release version always uses the same build number, so unless you are participating in an NI-CAN beta program, this build number is not relevant.

Version Comment

Returns any special comment on the NI-CAN software in the string output. Use card number 1 and port number 1 as inputs.

This string is normally empty for a Final release. In rare circumstances, an NI-CAN prototype or patch may be released to a specific customer. For these special releases, the version comment describes the special features of the release.

Number of Cards

Returns the number of CAN and LIN cards in the system in the number output. Use card number 1 and port number 1 as inputs.

If you are displaying all hardware information, you get this attribute first, then iterate through all CAN cards with a For loop. Inside the For loop, you get all card-wide attributes including Number Of Ports, then use another For loop to get port-wide attributes.

Serial Number

Card-wide attribute that returns the serial number of the card in the number output. Use the desired card number, and port number 1 as inputs.

Form Factor

Card-wide attribute that returns the form factor of the card in the number output. Use the desired card number, and port number 1 as inputs.

The returned Form Factor is an enumeration.

0

PCI

1

PXI

2

PCMCIA

3

AT

4

USB

Series

Card-wide attribute that returns the series of the card in the number output. Use the desired card number, and port number 1 as inputs.

Series 1 hardware products use the Intel 82527 CAN controller.

Series 2 hardware products use the Philips SJA1000 CAN controller, plus improved RTSI synchronization features.

The returned Series is an enumeration.

0

Series 1

1

Series 2

2

847x

3

847x with Sync

Number of Ports

Card-wide attribute that returns the number of ports on the card in the number output. Use the desired card number, and port number 1 as inputs.

If you are displaying all hardware information, you get this attribute within the For loop for all cards, then iterate through all CAN ports to get port-wide attributes.

Transceiver Type

This port-wide attribute returns the type of transceiver in the number output. Use the desired card number and port number as inputs.

For hardware other than Series 2 XS cards, the transceiver type is fixed. For Series 2 XS cards, the transceiver type reflects the most recent value specified by MAX or ncSetAttr.vi.

This attribute is not supported on the PCMCIA form factor.

This attribute uses the following values:

0 (High-Speed)

Transceiver type is High-Speed (HS).

1 (Low-Speed/Fault-Tolerant)

Transceiver type is Low-Speed/Fault-Tolerant (LS).

2 (Single Wire)

Transceiver type is Single Wire (SW).

3 (External)

Transceiver type is External. This transceiver type is available on Series 2 XS cards only. For more information, refer to ncSetAttr.vi.

4 (Disconnect)

Transceiver type is Disconnect. This transceiver type is available on Series 2 XS cards only. For more information, refer to ncSetAttr.vi.

5 (LIN)

Transceiver type is LIN.

Interface Number

Port-wide attribute that returns the interface number of the port in the number output. Use the desired card number and port number as inputs.

The interface number is assigned to a physical port using the Measurement & Automation Explorer (MAX). The interface number is used as a string in the Frame API (for example, "CAN0"). The interface number is used for the interface input in the Channel API.

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

If the attribute is a number, the value is returned in this output terminal.
If the attribute is a string, the value is returned in this output terminal.
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

This VI provides information about available CAN and LIN cards, but does not require you to open/start sessions. First get Number of Cards, then loop for each card. For each card, you can get card-wide attributes (such as Form Factor), and you also can get the Number of Ports. For each port, you can get port-wide attributes such as the Transceiver.