10-14-2019 08:33 AM
Hello guys,
I can't see the block diagram of a control file .ctl and I want to convert it to .vi.
Is it possible to convert it and how to do it?
/mctnnn
10-14-2019 08:35 AM
@mctnnn wrote:
Hello guys,
I can't see the block diagram of a control file .ctl and I want to convert it to .vi.
Is it possible to convert it and how to do it?
/mctnnn
A Control (*.ctl) has no block diagram. They can be used on a vi's front panel by placing them there.
10-14-2019 08:36 AM
Hi mctn³,
a CTL file contains the definition of a (most often customized) control - so there is no code and thus no block diagram.
No, you cannot convert a CTL file into a VI.
But: you can place the control in a VI and then save the VI: the control will be saved within the VI…
10-14-2019 08:55 AM
Hi GerdW, thank you for your answer.
I found a custom control file .ctl from a old signal generator HP3245,
and I want to use its code for another waveform generator with almost the sam configuration,
the problem is that I don't know exactly how to write such code yet.
As I've known this .ctl was written as a .vi before it's converted to type def with extension .ctl,
so it has a block diagram before.
/mctnnn
10-14-2019 08:56 AM
Hi Jay Thornby, thank you for your answer.
I found a custom control file .ctl from a old signal generator HP3245,
and I want to use its code for another waveform generator with almost the sam configuration,
the problem is that I don't know exactly how to write such code yet.
As I've known this .ctl was written as a .vi before it's converted to type def with extension .ctl,
so it has a block diagram before.
/mctnnn
10-14-2019 09:03 AM
Hello Mctnn,
A tip about the forums. There is no need to write two identical messages addressed to two different people. The messages form a continuous chain so that your first reply is seen by everyone, not just Gerd who you addressed. So Jay saw it as well. You could have easily said HI Gerd and Jay, ..... and both would have seen it and know you were giving both of them, and everyone else who reads the thread the same information.
A .ctl was not written as a .vi. There may have been an older VI that also used this control in it. But you can't turn a .vi into a .ctl. So if you think there is an older VI that includes code, you need to go track that down. .ctl and .vi are two separate file types.
10-14-2019 09:12 AM
Thank you RavensFan for the tip.
About the .ctl:
I have seen an example in a book that people write a .vi and make it as type def and save it as .ctl
to hide the block diagram.
But it 's obviously that .ctl could not be converte back to .vi.
/mctnnn
10-14-2019 09:14 AM
Congratulations! You've found a Type Definition (a.k.a. a TypeDef) for a Cluster of Three Elements: Channel A (a Cluster itself, probably also a TypeDef with Function, Output Range (V), and other elements), Channel B (a second instance of the same Cluster), and Ch. B divider (what appears to be an I32). The virtue of defining complex structures (especially Clusters and Enums) is that you can use the TypeDef as a type of "constant" when you need an instance of the element (as when you "bundle by name" a Cluster or you want to have a Case Statement take on a pre-defined range of values, say "Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet" (much simpler to have an Enum called "Color" with those exact values and not have to worry about the numeric encoding/representation).
Bob Schor
10-14-2019 09:26 AM
@mctnnn wrote:
Thank you RavensFan for the tip.
About the .ctl:
I have seen an example in a book that people write a .vi and make it as type def and save it as .ctl
to hide the block diagram.
But it 's obviously that .ctl could not be converte back to .vi.
/mctnnn
They don't write a .vi and make it as a typedef and save it as a .ctl. They write a .vi. Add a control to it. Perhaps customize it or give a it defined set of values like an enum. Or perhaps a cluster of set of defined other controls, then save that specific control as a type def. The .vi is still its own file, but will have a reference to the .ctl file which "defines" that specific entity. There is no hiding of a block diagram because a control does not have a block diagram. It does not have any executable code associated with it. There is no converting back to a .vi because a .ctl was never a .vi.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
Learn LabVIEW
10-14-2019 09:28 AM
Thank you Bob_Schor,
I problebly need to read more about the TypeDef, cluster and such tuff like that.
/mctnnn