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

From Flowcode Help
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
==Input CSV component==
 
==Input CSV component==
 
Allows the values from a buffer to be collected directly from a CSV file. Either a value at a time or from an array.
 
Allows the values from a buffer to be collected directly from a CSV file. Either a value at a time or from an array.
 +
 +
==Component Pack==
 +
 +
DSP
  
 
==Detailed description==
 
==Detailed description==
Line 19: Line 23:
  
  
''No detailed description exists yet for this component''
 
  
==Examples==
 
  
  
  
  
''<span style="color:red;">No additional examples</span>''
 
  
  
==Downloadable macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
''No detailed description exists yet for this component''
|-
+
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
==Examples==
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadArray'''
+
 
|-
+
 
| colspan="2" | Reads an array of values to fill up the specified buffer. Auto increments current location. FAT component must be initialised before calling this macro.&nbsp;
+
 
|-
 
|-
 
| 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;" | '''ReadValue'''
 
|-
 
| colspan="2" | Reads a single value from the current position in the CSV file. Then auto increments the position. FAT component must be initialised before calling this macro.&nbsp;
 
|-
 
|-
 
| 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;" | '''QueueData'''
 
|-
 
| colspan="2" | Takes a single value from the buffer input and stores it, once there are enough values queued up it returns a 1.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | ProcessWhenFull
 
|-
 
| colspan="2" | 0 = Do Nothing when Buffer is full, 1 = Auto call FFT macro when Buffer is full&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| 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;" | '''Uninit'''
 
|-
 
| colspan="2" | Un-initialize the UART and release the resources&nbsp;
 
|-
 
|-
 
| 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;" | '''ReceiveByteArray'''
 
|-
 
| colspan="2" | Receives an array of bytes and returns the number of bytes received.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | A byte array variable to hold the received data&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | NumBytes
 
|-
 
| colspan="2" | Maximum number of bytes to try and receive&nbsp;
 
|-
 
| 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&nbsp;
 
|-
 
| 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''
 
|}
 
  
 +
''<span style="color:red;">No additional examples</span>''
  
{| 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" | Receives a string of bytes and returns the number of bytes received.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | StringData
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | NumBytes
 
|-
 
| colspan="2" | Maximum number of bytes to try and receive&nbsp;
 
|-
 
| 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&nbsp;
 
|-
 
| 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''
 
|}
 
  
 +
==Downloadable macro reference==
  
 
{| 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;" | '''Start'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CloseFile'''
 
|-
 
|-
| colspan="2" | Startup routine required by the hardware device. Automatically clears the display after initialising.&nbsp;
+
| colspan="2" | Closes a file&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 160: Line 67:
 
|-
 
|-
 
| 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;" | '''SetLEDState'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OpenFile'''
 
|-
 
|-
| colspan="2" | Sets the state of a single LED&nbsp;
+
| colspan="2" | Opens a file ready for reading. Returns 1 if file opened correctly. Automatically called by the ReadValue/ReadArray macros with the default values set by the component properties if not already called by the program.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Port
+
| width="90%" | Filename
|-
 
| colspan="2" | 0 = PortA, 1 = PortB&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | LED
 
|-
 
| colspan="2" | 0 = LED0, 7 = LED7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | State
 
 
|-
 
|-
 
| colspan="2" | &nbsp;
 
| colspan="2" | &nbsp;
 
|-
 
|-
| 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-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
Line 188: Line 85:
 
|-
 
|-
 
| 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;" | '''ReadArray'''
|-
 
| colspan="2" | Gets the Rx ID as a Integer Standard and Extended IDs.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | Reads an array of values to fill up the specified buffer. Auto increments current location. FAT component must be initialised before calling this macro.&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Buffer
 
 
|-
 
|-
| colspan="2" | &nbsp;
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
|-
 
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
Line 206: Line 98:
 
|-
 
|-
 
| 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;" | '''Initialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadValue'''
 
|-
 
|-
| colspan="2" | Must be called before any other CAN component macros to enable and initialise the CAN peripheral. &nbsp;
+
| colspan="2" | Reads a value from the current position in the CSV file. FAT component must be initialised before calling this macro. Returns 0 when we are at the end of the file, else returns 1.&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
Line 235: Line 127:
 
|-
 
|-
 
| colspan="2" | Sets the buffer data type, data is automatically scaled to fit and make full use of the data type.&nbsp;
 
| colspan="2" | Sets the buffer data type, data is automatically scaled to fit and make full use of the data type.&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | CSV File
 +
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
Line 247: Line 143:
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Layout
+
| width="90%" | End of File
|-
 
| colspan="2" | Dictates if the data is read from a single column or a single row.&nbsp;
 
|-
 
| 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'''
 
 
|-
 
|-
 +
| colspan="2" | Determines what happens when we hit the end of the input file. The return value from the ReadValue/ReadArray can be checked to allow the file end to be caught and actioned.&nbsp;
 
|}
 
|}

Latest revision as of 17:19, 9 November 2022

Author Matrix Ltd
Version 1.2
Category DSP


Input CSV component

Allows the values from a buffer to be collected directly from a CSV file. Either a value at a time or from an array.

Component Pack

DSP

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png CloseFile
Closes a file 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png OpenFile
Opens a file ready for reading. Returns 1 if file opened correctly. Automatically called by the ReadValue/ReadArray macros with the default values set by the component properties if not already called by the program. 
Fc9-string-icon.png - STRING Filename
 
Fc9-bool-icon.png - BOOL Return


Fc9-comp-macro.png ReadArray
Reads an array of values to fill up the specified buffer. Auto increments current location. FAT component must be initialised before calling this macro. 
Fc9-bool-icon.png - BOOL Return


Fc9-comp-macro.png ReadValue
Reads a value from the current position in the CSV file. FAT component must be initialised before calling this macro. Returns 0 when we are at the end of the file, else returns 1. 
Fc9-bool-icon.png - BOOL 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. 
Fc9-conn-icon.png CSV File
Fc9-type-17-icon.png FAT Component
Points to the FAT filesystem component to allow access to file system and embedded SD card. 
Fc9-type-10-icon.png Filename
Name of the file to read DSP data from. 
Fc9-type-16-icon.png End of File
Determines what happens when we hit the end of the input file. The return value from the ReadValue/ReadArray can be checked to allow the file end to be caught and actioned.