Close

PC Software

A project log for 3d Printed Scanning Electron Microscope

The goal is to build a DIY Scanning Electron Microscope (DIY SEM) with commonly available materials

chrisdeerlegChris.deerleg 04/06/2018 at 02:040 Comments

GNU Octave

For the PC software I choose GNU Octave. A very powerful math tool kit with a option to include a graphic user interface. The download link for octave. Also very useful are the big variety of additional support packages on this page . I use the instrument-control package which contain the driver to user the serial interface. A useful descriptor for use the serial interface is this page https://www.edn.com/design/analog/4440674/Read-serial-data-directly-into-Octave.


The above linked video series gave me a introduction to Octave GNU.

Andreas Weber example code was very helpful to understand how a GUI in Octave is build.

h.plot_title_label = uicontrol ("style", "text",
                                "units", "normalized",
                                "string", "plot title: (text)",
"horizontalalignment",

I struggled a little bit until I understood that with (h.xyz = uico(...)) ui elements are placed.

 h = guidata (obj);
...
  switch (gcbo)
...
...
guidata (gcf, h)

guidata store the handle of the ui elements and guidata and gcbo gives the handle back in the function.

Another big challenge is to create a timer which calls periodically a function. I found a good approach on the following page https://savannah.gnu.org/bugs/?32316.  The approach is to use the event hook to call a function. I was able to call the function about every 100ms.

Discussions