Friday, May 30, 2008

SML on a Mac

I've encountered a problem running LabVIEW SML on MacOS (10.5/Leopard):

When building pathnames, LV uses the "Classic" Mac OS filename separator--the colon (:). However, some of the config files and/or VIs were written with the Unix standard in mind, which uses the slash (/) as the delimiter. Apparently, when both are used together, LV/MacOS does not know how to interpret this correctly--the most common initial error resulting from this would be "DefaultConfigFile not found".

My solution thus far is to change my environment variables to use colons as filename delimiters, and the resulting pathnames built with only colons as delimiters are then valid. However, some of the pathnames constructed in the PML VIs (FROMPML, TOSML, TOSVE) have hard-coded slash delimiters (technically, the paths for the python calls are constructed by concatenating strings rather than building pathnames). This will need to be changed in order for the PML scripts to be called successfully from LabVIEW. Furthermore (and rather oddly, in my opinion), the standard terminal windows in MacOS use only the Unix standard, and cannot comprehend colons as delimiters (I run bash; I haven't checked other shells). Thus, the two different standards mean that I cannot simultaneously run SML LabVIEW VIs and refer to, say, $APPROOT or $PYTHONPATH from the terminal's command line.
I am also unable to convert pathnames in LV to all-slash delimited; LV automatically prepends a colon to all pathnames.

In summary: for MacOS, all-colon delimiters work within LV, all-slash delimiters work within terminal windows, and mixed delimiters do not work at all.

EDIT: The problem only occurs at the environment level. Once the environment variables are read properly (APPROOT requires colon delimiters, PYTHONPATH requires slash delimiters) and LV is running, then the mixed-delimiter paths (e.g. in FROMPML) do not cause any further errors. So the solution does not require edits to the PML VIs.

No comments: