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

From Flowcode Help
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
==Input Digital component==
 
==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.
 
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 Pack==
 +
 +
DSP
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 22: Line 34:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 37: Line 57:
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddByte'''
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddByte'''
 
|-
 
|-
| colspan="2" | Adds a single byte value to the current location in the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
+
| 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. 
 
|-
 
|-
 
|-
 
|-
Line 53: Line 73:
 
|-
 
|-
 
| 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;" | '''AddByteArray'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddFloatArray'''
 
|-
 
|-
| colspan="2" | Adds an array of byte values to the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
+
| 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-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | Data
 
| width="90%" | Data
 
|-
 
|-
Line 76: Line 96:
 
|-
 
|-
 
| 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;" | '''AddByteArray'''
 
|-
 
|-
| colspan="2" | Adds a single unsigned long value to the current location in the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
+
| 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-u32-icon.png]] - ULONG
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
| width="90%" | Data
 
|-
 
|-
 
| colspan="2" |  
 
| 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;" | '''AddInt'''
 
|-
 
| colspan="2" | Adds a single unsigned int value to the current location in the specified buffer and scales it appropriatley to suit the buffer.  Auto increments current location. 
 
|-
 
 
|-
 
|-
 
| 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%" | Count
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
Line 112: Line 119:
 
|-
 
|-
 
| 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;" | '''AddLongArray'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddLong'''
 
|-
 
|-
| colspan="2" | Adds an array of long values to the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
+
| 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. 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 
| 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 135: Line 137:
 
|-
 
|-
 
| 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 specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
+
| 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 158: Line 155:
 
|-
 
|-
 
| 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;" | '''CheckBuffer'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddLongArray'''
 
|-
 
|-
| colspan="2" | Returns the number of values in the transmit or receive buffer 
+
| 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:]] -
+
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | Buffer
+
| width="90%" | Data
|-
 
| colspan="2" | 0=Transmit / 1=Receive 
 
|-
 
| 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;" | '''ReceiveString'''
 
|-
 
| colspan="2" | Gets a string from the receive buffer 
 
 
|-
 
|-
 +
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | MaxChars
+
| width="90%" | Count
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Timeout
 
|-
 
| colspan="2" | Time in milliseconds to wait for data 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| 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;" | '''Initialise'''
 
|-
 
| colspan="2" | Initialises the UART component pins ready to send and receive data 
 
|-
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 212: Line 178:
 
|-
 
|-
 
| 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;" | '''ReceiveString'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddIntArray'''
 
|-
 
|-
| colspan="2" | Receives a string of bytes and returns the number of bytes received. 
+
| 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-string-icon.png]] - STRING
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | StringData
+
| width="90%" | Data
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | NumBytes
+
| width="90%" | Count
|-
 
| colspan="2" | Maximum number of bytes to try and receive 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Timeout
 
|-
 
| colspan="2" | Max amount of time in ms to wait between bytes 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| 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;" | '''Start'''
 
|-
 
| colspan="2" | Startup routine required by the hardware device. Automatically clears the display after initialising. 
 
|-
 
|-
 
| 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;" | '''SetLEDState'''
 
|-
 
| colspan="2" | Sets the state of a single LED 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Port
 
|-
 
| colspan="2" | 0 = PortA, 1 = PortB 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | LED
 
|-
 
| colspan="2" | 0 = LED0, 7 = LED7 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | State
 
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
Line 281: Line 201:
 
|-
 
|-
 
| 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;" | '''GetRxIdent'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddFloat'''
 
|-
 
|-
| colspan="2" | Gets the Rx ID as a Integer Standard and Extended IDs. 
+
| 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-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | Buffer
+
| width="90%" | Data
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
 
| 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;" | '''Initialise'''
 
|-
 
| colspan="2" | Must be called before any other CAN component macros to enable and initialise the CAN peripheral.  
 
|-
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 328: Line 235:
 
|-
 
|-
 
| colspan="2" | Sets the buffer data type, data is automatically scaled to fit and make full use of the data type. 
 
| colspan="2" | Sets the buffer data type, data is automatically scaled to fit and make full use of the data type. 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 
|-
 
 
|}
 
|}

Latest revision as of 17:19, 9 November 2022

Author Matrix Ltd
Version 1.2
Category DSP


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 Pack

DSP

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.

Downloadable macro reference

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


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


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


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


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


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


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


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



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.