Jump to content

Component: Circular Buffer (Float) (Buffer)

From Flowcode Help
Revision as of 14:15, 13 July 2026 by SteveT (talk | contribs) (Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable"")
Author Matrix Ltd
Version 1.5
Category Buffer


Circular Buffer (Float) component

Circular buffer component allowing easy and efficient first in first out (FIFO) style data storage. Also features macros to allow you to check for specific floating point values.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

FlushBuffer

FlushBuffer
Clears the contents of the buffer and re-initialises the index locations. 
- VOID Return


GetData

GetData
Reads the next available 32-bit floating point value from the circular buffer, Returns the default value if the buffer is empty. 
- FLOAT Return


GetIndexedValue

GetIndexedValue
Gets the value of a single 32-bit floating point value at a known location in the buffer. Leaves the buffer contents and pointers untouched. 
- UINT address
 
- FLOAT Return


GetNumberValues

GetNumberValues
Returns the number of valid 16-bit data values currently stored inside the buffer. 
- UINT Return


GetSize

GetSize
Returns the number of 16-bit values that can be stored in the buffer. Either in total or the number of values remaining based on Mode. 
- BOOL Mode
0=TotalBufferSize, 1=BufferFreeSpace 
- UINT Return


LookForValues

LookForValues
Scans the buffer for an array of specific values. Returns 0 if the value is not found. Returns 1 if the value is found. 
- FLOAT Values
 
- BYTE NumValues
The number of values you wish to try and match 
- BYTE RemoveContent
0=Leave data alone, 1=Remove data from buffer 
- BYTE ResetFind
0=Continue the find from the last operation, 1=Start again 
- BYTE Return


PeekData

PeekData
Reads the next available 16-bit data value from the circular buffer without advancing the current index, Returns the default value if the buffer is empty. 
- FLOAT Return


PutData

PutData
Add a 32-bit floating point value to the next free location inside the circular buffer. If the data goes into the buffer correctly then return 1. Otherwise the buffer is full and the return value will equal 0. 
- FLOAT Data
 
- BYTE Return


WaitForValues

WaitForValues
Waits for an array of values to appear in the circular buffer. Returns 0 to indicate a timeout. Returns 1 to indicate the data has been found. 
- FLOAT Values
 
- BYTE NumValues
Number of values to try and look for 
- BYTE RemoveContent
0=Leave the buffer contents untouched, 1=Remove values as you go 
- UINT Timeout
Max amount of time to wait in milliseconds before returning 0=WaitForever 
- BYTE Return


Property reference

Properties
Buffer Size
Sets the number of byte elements inside the circular buffer. 
Storage Type
When buffer is full this property decides what to do. Store first x values - Will retain the information inside the buffer, new data will be discarded. Store last x values - Will discard the oldest location in the buffer and overwrite with new data. 
Memory Type
 
Default Return Data
Specifies the value returned by the receive function when there is no data held in the buffer 

Component Source Code

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

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