GLE is a scripting language which gives real flexibility in creating publication quality figures, including vector graphic output formats ( http://glx.sourceforge.net/index.html ). This demo project is just an example to show how to use GLE from LabVIEW in a limited way (via System Exec).
I have found GLE very useful in the last years, specially because of its fast learning curve and easy command line usage. GLE supports LaTeX too, so easy to create publication quality ps/eps figures/graphs for articles, university thesis, etc using LaTeX. This example code demonstrates how to automatize some common features in GLE, and can create output files in several formats: jpg, png (including transparent option), ps, eps, and pdf. Note that, for ps/eps we only need GLE to be installed on the PC (and a LaTeX package if we wish to use it for the graphs' text). To be able to create jpg/png/pdf files, GLE relies on GhostScript to be installed on the target PC.
This code creates a GLE script file based on user inputs, and then by calling the "System Exec.vi", it compiles it into the required output file format., thus automatizing/speeding up the often slow manual procedure. The code shows how to use GLE to create quality figures (as a png file which can be loaded into LV) for LabVIEW 2D Picture indicators and how to rescale them depending on the indicator size. Due to the required compile time this library is not intended to be a live plotting option, but more as a static graph/figure creator.
It is possible to access the GLE source files and functions to call them directly, but for easy interface creation I decided only to use the command line option (System Exec VI). Another reason to do so is that, the option to generate and keep the .gle and ascii data files. This can be very useful when we have to change GLE figures manually later (to match journal or report format requirements, etc.).
Finally, this is only a demo example which recently fulfills my needs for our projects. Feel free to modify the library as you need. Here I have only implemented a very limited feature set, if you have GLE and not LabVIEW related question, please refer to the GLE manual or mail list forum! GLE is much much more than what is shown in this LabVIEW interface, browse the example page what kind of things can be created with this very useful tool: http://glx.sourceforge.net/examples/index.html
All credits to the developers of GLE!
GLE website: http://glx.sourceforge.net/index.html
Since I only use GLE and LabVIEW for non commercial projects, please refer to the webpages for licensing information. I do not own any rights, etc...The zipped projects do not include any GLE or GhostScript installers or binaries, the users can download these via the given links.
Some screenshots from the project:
GLE_library_update1_v2013.zip
Added feature: "Add_GLE_label.vi". Free labels can be added to the Graph, parameters: position of label (either absolute pos in cm from origo, or referenced to the Graph x/y values), Font type, size, color. Label box optional: fill color, border color (or off), gap (between border and text), border rounded edges specified by value.
Plus some minor bug fixes, like if the Y-axis hidden, the Y2 axis got hidden too (if an "off" parameter is used for an axis in the GLE script, the "on" parameter must be present for the other axis).
Looks cool! I think this would be more usable if instead of a functional global, you passed the GLE_main_cluster value between each call. That would allow you to generate multiple graphs in parallel without worrying about one graph conflicting with the state of another graph.
Yes, I totally agree. In my case I just wanted to hide this "reference" or GLE_main_cluster value inside the Action Engine. In my project I plan to use these VIs in a single place serial only. But if someone needs to have a more general solution, it is better to get rid of that FGV, and as you say just pass the wire around as needed.