LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PlotStripChart function

Solved!
Go to solution

Hello,

 

I am using "PlotStripChart" function to express variables. I would like to show two variables(data range is pretty different.) in one chart.

I tried to show each variables with traces but it was hard to see the values because of the different range of data. 

 

Is it possible I could set active both Y-axises(Left and Right axis) for StripChart and bind the variables to each axis?

 

 

Thank you,

 

Insuk 

0 Kudos
Message 1 of 19
(5,290 Views)

Hello,

 

I think I found the indirect way by setting the axis scaling. If you have any better way, please let me know.

 

Thanks,

 

Insuk

0 Kudos
Message 2 of 19
(5,284 Views)

You can enable the right Y-axis and set the strip chart with two traces. Next customize e.g. trace 2 to use the right Y-axis. From this moment on, when you PlotStripChart with an array of two values, the first one refers to left axis and the second one to right axis.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 19
(5,271 Views)

This is how you set trace #2 to use the right axis:

 

ChartTrace.png



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 19
(5,264 Views)

Hello Roberto,

 

Thank you for answer. But I still have difficulty to see the trace#2 value.

If I use right Y axis, it should have the independent scale for the value. Right?
If the YLeft = 100 and YRight = 0.0001, then they should have each auto scale and show the graph by the range.

 

My Right Y axis values seems to follow the left range and hard to see the smallest Y axis value.

Should I set up for this one? I also could not see the right Y Axis values. Do I need to set up for showing Right Axis value?

 

Thank you,

 

Insuk

 

 

0 Kudos
Message 5 of 19
(5,248 Views)

This is how to show and set the right Y-axis scale:

 

RightYAxis.png



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 19
(5,244 Views)

Hello Roberto,

 

For making sure, let me attach the uir file setting and the part of my program.

Do I need to call "SetCtrlAttribute(DisplayHandle,Chart[idx].chartCtrl,ATTR_ACTIVE_YAXIS,VAL_RIGHT_YAXIS);" whenever I update chart?

I tried that but it did not work either.

 

The code:

 

SetCtrlAttribute(DisplayHandle,Chart[idx].chartCtrl,ATTR_ACTIVE_YAXIS,VAL_RIGHT_YAXIS); 
PlotStripChart(DisplayHandle,Chart[idx].chartCtrl,PlotBuf[idx],2,0,0,VAL_FLOAT);

 

 

The attachments:

1. trace setting

2. my uir apprearance

3.running result

 

 

 

 

 

 

Download All
0 Kudos
Message 7 of 19
(5,244 Views)

 

Thank you though I did that before asking that.

 

Insuk

 

 

0 Kudos
Message 8 of 19
(5,242 Views)

Let me give more codes for making sure. The following code is repeating every 1 sec.

 

 

PlotBuf[idx][0] = dataF; //This value for trace #1

PlotBuf[idx][1] = Chart[idx].sampleVar; //This value for trace #2

 

SetCtrlAttribute(DisplayHandle,Chart[idx].chartCtrl,ATTR_ACTIVE_YAXIS,VAL_RIGHT_YAXIS); 
PlotStripChart(DisplayHandle,Chart[idx].chartCtrl,PlotBuf[idx],2,0,0,VAL_FLOAT);

 

Thank you,

 

Insuk

0 Kudos
Message 9 of 19
(5,234 Views)

No, ACTIVE_YAXIS need not to be calle before plotting. You should simply call PlotStripChart as you are already doing. But I noticed that in your uir3.jpg (running result) the right Yscale is not visible: are you sure you are using at runtime the same strip chart you customized in the UIR editor?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 10 of 19
(5,228 Views)