Read Command; Set Up The Read Command - Allen-Bradley Logix5000 Series Application Book

Compactflash file system
Hide thumbs Also See for Logix5000 Series:
Table of Contents

Advertisement

18
CompactFlash Commands

Read Command

Publication LOGIX-AP007B-EN-P - January 2007
The Read command is used when you want to read data from the
CompactFlash card. A file must exist on the CompactFlash card before
executing this command.
The read command is broken into six commands:
• The file is open.
• The file pointer is set.
• The file is read.
Only 450 bytes can be read at one time from the file. Therefore, reading
from the file is broken down into 450 byte chunks. This moves the data
into the data_read array.
• The checksums are calculated and compared to those in the file. The
data is then parsed into the Data array in the CF_Data_Working UDT.
If the checksums are not calculated, compared, and parsed,
TIP
the file closes and the read sequence is restarted from the
beginning.
The application will attempt to read the file four times.
After the fourth failure a checksum error is set.
• The file is closed.
• Error handling is performed, if needed.

Set Up the Read Command

To set up the read command, you need to set the bit execute_CF_Read_Data.
The application code handles resetting this bit.
1. Define a file name including a file extension, for example, testfile1.dat.
2. Enter the number of bytes you want to read from the file.
3. Move the data from the data array in the CF_Data_Working UDT when
the read is completed.
Only 450 bytes can be read at one time from the file. Therefore, reading
from the file is broken down into 450 byte chunks. This moves the data
into the data_read array.
We recommended that you clear the data array before moving the data
into the array. This will clear out any data from previous read or write
commands.
Refer to Chapter 4, Example Application for complete instructions.

Advertisement

Table of Contents
loading

This manual is also suitable for:

1756-l611756-l621756-l60m03se1756-l631756-l64

Table of Contents