Component: File Access (File ): Difference between revisions
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable"" |
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead"" |
||
| Line 58: | Line 58: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AppendByteToFile''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AppendByteToFile''' | ||
|- | |- | ||
| Line 77: | Line 77: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AppendStringToFile''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AppendStringToFile''' | ||
|- | |- | ||
| Line 96: | Line 96: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CloseFile''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CloseFile''' | ||
|- | |- | ||
| Line 110: | Line 110: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CreateFile''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CreateFile''' | ||
|- | |- | ||
| Line 129: | Line 129: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DeleteFile''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DeleteFile''' | ||
|- | |- | ||
| Line 148: | Line 148: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | ||
|- | |- | ||
| Line 162: | Line 162: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToNextFileSector''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToNextFileSector''' | ||
|- | |- | ||
| Line 181: | Line 181: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OpenFile''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OpenFile''' | ||
|- | |- | ||
| Line 200: | Line 200: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OpenFolder''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OpenFolder''' | ||
|- | |- | ||
| Line 219: | Line 219: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromBuffer''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromBuffer''' | ||
|- | |- | ||
| Line 238: | Line 238: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromFile''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromFile''' | ||
|- | |- | ||
| Line 252: | Line 252: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromIndex''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromIndex''' | ||
|- | |- | ||
| Line 271: | Line 271: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromScan''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromScan''' | ||
|- | |- | ||
| Line 290: | Line 290: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileLength''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileLength''' | ||
|- | |- | ||
| Line 304: | Line 304: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileSector''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileSector''' | ||
|- | |- | ||
| Line 318: | Line 318: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileSize''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileSize''' | ||
|- | |- | ||
| Line 332: | Line 332: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadStringFromFile''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadStringFromFile''' | ||
|- | |- | ||
| Line 356: | Line 356: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ScanCurrentFolder''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ScanCurrentFolder''' | ||
|- | |- | ||
| Line 380: | Line 380: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFileIndex''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFileIndex''' | ||
|- | |- | ||
| Line 399: | Line 399: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTimeAndDate''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTimeAndDate''' | ||
|- | |- | ||
| Line 423: | Line 423: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteByteToBuffer''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteByteToBuffer''' | ||
|- | |- | ||
| Line 447: | Line 447: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteFileSector''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteFileSector''' | ||
|- | |- | ||
Revision as of 14:17, 13 July 2026
| Author | Matrix TSL |
| Version | 1.0 |
| Category | File |
File Access component
File component allowing access to read and write files on the local Windows file system. Only available in simulation runtime mode, cannot be downloaded to hardware. Compatible with File (SD Card) embedded component.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_File.fcsx
Please click here to view the component source code (Beta): FC_Comp_Source_File.fcsx
Detailed description
No detailed description exists yet for this component
Simple example App Developer file used with CVS Read/Write component to generate a two column CSV file that can be loaded into Microsoft Excel or LibreOffice Math.
For an embedded CSV read write see the File component
CSV Component used with App Developer -> File component:
CSV Test AD
Macro reference
AppendByteToFile
AppendStringToFile
CloseFile
| CloseFile | |
| Closes the currently opened file, releasing the file handle and allowing other applications to edit the file. | |
| Return | |
CreateFile
DeleteFile
| DeleteFile | |
| Searches for and deletes a file in the current folder location on the card. Default = Root Returns 0 for success. | |
| Filename | |
| 8.3 format filename e.g."file.txt" | |
| Return | |
Initialise
| Initialise | |
| Attempts to communicate with the SD card and if successful sets up the file system. Returns 0 for success. | |
| Return | |
MoveToNextFileSector
OpenFile
OpenFolder
ReadByteFromBuffer
ReadByteFromFile
ReadByteFromIndex
ReadByteFromScan
ReadFileLength
ReadFileSector
ReadFileSize
| ReadFileSize | |
| Reads the entire size of the current file in bytes. | |
| Return | |
ReadStringFromFile
ScanCurrentFolder
SetFileIndex
| SetFileIndex | |
| Sets the current file index and used to switch between several open file streams. Default = 0. | |
| File_Index | |
| File index ranges from 0 to (Max Concurrent Files - 1) | |
| Return | |
SetTimeAndDate
| SetTimeAndDate | |
| Sets the current time and date. Time = (Hour << 11) + (Min << 5) + (Sec >> 1) Date = (YearFrom1980 << 9) + (Month << 5) + (Day) Additional details can be found here: http://www.maverick-os.dk/FileSystemFormats/FAT16_FileSystem.html#TimeFormat | |
| Time | |
| Sets the current Time in FAT Time format hhhhhmmmmmmsssss - S=Secs/2 | |
| Date | |
| Sets the current Date in FAT Date format yyyyyyymmmmddddd - Y=Years since 1980 | |
| Return | |
WriteByteToBuffer
| WriteByteToBuffer | |
| Writes a single byte to the current 512 byte local sector buffer. | |
| Address | |
| Address Range 0 - 511 | |
| Data | |
| Data Byte to write to the buffer | |
| Return | |
WriteFileSector