LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

64 bit: inconsistent plot commands

A question, may be a comment:

 

While PlotXY accepts various data formats, double, int, and ssize_t integers, the plotline command is limited to double. Hence, I can not use the same data set to plot a line if the data are ssize_t integers without getting compiler warnings 'Conversion from 'ssize_t' to 'double' might lose data'. Of course, the warning is correct, but why not permit plotting integers?

 

(Background: sometimes events are counted and evaluated (normalized, offset corrected...) Using integers preserves precision, while at large numbers double values loose significant digits. Now, plotting a line from a large data set may be useful to connect two points from the data set, indicating a baseline ...) 

 

Any recommendations? If not, may I suggest to update the PlotLine... commands to accept 64 bit integers, too?

0 Kudos
Message 1 of 3
(3,295 Views)

The plotting functions that accept arrays (PlotX, PlotY, PlotWaveform, etc...) can accept variable data parameters because they can simply declare those arrays as void *. But functions that take scalars (PlotPoint, PlotLine, etc...) cannot accept values of variable types in a single function. They could do it by forcing you to pass a pointer to the value, instead of the value, but that would also be more cumbersome since it would require you to always use a variable. You wouldn't be able to pass a constant instead.

 

The warning from ssize_t to double makes sense (in 64-bit), but you can easily suppress it by casting it to a double when you pass it to PlotLine.

 

Luis

0 Kudos
Message 2 of 3
(3,279 Views)

Thanks, Luis.

 

May I then suggest to modify some analysis functions to accept both integers and doubles, e.g. Clear1D, LinEv1D etc.: now, for integer arrays, all these nice array functions cannot be used...

 

Wolfgang

0 Kudos
Message 3 of 3
(3,262 Views)