11-19-2008 10:40 AM
11-19-2008 11:22 AM
Hi Gillaume,
You have a couple of problems:
1. If you have more than one trace in the chart, you can't use PlotStripChartPoint. Whenever data is plotted on the chart, the data points that you pass in are distributed among all the traces in the chart. So, if you have two traces, you need to plot at least two points at a time, otherwise, nothing happens, because the modulo is discarded. For example, if you plot 7 points at a time, and you have 3 traces, then 2 points are added to each trace and the 7th point is discarded. This means that if you have two traces, you need to use the PlotStripChart function instead.
The fact that you are seeing data being plotted tells me that you haven't yet set up a second trace in the chart. This is something you have to do ahead of time, prior to plotting. You can either do it in the UI Editor (click on the Traces button in the Edit Strip Chart dialog) or programmatically using ATTR_NUM_TRACES. And if you haven't set up a second trace, then each time that you plot a point, that point goes to the first (and only) trace, which is probably why you're seeing the chart scroll twice as fast.
2. The way you plot using the right y-axis versus the left y-axis is different between graphs and charts. With a graph, you do have to set the active y-axis before you plot. But with the chart, since you have to create the traces ahead of time, then you simply associate each trace with an axis just once. You can also do this in the UI Editor, or programmatically using the ATTR_TRACE_YAXIS trace attribute (SetTraceAttribute).
Finally, I need to point out that a second y-axis was only added to the strip chart in version 8.5 of CVI. Therefore, if your plan is to port this app to Linux, you won't be able to use it until an updated version of the CVI Linux module comes out (the current version is based on CVI 8.0, as you know).
Luis
11-20-2008 02:33 AM
Hi Guillaume,
based on the last notice of Luis response, I can suggest you an alternative way of faking a second Y-axis on your control: this is described in my Multi axis graph in CVI example and even if described there on graphs it can be applied to strip charts too; moreover, since it does not uses any 8.5 release feature you should have no problems in port it on Linux.
11-20-2008 04:10 AM