Difference between revisions of "Component: Embed File (Storage)"

From Flowcode Help
Jump to navigationJump to search
Line 16: Line 16:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
 
''No detailed description exists yet for this component''
 
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 377: Line 381:
 
|-
 
|-
 
| 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
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBinaryFloat'''
 +
|-
 +
| colspan="2" | Sends out a 32-bit binary floating point value split across four bytes. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | MSBfirst
 +
|-
 +
| colspan="2" | 0=Least significant byte first, 1=Most significant byte first 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetProp'''
 +
|-
 +
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | PropName
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByteArray'''
 +
|-
 +
| colspan="2" | Attempts to receive an array of bytes using the COM port Returns the number of bytes received.  
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | MaxLength
 +
|-
 +
| colspan="2" | Max number of bytes to try and read 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Time to wait for incoming data in milliseconds 
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveString'''
 +
|-
 +
| colspan="2" | Attempts to receive an string using the COM port Returns the number of bytes received.  
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Time to wait for incoming data in milliseconds 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | MaxLength
 +
|-
 +
| colspan="2" | Max number of bytes to try and read 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
 +
|-
 +
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | EnableMask
 +
|-
 +
| colspan="2" | Range 0-63 or 0b00000 to 0b111111 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" |  
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetProp'''
 +
|-
 +
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | PropName
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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''
 
|}
 
|}

Revision as of 10:40, 17 November 2021

Author Matrix TSL
Version 1.0
Category Storage


Embed File component

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

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. FC6 Icon.png 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.

ZIP Icon.png 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.

EmbedFile.jpg


Downloadable macro reference

Fc9-comp-macro.png GetFileByte
Reads a single byte from the file at the specified address. 
Fc9-u16-icon.png - UINT Address
Address range 0 to NumBytesInFile - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetFileLength
Returns the file size in bytes. 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetByteArray
Writes an array of bytes to the EE memory. 
Fc9-u16-icon.png - UINT Address
Starting address of the first value to write 
Fc9-u8-icon.png - BYTE Data
 
Fc9-u8-icon.png - BYTE Count
Number of bytes to write to the EE memory, Range: 1 to 128 bytes 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetInt
Writes a 16-bit value to the EE memory. For consecutive 16-bit values the address must be incremented by 2. 
Fc9-u16-icon.png - UINT Address
Address of the value to write 
Fc9-u16-icon.png - UINT Value
16-bit value to write 
[[File:]] - MSBFirst
0: LSB is the first byte, 1: MSB is the first byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png AddressSpecificDevice
Starts a temperature conversion on a specific device using a hex string identifier. SerialNumber parameter should be 12 characters and contain the 48-bit Serial. 
Fc9-string-icon.png - STRING SerialNumber
48-bit Serial Number e.g. "32DF4A3C1901" 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetSerialString
Gets the Serial String for the current addressed device. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png AddressNextDevice
Scans for the next connected device with a matching family code. Goes through the device list generated by the ScanBus macro. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetLong
Writes a 32-bit value to the EE memory. For consecutive 32-bit values the address must be incremented by 4. 
Fc9-u16-icon.png - UINT Address
Address of the value to write 
Fc9-u32-icon.png - ULONG Value
32-bit value to write 
[[File:]] - MSBFirst
0: LSB is the first byte, 1: MSB is the first byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetFloat
Reads a 32-bit floating point value starting from the specified byte address. For consecutive float values the address must be incremented by 4. 
[[File:]] - Address
The starting byte address 
[[File:]] - MSBFirst
0: LSB is the first byte, 1: MSB is the first byte 
[[File:]] - Return


Fc9-comp-macro.png GetLong
Reads a 32-bit value starting from the specified byte address. For consecutive 32-bit values the address must be incremented by 4. 
[[File:]] - Address
The starting byte address 
[[File:]] - MSBFirst
0: LSB is the first byte, 1: MSB is the first byte 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png GetInt
Reads a 16-bit value starting from the specified byte address. For consecutive 16-bit values the address must be incremented by 2. 
[[File:]] - Address
The starting byte address 
[[File:]] - MSBFirst
0: LSB is the first byte, 1: MSB is the first byte 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png GetByteArray
Reads an array of bytes starting from the selected address. 
Fc9-u16-icon.png - UINT Address
Starting address of the first value to read 
Fc9-u8-icon.png - BYTE Data
Byte array to store incoming data 
Fc9-u16-icon.png - UINT Count
Number of bytes to read from the EE memory, Range: 1 to 128 bytes 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetByte
Writes a single byte to the EE memory. 
Fc9-u16-icon.png - UINT Address
Address of the value to write 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetByte
Reads a single byte from the selected address. 
Fc9-u16-icon.png - UINT Address
Address of the value to read 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetFloat
Writes a 32-bit floating point value to the EE memory. For consecutive float values the address must be incremented by 4. 
Fc9-u16-icon.png - UINT Address
Address of the value to write 
[[File:]] - Value
Floating point value to write 
[[File:]] - MSBFirst
0: LSB is the first byte, 1: MSB is the first byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Configures each matching sensor on the bus with the specified conversion bits. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendBinaryFloat
Sends out a 32-bit binary floating point value split across four bytes. 
[[File:]] - Value
 
[[File:]] - MSBfirst
0=Least significant byte first, 1=Most significant byte first 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetProp
Allows the property filter for the COM port list to be copied to a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png ReceiveByteArray
Attempts to receive an array of bytes using the COM port Returns the number of bytes received.  
Fc9-u8-icon.png - BYTE Data
 
Fc9-u16-icon.png - UINT MaxLength
Max number of bytes to try and read 
Fc9-u16-icon.png - UINT Timeout
Time to wait for incoming data in milliseconds 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png ReceiveString
Attempts to receive an string using the COM port Returns the number of bytes received.  
Fc9-u16-icon.png - UINT Timeout
Time to wait for incoming data in milliseconds 
Fc9-u16-icon.png - UINT MaxLength
Max number of bytes to try and read 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png PWMEnable
Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD 
Fc9-u8-icon.png - BYTE EnableMask
Range 0-63 or 0b00000 to 0b111111 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetProp
Allows the property filter for the COM port list to be copied to a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-string-icon.png - STRING Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-13-icon.png File
File you wish to embed into the program 
Fc9-type-21-icon.png File Length
File size in bytes. Max recommended file size = 65535 bytes 8-bit PICs may struggle with files larger than 256 bytes. 
Fc9-type-21-icon.png ROM Size
Number of bytes available in the target device ROM memory 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations