I'll just explain what I'm trying to do and the steps I've taken so far:
My LabVIEW 6.1 based application is intended to run on a linux based machine with no monitor and no user interaction. We have a small linux build with no X-windows or any other GUI system, just a bash command line.
1) Is it even possible to write such an application with LabVIEW, or will something crash because of the lack of graphical capabilities on my linux build? Or can I get away with it by being very careful not to call anything that will try to popup a front panel?
2) I see I can't build an executable without having at least one front panel, so how about I build my whole LabVIEW app into a shared object, then call it with a small C-based "wrapper"? Thi s seems to be convenient, and I even found a nice little wrapper program to do this using the "dlopen" and "dlsym" functions. Unfortunately, it doesn't work. After I got over the hiccup of linking with liblvrt.so.6.1, when I execute it just seems to hang and do nothing, not even exit (even if I include LabVIEW's exit function). The test vi I'm building into an 'so' is the simplest of all: pass an integer out to an indicator, which my function prototype then defines as the return code. Couldn't be simpler.
Any ideas out there? Should I just abandon LabVIEW and do everything in C?
Thanks, David Moerman, Advanced Measurements Inc www.advmeas.com
LabVIEW must have a display in order to work. But it does not need to be a "real" display (hardware display adaptor). A perfect display for LabVIEW on embedded Linux systems is Xvnc. This has the added bonus of allowing you to connect to the head of your application over TCP-IP via a VNC client.
The Linux version of RealVNC (available at http://www.realvnc.com) comes with Xvnc which creates a virtual display. You can have your LabVIEW apps displayed in this virtual display (and even connect to the display using a VNC client, if you so wish). BTW, this is how folks create embedded LabVIEW systems running on Linux. You might want to check out LabVIEW Graphical Programming, 3rd Ed. and read the chapters in the back of the book which detail embedding LabVIEW on Linux.
Install RealVNC by running the install script in the installer archive. You can start the Xvnc server on display 13 (or any unused display) with the command "vncserver :13". Run this once, as root, from a terminal. It will ask you for a login password and will create some files that it needs to start-up. Subsequent runs of this command will start Xvnc without user interaction. After Xvnc is running you can launch your LabVIEW App daemons with the command "myApp -display localhost:13"
You can add these commands to /etc/initab so that they launch at startup. You can also monitor them with a cron job, or another watchdog App, and restart them if they crash. However, if you want more subtle and flexible control of starting, stopping, and monitoring your apps, you might want to "daemonize" them using a tool such as daemontools.