Difference between revisions of "Component: String Initialiser (Storage)"

From Flowcode Help
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 15: Line 15:
 
A component allowing an easy way to initialise string variables using ROM memory. A simple and efficient way to populate string variables helping to save on RAM usage. Allows up to 16 strings to be stored. For additional strings simply use more String Initialiser components.
 
A component allowing an easy way to initialise string variables using ROM memory. A simple and efficient way to populate string variables helping to save on RAM usage. Allows up to 16 strings to be stored. For additional strings simply use more String Initialiser components.
  
==Detailed description==
+
==Component Pack==
  
 +
STORAGE
  
 +
==Detailed description==
  
''No detailed description exists yet for this component''
 
  
==Examples==
 
  
  
  
  
''<span style="color:red;">No additional examples</span>''
 
  
  
==Downloadable macro reference==
 
  
{| 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;" | '''GetString'''
 
|-
 
| colspan="2" | Gets a string stored in ROM memory and loads into a RAM string variable&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Index
 
|-
 
| colspan="2" | Range: 0-15 Depending on number of strings&nbsp;
 
|-
 
| 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;"
+
''No detailed description exists yet for this component''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDataByte'''
 
|-
 
| colspan="2" | Reads a single data byte from the specified address.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | PageAddress
 
|-
 
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ByteAddress
 
|-
 
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 
|-
 
| 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''
 
|}
 
 
 
 
 
{| 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;" | '''ReadUniqueID'''
 
|-
 
| colspan="2" | Reads the 8-byte unique identifier from the IC. Useful if you need each board to have it's own guarenteed unique address or identifier.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ID
 
|-
 
| colspan="2" | 8-Byte data array to store the unique ID read back from the IC.&nbsp;
 
|-
 
| 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''
 
|}
 
  
 +
==Examples==
  
{| 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;" | '''WriteDataArray'''
 
|-
 
| colspan="2" | Writes an array of data bytes atarting at the specified address. Writes must be enabled and memory locations must be erased for data writes to function correctly. Note that all bytes will be written to the same page.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | PageAddress
 
|-
 
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ByteAddress
 
|-
 
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Count
 
|-
 
| colspan="2" | Number of bytes to write.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| 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;" | '''EraseChip'''
 
|-
 
| colspan="2" | Erases all data stored on the chip. Chip erase takes between 20 seconds and 100 seconds to complete. Blocking mode is recommended to ensure write cycle is complete.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Blocking
 
|-
 
| colspan="2" | Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait&nbsp;
 
|-
 
| 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;" | '''WriteDataByte'''
 
|-
 
| colspan="2" | Writes a single data byte to the specified address. Writes must be enabled and memory locations must be erased for data writes to function correctly.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | PageAddress
 
|-
 
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ByteAddress
 
|-
 
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data byte to write&nbsp;
 
|-
 
| 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;" | '''EraseBlock'''
 
|-
 
| colspan="2" | Erases a block of data stored on the chip. Erase takes between 45 milliseconds and 2000 milliseconds to complete. Blocking mode is recommended to ensure write cycle is complete.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | EraseMode
 
|-
 
| colspan="2" | 0=4KB / 1=32KB / 2=64KB&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | PageAddress
 
|-
 
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Blocking
 
|-
 
| colspan="2" | Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait&nbsp;
 
|-
 
| 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;" | '''ReadDataArray'''
 
|-
 
| colspan="2" | Reads up to 256 data bytes starting from the specified address. Note that all bytes will be read from the same page.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | PageAddress
 
|-
 
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | ByteAddress
 
|-
 
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Count
 
|-
 
| colspan="2" | Number of bytes to read.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Byta array to store the incoming read data.&nbsp;
 
|-
 
| 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" | Initialises the SPI bus ready for communications.&nbsp;
 
|-
 
|-
 
| 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" | Configures each matching sensor on the bus with the specified conversion bits.&nbsp;
 
|-
 
|-
 
| 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Value
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | MSBfirst
 
|-
 
| colspan="2" | 0=Least significant byte first, 1=Most significant byte first&nbsp;
 
|-
 
| 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | PropName
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| 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. &nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | MaxLength
 
|-
 
| colspan="2" | Max number of bytes to try and read&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Timeout
 
|-
 
| colspan="2" | Time to wait for incoming data in milliseconds&nbsp;
 
|-
 
| 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''
 
|}
 
  
 +
''<span style="color:red;">No additional examples</span>''
  
{| 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. &nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Timeout
 
|-
 
| colspan="2" | Time to wait for incoming data in milliseconds&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | MaxLength
 
|-
 
| colspan="2" | Max number of bytes to try and read&nbsp;
 
|-
 
| 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''
 
|}
 
  
 +
==Downloadable macro reference==
  
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetString'''
 
|-
 
|-
| 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&nbsp;
+
| colspan="2" | Gets a string stored in ROM memory and loads into a RAM string variable&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | EnableMask
+
| width="90%" | Index
 
|-
 
|-
| colspan="2" | Range 0-63 or 0b00000 to 0b111111&nbsp;
+
| colspan="2" | Range: 0-15 Depending on number of strings&nbsp;
|-
 
| 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" | &nbsp;
 
|-
 
|-
 
| 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | PropName
 
|-
 
| colspan="2" | &nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
Line 421: Line 93:
 
|-
 
|-
 
| colspan="2" | String data index 1&nbsp;
 
| colspan="2" | String data index 1&nbsp;
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 
|-
 
 
|}
 
|}

Latest revision as of 17:24, 9 November 2022

Author Matrix Ltd
Version 1.0
Category Storage


String Initialiser component

A component allowing an easy way to initialise string variables using ROM memory. A simple and efficient way to populate string variables helping to save on RAM usage. Allows up to 16 strings to be stored. For additional strings simply use more String Initialiser components.

Component Pack

STORAGE

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png GetString
Gets a string stored in ROM memory and loads into a RAM string variable 
Fc9-u8-icon.png - BYTE Index
Range: 0-15 Depending on number of strings 
Fc9-string-icon.png - STRING Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Number of Strings
 
Fc9-type-10-icon.png String 0
String data index 0 
Fc9-type-10-icon.png String 1
String data index 1