LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform Chart as a Typedef Control won't accept multiple data plots

Developing an application that uses three waveform charts to plot 5 plots of data. When the chart is saved as a custom control, I can simply bundle my 5 data together and wire to the control.
But when saved as a Type Def control, it won't accept the bundled data. Preferred to use a Typedef since the 3 charts are identical in format, thus if I need to change it the future I only have to edit the control once.
 
What do I need to to to allow the Typedef control to accept 5 plots of data?
 
Thanks
 
AK2DM
 
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 1 of 6
(3,386 Views)
Hi AK2DM,

When you bundle the plots together you're changing the data type from a scalar double (for example) to a cluster. As the type def links the data type of each occurance of the control/indicator then you can only connect/display the same data type as the type def.

If you connect a cluster with your 5 plots to the chart first and then turn it into a type def that should do it.
Sarah

Applications Engineer | National Instruments | UK & Ireland
Message 2 of 6
(3,367 Views)

Sarah

It worked. Seems like a 'backwards' approach to do it in my mind, but now I know.

Thanks

Pete

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 3 of 6
(3,355 Views)
Hi Pete,

I see what you mean, I wouldn't say it was backwards exactly. When you save a control as a type definition, you're defining what the data type of that control is. Since the cluster datatype is defined by the elements in the cluster, then to use the type def, you have connect the correct data type to it.

It's unfortunate you can't change the datatype of the chart in the custom control, is that what you were planning on doing?

I'm guessing you want to create a type def of a chart with 5 plots then be able to add plots to the type def which would save you having to update each instance of the chart, is that correct?
Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 4 of 6
(3,337 Views)
Hi Pete,

Have you considered building an 2D array instead of a cluster to plot your data? Then the data type of the chart would stay the same and you would be able to add plots to it when you need to.
Sarah

Applications Engineer | National Instruments | UK & Ireland
Message 5 of 6
(3,332 Views)

Hi Sarah:

You are correct that I am using a typedef so if and when I need to change the control, it will get updated automatically thoughout the code. Very convenient, I have many other typedef custom controls within the program and they have saved a lot of time (frequent changes during development).

Shying away from arrays to store my data, point by point functions rule!happy smiley

Thanks again

-Pete

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 6 of 6
(3,320 Views)