Jump to content

Component: Embed File (File): Difference between revisions

From Flowcode Help
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable""
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(2 intermediate revisions by the same user not shown)
Line 106: Line 106:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFileArray'''
| width="90%" class="mtx-class-macrohead" | '''GetFileArray'''
|-
|-
| colspan="2" | Reads a number of bytes from the file from the specified start address. 
| colspan="2" | Reads a number of bytes from the file from the specified start address. 
Line 135: Line 135:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFileByte'''
| width="90%" class="mtx-class-macrohead" | '''GetFileByte'''
|-
|-
| colspan="2" | Reads a single byte from the file at the specified address. 
| colspan="2" | Reads a single byte from the file at the specified address. 
Line 154: Line 154:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFileLength'''
| width="90%" class="mtx-class-macrohead" | '''GetFileLength'''
|-
|-
| colspan="2" | Returns the file size in bytes. 
| colspan="2" | Returns the file size in bytes. 
Line 169: Line 169:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

Latest revision as of 14:22, 13 July 2026

Author Matrix TSL
Version 1.0
Category File


Embed File component

A component to simplify the process of embedding files into ROM. Stores the file inside a ROM look up table.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_EmbedFile.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_EmbedFile.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Basic example program which embeds a text file into the microcontrollers ROM memory and then prints the file out to a LCD display. EmbedFileExample Text file to go with the example, must be placed into the same directory as the Flowcode file.

File:TextFile.txt


Here is an archive which packages the example and text file together for you.

Embed File Example Files


The file is selected using the File component property.

Clicking the small arrow to the right of the property and selecting Browse allows you to select a file using a Windows file explorer.







Macro reference

GetFileArray

GetFileArray
Reads a number of bytes from the file from the specified start address. 
- UINT StartAddress
Address of the first byte to read 
- UINT NumBytes
Number of bytes to read from the file 
- BYTE Data
Variable to pass the data into 
- VOID Return


GetFileByte

GetFileByte
Reads a single byte from the file at the specified address. 
- UINT Address
Address range 0 to NumBytesInFile - 1 
- BYTE Return


GetFileLength

GetFileLength
Returns the file size in bytes. 
- UINT Return


Property reference

Properties
File
File you wish to embed into the program 
File Length
File size in bytes. Max recommended file size = 65535 bytes 8-bit PICs may struggle with files larger than 256 bytes. 
ROM Size
Number of bytes available in the target device ROM memory