02-10-2014 03:24 AM
Hello,
I have a GUI which needs to be replicated 10 times. the variables in the global file also needs to be replicated ten times. ex: if GUI1 is using global variables GUI1_TestMode, GUI1_Result etc, GUI2 should use GUI2_TestMode, GUI2_Result and GUI3 should use GUI31_TestMode, GUI3_Result etc. So, once I have saved GUI1 as GUI2, I need a way to select all GUI1_TestMode in GUI2 and replace it with with GUI2_TestMode.
I tried find and replace in the edit menu, but it finds all the global variables together.
there are about 40 such global variables associated with each GUI and I dont think it will be sane to sit down, rename all of them in the global file, click on each variable and change them. I really hope I dont have to do that.
I am using Labview 8.6
Thanks.
02-10-2014 03:54 AM - edited 02-10-2014 03:59 AM
Hi pcs,
instead of using 40 globals per GUI with upto 10 different GUIs you really should redesign your program.
I would suggest a FGV/AE handling those global data for all of those GUIs…
The quick & dirty way would be to use LabVIEW's VI linking scheme:
- Create your global VI with all needed variables. Create your "GUI" and connect it with that global VI.
- Now you copy your GUI to create a new one, this will still be linked to your "global VI".
- Then copy the global VI to create a new instance with a different name ("global2.vi") and ZIP (and remove) the original one.
- When you now open the global2.vi it will search for your orginal "global.vi". Then you simply direct it to use "global2.vi" instead…
- Repeat those steps for all other GUI-VIs…
As said before: QUICK & DIRTY!
02-10-2014 08:27 AM
Change the global to a cluster and place it in an array, then you'll have an array of settings/info that's easily handled.
/Y
02-10-2014 08:30 AM
02-11-2014 08:56 AM
what is FGV/AE ?
I have to actually sit and rename them since they are signals to a PLC and needs to be read back and processed, so I am doing it anyway.
Thanks!!
02-11-2014 10:19 AM
@pcs82 wrote:
what is FGV/AE ?
Functional Globals Variable and Action Engine (I highly recommend following that link and giving the nugget a good read).
02-11-2014 12:29 PM
@GerdW wrote:
Hi Yamaeda,
yes, easily handled - and a lot of race conditions as soon as several of those "GUIs" try to read and write their data at the same time…
If capsuled in an AE incl. a Update function which does the reading and writing internally it should help some, but you can always create races. 🙂
/Y