Alternatives to NI LabVIEW

Preamble

I have been reading O’Reilly’s Distributed Network Data by Bradford and Allan, see the XBee blog. The final chapter introduces an interesting graphical programming environment, LabVIEW that can be used with the Arduino. However, the costs are prohibitive and the trail version only lasts 45 days. So, I was looking for a free version to run on OS X. I managed to get MyOpenLab running, after a few tweaks (see below).

Alternatives

So, are there any open source alternatives? Yes, a couple:

  • MyOpenLab (Last updated 2014), downloads for Windows and Linux only, but it is a Java application…
  • PyLab-Works (Last updated 2009), googlecode repository is archived, but can be found on GitHub also (Where???). There is a SourceForge site, but that still appears to be in the planning stage, and was last updated 2013. There is a Show Case, but again from 2008. Links to the apparent Home Pages are dead. I think that it is safe to say that, unfortunately, the project is basically dead. There is a PyLab, but without the graphical programming, see PyLab for computer-generated graphs

Useful links

I am trying MyOpenLab now. It is graphical programming but still a little different from LabView. I like it because it can talk to Arduino.

No! Let me clarify that simple answer first. I have been working with LabVIEW since 2008. I was (was because certificates expire after 2 years) certified LabVIEW Developer. I have searched and found nothing close.
There are a few languages out there that are graphical but suitable for teaching programming concepts to children e.g Scratch (http://scratch.mit.edu/). Microsoft have VPL (msdn.microsoft.com/en-us/library/bb483088.aspx) part of their robotics suit. But none of them are as ………(what’s the proper word) complete, mature as LabVIEW. (Its possible that my knowledge is not complete with regards to your question. But I have searched and found nothing comparable yet.). As far as I know, it stands alone, in its niche.

Running MyOpenLab on Mac

It is possible to run on a Mac as it is a Java application. On my OS X 10.9.5

lamento haber encontrado MyOpenLab tan tarde, pero para quien busque esta respuesta en el futuro:

Descomprimir el paquete en un directorio, como /Users/usuario/MyOpenLab
Abrir un terminal, alcanzar el directorio MyOpenLab, y teclear:
java -jar c-exp-lab.jar Elements

No pude hacerlo funcionar con “start with JDK”.

So, first download the Linux version of MyOpenLab (distribution_linux64_3.0.4.1.zip from sourceforge). Note that I found Chrome had a problem with confirming the finished download, leaving me with a file “crdownload.unconfirmed”. I just renamed that file “myopenlab.zip” and then unipped it manually. After unzipping it then, in a terminal, navigate to the MyOpenLab directory:

MacBooks-MacBook-Pro:myopenlab user$ java -jar myopenlab.jar Elements
Exception in thread "main" java.lang.UnsupportedClassVersionError: VisualLogic/FrameMain : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

This probably means that Java 7 is required. Looking in the JavaVirtualMachines directory will show that it is empty:

~ user$ ls /Library/Java/JavaVirtualMachines

Apple only supplies Java 6, see Java 7 on Mac OS X

Apple has hurt its users who develop in Java by declaring an end to Java support but continuing to update Java 6 using its automatic update program. This means that installing Oracle Java 7 JDK is a hassle to begin with, and if you blindly accept all of Apple’s software updates (that is, you don’t remember to uncheck Java updates when they appear) you’ll have to re-do parts of your Java 7 installation from time to time because Apple’s Java updates reset all the symlinks to point to its own Java 6. In any case, here’s what you need to do to install and use Java 7 on Mac OS X and fix Apples “updates” if they slip by you. At the time of this writing the current Java 7 is update 17 (jdk1.7.0_17).

So, you need to download Java 7, go to Java SE Development Kit 7 Downloads. Open the .dmg and install the package.

JDK .dmg contents
JDK .dmg contents

Now, looking in the JavaVirtualMachines directory will show that it has Java 7:

~ user$ ls /Library/Java/JavaVirtualMachines
jdk1.7.0_79.jdk

Now you can run the java -jar command again to run Elememts.

myopenlab user$ java -jar myopenlab.jar Elements
Arg[0]=Elements
Locale=en_US
java.io.FileNotFoundException: /Volumes/Leopard/Users/user\MyOpenLab\UserElements/CircuitElements/definition.def (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:221)
at java.io.FileOutputStream.(FileOutputStream.java:171)
at VisualLogic.Tools.copyFile(Unknown Source)
at VisualLogic.FrameMain.createUserElementSubDirs(Unknown Source)
at VisualLogic.FrameMain.handleUserElementDirectory(Unknown Source)
at VisualLogic.FrameMain.(Unknown Source)
at VisualLogic.FrameMain.main(Unknown Source)
java.io.FileNotFoundException: /Volumes/Leopard/Users/user\MyOpenLab\UserElements/CircuitElements/icon.png (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:221)
at java.io.FileOutputStream.(FileOutputStream.java:171)
at VisualLogic.Tools.copyFile(Unknown Source)
at VisualLogic.FrameMain.createUserElementSubDirs(Unknown Source)
at VisualLogic.FrameMain.handleUserElementDirectory(Unknown Source)
at VisualLogic.FrameMain.(Unknown Source)
at VisualLogic.FrameMain.main(Unknown Source)
java.io.FileNotFoundException: /Volumes/Leopard/Users/user\MyOpenLab\UserElements/FrontElements/definition.def (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:221)
at java.io.FileOutputStream.(FileOutputStream.java:171)
at VisualLogic.Tools.copyFile(Unknown Source)
at VisualLogic.FrameMain.createUserElementSubDirs(Unknown Source)
at VisualLogic.FrameMain.handleUserElementDirectory(Unknown Source)
at VisualLogic.FrameMain.(Unknown Source)
at VisualLogic.FrameMain.main(Unknown Source)
java.io.FileNotFoundException: /Volumes/Leopard/Users/user\MyOpenLab\UserElements/FrontElements/icon.png (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:221)
at java.io.FileOutputStream.(FileOutputStream.java:171)
at VisualLogic.Tools.copyFile(Unknown Source)
at VisualLogic.FrameMain.createUserElementSubDirs(Unknown Source)
at VisualLogic.FrameMain.handleUserElementDirectory(Unknown Source)
at VisualLogic.FrameMain.(Unknown Source)
at VisualLogic.FrameMain.main(Unknown Source)
myopenlab Path=/Volumes/Leopard/Users/user/Downloads/myopenlab/Elements
Java version :1.7.0_79
*************** PORTS ----------------
Driver loaded : MyOpenLab.RS232
Driver loaded : Velleman.K8047
Driver loaded : Velleman.K8055_v1.1
Driver loaded : modusbus.CompuLab

Note that the first run will result in a few FileNotFoundExceptions. However, when it is running, a dialog will pop up asking if you wish to update a path, clicking yes will fix this issue. Close MyOpenLab and run it again, this time no errors will appear.

MacBooks-MacBook-Pro:myopenlab user$ java -jar myopenlab.jar Elements
Arg[0]=Elements
Locale=en_US
myopenlab Path=/Volumes/Leopard/Users/user/Downloads/myopenlab/Elements
Java version :1.7.0_79
*************** PORTS ----------------
Driver loaded : MyOpenLab.RS232
Driver loaded : Velleman.K8047
Driver loaded : Velleman.K8055_v1.1
Driver loaded : modusbus.CompuLab
MacBooks-MacBook-Pro:myopenlab user$

You will now have MyOpenLab running on your Mac!

MyOpenLab running on OS X
MyOpenLab running on OS X

See also:

Now all that remains is to move the unzipped directory to the Applications folder and create a iconised shortcut to click on. See Create terminal command shortcut icon and Allow .command files to determine working directory. Place the line

cd `dirname $0`
java -jar ./myopenlab.jar Elements

in a text file, save as plain text, in the MyOpenLab directory (along with the rest of the existing java application’s code), and name “run_myopenlab.command”. Make it executable,

chmod +x run_myopenlab.command

When you double click it, MyOpenLab will run…

NOTE: Now you could use Automator, with “Run Shell script” to create an app, but I would not bother wasting your time using flakey software. See Create terminal command shortcut icon and Terminal Command with Automator

Also of interest

Running PyLab-Works

Download PyLab_Works_v0.3.zip, from the google code download repository. However, it will not run “straight-out-of-the-box”, as a number of python packages are missing, on native OS X 10.9.5. It requires:

Endless errors:

These are the errors that you will encounter

MacBooks-MacBook-Pro:PyLab_Works user$ python PyLab_Works.py
************** ALARM *************
Traceback (most recent call last):
  File "PyLab_Works.py", line 15, in
    from General_Globals import *
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/General_Globals.py", line 607, in
    from inifile_support import inifile
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/inifile_support.py", line 4, in
    from language_support import _
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/language_support.py", line 42, in
    import wx
ImportError: No module named wx
MacBooks-MacBook-Pro:PyLab_Works user$ python PyLab_Works.py
************** ALARM *************
Traceback (most recent call last):
  File "PyLab_Works.py", line 15, in
    from General_Globals import *
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/General_Globals.py", line 607, in
    from inifile_support import inifile
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/inifile_support.py", line 118, in
    from configobj import ConfigObj
ImportError: No module named configobj
CLOSE LANGUAGE LOG FILE
MacBooks-MacBook-Pro:PyLab_Works user$ python PyLab_Works.py
************** ALARM *************
Traceback (most recent call last):
  File "PyLab_Works.py", line 15, in
    from General_Globals import *
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/General_Globals.py", line 607, in
    from inifile_support import inifile
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/inifile_support.py", line 118, in
    from configobj import ConfigObj
  File "/Library/Python/2.7/site-packages/configobj.py", line 22, in
    import six
ImportError: No module named six
CLOSE LANGUAGE LOG FILE
MacBooks-MacBook-Pro:PyLab_Works user$ python PyLab_Works.py
************** ALARM *************
Traceback (most recent call last):
  File "PyLab_Works.py", line 34, in
    import PyLab_Works_Globals as PG
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/PyLab_Works/PyLab_Works_Globals.py", line 85, in
    from gui_support      import *
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/gui_support.py", line 721, in
    from   picture_support import *
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/picture_support.py", line 3, in
    from system_support   import *
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/support/system_support.py", line 59, in
    import pygame
ImportError: No module named pygame
CLOSE LANGUAGE LOG FILE
MacBooks-MacBook-Pro:PyLab_Works user$ python PyLab_Works.py
************** ALARM *************
New Language = US  Set from : /Volumes/Leopard/Users/user/Downloads/Data_Python_25/PyLab_Works/PyLab_Works_Globals.py
Traceback (most recent call last):
  File "PyLab_Works.py", line 34, in
    import PyLab_Works_Globals as PG
  File "/Volumes/Leopard/Users/user/Downloads/Data_Python_25/PyLab_Works/PyLab_Works_Globals.py", line 150, in
    General_BackGround_Color = wx.Color ( rgb, rgb, rgb )
AttributeError: 'module' object has no attribute 'Color'
CLOSE LANGUAGE LOG FILE
MacBooks-MacBook-Pro:PyLab_Works user$

Now, the issue is in the file

PyLab_Works_Globals.py

These two lines need to be changed:

    General_BackGround_Color = wx.Color ( rgb, rgb, rgb )

and

    Brick_Execution_Color = wx.Color ( 255, 0, 255 )

Color no longer exists, and is now wx.Colour (see wx.Color no longer exists, only wx.Colour, note the correct British spelling), so just add a ‘u’. Also useful:WxPython Error ‘Module’ Has No Attribute ‘App’:

>>> import wx
>>> dir(wx)

Running PyLab_Works.py will now get a lot further, with a couple of “SyntaxWarning: import * only allowed at module level” warnings for “PyLab_Works_shape_container.py:308” and “control_scope.py:24”, as well as a Windows specific warning about “wx.lib.iewin.IEHtmlWindow”.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s