LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to auto create a global variable with specific variable name in a global vi ?

how to auto create a global variable with specific variable name in a global vi using lv ? Because i need to add a lot of global variable in this global vi. But you know, if  i manually add them , it will be a much time-costing work. So i want to use someway to auto generate ? Can i ?? Thanks a lot !
0 Kudos
Message 1 of 8
(3,626 Views)
You can't auto-create a global, or any other variable for that matter. What you need to do is to create a global or other variable that fits the data you are trying to manipulate. If you have a lot of data of the same type, for example, it is probably a good idea to make the global an array of your datatype.
If you want to have named variables, just tag the name to the variable and use it to find the index of an element in the global array.
 
0 Kudos
Message 2 of 8
(3,620 Views)

Hi

what aartjan is saying is the way for you. but you can develop an utility which will actually help you create global variables. To get the details on this just have a look at VI Scripting section on LAVA forum.

But i would like you to suggest few things

1. If your programs have so many global variables (Thats why u want utility) then you should take out some time to read about LabVIEW design patterns. I think if programmer follows these practicess he dont need a single global variable.

2. Their are some other ways to achieve similar functionality as of global variables (Uninitialized Shift Registers, Single Element Qs and so on) but they are much faster than global variables.

I am Attaching Whatever Resources i am having I will also attach the template of the design pattern i generaly use in short duration

Message Edited by Tushar Jambhekar on 10-06-2005 07:33 PM

Message Edited by Tushar Jambhekar on 10-06-2005 07:36 PM

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

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

Hi Please Find The attached template. Copy this to tempates folder in LabVIEW 7.1 dir. and you can create the VIs based on this template by using new... option

 

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 4 of 8
(3,599 Views)
Wow, I think you are throwing quite some power programming stuff at this guy! Having said that, you shared some very interesting code.
0 Kudos
Message 5 of 8
(3,592 Views)

Hi

Thanks for the compliment. i hope this will start a new discussion and each one of us will be get some benifit Smiley Tonguepe

I hope there is scope for improvement the template i have made and i would definetaley like to get comments on that

 

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 6 of 8
(3,576 Views)
Interesting template. I suggest you start a fresh thread if you want to get input from others about this framework.
0 Kudos
Message 7 of 8
(3,567 Views)

Hi

As per your suggestion i have created new thread "Can You Contribute your views on LabVIEW Design Patterns"

I hope i will get some good suggestions from you as well

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

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