Menu

Using Octave Scripts

Help
Anonymous
2007-11-06
2012-11-23
  • Anonymous

    Anonymous - 2007-11-06

    Hi,

    the source code delivers also octave scripts to plot statitics about the clock synch process. How can I get the data ("t" and "tr" in the scripts) out of ptpd?

    Many thanks in advance!

    fitzek

     
    • Alan Bartky

      Alan Bartky - 2007-11-06

      fitzek,

      To get statistics out of ptpd, you have to enable command line, statisitcs and file output, so you would setup you test environment with a PTP master in one system and the system you want to test as slave, and then run ptpd with statistics on the slave system.  To do this, it is easier to force ptpd to go into slave only mode on the system you want to collect statsitcis.  You also want to make sure that ptpd is not compiled with any debug option as in the current code, statistics will be disabled if debugging is compiled as enabled.  For the examples below, to match the kind of graphs in the PDF file, I would also recommend setting ptpd sync interval ("-y" option) to once per second (2 to the power of 0)

      On the slave you would enter:

      ptpd -c -g -y 0 -d -f capturefilename 

      This will give you a file from which you can extract and edit the ASCII data you need such as offset from master into a format compatable for the offset_stats.m octave script (I have never used octave, but a quick look at their web site indicates you can load ASCII data into the t and tr matrices).

      Also for octave, at least for the initial load of the data for analysis, looks likes you'll need to load the data using the -ascii option (excerpt from octave manual load function options below):

      -ascii
      Force Octave to assume the file contains columns of numbers in text format without any header or other information. Data in the file will be loaded as a single numeric matrix with the name of the variable derived from the name of the file.

      If you want to use excel or other programs that support .csv files to do analysis, then you invoke the same command, but use "-D" instead of "-d" to force the output to .csv format:

      ptpd -c -g -y 0 -D -f capturefilename.csv

      Hope this helps,

      Best regards,

      abartky

       
      • Anonymous

        Anonymous - 2007-11-07

        Hi abartky,

        thank you for your quick answer! ptpd runs quite well for our tests.

        For the statistics I changed the "offset_stats.m" octave file to become a matlab file (which I can deliver if somebody will be interested). (btw: Importing the data was not a big problem! ;)) I did the mapping of the "offset from master" (ofm) and "one way delay" (owd) from the output file like follows:

        t = ofm; % offset from master
        tr = owd; % one way delay

        Hope that is correct. At least the plots seems to be ok with this mapping.

        Kind Regards,

        fitzek

         

Log in to post a comment.