Multiple PXI Device Synchronization and Multithreading Reference Example for VB.NET
This example demonstrates synchronizing multiple National Instruments devices in a PXI chassis using Visual Basic.NET
and the appropriate NI drivers for the .NET Framework 2.0. It also demonstrates how to set callback functions for certain devices to be run from their own threads.
This example program contains two separate applications, one that uses a 6653 timing module placed in slot 2
of a PXI chassis for driving the PXI Star line and another that does not use a timing module in slot 2.
The second application uses the PXI_Trig lines on the backplane of the PXI chassis for timing and synchronization.
This example was built using Visual Studio 2005 and uses the following modules:
PXI-6251 (or any other M-Series device)
PXI-6552 (or any other NI-HSDIO device)
PXI-5421 (or any other NI-FGEN device)
Software required to run example:
Visual Studio 2005
NI-DAQmx 8.0 or later
To run this example, verify you have the appropriate hardware (or remove the sections of code that use hardware you do not possess), insert the names of the devices into the UI inputs after running the application in Debug mode.
The devices will export their sample clocks to one of the available front connectors which can then be probed with a scope to verify the amount of phase offset between the clock on each module.
The 6509 and GPIB devices are software timed and are not synchronized with the other devices in this example. In addition, each task can be independently started and stopped without affecting the other running tasks.
The counter on the 6251 is generating a pulse every 4.8 to which the other devices in the system use as a start trigger when they are initialized from the front panel. This counter pulse is routed to the backplane of the chassis to either a 6653 timing module for a re-route to the PXI Star line or to a PXI_Trig line. All hardware-timed devices are phase locked to the PXI_clk_10 line. The software-timed devices (6509 and GPIB) are not phase locked.
**The accompanying code represents a very specific use case for NI products. For more general examples, please refer to ni.com/examples, the LabVIEW Example Finder, or the NI driver help files that come with every NI driver.
Language(s): Visual Basic .NET
Additional Software: Visual Basic .NET
Hardware Group: Digital I/O (DIO), GPIB, High-Speed Digital I/O, Multifunction DAQ (MIO), PXI/CompactPCI, Signal Source (AWG/FG/AO)
Driver: NI-488.2 2.5, NI-DAQmx 8.0, NI-FGEN 2.4, NI-HSDIO 1.5, NI-Sync 2.0
Reader Comments | Submit a comment »