LabVIEW Example Projects
LabVIEW example projects are included in the XJTAG installation which demonstrate how to use the XJIntegration DLL through LabVIEW.
These projects contain top level executable VIs which demonstrate the range of functionality in the integration, alongside many SubVIs which are used to perform common operations such as initialising an XJLink or opening a project. By reusing these SubVIs, you can quickly integrate XJRunner or XJAnalyser into your own LabVIEW project - just right-click on the block diagram, choose Select a VI... and browse to the location of the XJTAG VI. The XJTAG VI library will then automatically be added to your project as a dependency.
XJAnalyser Integration Examples
The XJAnalyser Integration example project is installed in the XJTAG Shared Files folder under XJIntegration .NET Examples\XJAnalyser\LabVIEW. This project contains 3 top level VIs demonstrating how to interact with the JTAG chain through the XJIntegration DLL:
- XJTAG Read Pin
- This VI demonstrates how to read the value on a pin on the JTAG chain. It first loads the XJTAG demoboard project, then continuously polls the state of a pin connected to the push button on the demoboard, activating an indicator on the front panel when the push button is pressed.
- XJTAG Write Pins
- This VI demonstrates how to write values directly to pins on the JTAG chain. It loads the XJTAG demoboard project, then sets output values directly on pins in the JTAG chain connected to each of the LEDs on the demoboard. These outputs can be updated instantly whilst the chain is running using switches on the front panel.
- XJTAG Handle Conflicts
- This VI demonstrates how to handle conflicts which may occur on pins in the JTAG chain. It loads the XJTAG demoboard project and starts the chain running before giving the user the option of triggering a conflict on one of the pins in the chain. A callback VI is used to handle the event which is fired when a conflict occurs, and this asks the user how the conflict should be resolved.
XJRunner Integration Examples
The XJRunner Integration example project is installed in the XJTAG Shared Files folder under XJIntegration .NET Examples\XJRunner\LabVIEW. This project contains seven top level VIs demonstrating different areas of functionality:
- XJTAG Multiple Test Runs
- Loads a project from an XJPack file. Contains a tree control for selecting and deselecting XJEase test functions to run. Runs selected tests, writing the test output to an XJTAG Output Box.
- XJTAG Single Test Run
- Loads a project from an XJPack file. Creates a Runner instance and runs the default test list, and then closes the system down. The test output is written to an XJTAG Output Box and there is also an indicator which displays the pass/fail result for the test run.
- XJTAG UserInteraction
- Demonstrates running a single XJEase test that requires user interaction - in this case the Push Button Test. Has a button on the VI which provides input to the test. The pass/fail result of the test is displayed by a boolean indicator.
- XJTAG LED UserInteraction
- Demonstrates how to use XJEase functions to dynamically interact with the board and the user at runtime through LabVIEW. The VI calls XJEase functions which switch the LEDs on and off, and waits for user input to determine whether the LEDs are flashing. The rate at which the LEDs flash can be configured using a slider on the front panel.
- XJTAG Last Test Run Output
- This VI demonstrates how to programatically get the text output from a test run. It loads a project from an XJPack file and runs the tests which are specified by an array on the front panel. The plain text test output is then retrieved from the Runner object using the OutputFromLastTestRun property, and is displayed in a textbox on the front panel.
- XJTAG Get Results From Last Test Run
- This example demonstrates how to use the Test Results node on the Run.vi to retrieve details about individual tests from the last test run, including the test result, the time taken to perform the test and any text output generated.
- XJTAG Using Events
- This example demonstrates how to use the .NET events on the Runner object to monitor the testing progress. Individual event-callback VIs are registered to each event on the Runner object; These handle updating the UI as each event occurs. Any XJEase message and input boxes are also handled, without using the XjtagOutputBox, through their respective .NET events. Using events allows for a more asynchronous application design, making it possible to provide constant feedback on testing progression, process test results and output as it occurs, and stop testing early from the UI.
Common XJIntegration Examples
The Common XJIntegration example project is installed in the XJTAG Shared Files folder under XJIntegration .NET Examples\Common\LabVIEW. This project contains a single top level executable VI, XJTAG XJLink Test, as well as SubVIs which are common between the XJRunner and XJAnalyser Integration projects.
XJTAG XJLink Test.vi runs tests on an XJLink2 to verify that the unit is functioning correctly. This is the same functionality available in XJLink Manager. The test output is written to an XJTAG Output Box.
Many of the SubVIs in this project are particularly helpful for integrating XJTAG into your own LabVIEW project. For example, InitialiseXJLink.vi can be used to return a .NET refnum representing an available XJLink, and CloseXJTAG.vi is a good way of ensuring you have fully released all resources used by XJIntegration.
There are more detailed explanations of the functionality of VIs from each of these projects in the individual VI documentation within LabVIEW.
N.B. The XJTAG example VIs must be opened through the project which they are contained in. The LabVIEW project file contains information on loading the XJIntegration assembly which means that running straight from the .vi file can cause errors. The VIs can be referenced from other projects, and XJIntegration.dll will be added to the Dependencies section in the Project Explorer, but VIs which reference the XJTAG VIs should only be opened through the corresponding .lvproj project file.
XJTAG v4.1.100