2 Replies Latest reply on Mar 18, 2019 8:36 AM by kl_tanner

    How do I store a waveform as a tcl object and then use it

    jasond

      Hi

       

      I am opening multiple simulation results in a tcl script. 

       

      How do I store a waveform as a tcl object and subsequently use it to plot all the waveforms I have opened in a new window?

       

      I am looking for the tcl code and not GUI interaction.

       

      Many thanks in advance

       

      Jason

        • 1. Re: How do I store a waveform as a tcl object and then use it
          jasond

          trace define Iout_${corner_file_text} VV1:neg:I              ;# Assigns the wanted waveform to a trace

          chart new -analysis Transient -newwindow                        ;# Opens new window

          trace add -name trace(Iout_${corner_file_text}) -chartbook ${corner_file_text} -chart Chart1 -plot 1    ;# Adds trace so it can be selected in next step

           

          set I_trace($sim_num) [calc -tcl]                    ;# stores the data in a tcl array (I_trace)

           

           

          To loop through $sim_num simulations and plot them

           

          chartbook new -chartbook Test_chart_book              # Opens clean workspace

          chart new -analysis XY -newwindow

          for {set i 0} {$i < $sim_num} {incr i} {

              trace define -data $I_trace(${i}) -name test_${i}

              trace add -name trace(test_${i}) -chartbook Test_chart_book -chart Chart1 -plot 1

          }

           

          Just in-case other users wish to do this.

          • 2. Re: How do I store a waveform as a tcl object and then use it
            kl_tanner

            Glad you figured it out. Typically you can just do what you want in Waveform Viewer (or S-Edit) and the Tcl commands used will be listed in the Command Window. Then you can create an automation script from those commands.

            FYI, if you are looking for a quick response to a technical question, it is best to submit a Support Request (SR) on Support Center provided you have a current support contract.