02-22-2014 01:18 PM - edited 02-22-2014 01:18 PM
I'm having an issue both with setting the position of cursors on a graph that has traces with NaNs. I have a VI that acquires data from several instruments and then displays the data as a function of time. The VI is set up so that when it first starts, all the instruments are off, and the user can choose which instruments they want to turn on. When an instrument is off, the VI returns a NaN for that measurement. On the front panel of the VI, there is a graph with all the data. The X data (the times) are the same for all the different instruments. However, the time interval is not constant. There are two cursors on the graph that are used to calculate the average value over a period. The user moves the first cursor, and then the second cursor will get placed at a time after after the first one (so if you move the first cursor to 5 minutes, the second one will be set to 7 minutes). The cursors are linked to the data traces, so when the program averages it isn't interpolating between points.
The VI was originally written in LV2011. In that version the cursors were linked to the first trace on the graph, but even if the instrument corresponding to that trace was turned off (reading NaNs), I could still move the cursors freely. The attached VI CSR_test_LV11 works fine in LV2011. I recently upgraded to LV2013. When I open the VI in 2013 (CSR_test_LV13_unmod), the cursors don't move like they used to, and if the first trace (the one the cursors are linked to) is NaNs, I can't move the cursor at all. The issue seems to due to the fact that even though the X data are not NaNs, if the trace the cursor is linked to is NaNs, the cursor doesn't know where to go. I'm trying to get back the behavior I had in LV2011, where as long as the X data is not NaNs the cursors can move as they are supposed to.
Using a multiplot cursor didn't seem to work as the cursors then didn't snap to the data points on the graph. The only way that gets me close to what I want is to set the first data point in all the arrays to zero (or some non-NaN value), and then programmatically set the cursors to be linked to "All Plots" under the Allow Dragging setting (CSR_test_LV13_fix_1). What's odd is that even if all the other points in the array are NaNs, as long as the first point isn't a NaN this seems to work. In the "fixed" VI there is a button so you can change whether or not the first point is a NaN, and you can see this.
Is there another way to replicate the behavior from LV2011 that doesn't require me to set the first point in all the waves to zero? I only need the X position of the cursor. I would prefer not to do this as it would require changing how a lot of arrays are initialized. The VIs that I've attached are MWEs and the actual VI runs 5 instruments and has ~25 arrays of data that it is updating.
02-22-2014 01:27 PM
That seems like a bug.
02-24-2014 11:45 AM
I will take a look at your VI's and post back once I have compared your methods from 2011 to 2013. If this does turn out to be a bug I will go ahead and report the issue for you as well. Thank you fo posting on our forums!
02-26-2014 10:45 AM
There doesn't really seem to be any work around other than what you have provided in order to make the values register. It does seem odd that as long as the first value is a 0 then everything works fine. I would stick with your solution for now and I will try to escalate this problem so that our developers are made aware of it.
Thanks for posting on the forums!
02-28-2014 09:09 AM