Randy-
I agree with you that when performing operations that depend on 32-bit operation with a n-bit register (n=64,80,128) for true emulation, using standard code with float rather than double declarations may not make a difference (it depends on the compiler settings and the platform; for instance, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_.2f.op.asp for the switch in Visual C++ for Intel computers to change the compiler behavior). That is a specialized application that one really can't expect National Instruments to address.
However, the issue that I am mainly trying to address is execution speed and unnecessary overhead. There are a number of signal generation and analysis routines (as opposed to the simulation routines referred to above) that we've written for these fairly large arrays of single-precision numbers --- the type of register is used to hold intermediate results is not critical, as a small amount of roundoff error is fine.
My experience, both within Labview with G-only code (i.e., no external code routines for which type declarations can't be modified), and with other programming languages in general, is that the execution speed of a given mathematical routine on an array of floats is usually substantially faster than that for an array of doubles, due primarily to memory I/O issues. So, in the case at hand, we are taking two potential performance hits:
a. the conversion of the array from float to double (and double back to float at the end) in Labview
b. the use of double arrays (the overhead associated with dealing with a structure that is twice as large as its float counterpart) inside the external code
I believe that there could be a significant speed increase for these types of application (i.e., when large arrays of single precision data are involved) if single precision versions of certain elements of the analysis tools were available. This is something from which a number of Labview users might benefit.
Is there any way that you can provide single-precision components of the lvanlys.dll library for the following functions:
White (Uniform White Noise.vi)
Spectrum (Power Spectrum.vi)
and, important to a lesser extent,
ChirpCIN (Chirp Pattern.vi)
SineWaveCIN (Sine Wave.vi)
TriangleWaveCIN (Triangle Wave.vi)
SquareWaveCIN (Square Wave.vi)
RealFFTH (Real FFT.vi)
Obviously, any other library routines that these components call would need to be modified for single precision inputs/outputs).
I would obviously let you know the results of using such code on the (hopefully substantial) improvement in execution speed (if you're interested).
Thanks..
Stephen Applebaum, PhD