LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do global variables have a .vi extension?

Solved!
Go to solution

Hi,

 

While cleaning up some code the other day, it occured to me that although Virtual Instruments and Global Variables are distinct entities with separate roles in the LabVIEW environment, they share the same file extension .vi. It seems much more logical to assign a unique extension like we already do for controls, menus, classes, etc.

 

Can anyone explain why it's done this way?

 

Thanks!

0 Kudos
Message 1 of 8
(3,751 Views)
Solution
Accepted by topic author garrettmarsh

It's just historical (they've been around since LabVIEW 3). A Global is a VI file type, it's just that the LabVIEW editor prevents you from seeing its diagram. If we had it to do over again, I think we would not only have implemented them differently (i.e., something other than a VI front panel to define global data), but we would probably have given them a unique file type as well.

0 Kudos
Message 2 of 8
(3,742 Views)

Thanks, very interesting. I didn't know there was a 'hidden' block diagram. Does LabVIEW place any code there? I'd assume if we could see the diagram, it would only contain the control terminals?

0 Kudos
Message 3 of 8
(3,734 Views)

@garrettmarsh wrote:

 

Does LabVIEW place any code there? I'd assume if we could see the diagram, it would only contain the control terminals?


Nope, no code there. And I haven't played with it in a while, but I don't even think there are control terminals there either. It's kinda weird... 😛

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

No terminals on a global's BD.  Just a blank slate.  You CAN put stuff there but if there is any reference to a FP object LabVIEW will blow up on you so there is no real easy way to pass data in or out. (I once thought of embeding a counter into a global-  It was not pretty)

 

Regardless, no matter what you COULD do, there must be another legitamate way to do the same thing.  Its basically "Trickery or witchery."  Do that kind of thing at your own risk! (Don't try this at home- We are professionals)  Since you shouldn't be there, there are fewer protections.  BAD things CAN and likely WILL happen.  Think of it like triing to drive a car on two wheels.   Its possible but, perhaps you want to try it with a really cheap car and know someone good with body repair.


"Should be" isn't "Is" -Jay
Message 5 of 8
(3,712 Views)

Rats!

 

globalbd.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 8
(3,645 Views)

@JÞB wrote:

[...] LabVIEW will blow up on you so there is no real easy way to pass data in or out [...]


You aren't kidding.  Also, Quick Drop doesn't work in there.  😄

 

crash.png

 

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 8
(3,612 Views)

Don't say I didn't warn you!  But, you just had to go down the rabbit hole didn't you?


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