Examples of XJIntegration Use
C#, Python, LabVIEW, TestStand, LabWindows/CVI and ATEasy examples are provided that contain all the structures users will need. The LabVIEW examples have been created in a highly modular fashion, and users are encouraged to import these and use them directly in their code. The examples for C# and other languages are heavily commented and demonstrate how to use the different classes: they can be copied and edited as required.
The examples will be found in folders beneath the XJIntegration .NET Examples directory (\XJIntegration .NET Examples).
Inside this examples directory is a sub-directory for the XJDemo v4 board.
- A shortcut to the directory that holds the examples will have been placed in the Start menu’s XJTAG folder during installation
- Additional examples are occasionally added during software updates; they will be found in the XJIntegration .NET Examples directory alongside those mentioned in this section.
- Remember that the examples have been created for 32-bit test executives. If used with 64-bit versions, the path to xjintegration.dll will need to be changed as described in Locating Files and Using 64-Bit Test Executives above.
LabVIEW Examples
- The example VI files must be opened from the XJRunnerIntegration.lvproj project file or XJAnalyserIntegration.lvproj project as appropriate – opening them directly can cause errors because the project file contains necessary information on loading the XJIntegration assembly.
- The VIs installed by XJTAG have interdependencies, and so should not be copied singly into your own LabVIEW project - the file structure between them needs to be preserved.
- If you copy the installed VIs into your own project and away from their original location, even minor updates to the installed version of XJTAG may break your project and require you to set up the VI references again.
Seven complete LabVIEW examples demonstrating how to use XJRunner Integration are available in the XJRunner\LabVIEW sub-directory:
- XJTAG Single Test Run
- Shows how to open a project, create a Runner instance and run the default test list, and then close the system down.
- XJTAG Multiple Test Runs
- Shows how to perform multiple test runs, for example to repeat tests of multiple boards. This is a more complex example than the XJTAG Single Test Run, providing test selection through the UI, and the ability to stop a test run part way, due to all tests being run asynchronously. Test output is displayed together with hyperlinks. This is typical of a normal production line scenario.
- XJTAG LED User Interaction
- Demonstrates how to use the RunFunction() method by giving an example that uses the XJEase functions LEDsOn() and LEDsOff() to flash the LEDs on the XJDemo board; user input is accepted to verify whether the LEDs are flashing.
- XJTAG User Interaction
- Demonstrates passing key presses in and out of the software, and how text strings can be used to automatically populate an XJRunner dialog box.
- XJTAG Last Test Run Output
- Shows how to pass a results summary in raw text into a user’s own application. This method of outputting results is useful when there is no need for the full output panel that displays all the test information with hyperlinks because this method is more memory efficient (for how to use the standard output panel, look at how results are output from XJTAG Single Test Run and XJTAG Multiple Test Runs).
- XJTAG Get Results From Last Test Run
- 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
- 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.
Three LabVIEW examples demonstrating how to use XJAnalyser Integration are available in the XJAnalyser\LabVIEW directory:
- XJTAG Read Pin
- Demonstrates how to use the integration assembly to access specific pins on a boundary scan device, and how to read their values when the chain is running.
- XJTAG Write Pin
- Shows how to write to pins on a boundary scan device.
- XJTAG Handle Conflicts
- Gives an example of how to resolve the conflict when a user attempts to drive a pin that another device is already holding in a different state.
- These examples call other VI files that are stored in the XJRunner\LabVIEW\Public sub-directory, which users are encouraged to use as building blocks for their own applications by importing the VI library as a dependency (using the LabVIEW "Select a VI..." function).
TestStand Examples
The directories XJRunner\TestStand and XJAnalyser\TestStand provide examples to help users incorporate XJIntegration into TestStand applications.
Two examples demonstrate how to perform LED tests. The XJRunner Integration example does this by using the standard XJEase test, whereas the XJAnalyser Integration example shows how to control the LED by directly driving the relevant pin on the JTAG device; they also demonstrate prompts and user-interaction. A third example for XJRunner demonstrates running the full test list for an XJDemo board.
The examples are heavily commented to aid understanding and re-use.
LabWindows/CVI Examples
An example of how to use XJIntegration in LabWindows/CVI applications is provided in the directory XJRunner\LabWindows CVI Example.
C# Examples
Documented C# code is provided in the directories XJRunner\CSharp Console Example, XJRunner\CSharp Windows Forms Example and XJAnalyser\CSharp Example. Users are encouraged to copy and edit these examples for use in their own code.
- To reference XJIntegration from a C# project, a copy of XJIntegration.dll needs to be included in the project directory alongside the solution file. This should be referenced from the project with CopyLocal set to true. XJIntegration.dll will then be able to load its dependencies from the XJTAG install directory rather than the output directory of the C# program, allowing it to resolve all its dependencies. Failure to do this can result in an error message of the format "Could not load file or assembly...".
Python Examples
Documented Python example scripts are provided in the directories Common\XJLinkTest\Python Example, XJRunner\Python and XJAnalyser\Python. These example scripts display how to use the 3rd party Python.NET package to call XJIntegration from Python. They cover using the XJLink2 self-test feature and hosting the XjtagOutputBox using Windows Forms from Python, running XJRunner tests and functions from the console, and controlling the JTAG chain using the XJAnalyser integration.
XJTAG v4.1.101