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.
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.
06-02-2014 04:37 AM
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
Solved! Go to Solution.
06-05-2014 07:00 AM - edited 06-05-2014 07:06 AM
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:
06-05-2014 07:39 AM
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
06-06-2014 07:25 AM
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:
06-06-2014 11:12 AM
Hi
Thank you very much for the help and ready to use code!!! I appreciate the effort.
06-10-2014 09:27 AM
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
06-12-2014 06:07 AM
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
06-16-2014 04:21 AM
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:
Or you can use the same generator code and reshape the array:
Let me know if this helps.
Kind regards:
06-16-2014 08:44 AM
06-20-2014 01:17 AM
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