gogoWebsite

LabVIEW Basics - Common Data Transfer in LV

Updated to 3 hours ago

Data delivery method

  • 1. Local variables
  • 2. Global variables
  • 3. Functional global variables
  • 4. Quotation
  • V. Attribute nodes
  • 6. Queue
  • 7. Notifier

1. Local variables

Data for local variables are stored in controls, each variable corresponds to a specific control. A control can have multiple local variables, and each local variable has to copy the data in the corresponding control, so it consumes more memory. In addition, for those with large amounts of data, it is difficult to judge the direction of the data flow, and there is a problem of "competition". It is not recommended to use local variables to pass values ​​to large arrays.

2. Global variables

When reading data from a global variable, a copy of the data is created and saved in that global variable. What operates on large arrays and strings is that it takes a lot of time and memory to manipulate global variables. In addition, when operating an array, LabVIEW still saves and modifys the entire array even if only a certain element in the array is modified. If a global variable is read at the same time at different locations, multiple memory buffers are created, resulting in reduced execution efficiency and performance. It is not recommended to use global variables when manipulating arrays. But local variables and global variables are really convenient.

3. Functional global variables

Functional global variables save data in uninitialized shift registers, saved or accessed in data blocks, and can transmit data without a large amount of memory.

4. Quotation

A reference handle is a pointer to a pointer, and its contents are saved as addresses pointing to a specific data type. The reference handle itself does not represent any space. Only after pointing to a specific instance through the reference handle can specific controls be operated. Control property parameters can be changed by operating on the reference handle.
Probably, the quote is to throw an address for you, but the subsequent operations are all carried out where this address points. Different loops and VIs can use the same reference to change the value and complete the passing of the value. High performance.

V. Attribute nodes

The attribute node focuses more on the characteristics of the control in the front panel, such as the control color, size, cursor and other information about the control itself. The attribute node can implement the operation of interface functions in the program, including the value of the operation control.
When obtaining values ​​through attribute nodes, the values ​​will be requested from the controls in the front panel, which is less efficient than local variables. It is not recommended to use attribute nodes to make values.

6. Queue

The queue is a first-in, first-out, which can pause the execution of the reader's loop, cache data, and pass a one-to-one thing for each data between Vi. It can store a large amount of data, but it takes up little memory. When accessing data, the queue must be disassembled, and other parts of the program cannot access this data synchronously. There are several queues for this data in several places.

7. Notifier

The notifier can pause the reader's loop execution, cannot cache data, will lose packets, and can be read by multiple loops to pass data.