From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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 several PCIe-6535B

Solved!
Go to solution

Hi

 

I need to synchronize all DOs in four of the PCIe-6535B. They are all connected with the RTSI cable, operating at 5MHz sample rate. 

All 128 lines need to start outputing the data when a single PFI trigger is received. 

 

What would be the preferable way of synchronizing these four devices? The NI examples show master/slave concept, but is there any better way? I would like to see all of the four devices as one array of 128 channels.

Can I combine all of the lines into a single task and write the data to all of them at once? 

 

thank you

0 Kudos
Message 1 of 10
(6,184 Views)

Hi Pawel!

 

The most basic of solutions, namely, to have all devices used in a single DAQmx task, is not possible according to my tests. (True enough, I do not have any such devices, so I only made some simulated DAQ tests, but if something does not simulate it should not work in practice). So best is to stick with master/slave.

 

If the trigger is an external PFI, it might be worth considering distibuting this line to all cards with cables of equal length. This way, you can set up triggering the exact same way, only the clock needs to be distributed through RTSI. You also get the additional benefit of tighter synchronization, as propagation delay between master and slave will not affect the trigger.

 

You can also use one array of 128 channels to control all lines. All you have to do is to create an array of DAQmx tasks, with all the lines of one device in one task. Every DAQmx function (setting up, starting, writing) can be executed in a For loop that iterates through the array.Triggering and clock distribution ensures synchronization, even if the tasks are configured sequentially. All that I recommend  putting the master task last, to ensure all slave tasks are ready and waiting when it fires.

 

Let me know if this was helpful, or we can discuss specifics and code if something is left unclear.

 

Kind regards:

Andrew Valko
National Instruments Hungary
0 Kudos
Message 2 of 10
(6,144 Views)

Hi Andrew

 

Thanks a lot, that was helpful.

I like the idea of having the array of 128 channels, it makes it somewhat easier than 4x32.

 

If I have one channel as a master, how do I export the clock of that channel through the RTSI cable? There are several lines in the RTSI which are configurable, which one is the correct one?

 

thanks

0 Kudos
Message 3 of 10
(6,140 Views)
Solution
Accepted by topic author pawel

Dear Pawel,

 

You can use the RTSI7 line to distribute clock signals (DO/SampleClock, specifically). The trigger signal can also be distributed through RTSI. For all available routing, you can consult the Device Routes tab in MAX. I have also experimented with this array-type DAQmx setup, please find the results attached. 

 

Let me know if you have other questions.

 

Kind regards:

Andrew Valko
National Instruments Hungary
0 Kudos
Message 4 of 10
(6,120 Views)

Hi 

 

Thank you very much for the help and ready to use code!!! I appreciate the effort.

0 Kudos
Message 5 of 10
(6,117 Views)

Hi

 

I did what you suggested, but unfortunatelly when I execute one channel at a time I am getting an error "Resource requested by this task has already been reserved by a different task." The vi you sent however, works. Will you be able to tell what am I doing wrong?

 

I attached the sample code, which is modified your code.

 

thank you in advance 

 

0 Kudos
Message 6 of 10
(6,078 Views)

Hi Andrew

 

I did a litle bit of poking and it seems I cannot have two tasks each devoted for each physical channel controlled separatelly. LV returns error and says the recourse is already used. I can have two task each for different device, but not within the same device. 

 

Could you please confirm that I have to create tasks which are related to different devices and I will not be able to build array of 128 tasks (i.e. four boards with 32 chnls each).

 

thank you

0 Kudos
Message 7 of 10
(6,052 Views)

Dear Pawel,

 

sorry for the late reply, I was on vacation for the past week.

 

Indeed you are right. The device has a limit of how many individual tasks it can handle, because a task encompasses a lot of different settings and functionality (timing, triggering, registers and so on), and ther is oly so much space the device can accomodate. So what I advise to do is to have one task for each device instead of each line. This also the way I did it in the example code I have sent you. To address this when writing values, you need one additional For Loop in the generator code:

Digital Outpu 4x32 lines.png

 

Or you can use the same generator code and reshape the array:

DWFM reshape.png

 

Let me know if this helps.

 

Kind regards:

 

Andrew Valko
National Instruments Hungary
0 Kudos
Message 8 of 10
(6,010 Views)
Yes, I used your original configuration with four tasks.
Thank you.
0 Kudos
Message 9 of 10
(6,003 Views)

Hi Andrew

 

I posted other related to that question, but no answers.

Could you perhaps take a look, I am not sure where to poke more. 

 

thank you

0 Kudos
Message 10 of 10
(5,970 Views)