03-24-2009 12:25 PM
Hi All,
A bit of a weird one this (I think). I am trying to update a chart that lies within a cluster, using a refnum.
See the attached example, the boolean updates correctly, but not the (top) chart. Is there something I am doing incorrectly or can charts just not be updated this way?
Using LV 8.6 in Win XP (SP3).
Ideas?
nrp
Solved! Go to Solution.
03-24-2009 05:01 PM
03-24-2009 05:25 PM
Perfect! Thanks.
I still don't really know why this does not work though
03-25-2009 12:33 AM - edited 03-25-2009 12:34 AM
Hi,
look at this vi u can update the numeric inside the cluster, if u need to update the waveform chart, you need to upadate the value of the waveform chart by its propety node or by its control refnum then only the chart get updated.
smercurio_fc extracted the control reference and updated the waveform chart so its works fine.
03-25-2009 03:47 AM
Hi Baji, thanks for your comments.
I think you misunderstood me though, as I didn't say that I don't understand how smercurio solved it, I was wondering why the original example doesn't work (and still wondering...).
In my example the reason I added the boolean within the cluster was to show that it was being updated (similar to your example).
nrp
03-25-2009 07:38 AM
nrp wrote:Hi Baji, thanks for your comments.
I think you misunderstood me though, as I didn't say that I don't understand how smercurio solved it, I was wondering why the original example doesn't work (and still wondering...).
In my example the reason I added the boolean within the cluster was to show that it was being updated (similar to your example).
nrp
The answer hinges on "What was in the cluster?"
If the cluster has a boolean and a reference then your cluster has a data value (the boolean) and an index to a data structure (the refenece). Updating the cluster updates the boolean and updates the index (ref). This would be useful if you want to refer to multiple charts. But updating the index (ref) does not actually do anything to the widget (the chart) that the ref points at. You still have to "do something" (invoke a method, update a property) to the widget the ref points at.
I'll leave it at that,
Ben
03-25-2009 12:23 PM
OK, I follow that, but the original cluster (that was not being updated correctly) did not have a reference (it had a float and a bool) in it, I was merely using a reference to get to the cluster. It would appear that writing the data value to the cluster (via a reference) does not cause the chart to be updated.
Another observation, my initial testing was done with a typedef which included the chart in a cluster, and if you probed immediately after the data had been bundled the chart in the probe (cool!) did show the data being written correctly to the chart.