12-20-2013 03:22 PM
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!
Solved! Go to Solution.
12-20-2013 03:26 PM
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.
12-20-2013 03:30 PM
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?
12-20-2013 03:32 PM
@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... 😛
12-20-2013 04:47 PM - edited 12-20-2013 04:50 PM
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.
12-23-2013 06:37 AM
12-23-2013 12:26 PM
@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. 😄
12-23-2013 12:53 PM
Don't say I didn't warn you! But, you just had to go down the rabbit hole didn't you?