Component: File (RPI) (File): Difference between revisions
Appearance
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (10 intermediate revisions by 2 users not shown) | |||
| Line 48: | Line 48: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
| Line 53: | Line 63: | ||
==Macro reference== | ==Macro reference== | ||
{| class="wikitable | ===AppendByteToFile=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''AppendByteToFile''' | ||
|- | |- | ||
| colspan="2" | | |||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Data | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===AppendStringToFile=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''AppendStringToFile''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | | | width="90%" | Data_String | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 94: | Line 101: | ||
{| class="wikitable | ===CloseFile=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CloseFile''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 117: | Line 115: | ||
{| class="wikitable | ===CreateFile=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CreateFile''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | | | width="90%" | Filename | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 135: | Line 134: | ||
{| class="wikitable | ===DeleteFile=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DeleteFile''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | Filename | |||
|- | |||
| colspan="2" | | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable" | ===MoveToNextFileSector=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''MoveToNextFileSector''' | |||
|- | |||
| colspan="2" | Not currently implemented on the RPI | |||
|- | |- | ||
|- | |- | ||
| | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | ForceNextSector | |||
|- | |- | ||
| colspan="2" | | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 161: | Line 172: | ||
{| class="wikitable | ===OpenFile=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''OpenFile''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Searches for and opens a file for reading or writing from within the current directory on the disk. Returns 0 for success. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | | | width="90%" | Filename | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | 8.3 filename of the file we are trying to open e.g. "file.txt" | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 179: | Line 191: | ||
{| class="wikitable | ===OpenFolder=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''OpenFolder''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 188: | Line 201: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | | | width="90%" | Folder_Name | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 197: | Line 210: | ||
{| class="wikitable | ===ReadByteFromFile=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadByteFromFile''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Reads a byte from the currently open file. Auto increments the position in the file. A return value of 0 may signify the end of the file has been reached (depending on the contents of the file). | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 215: | Line 224: | ||
{| class="wikitable | ===ReadByteFromIndex=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadByteFromIndex''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Reads a byte of data from the local sector buffer. Return = Data byte read from the local sector buffer. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
| width="90%" | | | width="90%" | Address | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 233: | Line 243: | ||
{| class="wikitable | ===ReadFileLength=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadFileLength''' | ||
|- | |- | ||
| colspan="2" | Not currently implemented on the RPI | | colspan="2" | Not currently implemented on the RPI | ||
| Line 246: | Line 257: | ||
{| class="wikitable | ===ReadFileSize=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadFileSize''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Reads the entire size of the current file in bytes. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===ReadStringFromFile=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadStringFromFile''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Reads a string from the currently open file. Auto increments the position in the file. An empty string signifies the end of the file has been reached. | ||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | |||
| width="90%" | NumBytes | |||
|- | |||
| colspan="2" | Maximum number of bytes to attempt to read | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | EndChar | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | colspan="2" | Ends the string if the value specified is found, default is 0 | ||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===SetFileIndex=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetFileIndex''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 295: | Line 314: | ||
{| class="wikitable" | ===WriteByteToBuffer=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''WriteByteToBuffer''' | |||
|- | |||
| colspan="2" | Not currently implemented on the RPI | |||
|- | |||
|- | |- | ||
| width="10% | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90% | | width="90%" | Address | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="10%" align="center" | [[File:Fc9- | | width="90%" | Data | ||
| width="90%" | | |||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===WriteFileSector=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WriteFileSector''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Not currently implemented on the RPI | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| Line 346: | Line 370: | ||
| colspan="2" | Number of simultaneous files we want to access. | | colspan="2" | Number of simultaneous files we want to access. | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | Matrix Ltd. |
| Version | 2.7 |
| Category | File |
File (RPI) component
File component allowing access to read and write files on the Raspberry Pi file system.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_File_RPI.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_File_RPI.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
AppendByteToFile
| AppendByteToFile | |
| Data | |
| Return | |
AppendStringToFile
| AppendStringToFile | |
| Data_String | |
| Return | |
CloseFile
| CloseFile | |
| Return | |
CreateFile
| CreateFile | |
| Filename | |
| Return | |
DeleteFile
| DeleteFile | |
| Filename | |
| Return | |
MoveToNextFileSector
| MoveToNextFileSector | |
| Not currently implemented on the RPI | |
| ForceNextSector | |
| Return | |
OpenFile
OpenFolder
| OpenFolder | |
| Folder_Name | |
| Return | |
ReadByteFromFile
ReadByteFromIndex
| ReadByteFromIndex | |
| Reads a byte of data from the local sector buffer. Return = Data byte read from the local sector buffer. | |
| Address | |
| Return | |
ReadFileLength
| ReadFileLength | |
| Not currently implemented on the RPI | |
| Return | |
ReadFileSize
| ReadFileSize | |
| Reads the entire size of the current file in bytes. | |
| Return | |
ReadStringFromFile
SetFileIndex
| SetFileIndex | |
| File_Index | |
| Range: 0 to 4 | |
| Return | |
WriteByteToBuffer
| WriteByteToBuffer | |
| Not currently implemented on the RPI | |
| Address | |
| Data | |
| Return | |
WriteFileSector
| WriteFileSector | |
| Not currently implemented on the RPI | |
| Return | |
Property reference
| Properties | |
| Root Folder | |
| Root location on the RPI where the files will be stored | |
| File Count | |
| Number of simultaneous files we want to access. | |
| Simulation | |
| Sim Root Folder | |