LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize four sessions on three 6561 cards?

Hello,

it seems tha
t I cannot figure out on myself how to synchronize several sessions on three 6561 cards.

My setup is as follows:

I have three 6561 cards in a PCI computer. These cards are used to write patterns to an external motherboard and read data from there. The three cards are connected by a RTSI cable which is registered in MAX.

Card 1 reads data.
Card 2 writes patterns.
DIO0-11 of card 3 write patterns.
DIO12-15 read data.

The patterns are generated using scripts.

I need to synchronize all of these sessions. My current approach is:

The sample clock of card 2 is used as the master clock for the whole system. It is routed to "ClkOut on Digital Data & Control Connector". From there it goes through the motherboard to the strobe inputs of card 1 and 3. These cards use strobe as clock for reading. Additionally this clock goes through the motherboard also to ClkIn for card 3 as it is not possible to use strobe as a clock for generation. So far this works.

I try to use the start of the generation session on card 2 as the reference point for timing. The start trigger of this session is set to "Software".        
I export the start trigger of the generation session on card 2 to "PXI Trigger Line 0/RTSI 0".  The start trigger of all other sessions is set to have "PXI Trigger Line 0/RTSI 0" as source and be of type "Rising Edge". The script trigger of the generation sessions on card 2 and 3 are also set to have "PXI Trigger Line 0/RTSI 0" as source and be of type "Rising Edge".

Now I had the im
pression that NI-TClk would be the correct way to synchronize the sessions. I set "StartTrigMasterSession" of the generation session on card 2 to itself (I don't know whether this is the right way to do it, could not find an example).

Then I make an array of all four sessions and feed them into "niTClk Configure For Homogeneous Triggers", "niTClk Synchronize" and "niTClk Initiate". This I got from the example "Multi-Device Dynamic Generation and Acquisition-Source Synchronous (TClk).vi".

Upon doing so I get an error -250031. In the description I'm told that:

"Two sessions for one physical device are specified in the sessions array.
You can use NI-TClk to synchronize two sessions for one device, but not in the same sessions array."

Unfortunately I cannot figure out how to do that. If I leave out the acquisition session of card 3 from the array that I feed into the synchronizing VIs,  the card starts reading about 200 clock cycles ahead of card 1.

Is there a solution for this problem?

I hope I could describe the system in a way that anybody can make sense of it. If anything is not clear, I'll be glad to provide more information.

Best regards

Armin
0 Kudos
Message 1 of 5
(3,456 Views)

Hi - first can you tell me with what programm you´re working ? Labview or CVI or C and in what version ?

Can you attach here your code with the error ? I´ve here links to examples with synchronize cards with tclk - perhaps you see here the problem.

The error looks like wrong handling (not sessions synchronize but device can be sychronize...)

Labview

http://zone.ni.com/devzone/cda/epd/p/id/5029

CVI

http://zone.ni.com/devzone/cda/epd/p/id/5064

waveforms

http://zone.ni.com/devzone/cda/epd/p/id/3269

Tutorials

http://zone.ni.com/devzone/cda/tut/p/id/5501

http://zone.ni.com/devzone/cda/tut/p/id/3675

 

Best Regards

AE Munich

 

0 Kudos
Message 2 of 5
(3,425 Views)


Johann.Wagner wrote:

Hi - first can you tell me with what programm you´re working ? Labview or CVI or C and in what version ?


I use Labview 8.2.


Can you attach here your code with the error ?


Sorry, at the moment I cannot. I'm working under high pressure, and meanwhile circumvented the problem by using the PF0 connector

to transport the trigger signal. This seems to work at the moment. I also did not keep the code that caused the error, but the message is

(as in my previous post said):

"Two sessions for one physical device are specified in the sessions array.
You can use NI-TClk to synchronize two sessions for one device, but not in the same sessions array."

Error code is -250031  (Hmm, maybe there's a typo there and it was -25031...)

I will be out of office for some days, but when I'm back I'll try to provide you with a complete example...


I´ve here links to examples with synchronize cards with tclk - perhaps you see here the problem.

I will have a look at them!


The error looks like wrong handling (not sessions synchronize but device can be sychronize...)

But the error message says that I could ?!



Thank you for your help.


Best regards

Armin
0 Kudos
Message 3 of 5
(3,407 Views)
Here is a issue for synchronization - does it help you ?

Problem 

I am trying to synchronize two generation channels on different HSDIO devices using TClk, and the channel to channel time delay is not tight enough for my application. Is there any way that I can improve this channel to channel time delay?

Solution 

If having two channels synchronized at this time delay is not tight enough, it is possible to take advantage of the features such as data position delay and adjust sample clock relative delay to improve channel to channel synchronicity. Data Position Delay allows you to shift the position of your generation data relative to the sample clock, while the Adjust Sample Clock Relative Delay allows you to adjust the sample clock relative to the reference clock. When externally clocking your generation, use the data position delay feature. When using the onboard internal clocks, use the adjust sample clock relative delay vi. For more information on Data Position Delay, please see the addendum at the bottom of the page (taken from Digital Waveform Generator / Analyzer Help)

External Clocking

If you are using external clocking on your HSDIO devices and wish to synchronize two channels on two boards, follow the basic programming flow as follows:

  1. Configure both HSDIO devices for generation
  2. Synchronize devices using TClk
  3. Generate identical data on both devices
  4. Use a high sampling rate oscilloscope (e.g. NI 5114) to monitor time delay between identical channels on both devices. (The easiest method would be to use the Scope Soft Front Panel and view the time delay measurement)
  5. If one device lags the other, increase the data delay of the other device until the time delay is minimized

One caveat is that while this method can synchronize two channels on different devices, channel to channel delay on the same board must still be accounted for. Therefore, while you may be able to synchronize channel 0 of device 1 and channel 0 of device 2 to this resolution, this does not guarantee that channel 1’s of these devices will also be synchronized to this level.

Attached is some LabVIEW code that demonstrates this principle. Two HSDIO devices share a 100 MHz external clock, and generate the same HWS test pattern. The hardware setup is shown in an attached JPG file.

Internal Clocking

If you are using the internal clock on your HSDIO devices and wish to synchronize them, you can also use the Sample Clock Delay on the NI-TClk property node to align the sample clock of one device with the sample clock of another. This property allows you to align the sample clocks on synchronized devices. It is also worth noting that the sample clock delay is only adjustable for generation sessions only.

Data Position Delay Resolution

NI digital waveform generator/analyzers have three internal independent delay mechanisms, one for dynamic generation, one for dynamic acquisition, and one for the exported Sample clock. The delay mechanisms are capable of delaying the data and clock positions by up to one full Sample clock period, for Sample clock frequencies of 25 MHz and above. Refer to the specifications document for your device for valid frequencies and ranges for delays.

0 Kudos
Message 4 of 5
(3,396 Views)