Author
|
Matrix Ltd
|
Version
|
1.5
|
Category
|
Storage
|
Circular Buffer (16-bit) 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 16-bit values.
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Downloadable macro reference
|
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.
|
- UINT
|
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
|
|
GetNumberValues
|
Returns the number of valid 16-bit data values currently stored inside the buffer.
|
- UINT
|
Return
|
|
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.
|
- UINT
|
Return
|
|
PutData
|
Add a 16-bit 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.
|
- UINT
|
Data
|
|
- BYTE
|
Return
|
|
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.
|
- UINT
|
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
|
|
GetData
|
Reads the next available 16-bit value from the circular buffer, Returns the default value if the buffer is empty.
|
- UINT
|
Return
|
|
FlushBuffer
|
Clears the contents of the buffer and re-initialises the index locations.
|
- VOID
|
Return
|
|
GetIndexedValue
|
Gets the value of a single 16-bit value at a known location in the buffer. Leaves the buffer contents and pointers untouched.
|
- UINT
|
address
|
|
- UINT
|
Return
|
|
FlushBuffer
|
Clears the contents of the buffer and re-initialises the index locations.
|
- VOID
|
Return
|
|
GetConsoleHandle
|
Gets the handle to the console allowing data displaying on the panel etc.
|
[[File:]] -
|
Return
|
|
SendByteArray
|
Sends an array of bytes to the COM port.
|
- BYTE
|
Data
|
Data byte array to send
|
- UINT
|
Length
|
Number of bytes to send
|
- VOID
|
Return
|
|
ReceiveBinary16Bit
|
Receives a binary 16-bit value split across two bytes.
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- UINT
|
Return
|
|
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.
|
- 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
|
|
SendFloat
|
Sends out a floating point number as an ASCII String from the UART interface.
|
[[File:]] -
|
Number
|
|
- VOID
|
Return
|
|
SendHexNumber
|
Sends out a number as an ASCII hexadecimal String from the UART interface.
|
- ULONG
|
Number
|
|
- 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
|
- VOID
|
Return
|
|
SetFlowControl
|
Allows the Flowcontrol signals to be enabled or disabled.
|
- BYTE
|
State
|
A value of 0 disables flow control, 1 or above willl enable flow control.
|
- VOID
|
Return
|
|
OpenPort
|
Opens the currently selected COM port, allowing data to be sent and received.
|
- VOID
|
Return
|
|
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.
|
- 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
|
- ULONG
|
Return
|
|
SetProp
|
Allows the COM port property to be set from a parent component.
|
- STRING
|
PropName
|
|
- ULONG
|
PropVal
|
|
- VOID
|
Return
|
|
SendBinary32Bit
|
Sends out a 32-bit binary value split across four bytes.
|
- ULONG
|
Value
|
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
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
|
- VOID
|
Return
|
|
GetProp
|
Allows the property filter for the COM port list to be copied to a parent component.
|
- STRING
|
PropName
|
|
- STRING
|
Return
|
|
ReceiveByteArray
|
Attempts to receive an array of bytes using the COM port Returns the number of bytes received.
|
- BYTE
|
Data
|
|
- UINT
|
MaxLength
|
Max number of bytes to try and read
|
- UINT
|
Timeout
|
Time to wait for incoming data in milliseconds
|
- UINT
|
Return
|
|
ReceiveString
|
Attempts to receive an string using the COM port Returns the number of bytes received.
|
- UINT
|
Timeout
|
Time to wait for incoming data in milliseconds
|
- UINT
|
MaxLength
|
Max number of bytes to try and read
|
- STRING
|
Return
|
|
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
|
- BYTE
|
EnableMask
|
Range 0-63 or 0b00000 to 0b111111
|
- VOID
|
Return
|
|
Initialise
|
|
- VOID
|
Return
|
|
GetProp
|
Allows the property filter for the COM port list to be copied to a parent component.
|
- STRING
|
PropName
|
|
- STRING
|
Return
|
Property reference
|
Properties
|
|
Buffer Size
|
Sets the number of byte elements inside the circular buffer. The maximum number of bytes that can be stored at any one time is this number minus 1.
|
|
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
|
|
Connections
|
|
Simulations
|