05-12-2014 07:19 AM
Hi,
I'm trying to do the following two different synchronization tasks (for proof of concept) with two PXIe-6556 cards both in a PXIe-1073 chassis:
Thoughts?
Thanks for the help.
05-13-2014 08:39 AM
hch3,
you are completely correct in you assesment. The reason the two tasks are not aligned is due to them not sharing a reference clock. In order to sample at the same time across cards you must also share the sample clock. As for the second question, it should not be two sessions as much as a single session with two channels.
05-13-2014 09:17 AM
Hello,
While sharing a reference clock will help keep the two PXIe-6556s geneation clocks running at the same frequency, there are other challenges to synchronizing instruments togehter. For example any delay from the first 6556 trigger to the second module could lead to the instruments being misaligned by a sample. Additionally just sharing a reference clock is not enough to guarantee phase alighment between modules.
Fortunately there is an easy way to achieve synchronization between several 6556 modules. This is through the NI TCLK API. You can read more about the TCLK API here. The TCLK API allows for easy sychronzation between your different generation sessions. Seveal examples ship with the NI HSDIO driver to show how to use TCLK. If you're using LabVIEW you can find them by clicking Help -> Find Examples. Inside example finder select Hardware Input and Output -> Modular Instruments -> NI-HSDIO (High-Speed Digital I/O) -> Synchronization -> Multi-Device Dynamic Generation (TCLK).vi
I hope this help,
05-13-2014 03:55 PM
Hi Jesse_O and PeanutButterOven,
Thanks for the information. I was able to sync two different 6556 cards with TCLK. I only created a generation session on each card. Tomorrow I'll work on sync'ing two generate and acquire sessions.
I do have one question for now. When I'm watching the flashy lights on the front of the 6556s during the execution of the code, I notice the Active LED goes red for a brief period on both cards while the niTCLK.Synchronize() method is executing. Is this to be expected? Maybe part of the synchronization process? When I run the niTCLK.Initiate() method the data shows up synchronized on the oscope, so right now it appears that it is working correctly.
Below is my C# code I'm executing for this demo. Is there anything I have or missing that would cause the Active LED to display red?
niHSDIO pxiBoxGenerate1; niHSDIO pxiBoxGenerate2; string resourceName1 = "Dev2"; string resourceName2 = "Dev3"; string channelList1 = "0"; string channelList2 = "0"; double sampleClockRate = 100000; string channel1WordString = "10101010100"; string channel2WordString = "01010101010"; string digitalWordString1 = channel1WordString; string digitalWordString2 = channel2WordString; List<System.IntPtr> sessionsL = new List<IntPtr>(); byte[] digitalWordByte1 = digitalWordString1.Select(n => Convert.ToByte(char.GetNumericValue(n))).ToArray(); byte[] digitalWordByte2 = digitalWordString2.Select(n => Convert.ToByte(char.GetNumericValue(n))).ToArray(); System.IntPtr session1; pxiBoxGenerate1 = niHSDIO.InitGenerationSession(resourceName1, true, true, "", out session1); sessionsL.Add(session1); System.IntPtr session2; pxiBoxGenerate2 = niHSDIO.InitGenerationSession(resourceName2, true, true, "", out session2); sessionsL.Add(session2); pxiBoxGenerate1.AssignDynamicChannels(channelList1); pxiBoxGenerate1.ConfigureSampleClock(niHSDIOConstants.OnBoardClockStr, sampleClockRate); pxiBoxGenerate1.ConfigureGenerationMode(niHSDIOConstants.Waveform); pxiBoxGenerate1.ConfigureGenerationRepeat(niHSDIOConstants.Finite, 1); pxiBoxGenerate1.WriteNamedWaveformWDT("Test", digitalWordByte1.Length, niHSDIOConstants.GroupByChannel, digitalWordByte1); pxiBoxGenerate2.AssignDynamicChannels(channelList2); pxiBoxGenerate2.ConfigureSampleClock(niHSDIOConstants.OnBoardClockStr, sampleClockRate); pxiBoxGenerate2.ConfigureGenerationMode(niHSDIOConstants.Waveform); pxiBoxGenerate2.ConfigureGenerationRepeat(niHSDIOConstants.Finite, 1); pxiBoxGenerate2.WriteNamedWaveformWDT("Test", digitalWordByte2.Length, niHSDIOConstants.GroupByChannel, digitalWordByte2); pxiBoxGenerate2.Initiate(); int niTCLKError = 0; niTCLKError = niTCLK.ConfigureForHomogeneousTriggers((uint)sessionsL.Count, sessionsL.ToArray()); niTCLKError = niTCLK.Synchronize((uint)sessionsL.Count, sessionsL.ToArray(), 0); niTCLKError = niTCLK.Initiate((uint)sessionsL.Count, sessionsL.ToArray()); pxiBoxGenerate1.WaitUntilDone(-1); pxiBoxGenerate1.DeleteNamedWaveform("Test"); pxiBoxGenerate2.DeleteNamedWaveform("Test");
Thanks for your help,
Harold