I have a .csv file with x column (1st column for x-axis values) and y column (2nd column for y-axis values).
I have plotted already a waveform in wavescan/Viva.
The .csv file is having same x and y units as that of wavescan/Viva.
Is there any way I can append the plot of the .csv file onto the wave in ViVA ?
Could anybody please help me in this regard.
So you want to concatenate two waveforms (did I understand you correctly)? You could use this custom function to concatenate the two.
Thanks Andrew, Yes this can be used but how to bring the x and Y data from the .csv file to the wave in Viva and then concatenate it ?
It's a bit of a strange requirement, but you should be able to bring in the data from the CSV using the getAsciiWave function in the calculator, and the original waveform you should be able to use Right Mouse->Send->To Calculator (or something like that) and then use my custom concatenation function, and plot the result.
I tried to use getAsciiWave function for a csv file.
The data format in the file is as below:- (the 1st column is the timestamp and the 2nd column is the voltage value)
0.000000000000000e+00 , -1.599895321664491e-041.022413504667159e-13 , -1.925820261625804e-042.044827009334319e-13 , -2.264630041929152e-043.067240514001478e-13 , -2.641736431026884e-044.089654018668637e-13 , -3.011815624487069e-045.112067523335796e-13 , -3.374965222249115e-04
I then use the command in the calculator as below:-
getAsciiWave("/user/home/MAT_WORK_CAD/PPV_ISF_OSC/RING_OSC_HB_TD_WAVE.csv" 1 2 ?xskip 0 ?yskip 0 ?formatFloat t ?xName "Time" ?xUnits "s" ?yName "V" ?yUnits "v" ).
But, it is not plotting in ViVa. The file location is correct.
The errors I am getting in CIW is as:-
expression evaluation failed: val is not legal.expression evaluation failed: getAsciiWave("/user/home/MAT_WORK_CAD/PPV_ISF_OSC/RING_OSC_HB_TD_WAVE.vcsv" 1 2 ?xskip 0 ?yskip 0 ?formatFloat t ?xName "Time" ?xUnits "s" ?yName "V" ?yUnits "v" )Data directory must point to valid simulation results.
Could you please tell why this is happening ?
There's an issue if you have CSV files when you use ?formatFloat t (so set that to "off" on the form to avoid this). If you have formatFloat set to "on" (or t), then you need to remove the commas in the file. Since all the numbers are floating point anyway, you can leave formatFloat as off and then you don't need to change the file (CCR 1629658 is about this). So this should work:
getAsciiWave("/user/home/MAT_WORK_CAD/PPV_ISF_OSC/RING_OSC_HB_TD_WAVE.csv" 1 2 ?xskip 0 ?yskip 0 ?formatFloat nil ?xName "Time" ?xUnits "s" ?yName "V" ?yUnits "v" )