LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

globa; variables vs pipe lines

what is better :
using global variables or pipelines that goes into subvi's ?
i'm talking about arrays and some string variables

-jcz-
0 Kudos
Message 1 of 3
(2,549 Views)
i think you should describe your problem in more detail.
the choice totally depends on the condition.
here are few cosnsiderations

1. while using Qs we can insert data at many locations but data cant be read at multiple locations. Notifier can be used if u want data to be available at multiple locations.
2. we can destroy the Qs programmatically to release resources. but Global variables hold resources thoroughout application
3.as per my experience Qs are slower than Global variable.(i am not very sure, but most probably this must be the case)
4. most of the times its better to transfer data through wires, so if you are thinking global variable or Qs as a means of data transfer between VIs without terminals, or wires i think you should think again

Tushar Jambhekar
tushar@jambhekar.com

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

0 Kudos
Message 2 of 3
(2,549 Views)
hi

in most cases i use a FGV ("functional global variable", i.e. a vi which contains an uninitialized shift register in a while loop which runs only once. the data then can be stored throug several calls of the vi inside the shift register) to transport data. you then don't need any lines at all (makes your code quite neat and clean) to bring the data to every location you want, and you don't have any troubles whith synchronisation. global variables are NOT synchronized, therefore i avoid to use them. in most cases Qs, notifiers and so on are much too sophisticated (ok, depends on what you want to do...). and, by the way, FGVs are the most efficient way to transport large amounts of data or data with a complicated structure.

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 3 of 3
(2,549 Views)