Difference between revisions of "Component: File Access (File )"
(One intermediate revision by one other user not shown) | |||
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_File.fcsx FC_Comp_Source_File.fcsx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_File.fcsx FC_Comp_Source_File.fcsx] |
==Detailed description== | ==Detailed description== | ||
Line 47: | Line 47: | ||
''No detailed description exists yet for this component'' | ''No detailed description exists yet for this component'' | ||
− | + | Simple example App Developer file used with [[Component:_CSV_Read/Write_(File)|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 [[Component:_Embed_File_(File)|File component]] | ||
+ | CSV Component used with App Developer -> File component: {{Fcfile|CSVTestAD.fcsx|CSV Test AD}} | ||
==Macro reference== | ==Macro reference== |
Latest revision as of 15:04, 29 March 2023
Author | Matrix TSL |
Version | 1.0 |
Category | File |
Contents
- 1 File Access component
- 2 Component Source Code
- 3 Detailed description
- 4 Macro reference
- 4.1 AppendByteToFile
- 4.2 AppendStringToFile
- 4.3 CloseFile
- 4.4 CreateFile
- 4.5 DeleteFile
- 4.6 Initialise
- 4.7 MoveToNextFileSector
- 4.8 OpenFile
- 4.9 OpenFolder
- 4.10 ReadByteFromBuffer
- 4.11 ReadByteFromFile
- 4.12 ReadByteFromIndex
- 4.13 ReadByteFromScan
- 4.14 ReadFileLength
- 4.15 ReadFileSector
- 4.16 ReadFileSize
- 4.17 ReadStringFromFile
- 4.18 ScanCurrentFolder
- 4.19 SetFileIndex
- 4.20 SetTimeAndDate
- 4.21 WriteByteToBuffer
- 4.22 WriteFileSector
- 5 Property reference
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