manufacturer of I/O-rich SBCs, operator interfaces, handheld instruments, and development tools for embedded control low cost single board computers, embedded controllers, and operator interfaces for scientific instruments & industrial control development tools for embedded control order our low cost I/O-rich embedded control products embedded controller manufacturer profile single board computers & embedded controllers development tools & starter kits for your embedded design operator interfaces with touchscreens and graphical user interface plug-in expansion modules for digital & analog I/O C language & Forth language integrated development tools, IDE single board and embedded computer accessories embedded controller enclosures, bezels, environmental gaskets
Table of Contents

Introduction

Specifications

Hardware

Flash Card

Connecting To the Wildcard Bus

Selecting the Wildcard Address

Installing the CF Card

CF Card Software Package User Guide and Glossary

How To Install the CF Software

Using the Driver Code with C

Using the Driver Code with Forth

CF Card Software

Categorized List of Functions and Constants

ATA Failure Codes

ATA Primitives

CF Card Information

Directory

File Access and Position Modes

File I/O

File Processing

File System Error Handling

Initialization

Overview of Glossary Notation

Using the File System Functions

Commonly Used Terms

String Parameters and the Use of THIS_PAGE

Access Privileges

Root Directory Only and File Name Restrictions

File Position Indicator

Error Handling

Real-Time Clock on the Host Computer Enables Time/Date Marking of Files 12

Initialization

Automatic Initialization and File Processing

Upgrade note for former Memory Interface Board (MIB) Users

How To Create and Use an AUTOEXEC.QED File

Compile a Program into Flash Memory

Create a Set of Image Files

Transfer the Image File Contents into Memory

Restrictions on Software Upgrades

Recovering from Buggy AUTOSTART.QED Files

Compact Flash Card Software Package Main Glossary

Upgrade Notice for Prior Users of the Memory Interface Board

Sample FILEDEMO.C File (pdf)

Sample FILEDEMO.4th File (pdf)

CF Wildcard Hardware Schematic

The Compact-Flash Wildcard and
CF Card Software Package User Guide

<< Previous | Next>>

4th: END_CAPTURE ( -- )
A do-nothing function that serves as a marker used to terminate File_Capture. To be recognized, END_CAPTURE must be the first non-white-space item on a line. If executed by Forth (for example, during file processing), END_CAPTURE has no effect. See the glossary entry for File_Capture.

C: int End_Update ( void )
4th: End_Update ( -- error )
This routine must be the last function called in an AUTOEXEC.QED file (or other processed file) that is used to perform a software update of the page that contains the code that invoked the update. For example, if a priority autostart routine located on page 4 calls Do_Autoexec, and if the AUTOEXEC.QED file contains 4 File_To_Page, then that file must end with End_Update. End_Update prints a message asking the user to remove the CF Card, stops task switching, closes input and output files, restores prior serial vectors and abort parameters, waits for the CF Card to be removed, then aborts to reboot the processor. This approach prevents a crash which would occur if the autostart routine was replaced while it was executing! This routine is always callable by Process_File, even if the CF Card Forth headers have not been loaded onto the Mosaic controller. See the "How to Create an Autoexec.QED File" section for an example of use.

C: ERR_BAD_OR_UNOPEN_FILEID
4th: ERR_BAD_OR_UNOPEN_FILEID ( -- n )
A constant (equal to 0x4000) that is returned as an error code when an attempt to access a file fails because the specified file_id is invalid, or is not associated with an open file. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function. Because this error is associated with operations that are performed on a file that does not have a valid file_id, it cannot be accessed by File_Error; use Report_File_Open_Errors for diagnostics.

C: ERR_CANNOT_ADD_CLUSTER
4th: ERR_CANNOT_ADD_CLUSTER ( -- n )
A constant (equal to 0x0010) that is returned as an error code when an attempt to allocate a disk cluster fails; this may be because the disk is full. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function or by File_Error. See File_Error.

C: ERR_CANNOT_TRUNCATE_FILE
4th: ERR_CANNOT_TRUNCATE_FILE ( -- n )
A constant (equal to 0x0200) that is returned as an error code when an attempted truncation of a file fails. Truncation is required when opening a file with W_MODE or WPLUS_MODE access privileges. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function. Because this error is associated with operations that are performed on a file that does not have a valid file_id, it cannot be accessed by File_Error; use Report_File_Open_Errors for diagnostics.

C: ERR_DISK_IS_FULL
4th: ERR_DISK_IS_FULL ( -- n )
A constant (equal to 0x1000) that is returned as an error code when an attempt to write to the disk fails because the disk is full. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function. Because this error is associated with operations that are performed on a file that does not have a valid file_id, it cannot be accessed by File_Error; use Report_File_Open_Errors for diagnostics.

C: ERR_EOF
4th: ERR_EOF ( -- n )
A constant (equal to 0x8000) that is returned as an error code when an end of file condition is encountered during a file access. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function or by File_Error. See File_Error and File_EOF.

C: ERR_FAIL_ID_DRIVE
4th: ERR_FAIL_ID_DRIVE ( -- n )
A constant (equal to 0x0100) that is returned as an error code when a the ATA_ID_Drive command fails. This error message is also returned if Init_File_System or Init_File_IO is not called before attempting to call a file manipulation function. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function or by File_Error (see its glossary entry). This error code is relevant for both the low level ATA drivers and the high level file system functions; thus it also has the name FAIL_ID_DRIVE to be consistent with the ATA failure codes.

C: ERR_FILE_DOES_NOT_EXIST
4th: ERR_FILE_DOES_NOT_EXIST ( -- n )
A constant (equal to 0x0400) that is returned as an error code when a file is required to exist but does not. Pre-existence is required when opening a file with R_MODE or RPLUS_MODE access privileges. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function. Because this error is associated with operations that are performed on a file that does not have a valid file_id, it cannot be accessed by File_Error; use Report_File_Open_Errors for diagnostics.

C: ERR_INVALID_SECTOR_NUMBER
4th: ERR_INVALID_SECTOR_NUMBER ( -- n )
A constant (equal to 0x0008) that is returned as an error code when a disk access to an out-of-range sector number is attempted. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function or by File_Error. See File_Error.

C: ERR_NEGATIVE_FILE_POSN
4th: ERR_NEGATIVE_FILE_POSN ( -- n )
A constant (equal to 0x0020) that is returned as an error code when the file position pointer is set to a negative value. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function or by File_Error. See File_Error.

C: ERR_NOT_DOSFAT_DRIVE
4th: ERR_NOT_DOSFAT_DRIVE ( -- n )
A constant (equal to 0x0004) that is returned as an error code when the boot sector of an ATA Flash drive is not properly formatted with a DOS-compatible FAT file system. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function or by File_Error. See File_Error.

C: ERR_READ_ACCESS_VIOLATION
4th: ERR_READ_ACCESS_VIOLATION ( -- n )
A constant (equal to 0x0080) that is returned as an error code when a read is attempted on a write-only file. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function or by File_Error. See File_Error.

C: ERR_ROOT_DIR_FULL
4th: ERR_ROOT_DIR_FULL ( -- n )
A constant (equal to 0x0800) that is returned as an error code when an attempt to add a file to the root directory fails. The maximum number of files in the root directory is set when the flash card is formatted. For example, the root directory of a 10 Megabyte card can contain a maximum of 512 files. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function. Because this error is associated with operations that are performed on a file that does not have a valid file_id, it cannot be accessed by File_Error; use Report_File_Open_Errors for diagnostics.

C: ERR_TOO_MANY_FILES_OPEN
4th: ERR_TOO_MANY_FILES_OPEN ( -- n )
A constant (equal to 0x2000) that is returned as an error code when an attempt to open a file fails because the maximum number of files as set by Init_File_Heap (called by Init_File_IO and Init_File_System) has been exceeded. Note that some file operations such as File_Type or File_Copy need to open and then close one or two files. To proceed, use File_Close to close any unneeded files. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function. Because this error is associated with operations that are performed on a file that does not have a valid file_id, it cannot be accessed by File_Error; use Report_File_Open_Errors for diagnostics.

C: ERR_WRITE_ACCESS_VIOLATION
4th: ERR_WRITE_ACCESS_VIOLATION ( -- n )
A constant (equal to 0x0040) that is returned as an error code when a write is attempted to a read-only file. Note that File_Open will set the access mode of a file to R_MODE (read only) if the directory entry for the file (initialized when the file was originally created) specifies read-only access. All error codes returned by the file system functions have names starting with "ERR", have a single-bit set, and may be OR'd together to represent multiple errors. This constant may be used as a bitmask to decode the value returned by a calling file system function or by File_Error. See File_Error.

<< Previous | Next>>


Home|Site Map|Products|Manuals|Resources|Order|About Us
Copyright (c) 2006 Mosaic Industries, Inc.
Your source for single board computers, embedded controllers, and operator interfaces for instruments and automation