CSV Export
This function block collects incoming data columns over time and saves them as a CSV file when requested. Use it to build simple data logs (measurements, counters, labels) and export them for analysis or archiving.
π₯ Inputs
Folder PathFolder where the CSV file will be saved (uses current folder if not provided)File NameFile name to use for the exported CSV (timestamped default if not provided)Start LoggingBoolean trigger to start appending incoming data into the internal log bufferExport FileBoolean trigger to write accumulated log data into the CSV fileData_1...Data_10Generic data columns that will be stored (only connected columns are logged)
π€ Outputs
This function block does not produce any outputs.
πΉοΈ Controls
Header fieldsTen text fields where you can provide human-friendly column names for the correspondingData_1...Data_10inputs. Leave fields empty to use the defaultData_nlabels.Start Logginginput Used to enable logging of incoming values into the internal buffer.Export Fileinput Used to flush the buffered rows into a CSV file on disk.
π― Features
Automatic timestamp per row (time is added as the first column).
Flexible columns: only connected
Data_ninputs are included in the CSV.Header management: if you change header fields, existing CSV header row is updated automatically (if the file already exists).
Buffered logging: rows are stored internally while
Start Loggingis active and written out only whenExport Fileis triggered.Safe write behavior: warnings and errors are shown in the UI if the file is open elsewhere or write fails.
π How to use
Set destination using
Folder PathandFile Nameinputs (optional).Provide readable column names in the
Header fieldsfor anyData_nsockets you will connect.Connect the data sources to the corresponding
Data_1...Data_10inputs (use only the inputs you need).Drive
Start Loggingwith a boolean signal (for example via aLogic Inputblock) to begin buffering rows.When ready, activate the
Export Fileinput to save buffered rows to disk. The block will add or update the CSV header automatically.
π Behavior
While
Start Loggingis active the block captures the current timestamp and the values of all connected data sockets into an internal list.When
Export Filebecomes true the block writes the accumulated rows to the CSV file atFolder Path+File Name. After successful export the internal buffer is cleared.
π‘ Tips and Tricks
Use
Date-TimeorDate-Time Listblocks to build meaningful file names or to feed extra time-related columns in addition to the automatic timestamp.Use
Logic Inputto manually controlStart LoggingandExport Filefrom the UI.When logging numeric measurements, use
Number Inputor math blocks (likeAdd,Subtract) upstream to prepare values before connecting to theData_ninputs.For string labels or IDs, use
String InputorString Mergeto combine text fields before sending to aData_ninput.To export image-related metadata (e.g., frame count, detection numbers), connect relevant analysis blocks such as
Object Detection,Mask Detection, orFind Objectinto the genericData_ninputs.If you want to save images alongside numeric logs, use
Image LoggerorImage Writein parallel and keep CSV for numeric/textual metadata only.Use
CSV Exporttogether withScopeto visualize numeric streams and then save the data once you verify events of interest.
π οΈ Troubleshooting
File not saved / permission error: make sure the CSV file is not open in another program and that you have write permission for the selected folder. Run the application with sufficient privileges if needed.
No data exported: ensure you have activated
Start Loggingat least once so that the internal buffer contains rows before triggeringExport File. The block will warn if there is no stored data when export is requested.Wrong columns in CSV: confirm which
Data_nsockets are connected and adjust theHeader fieldstext boxes. The block only includes connected inputs and updates the header when you change header text.
Last updated
Was this helpful?