From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing PXIe-6556

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:

  1. Synchronize two generation sessions with one generation session on each 6556 card.  If I configure one session to have a SoftwareStartTrigger and export StartTrigger on PxiTrig0Str, the second session will successfully trigger from it.  However, they aren't aligned, which I think is due to them not having a shared reference clock?
  2. Synchronize two generation sessions on a single 6556 card.  This one I haven't had any luck and I'm not sure is possible.

Thoughts?

 

Thanks for the help.

0 Kudos
Message 1 of 4
(5,579 Views)

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.

 

 

Applications/Systems/Test
National Instruments | AWR Group
0 Kudos
Message 2 of 4
(5,559 Views)

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,

Jesse O. | National Instruments R&D
0 Kudos
Message 3 of 4
(5,555 Views)

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

0 Kudos
Message 4 of 4
(5,545 Views)