I've just started using DS-5 to develop for Vybrid.
During the debug I have some variables added to Expressions view. Some of them are C arrays.
I need to show these arrays as plots (charts) and to export them in text files (for example csv) to load them in other software.
I think it's an easy and common task, but I can't find a way to do this.
Could someone help, please?
It seems that there is no options in DS-5 debugger to plot an array. I have attached a script for simple plotting. The script dumps the variable content to: /tmp/ds5/debug_dump_variable_ds5.bin and uses gnuplot (i.e you need to run eclipse on linux) to plot the data.
Source the script plot.ds in the DS-5 debugger command window, or configure your Debugger configurations to do it at start-up.
Usage: plot <variable> <array size in bytes> <format> - format = float32, int32, int16 - array size in bytes = This number can be less that the array size if you e.g. only wants to plot the start of the array. - E.g: plot myFloatBuffer 4096*4 float32 , *4 is to get the correct byte size plot myInt16Buffer 4096*2 int16 , *2 is to get the correct byte size
plot.ds:
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY. I.e. use at your own risk. # # Simple plot: define plot shell echo "------------------------------------------------------------------" shell echo "Plotting Variable:$arg0 Size in bytes:$arg1 Format:$arg2 " shell echo " - Usage: plot <variable> <size in bytes> <format> " shell echo " - format = float32, int32 or int16 " shell echo " - Usage: plot mybuffer 4096*4 float32 " shell echo "------------------------------------------------------------------" # #Dump content of variable to file shell mkdir -p /tmp/ds5 shell rm -f /tmp/ds5/debug_dump_variable_ds5.bin dump binary memory /tmp/ds5/debug_dump_variable_ds5.bin &$arg0 +$arg1 whatis $arg0 shell echo "Doing a plot of $arg0." shell gnuplot -p -e "set mouse; set title '$arg0'; plot '/tmp/ds5/debug_dump_variable_ds5.bin' binary format='%$arg2' u 0:1 with lines; pause -1" & shell echo ------------------------------------------------------------------ end