Difference between revisions of "Component: Input Digital (DSP Inputs)"

From Flowcode Help
Jump to navigationJump to search
 
(8 intermediate revisions by one other user not shown)
Line 16: Line 16:
  
 
==Component Source Code==
 
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_DSP_Input.fcfx FC_Comp_Source_DSP_Input.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_DSP_Input.fcfx FC_Comp_Source_DSP_Input.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_DSP_Input.fcfx FC_Comp_Source_DSP_Input.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
  
  
Line 40: Line 48:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
  
  
Line 59: Line 73:
  
 
Here is a basic example demonstrating how to pass a value into the DSP chain.
 
Here is a basic example demonstrating how to pass a value into the DSP chain.
 +
 
{{Fcfile|Delay.fcfx|Delay}}
 
{{Fcfile|Delay.fcfx|Delay}}
 +
 
The input value in the example uses an ADC reading but this can be taken from anything such as a reading from a CSV file on a SD card or a value passed by a sensor on a I2C bus etc.
 
The input value in the example uses an ADC reading but this can be taken from anything such as a reading from a CSV file on a SD card or a value passed by a sensor on a I2C bus etc.
  
 
==Macro reference==
 
==Macro reference==
  
 +
===AddByte===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 82: Line 99:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===AddByteArray===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddFloatArray'''
 
|-
 
| colspan="2" | Adds an array of float values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | Data
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Count
 
|-
 
| 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''
 
|}
 
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 128: Line 123:
  
  
 +
===AddFloat===
 
{| 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;" | '''AddLong'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddFloat'''
 
|-
 
|-
| colspan="2" | Adds a single long value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
+
| colspan="2" | Adds a single float value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | Data
 
| width="90%" | Data
 
|-
 
|-
Line 146: Line 142:
  
  
 +
===AddFloatArray===
 
{| 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;" | '''AddInt'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddFloatArray'''
 
|-
 
|-
| colspan="2" | Adds a single integer value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
+
| colspan="2" | Adds an array of float values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | Data
 
|-
 
| 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''
 
|}
 
 
 
 
 
{| 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;" | '''AddLongArray'''
 
|-
 
| colspan="2" | Adds an array of long values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 
 
| width="90%" | Data
 
| width="90%" | Data
 
|-
 
|-
Line 187: Line 166:
  
  
 +
===AddInt===
 
{| 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;" | '''AddIntArray'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddInt'''
 
|-
 
|-
| colspan="2" | Adds an array of integer values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
+
| colspan="2" | Adds a single integer value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Data
 
| width="90%" | Data
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Count
 
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
Line 210: Line 185:
  
  
 +
===AddIntArray===
 
{| 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;" | '''AddFloat'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddIntArray'''
 
|-
 
|-
| colspan="2" | Adds a single float value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
+
| colspan="2" | Adds an array of integer values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | Data
 
|-
 
| 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-21-icon.png]]
 
| width="90%" | Buffer Size
 
|-
 
| colspan="2" | Number of individual elements the buffer can store, default 1. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Buffer Type
 
|-
 
| colspan="2" | Sets the buffer data type, data is automatically scaled to fit and make full use of the data type. 
 
|}==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;" | '''AddByte'''
 
|-
 
| colspan="2" | Adds a single byte value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
 
|-
 
|-
| 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''
 
|}
 
 
 
{| 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;" | '''AddFloatArray'''
 
|-
 
| colspan="2" | Adds an array of float values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | Data
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Count
 
|-
 
| 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''
 
|}
 
 
 
{| 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;" | '''AddByteArray'''
 
|-
 
| colspan="2" | Adds an array of byte values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
 
| width="90%" | Data
 
| width="90%" | Data
 
|-
 
|-
Line 313: Line 209:
  
  
 +
===AddLong===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 331: Line 228:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===AddLongArray===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddInt'''
 
|-
 
| colspan="2" | Adds a single integer value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Data
 
|-
 
| 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''
 
|}
 
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 370: Line 250:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| 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;" | '''AddIntArray'''
 
|-
 
| colspan="2" | Adds an array of integer values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Data
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Count
 
|-
 
| 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''
 
|}
 
 
 
{| 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;" | '''AddFloat'''
 
|-
 
| colspan="2" | Adds a single float value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | Data
 
|-
 
| 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''
 
|}
 
 
 
  
  

Latest revision as of 11:27, 29 January 2025

Author Matrix Ltd
Version 1.2
Category DSP Inputs


Input Digital component

Allows the values from a buffer to be assigned. Either a value at a time or from an array. The input signal would usually take the form of an ADC reading or raw data values.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example demonstrating how to pass a value into the DSP chain.

FC6 Icon.png Delay

The input value in the example uses an ADC reading but this can be taken from anything such as a reading from a CSV file on a SD card or a value passed by a sensor on a I2C bus etc.

Macro reference

AddByte

Fc9-comp-macro.png AddByte
Adds a single byte value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


AddByteArray

Fc9-comp-macro.png AddByteArray
Adds an array of byte values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
Fc9-u8-icon.png - BYTE Data
 
Fc9-u16-icon.png - UINT Count
 
Fc9-void-icon.png - VOID Return


AddFloat

Fc9-comp-macro.png AddFloat
Adds a single float value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
Fc9-f32-icon.png - FLOAT Data
 
Fc9-void-icon.png - VOID Return


AddFloatArray

Fc9-comp-macro.png AddFloatArray
Adds an array of float values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
Fc9-f32-icon.png - FLOAT Data
 
Fc9-u16-icon.png - UINT Count
 
Fc9-void-icon.png - VOID Return


AddInt

Fc9-comp-macro.png AddInt
Adds a single integer value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
Fc9-u16-icon.png - UINT Data
 
Fc9-void-icon.png - VOID Return


AddIntArray

Fc9-comp-macro.png AddIntArray
Adds an array of integer values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
Fc9-u16-icon.png - UINT Data
 
Fc9-u16-icon.png - UINT Count
 
Fc9-void-icon.png - VOID Return


AddLong

Fc9-comp-macro.png AddLong
Adds a single long value to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
Fc9-u32-icon.png - ULONG Data
 
Fc9-void-icon.png - VOID Return


AddLongArray

Fc9-comp-macro.png AddLongArray
Adds an array of long values to the current location in the specified buffer. Auto increments current location if output buffer size is greater than 1. 
Fc9-u32-icon.png - ULONG Data
 
Fc9-u16-icon.png - UINT Count
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-21-icon.png Buffer Size
Number of individual elements the buffer can store, default 1. 
Fc9-type-16-icon.png Buffer Type
Sets the buffer data type, data is automatically scaled to fit and make full use of the data type.