02-12-2022 10:53 AM
I recently inherited a large amount of LabVIEW code. All throughout the files I noticed that the previous developer had changed the default file extension for controls & typdefs from ctl to vi. Never mind trying to understand why they would have done this, ugh! I have considered hunting them down and changing them back but this is a large undertaking. I am concerned about this coming back to bite me down the road. So the question - is there any known negative repercussions to changing the file extensions of ctl file to vi?
Solved! Go to Solution.
02-12-2022 11:12 AM
It does not make sense to change the extension to VI in the first place, then if you changed to VI, I don't think LabVIEW will detect it as neither a VI nor a control, really, no clue why it was done and whether it works.
The right thing to do is, if it works, leave it as such.
02-12-2022 11:19 AM
LabVIEW itself is largely file ending agnostic. It originated on the Mac which had way more advanced techniques even more than 30 years ago, than tacking a three (or more) letter file ending on a file name to associate files with applications. So almost all the LabVIEW files use an internal binary file structure with a header that says very specifically to LabVIEW what the file really is. If you call it MyGreatest.vi, MyGreatest.bullshit or MyGreatest.idea, makes no difference to LabVIEW.
That all said, the world has since largely moved to associate files to certain applications by file ending. That may have also influenced some tools on the edge of the LabVIEW universe to somehow rely on file endings. But the core LabVIEW system really couldn't care about file endings less.
02-12-2022 11:23 AM - edited 02-12-2022 11:26 AM
@EduNI wrote:
I recently inherited a large amount of LabVIEW code. All throughout the files I noticed that the previous developer had changed the default file extension for controls & typdefs from ctl to vi. Never mind trying to understand why they would have done this, ugh! I have considered hunting them down and changing them back but this is a large undertaking. I am concerned about this coming back to bite me down the road. So the question - is there any known negative repercussions to changing the file extensions of ctl file to vi?
Those are NOT CONTROLS! they are Global.vis. Don't change the extensions!
Now, it is highly possible that the original developer abused those Globals (probability very near unity and, I don't even have to ask you to post a code example). Hunting down the usage (Use the hierarchy view) and refactoring the code should be high on your "To-Do" list.
Hunting down the original author can be very satisfying but, make sure you can escape legal action.
02-12-2022 12:13 PM
@JÞB wrote:
Those are NOT CONTROLS! they are Global.vis. Don't change the extensions!
How can you possibly come to that conclusion from the information given?
IMHO, the post was very specific about "controls & typdefs", i.e. not globals.)
02-12-2022 01:16 PM - edited 02-12-2022 01:24 PM
@altenbach wrote:
@JÞB wrote:
Those are NOT CONTROLS! they are Global.vis. Don't change the extensions!How can you possibly come to that conclusion from the information given?
IMHO, the post was very specific about "controls & typdefs", i.e. not globals.)
I did not. Wanna bet? Since both Global.vis and Controls can be independently filtered in the Hierarchy view, it will be simple to test irrespective of the file extension. 😀
02-12-2022 01:27 PM
@JÞB wrote:
, it will be simple to test irrespective of the file extension.
I cannot test, because I don't have the relevant code. Once we do, we can be sure. 😄
02-12-2022 01:44 PM
@altenbach wrote:
@JÞB wrote:
, it will be simple to test irrespective of the file extension.I cannot test, because I don't have the relevant code. Once we do, we can be sure. 😄
It speaks to my general philosophy about all of us silly humans. I simply asked myself; "How Braindamaged would a developer have to be to change all ctl file extensions?" And, "Could such a brain have the capacity to execute that change?"
The alternative was to reject that the extensions were intentionally changed and substitute that the OP was seeing something else in the project that was recently inherited.
Yea! OCCAM
02-12-2022 02:04 PM
The OP is registered here for almost 6 years, i.e. not a newbie, so I reject these assumptions. We might never find out though. 😄
02-12-2022 02:08 PM
@JÞB wrote:
@altenbach wrote:
@JÞB wrote:
, it will be simple to test irrespective of the file extension.I cannot test, because I don't have the relevant code. Once we do, we can be sure. 😄
"How Braindamaged would a developer have to be to change all ctl file extensions?"
The alternative was to reject that the extensions were intentionally changed and substitute that the OP was seeing something else in the project that was recently inherited.
Yea! OCCAM
How brain damaged? Certainly an interesting question! I have no clue why the original developer would have done this.
Seeing something else? I didn't imagine it. I discovered it by clicking on a .vi file and it opens up as a typedef.
You don't need code to test this. Just find any .ctl file in any existing project, use file explorer to change the extension to .vi, then open the project. Everything seems to behave and run without a hitch. See the answer by rolfk, it seems to explain why it works and that it should be ok going forward.