Final Clean Up After Use

When all board testing has been completed and the test system is ready to be shut down, all objects should be disposed, and a clean-up should be performed to ensure all the threads that XJTAG created are stopped. This is performed using the XjtagSystem.Close() command.

  • XjtagSystem.Close() should only be used when all testing is complete; it should not be used if other tests are still to be run.

In C#, this can be done as in the following XJAnalyser Integration example:

	// dispose all ChainRunner, AnalyserProject and XJLink objects: 
	m_chainRunner?.Dispose();
	m_project?.Dispose();
	m_xjlink?.Dispose();
	// Ensure any background threads started by XJIntegration are tidied:
	XjtagSystem.Close();
  

In LabVIEW, it can be performed using CloseXJTAG.vi as shown in Figure 17 (from the XJTAG Single Test Run.vi LabVIEW example). In this example it has been used in conjunction with CloseProject.vi to dispose the RunnerProject instance, and CloseXJLink.vi to dispose of the XJLink instance. The CloseXJTAG.vi call performs the system close, so it should be called last. CloseXJTAG.vi also has optional input terminals for arrays of XJLink, XJRunner and RunnerProject refnums. The VI will call DisposeDotNet.vi to dispose any instances passed in this way, before performing a system close. With the arrays CloseXJTAG.vi can close multiple Runner objects at once, which can make cleaning up easier when running on multiple XJLinks. Many of the other LabVIEW examples provided use this approach instead.

Closes the RunnerProject Closes the XJTAG system, should always be called last Closes the XJLink

Figure 17: Using XjtagSystem.Close