LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with line style in strip chart.

Ref: LabWindows/CVI 5.5

I am having a problem displaying multiple traces on a strip chart. I use colors and line styles to identify different data signals.
Unfortunately, all the signal traces show up as solid lines despite the attribute setting of the traces (traces are assigned to different line styles to distinguish from each other). What puzzles me is that when I click on another control button which evokes a callback function to open another panel, the existing portion of the trace line in the strip chart turns to the correct line style (VAL_DASH_DOT, VAL_DASH, etc) momentarily, but new data trace still being plotted as solid line. If I close the newly opened panel and then click on the control button to open the panel again
, the portion of the traces that were plotted as solid lines will turn into their correct line style momentarily. Again, the new data trace after that will appear as solid line. Does anyone has any clues of what might cause it to happen like this?

The following codes are used to set up the plot traces:
// Set up and clear the strip chart
SetCtrlAttribute (panel, MYPLOT, ATTR_NUM_TRACES, 40)

// Set Trace Attributes
for (i=0; i<40; i++)
{
SetTraceAttribute (panel, MYPLOT, i+1, ATTR_TRACE_COLOR, TraceColors[i]);
SetTraceAttribute (panel, MYPLOT, i+1, ATTR_LINE_STYLE, TraceStyle[i]);
}
ClearStripChart (panel, MYPLOT);
SetCtrlAttribute (panel, MYPLOT, ATTR_SCROLL_MODE, VAL_CONTINUOUS);
0 Kudos
Message 1 of 2
(3,145 Views)
That is very peculiar indeed, but I'm wondering if the momentary conversion to the desired linestyle is caused by just a momentary slow-down in window drawing and updating of the linestyle attribute or by result of the linestyle updates that the different scroll modes a chart supports make automatically (CONTINUOUS, SWEEP, and BLOCK).

When in CONTINUOUS mode, the line style for a trace's currently displayed data will be retained even when the chart is covered and uncovered by another window and the chart is redrawn. In SWEEP and BLOCK mode, if displayed data is covered and uncovered it will be redrawn with the most currently set linestyle. This is the way the control was designed to work and other than that there have been no reported instances of random beha
vior of linestyle changes.

Try using the stripchart.prj example that only has 3 traces in your ...\cvi\samples\userint directory to see this behavior by playing around with the trace linestyles. Just as a side note though, I would try to see if you can exhibit the same behavior with quite a few less traces because I don't know how you can differentiate anything with 40 of them.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(3,145 Views)