Link DCAF items to a LabVIEW user interface.
Writes latest value to, and reads latest value from, a linked LabVIEW front panel running on the same target as the engine in which the module resides.
Configuration of the UI Reference Module
Steps before Configuration
Browse for the UI to Load, and select the user interface VI you wish to link to DCAF.
Click the Configure from UI button. Select if you wish to generate tags based on the front panel items. If you select Yes, tags will be made for all input and output items found on the front panel. If you select no, the table will still be populated with all input and output items found, but you will need to manually map those items to tags.
If you wish to remove items from the table (for example, if there is a control you do not wish to expose to DCAF), select that line of the table and click the - button.
If you wish to add items to the table (for example, you just added a new control to the UI but you don't want to remap the whole UI), click the + button. There must be an item with that label and data type present on the UI at run-time or you will get an error.
If you wish to modify an existing table item, press the gear button to configure that item, including the tag it is mapped to.
Source Code Design
This module uses the most highly optimized method of reading/writing front panel items available, the Get/Set Control Values by Index functions. These are much higher performance than using the VI Server Value or Value (Signalling) property nodes, since they do not need to perform any lookups into the front panel data space.
All items of a particular data type are read/written as a bulk operation. For highest performance, use the minimum number of data types on the same panel (the overhead of 3 I32 writes is less than 1 I32 write, 1 U32 write, and one I16 write, for example).
The module resolves, during the init stage of run-time, the various named controls and indicators in the configuration to the specific control indices needed by the access functions. The input runtime method then grabs the latest values of controls to read, and the output runtime method updates the values to write.
To show the user interface at run-time, include the user interface VI at the top level of the DCAF application and make sure that the Show Front Panel When Called option is enabled. This can be enabled either on the individual subVI call (right-click the subVI, select SubVI Node Setup... and enable the Show Front Panel When Called option) or for all calls to that subVI (go to VI Properties>>Window Appearance>>Customize and enable the Show Front Panel When Called option).
Install the UI Reference module directly from VI Package Manager.
Please report any issues with this module on our Github repository.
You may also post here with questions.
Visit Collaborating on the Development of DCAF to learn how to contribute your own improvements to this module directly.
It can still work, but you might see issues depending on what the VI is doing. If you have the VI writing to its own indicators and also set the UI module to write values to those indicators, you will have a contention issue.
if there is code on the UI block diagram, like a while loop, this will not work correct?
It works, I have a main UI with producer consumer loop, tab planes etc with the target controls on them.
I am also reading data from multiple sources and have pop up windows to display panels for each of those sources for debugging etc.
So it works fine. What I did was prefix all controls labels that are not updated by DCAF with NT_ (No Tag). This means when you import the panel into DCAF you can easily delete the ones you don't need from the list.
Also make sure all control labels are unique on the panel.
Thank you Nick and Matt I've got my UI working with the UI ref module, with a while loop in it and all. Not sure why I thought there was a limitation to do with VIs that run indefinitely