LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to a chart within a cluster using a refnum not working?

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(3,272 Views)
Solution
Accepted by Neil.Pate
That won't work. You have to extract the reference for the chart from the cluster and update it that way. See attached mod.
Message 2 of 7
(3,253 Views)

Perfect! Thanks.

 

I still don't really know why this does not work though Robot surprised

0 Kudos
Message 3 of 7
(3,249 Views)

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.

Message Edited by Baji on 03-25-2009 11:04 AM
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 4 of 7
(3,230 Views)

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

 

 

0 Kudos
Message 5 of 7
(3,214 Views)

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 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 7
(3,191 Views)

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. 

0 Kudos
Message 7 of 7
(3,179 Views)