LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Impossible to clear a waveform inside a cluster...? LabVIEW quirk?

I want to erase the chart history of a chart inside of a cluster. This seems apparently impossible to do. The code takes two minutes to see what I'm talking about--sorry no predone LabVIEW code.

Create cluster
Create waveform chart in cluster
Create a waveform chart outside of the cluster

Switch to diagram:
Create cluster property node
Select AllObjs[]
Create for loop
Wire AllObjs[] output to for loop (leave indexing enabled)

Inside for loop:
Drag to diagram: "class specifier constant", under app control
Select VI Server class and choose:
Generic > GObject > Control > GraphChart > WaveformChart
Drag to diagram: "to more specific class", under app control
Wire "class specifier co
nstant" to top node of "to more specific class"
Wire indexed reference from AllObjs[] to left 'reference'
node of "to more specific class"
Drage to diagram property node, under app control
Wire output terminal of "to more specific class" to property node.
Create property node from Waveform chart terminal that is not in cluster.
Click and compare.

These should be two property nodes that do the exact same thing, but they don't. You will notice you cannot access the history data of the chart in the cluster. To clear the chart you need to access the history data and write a null array to it, which works fine if it's not in a cluster. Is this a LabVIEW quirk with clusters or is there a workaround to wipe the data?
0 Kudos
Message 1 of 4
(2,986 Views)
> I want to erase the chart history of a chart inside of a cluster.
> This seems apparently impossible to do
....
> Wire indexed reference from AllObjs[] to left 'reference'
> node of "to more specific class"
> Drage to diagram property node, under app control
> Wire output terminal of "to more specific class" to property node.
> Create property node from Waveform chart terminal that is not in
> cluster.
> Click and compare.
>
> These should be two property nodes that do the exact same thing, but
> they don't. You will notice you cannot access the history data of the
> chart in the cluster... Is this a LabVIEW quirk with clusters or is there a
> workaround to wipe the data?

The problem is that the property nodes aren't of exactly the same type.
To illust
rate this, popup on the chart's implicit property node and
choose Disconnect from Control. Note that the class name at the top
includes (strict) whereas the one created by casting to more specific
doesn't.

If you go to your chart and create a reference directly from it and wire
that reference to the middle terminal of the To More Specific, it will
contain the History data.

Here is why.
Some LV controls/indictors, like the Boolean, are always the same type.
Others like numerics and graphs/charts either adapt to type or allow
for selection of various datatypes. Properties that are common to these
are exposed as a nonstrict class, and if the value's datatype is
included, it is considered strict and is actually a unique class built
on the fly.

Greg McKaskle
0 Kudos
Message 2 of 4
(2,986 Views)
well stated reply--i achieve the results indicated above but there are two problems.

number one, you cannot "go to your chart and create a reference directly from it" if that chart is in a cluster--unless i'm just unaware of some way to do that.

two, if you create a reference to a chart that is not in a cluster and use it to typecast your class, the reference gets deleted if you try and delete the waveform chart it references.

so the obvious workaround here is to make an unused chart not in a cluster, hide it on the front panel and use it for typecasting... good enough to get things working... thanks so much for the info.
0 Kudos
Message 3 of 4
(2,986 Views)
You can create a reference to the waveform chart in the cluster from the front panel. You are not able to do this from the block diagram. Simply right click on the chart in the cluster on the front panel and select Create >> Reference. He can then do what Greg mentioned.
Message 4 of 4
(2,986 Views)