![]() ![]() This behavior results in a slightly longer execution time for the first use of each shared variable compared with subsequent uses. Note: In legacy versions of LabVIEW (versions prior to 8.6), LabVIEW creates a real-time FIFO the first time a Shared Variable node attempts to write to or read from a shared variable. LabVIEW creates a real-time FIFO when the VI is reserved for execution (when the top-level VI in the application starts running in most cases), so no special consideration of the first execution of the Shared Variable node is needed. You can avoid using the low-level real-time FIFO VIs by enabling the real-time FIFO on a single-process shared variable. ![]() NI recommends using real-time FIFOs to transfer data between a time-critical and a lower-priority loop. When you install the LabVIEW Real-Time Module, you can configure a shared variable to use real-time FIFOs by enabling the real-time FIFO feature from the Shared Variable Properties dialog box. In order to maintain determinism, a real-time application requires the use of a nonblocking, deterministic mechanism to transfer data from deterministic sections of the code, such as higher-priority timed loops and time-critical priority VIs, to nondeterministic sections of the code. Single-Process Shared Variables and LabVIEW Real-Time The main advantage of single-process shared variables over traditional global variables is the ability to convert a single-process shared variable into a network-published shared variable that any node on a network can access. The underlying implementation of the single-process shared variable is similar to that of the LabVIEW global variable. Use single-process variables to transfer data between two different locations on the same VI that cannot be connected by wires, such as parallel loops on the same VI, or two different VIs within the same application instance. ![]() When you save the variable library, these changes are also applied to the variable definition stored on disk. The LabVIEW project propagates the new settings to all shared variable references in memory. You can right-click a shared variable in the Project Explorer window and edit the shared variable properties at any time. Right-click a node and select Reference Mode»Target Relative or Reference Mode✺bsolute to change how the Shared Variable node connects to the shared variable. Shared Variable nodes are absolute by default. Use target-relative Shared Variable nodes when you expect to move VIs and variables to other targets. If you move a VI that contains a target-relative Shared Variable node to a new target, you also must move the shared variable to the new target. A target-relative Shared Variable node connects to the shared variable on the target on which you run the VI that contains the node. An absolute Shared Variable node connects to the shared variable on the target on which you created the variable. You can set a Shared Variable node as absolute or target-relative depending on how you want the node to connect to the variable. Reading and Writing to a Shared Variable Using a Shared Variable Node Although in this example both the LabVIEW Real-Time Module and the LabVIEW DSC Module are installed, you can use the features the LabVIEW DSC Module adds only for network-published shared variables.įigure 3. The LabVIEW Real-Time Module and the LabVIEW Datalogging and Supervisory Control (DSC) Module provide additional features and configurable properties to shared variables. Refer to the Shared Variable Lifetime section for more information about variables and libraries.įigure 1 shows the Shared Variable Properties dialog box for a single-process shared variable. If you right-click a target or a folder that is not inside a project library and select New»Variable from the shortcut menu to create a shared variable, LabVIEW creates a new project library and places the shared variable inside. Select among the shared variable configuration options and click the OK button. From the project explorer, right-click a target, a project library, or a folder within a project library and select New»Variable from the shortcut menu to display the Shared Variable Properties dialog box. ![]() To create a shared variable, you must have a LabVIEW project open. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |