Difference between revisions of "Component: Input CSV (DSP)"
From Flowcode Help
Jump to navigationJump to search(2 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 24: | Line 34: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 34: | Line 50: | ||
==Downloadable macro reference== | ==Downloadable 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;" | '''CloseFile''' | ||
+ | |- | ||
+ | | colspan="2" | Closes a file | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''OpenFile''' | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Filename | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
Line 43: | Line 90: | ||
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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 53: | Line 100: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadValue''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadValue''' | ||
|- | |- | ||
− | | colspan="2" | Reads a | + | | 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. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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 80: | Line 127: | ||
|- | |- | ||
| 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:#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 92: | Line 143: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
− | | width="90%" | | + | | width="90%" | End of File |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
+ | | 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. | ||
|} | |} |
Latest revision as of 17:19, 9 November 2022
Author | Matrix Ltd |
Version | 1.2 |
Category | DSP |
Contents
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
![]() |
CloseFile |
Closes a file | |
![]() |
Return |
![]() |
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. | |
![]() |
Return |