Table Of Contents

Adding Custom Device Pages

Last Modified: June 10, 2021

Add pages to a custom device by creating the extra page VIs and GUIDs, adding the extra pages to the custom device build specifications, and defining the pages in the Custom Device XML file.

Before you begin, you should understand custom device pages.
  1. Create a page VI with the required reference using the template VI included in the Custom Device API library.
    1. Open the LabVIEW project for your custom device.
    2. In Project Explorer, browse to My Computer»Custom Device API.lvlib»Templates»Subpanel Page VI»Page Template.vit.
    3. Right-click Page Template.vit and select New from Template.
    4. From the front panel of the new VI, save the VI in the folder containing the other VIs for your custom device, such as RT Driver VI and Main Page VI.
    5. Close the VI.
    6. In Project Explorer, drag the new VI to the Custom Device library.
  2. Declare the page in the XML file of the custom device.
    1. Open the LabVIEW project for your custom device.
    2. In Project Explorer, browse to My Computer»Custom Device <Name>.xml and open the XML file of your custom device.
    3. Under the Pages section of the XML file, locate the Page section for the main page of your custom device. The declarations for the main page should be the first listed under the Pages section. The name of the main page corresponds to the name of the custom device.
    4. Copy the information between the Page tags, including the <Page> and </Page> declarations, and paste it between the <Pages> and </Pages> declarations.
    5. Replace the information between the <eng> and <loc> decelerations with the name of the new page. For example, if you saved your page VI as ExtraPage.vi, enter ExtraPage.
    6. Replace the information between the Path tags with the file path to the new page.
      spd-note-note
      Note  

      You should only need to replace the last token in the path, <Name> Main Page.vi, with your page VI.

    7. Change the GUID between the <GUID> tags.
      spd-note-note
      Note  

      To reduce the risk of error when working with GUID string constants, consider using a LabVIEW global variable that is read only or creating a combo box control and saving it as a type definition.

    8. Save and close the XML file.
    spd-note-note
    Note  

    Every item with a unique page VI must have a page entry in the Custom Device XML file and a unique GUID. However, items with different GUIDs can reference the same page VI. If you want to create several configuration pages that are only slightly different, you can use the same page VI for each item by configuring the VI to check the associated item GUID at run time. For example, you can add a Case structure to the page VI with a case for each GUID.

  3. Add the page to the build specifications.
    1. Open the LabVIEW project for your custom device.
    2. In Project Explorer, expand Build Specifications, and double-click Configuration.
    3. In the Category menu, select Source Files.
    4. In Project Files, expand <Name> Custom Device.lvlib.
    5. Select the new page VI, and click Add Item. The VI is added to the Always Included section.
    6. In the Category menu, select Source Files Settings.
    7. In Project Files, expand the <Name> Custom Device.lvlib.
    8. Select the new page VI, and from the Destination drop down box, select <Name> Configuration LLB.
    9. Click OK to close the build specification.
    10. Save the LabVIEW project.
  4. Restart VeriStand.
If your new page is not created properly, you will receive a custom device page error when adding your custom device to the system definition:

Recently Viewed Topics