Component: Base 64 (Storage)

From Flowcode Help
Revision as of 10:39, 17 November 2021 by Wiki bot (talk | contribs)
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category Storage


Base 64 component

Component to allow base 64 encoding and decoding. Sometimes when communicating raw binary data it is useful to perform base 64 encoding to ensure that none of your data bytes trigger any escape codes or other special case conditions. Base64 converts your binary data into readable data using standard ASCII characters so you can be fairly certain that the data you send is the same as the data that is received.

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example that shows how to convert data into base64 encoded data and visa versa. FC6 Icon.png Base64 Tests

Downloadable macro reference

Fc9-comp-macro.png Encode
Encodes an array of bytes into a base64 encoded string 
Fc9-u8-icon.png - BYTE BinaryData
Raw binary data array you wish to encode 
Fc9-u16-icon.png - UINT ByteCount
Number of bytes of data to encode 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png Decode
Decodes a base64 encoded string into an array of bytes. Populates the BinaryData parameter array with the decoded data. Returns the number of decoded data bytes. 
Fc9-u8-icon.png - BYTE BinaryData
Variable to hold the decoded binary data 
Fc9-string-icon.png - STRING Base64Data
Data string you wish to decode 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png DisableOutput
Disables the output to prevent any buzzing etc while not speaking. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadByteFromPhoneme
Reads a single byte value from the specified phoneme data array. This function will not simulate correctly as it requires C style pointers. 
Fc9-string-icon.png - STRING Phoneme
Specifies a single Phoneme 
Fc9-u16-icon.png - UINT Idx
Specifies the position within the Phoneme 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png OutputPhoneme
Streams a single Phoneme or string of comma seperated Phonemes. OutputPhoneme("OY") OutputPhoneme("OY,AY,OY") 
Fc9-string-icon.png - STRING DataString
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
[[File:]] - Return


Fc9-comp-macro.png SendByteArray
Sends an array of bytes to the COM port. 
Fc9-u8-icon.png - BYTE Data
Data byte array to send 
Fc9-u16-icon.png - UINT Length
Number of bytes to send 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReceiveBinary16Bit
Receives a binary 16-bit value split across two bytes. 
[[File:]] - MSBfirst
0=Least significant byte first, 1=Most significant byte first 
Fc9-u8-icon.png - BYTE Timeout
Max amount of time in ms to wait between bytes 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png ReceiveFloat
Attempts to receive a floating point number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none numeric char is received, the none numeric char will be lost. 
Fc9-u8-icon.png - BYTE Timeout
Max time in ms to wait in between bytes 
[[File:]] - IgnoreData
0=Dont ignore any data, 1=Ignore any initial none numeric data 
[[File:]] - Return


Fc9-comp-macro.png SendFloat
Sends out a floating point number as an ASCII String from the UART interface. 
[[File:]] - Number
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendHexNumber
Sends out a number as an ASCII hexadecimal String from the UART interface. 
Fc9-u32-icon.png - ULONG Number
 
Fc9-u8-icon.png - BYTE NumChars
Number of characters in the string data, 0 for auto, 2 for 0x00, 4 for 0x0000 
[[File:]] - Prefix
Generate hexadecimal prefix 0x e.g. 1= 0xFF, 0= FF 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetFlowControl
Allows the Flowcontrol signals to be enabled or disabled. 
Fc9-u8-icon.png - BYTE State
A value of 0 disables flow control, 1 or above willl enable flow control. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png OpenPort
Opens the currently selected COM port, allowing data to be sent and received. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReceiveHexNumber
Attempts to receive a hex number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none hexadecimal char is received, the none numeric char will be lost. 
Fc9-u8-icon.png - BYTE Timeout
Max time in ms to wait in between bytes 
[[File:]] - IgnoreData
0=Dont ignore any data, 1=Ignore any initial none numeric data 
[[File:]] - Prefix
Look for prefix before receiving, 1=0xFF, 0=FF 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png SetProp
Allows the COM port property to be set from a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-u32-icon.png - ULONG PropVal
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendBinary32Bit
Sends out a 32-bit binary value split across four bytes. 
Fc9-u32-icon.png - ULONG Value
 
[[File:]] - MSBfirst
0=Least significant byte first, 1=Most significant byte first 
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-conn-icon.png Connections
Fc9-conn-icon.png Simulations