NI 9802 (FPGA Interface)

CompactRIO

NI 9802 (FPGA Interface)

CompactRIO 2 SD Card Memory Module

FPGA I/O Node

This device does not support the FPGA I/O Node. You can use the FPGA I/O Method Node and FPGA I/O Property Node to access methods and properties for the device.

Note Note  If you add the NI 9802 to the project, the Real-Time support for the Mount SD Card Interface method compiles onto the FPGA when you compile the FPGA VI, which can take up space on the FPGA. If you are not actively using the NI 9802, you might want to remove the module item from the project.

Arbitration

This device supports only the Arbitrate if Multiple Requestors Only option for arbitration. You cannot configure arbitration settings for this device.

SD Card Methods

Use the FPGA I/O Method Node to access the following methods for this device. You also can use the Mount SD Card Interface method to mount the file system of an SD Card into a drive. This device does not support any module methods.

Method Description
Close File Closes the open file specified by FileRefIn. This method executes regardless of whether an error occurred in a preceding operation, which ensures that files are closed correctly. If the file reference is zero, the method returns an error and does not execute.
Delete File Deletes the file specified by FileID. The file ID can be any unsigned integer value from 0 to 255 and appears as an 8-bit hexadecimal value in the filename. If the specified file is open, the method returns an error and does not execute.
Get File Size Returns the file size in bytes of the file specified by FileID. The file ID can be any unsigned integer value from 0 to 255 and appears as an 8-bit hexadecimal value in the filename. If the specified file is open, the method returns an error and does not execute.

Refer to the NI 9802 Methods VI in the labview\examples\CompactRIO\Module Specific\NI 9802\NI 9802 Methods directory for an example of using this method.

 Open example
Get Space Returns the amount of unallocated storage in bytes on the SD Card file system. If a file is open on the specified card, the value returned may be less than the actual free space.

Refer to the NI 9802 Methods VI in the labview\examples\CompactRIO\Module Specific\NI 9802\NI 9802 Methods directory for an example of using this method.

 Open example
Open File Opens or creates a file specified by FileID.
Note Note  Only one file can be open on a given SD Card at one time.
The file ID can be any unsigned integer value from 0 to 255 and appears as an 8-bit hexadecimal value in the filename. The name of the file is in the format CRIO-X##.BIN, where ## is the hexadecimal representation of the value you entered. The filename must be uppercase and must comply with the DOS 8.3 naming convention. The Mode input determines the access mode of the file: Read opens an existing file for reading only and returns an error if the file does not exist; Write New creates a new file for writing and returns an error if the file already exists; Write Over either creates a new file for writing or opens the existing file and overwrites existing data with new data; and Write Append either creates a new file for writing or opens the existing file and appends new data to the end of the file. FileRefOut returns a reference to the open file.
Note Note  You must use the Close File method to close the file you open. Not closing a file may result in incomplete data or errors the next time you use the file.
Read U32 Reads binary data in big-endian format from the open file specified by FileRefIn. If the file reference is zero, the method returns an error and does not execute. FileRefOut returns a reference to the open file. EOF returns TRUE when there is no more data to read. If the file does not contain the number of bytes requested, the method returns an error.
Read U16 Reads binary data in big-endian format from the open file specified by FileRefIn. If the file reference is zero, the method returns an error and does not execute. FileRefOut returns a reference to the open file. EOF returns TRUE when there is no more data to read. If the file does not contain the number of bytes requested, the method returns an error.
Read U8 Reads binary data in big-endian format from the open file specified by FileRefIn. If the file reference is zero, the method returns an error and does not execute. FileRefOut returns a reference to the open file. EOF returns TRUE when there is no more data to read. If the file does not contain the number of bytes requested, the method returns an error.

Refer to the NI 9802 Read U8 Variable VI in the labview\examples\CompactRIO\Module Specific\NI 9802\NI 9802 Read U8 File directory for an example of using this method.

 Open example
Write Writes binary data in big-endian format to the open file specified by FileRefIn. The data type you wire to the FileRefIn input determines whether the polymorphic method writes U32, U16, or U8 values. If the file reference is zero, the method returns an error and does not execute. FileRefOut returns a reference to the open file.

Refer to the NI 9802 Write VI in the labview\examples\CompactRIO\Module Specific\NI 9802\NI 9802 Write File directory for an example of using this method.

 Open example

SD Card Properties

Use the FPGA I/O Property Node to access the following properties for this device.

Refer to the NI 9802 Methods VI in the labview\examples\CompactRIO\Module Specific\NI 9802\NI 9802 Methods directory for an example of using these properties.

 Open example

Property Description
Card Present Returns a Boolean value. A value of TRUE indicates that an SD Card is inserted in the slot.
Door Open Returns a Boolean value. A value of TRUE indicates that the SD Card slot door is open and it is not safe to read from or write to the SD Card in the slot.

Module Properties

Use the FPGA I/O Property Node to access the following properties for this device.

Property Description
Module ID Returns the module ID.
Serial Number Returns the unique serial number of the module.
Vendor ID Returns the National Instruments vendor ID, 0x1093.

Removing SD Cards

Do not open an SD Card slot door or remove an SD Card while the yellow LED for that card is lit or flashing.

Caution Caution  Opening an SD Card slot door or removing an SD Card while the yellow LED for that card is lit or flashing might result in incomplete data.

If you open an SD Card slot door while the yellow LED for that card is lit or flashing, the software attempts to protect the SD Card file system by closing all open files, which can result in lost data. Refer to the NI 9802 Operating Instructions and Specifications for descriptions of each of the LEDs on the NI 9802 and when it is safe to remove SD Cards from the NI 9802.

Single-Cycle Timed Loop

This device does not support the single-cycle Timed Loop.

FPGA Target Clock Support

This device supports only the 40 MHz FPGA target clock setting.

Hardware Documentation

Refer to the NI 9802 Operating Instructions and Specifications to learn about module specifications and how to use the module. Refer to the CompactRIO Related Documentation for further information about CompactRIO documentation.