LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Alternate "Type Definition" in Case structure definition type

Hello,

 

 

Moving from the home PC to the "at work" one and then opening a VI that I worked at home I've been mistaken with assigning correct .ctl file to "case structure" type.

Is it possible to repaire this error without redefining manually "case structure" type (e.g. reload in some way the correct .ctl)

 

Thanks in advance.

 

Pavel

0 Kudos
Message 1 of 8
(4,114 Views)

Hi Pavel,

 

what is a "case structure" type?

 

When the ctl-file for a typedefined control/constant is missing you can disconnect the control/constant from the typedef to "repair" your VI. After disconnection you can create a new typedefinition from the control/constant…

 

Moving from the home PC to the "at work" one

You should rethink your "move" process!

The general suggestion is to use a SVN tool (subversion, GIT) to synchronize sources between several computers.

The LabVIEW specific suggestion is to use a proper project file and folder. When "moving" to a different computer you should create a build spec to export the whole project as ZIP file…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(4,099 Views)

Hi GerdW,

 

Thanks for suggestions. Sure, I'll follow them.

The issue is a little bit more complicated than I descibed above - I forgot the correct .ctl file at home.

So, I edited the old version that I have on my work PC and upon opening the VI and LabView avertissement that correct .ctl isn't find, I provided the new .ctl.

 

Anyway is it possible to "reassign" a new .ctl to enum type if I discover one day that states (their number and theirs names) in state machine need to be modified.

 

Best Regards

 

Pavel.

0 Kudos
Message 3 of 8
(4,092 Views)

Hi Pavel,

 

is it possible to "reassign" a new .ctl to enum type if I discover one day that states (their number and theirs names) in state machine need to be modified.

In this case you simply edit the typedefiniton of the ENUM: it's the main purpose of the typedefinition to have one instance you need to edit to apply the changes to all instances in your code!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(4,080 Views)

@Pavel_47 wrote:

Hi GerdW,

 

Anyway is it possible to "reassign" a new .ctl to enum type if I discover one day that states (their number and theirs names) in state machine need to be modified.

 


 

Replace or update the .ctl file. LV looks for a .ctl of a certain name, it'll use what it finds with that name, right or wrong.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 8
(4,071 Views)

GerdW a écrit :

Hi Pavel,

 

is it possible to "reassign" a new .ctl to enum type if I discover one day that states (their number and theirs names) in state machine need to be modified.

In this case you simply edit the typedefiniton of the ENUM: it's the main purpose of the typedefinition to have one instance you need to edit to apply the changes to all instances in your code!

 

 

In a case when I have another .ctl (e.g. used in another project) that I want to integrate into VI, the simplest way to do it is to rename this .ctl. Correct ?

 

0 Kudos
Message 6 of 8
(4,058 Views)

First, I really hope you are using LabVIEW Project to manage all of your VIs and Controls/Typedefs.  If you have a reference to a Typedef called "Type1.ctl" in your code, and you move the code (without the Typedef) to another computer that lacks this Typedef, your code will "break", obviously.  Suppose the other computer has a Typedef called "Type2.ctl".  If you want to use this on the second computer, you have two choices -- you can rename the Control to "Type1.ctl" and make sure you code can find it (having it in the Project file makes this simple), or you can find all of the calls in your code to "Type1" and change them to "Type2".

 

Depending on your particular circumstance, there might be good arguments for either scenario.  The bottom line is that LabVIEW will look for Controls and VIs based on the name of the file, but once it finds it and makes the "logical" connection, it better find "what it needs" there.  [I hope you understand what I'm trying to say -- just because you've renamed a Control or a VI to have the same name as a VI on another machine doesn't mean the internals of the Control or VI are the same, and thus will "work"].

 

Bob Schor

0 Kudos
Message 7 of 8
(4,037 Views)

@Pavel_47 wrote:

Hello,

 

 

Moving from the home PC to the "at work" one and then opening a VI that I worked at home I've been mistaken with assigning correct .ctl file to "case structure" type.

Is it possible to repaire this error without redefining manually "case structure" type (e.g. reload in some way the correct .ctl)

 

Thanks in advance.

 

Pavel


Pavel- You sure do get into a lot of trouble!  Take the advice about a proper SCC system seriously.

 

Now, How to "Fix it" the easy way

 

With the Main VI open selecu menu View>>VI Hierarchy Make sure you show controlls- the help file explains what ribon bar glyps do what- 

Then Ctrl+F will open the "Find dialog"  Search the application instance of your project for "Bad Control.ctl" and hit "Find" in the search results window you can replace each or all instances of "Bad Control.ctl" with "Control I Forgot To Bring Home.ctl"

Save All - write your self a note to not do that again.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(4,026 Views)