public void ReadHistogram() {
        // TODO 
        // currently we are reading always from IP with Index 0
        // but how to deal with multiple histograms?
        // maybe make the one displayed switchable to select which camera the data should come from?

        URLConnection conn = null;
        BufferedReader data = null;
        String line;
        String result = null;
        StringBuffer buf = new StringBuffer();
        URL HistURL = null;
        int parameter = 0;
        String camera = null;
        if (Parent.Camera.GetHistogramScaleMode() == HistogramScaleMode.LINEAR) {
            camera = "http://" + this.IP[0] + "/ElphelVision/histogram.php?mode=linear&" + (int) (Math.random() * 32000); // to prevent reading a cached result we add a random number to the URL
        } else if (Parent.Camera.GetHistogramScaleMode() == HistogramScaleMode.LOG) {
            camera = "http://" + this.IP[0] + "/ElphelVision/histogram.php?mode=log&" + (int) (Math.random() * 32000); // to prevent reading a cached result we add a random number to the URL
        }

        try {
            HistURL = new URL(camera);
        } catch (MalformedURLException e) {
            Parent.WriteErrortoConsole("Reading histogram data failed at URL: " + HistURL);
        }

        try {
            conn = HistURL.openConnection();
            conn.connect();

            Parent.WriteLogtoConsole(this.IP[0] + ": ReadHistogram(): Reading histogram data");

            data = new BufferedReader(new InputStreamReader(conn.getInputStream()));

            buf.delete(0, buf.length());
            while ((line = data.readLine()) != null) {
                buf.append(line + "\n");
            }

            result = buf.toString();
            data.close();
        } catch (IOException e) {
            Parent.WriteErrortoConsole("Reading histogram data IO Error:" + e.getMessage());
        }

        try {
            String[] x = Pattern.compile(";").split(result);
            int a = 0;

            // RED
            for (int j = 0; j < 256; j++) {
                Histogram[0][j] = (int) (Integer.parseInt(x[a++]));
                //System.out.println(j + " \"" + x[j] + "\"");
            }
            // GREEN
            for (int j = 0; j < 256; j++) {
                Histogram[1][j] = (int) (Integer.parseInt(x[a++]));
                //System.out.println(j + " \"" + x[j] + "\"");
            }
            // BLUE
            for (int j = 0; j < 256; j++) {
                Histogram[2][j] = (int) (Integer.parseInt(x[a++]));
                //System.out.println(j + " \"" + x[j] + "\"");
            }
            int b = 1;
        } catch (Exception e) {
            Parent.WriteErrortoConsole("Reading histogram data IO Error:" + e.getMessage());
        }
    }