LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine strict reference to the waveform chart

Solved!
Go to solution

Hello,

I would like to change properties of a waveform programatically. I have used to get all references of waveform charts a function from VI scripting palete in my VI. Then I have typecasted references To More Specific Class (strict-single plot) after this proces I have been able to set properties such as History data. Everything functions great but  if I add a Chart which is multiplot this approach does not function any more.

The problem is that in the array of references there is reference to a multiplot waveform chart and  this references is not possible typcast to To More Specific Class (stric-single plot).

 

My question is: How to determine if the reference in the array is corresponding the appropriate waveform charts (single or multiplot).  

 

In the attached VI is a code which is demonstrating my problem.

 

Thanks a lot for answers

 

Jan

0 Kudos
Message 1 of 3
(3,927 Views)

There are a couple of possible ways to attack the problem, both of which I have used at one time or another.

 

  1. If you know your charts are one of two types, try to typecast them to one type.  If you get an error, typecast to the other type should succeed.
  2. Using the original reference, get the Value property, then use the VIs in <vi.lib>\Utility\VariantDataType to determine if you have a multiplot or single plot chart.

In your case, I would probably use option 1.

 

0 Kudos
Message 2 of 3
(3,916 Views)
Solution
Accepted by topic author janCZ1

Thanks a lot for an advice. I created VI according point 2 your answer and it works. The solution is attached. 


Whether I understand it well. I must know the type of chart ahead.

My first idea was create a Drop IN VI which initialize all charts in VI on type of chart independently.

 

But this solution is fine because I will use only charts-single plot and multiplot(two elements).

 

 

 

Thanks

Jan

0 Kudos
Message 3 of 3
(3,911 Views)