LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert .ctl to .vi

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

0 Kudos
Message 1 of 11
(3,101 Views)

@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. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 11
(3,093 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 11
(3,092 Views)

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

HP3245 Configuration.png

0 Kudos
Message 4 of 11
(3,081 Views)

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

 

HP3245 Configuration.png

0 Kudos
Message 5 of 11
(3,078 Views)

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.

0 Kudos
Message 6 of 11
(3,072 Views)

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

 

0 Kudos
Message 7 of 11
(3,065 Views)

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 

0 Kudos
Message 8 of 11
(3,063 Views)

@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

0 Kudos
Message 9 of 11
(3,056 Views)

Thank you Bob_Schor,

I problebly need to read more about the TypeDef, cluster and such tuff like that.

/mctnnn

0 Kudos
Message 10 of 11
(3,054 Views)