Difference between revisions of "Component: Level (DSP Outputs)"

From Flowcode Help
Jump to navigationJump to search
 
(6 intermediate revisions by the same user not shown)
Line 22: Line 22:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 48: Line 50:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 88: Line 92:
 
Average: Rolling average calculated from the values inside the buffer.
 
Average: Rolling average calculated from the values inside the buffer.
  
==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;" | '''ReadTroughArray'''
 
|-
 
| colspan="2" | Returns the lowest value from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;" | '''ReadTrough'''
 
|-
 
| colspan="2" | Returns the lowest value from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| 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;" | '''ReadAverage'''
 
|-
 
| colspan="2" | Returns the average from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| 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;" | '''ReadPeakArray'''
 
|-
 
| colspan="2" | Returns the highest value from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;" | '''ReadAverageArray'''
 
|-
 
| colspan="2" | Returns the average from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;" | '''ReadPeak'''
 
|-
 
| colspan="2" | Returns the highest value from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| 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;" | '''ResetRecords'''
 
|-
 
| colspan="2" | Allows the peak and trough to be reset back to default values. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | ResetPeak
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | ResetTrough
 
|-
 
| 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''
 
|}
 
  
  
  
  
==Property reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Connect To
 
|-
 
| colspan="2" | DSP component with output buffer to collect our data from. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Decay on Peak/Trough
 
|-
 
| colspan="2" | Yes - The Peak and Trough value will only be maintained for the decay number of buffers. No - The record Peak and Trough values will be maintained until reset. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Decay
 
|-
 
| colspan="2" | Configures how many buffers or values to allow a record to persist 
 
|}==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;" | '''ReadTroughArray'''
 
|-
 
| colspan="2" | Returns the lowest value from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;" | '''ReadTrough'''
 
|-
 
| colspan="2" | Returns the lowest value from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
==Macro reference==
  
 +
===ReadAverage===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 256: Line 122:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===ReadAverageArray===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPeakArray'''
 
|-
 
| colspan="2" | Returns the highest value from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 282: Line 136:
  
  
 +
===ReadPeak===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 295: Line 150:
  
  
 +
===ReadPeakArray===
 
{| 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;" | '''ResetRecords'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPeakArray'''
 
|-
 
|-
| colspan="2" | Allows the peak and trough to be reset back to default values. 
+
| colspan="2" | Returns the highest value from the last "Decay" number of buffers. 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | ResetPeak
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | ResetTrough
 
|-
 
| 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''
 
|}
 
 
 
 
 
 
 
 
 
==Property reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Connect To
 
|-
 
| colspan="2" | DSP component with output buffer to collect our data from. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Decay on Peak/Trough
 
|-
 
| colspan="2" | Yes - The Peak and Trough value will only be maintained for the decay number of buffers. No - The record Peak and Trough values will be maintained until reset. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Decay
 
|-
 
| colspan="2" | Configures how many buffers or values to allow a record to persist 
 
|}==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;" | '''ReadTroughArray'''
 
|-
 
| colspan="2" | Returns the lowest value from the last "Decay" number of buffers. 
 
 
|-
 
|-
 
|-
 
|-
Line 357: Line 164:
  
  
 +
===ReadTrough===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 370: Line 178:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===ReadTroughArray===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAverage'''
 
|-
 
| colspan="2" | Returns the average from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| 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;" | '''ReadPeakArray'''
 
|-
 
| colspan="2" | Returns the highest value from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;" | '''ReadAverageArray'''
 
|-
 
| colspan="2" | Returns the average from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;" | '''ReadPeak'''
 
|-
 
| colspan="2" | Returns the highest value from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| 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;" | '''ResetRecords'''
 
|-
 
| colspan="2" | Allows the peak and trough to be reset back to default values. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | ResetPeak
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | ResetTrough
 
|-
 
| 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''
 
|}
 
 
 
 
 
 
 
 
 
==Property reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Connect To
 
|-
 
| colspan="2" | DSP component with output buffer to collect our data from. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Decay on Peak/Trough
 
|-
 
| colspan="2" | Yes - The Peak and Trough value will only be maintained for the decay number of buffers. No - The record Peak and Trough values will be maintained until reset. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Decay
 
|-
 
| colspan="2" | Configures how many buffers or values to allow a record to persist 
 
|}==Macro reference==
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 484: Line 192:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===ResetRecords===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadTrough'''
 
|-
 
| colspan="2" | Returns the lowest value from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| 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;" | '''ReadAverage'''
 
|-
 
| colspan="2" | Returns the average from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| 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;" | '''ReadPeakArray'''
 
|-
 
| colspan="2" | Returns the highest value from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;" | '''ReadAverageArray'''
 
|-
 
| colspan="2" | Returns the average from the last "Decay" number of buffers. 
 
|-
 
|-
 
| 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;" | '''ReadPeak'''
 
|-
 
| colspan="2" | Returns the highest value from the last "Decay" number of index locations. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 570: Line 214:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  

Latest revision as of 10:26, 20 October 2023

Author Matrix Ltd
Version 1.2
Category DSP Outputs


Level component

Allows for detection and collection of peaks, troughs and averages.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example of the Level component. The example collects the max, min and average readings from the buffer and displays them on the LCD display.

FC6 Icon.png Level


The values in the buffer are defined using the InputADC component.

DSPLevel.jpg


Min: Minimum (smallest) value read from the buffer.

Max: Maximum (largest) value read from the buffer.

Average: Rolling average calculated from the values inside the buffer.








Macro reference

ReadAverage

Fc9-comp-macro.png ReadAverage
Returns the average from the last "Decay" number of index locations. 
Fc9-s32-icon.png - LONG Return


ReadAverageArray

Fc9-comp-macro.png ReadAverageArray
Returns the average from the last "Decay" number of buffers. 
Fc9-u16-icon.png - UINT Return


ReadPeak

Fc9-comp-macro.png ReadPeak
Returns the highest value from the last "Decay" number of index locations. 
Fc9-s32-icon.png - LONG Return


ReadPeakArray

Fc9-comp-macro.png ReadPeakArray
Returns the highest value from the last "Decay" number of buffers. 
Fc9-u16-icon.png - UINT Return


ReadTrough

Fc9-comp-macro.png ReadTrough
Returns the lowest value from the last "Decay" number of index locations. 
Fc9-s32-icon.png - LONG Return


ReadTroughArray

Fc9-comp-macro.png ReadTroughArray
Returns the lowest value from the last "Decay" number of buffers. 
Fc9-u16-icon.png - UINT Return


ResetRecords

Fc9-comp-macro.png ResetRecords
Allows the peak and trough to be reset back to default values. 
Fc9-bool-icon.png - BOOL ResetPeak
 
Fc9-bool-icon.png - BOOL ResetTrough
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Connect To
DSP component with output buffer to collect our data from. 
Fc9-type-7-icon.png Decay on Peak/Trough
Yes - The Peak and Trough value will only be maintained for the decay number of buffers. No - The record Peak and Trough values will be maintained until reset. 
Fc9-type-14-icon.png Decay
Configures how many buffers or values to allow a record to persist