Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering multiple boards

Solved!
Go to solution

Hi,

 

I have a PXI-1033 chassis with a PXI-6534 digital card and a PXI-6733 analog card, and am using LabVIEW 2010 and DAQmx (I'm fairly new to both). I am trying to synchronise sets of ~1min digital and analog output with a timing resolution of about 1us. To store the value of every channel at every 1us would need more memory than the cards have, so I've set up a trigger to tell them when a channel needs to change.

 

Currently, the way I have it set up is as follows: the digital and analog output arrays are loaded onto the cards, and they are configured for output with sample clocks that take an external trigger input (PFI2 and PFI5, respectively). One of the digital output lines on the 6733 is set up to output a pulse whenever a channel needs to change. That line is plugged into PFI2 on the 6534 and PFI5 on the 6733.

 

It works as expected, but I have a couple of questions:

 

1) At the moment, I'm using an external function generator running at 1MHz as the clock for the digital output on the 6733 (the one that acts as a trigger). I'd rather not need an external device to do this: is there an internal clock either on the cards or in the PXI chassis that I can use instead? I tried selecting "OnboardClock" as the source for the Sample Clock VI, but it gave an error: "Source terminal to be routed could not be found on the device."

 

2) Is there a way of routing the trigger signals internally, rather than having BNC cables running between the boards? (This one is less important; it's more of an aesthetic issue.)

 

Any help is much appreciated 🙂

 

Rob

0 Kudos
Message 1 of 15
(3,754 Views)

Take a look at this document

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

 

Q1: You will see that Onboard clock is for PCI sync, PXI allows you to use a PXI_CLK

Q2: The DAQmx driver is pretty smart, you don't need to tell him to route your signals. Instead as shown in the linked document, you just tell DAQmx that you want to use the trigger of the other task.

 

Felix

0 Kudos
Message 2 of 15
(3,753 Views)

Hi Felix,

 

Thanks for your reply. That document was indeed interesting and pertinent (I think), but as I said I'm fairly new to LabVIEW, DAQmx and the associated terminology, and I couldn't follow much of it.

 

Right now, I've got an array of zeros of length (clock freq) x (length of output), with a one every time an update is required. I set up a task on the 6733 card, configured for digital output, with a sample clock that takes an external, 1MHz trigger, and outputs that array.

 

I don't understand how to replicate this using the internal clock. Is it just a simple matter of changing the sample clock's source? (I couldn't find PXI_CLK in the list of options.)

 

Then, how do I route this signal (which is being output on DO line 1) to trigger updates on both cards?

 

Thanks again 🙂

 

Rob

0 Kudos
Message 3 of 15
(3,735 Views)

At first, select a 'master' task. Give this master task the PXI-CLK10 timebase (don't know why you aren't seeing it, you can use MAX to check your devices; somewhere in the advanced settings there was a matrix of all available signals and the possible routes between them).

The you assign the slave tasks to trigger on the master tasks start trigger and to use the master tasks sample clock.

For digital waveforms I think it was enough to assign them the same sample clock, as this clock is only generated when the AO task is running.

 

Felix

0 Kudos
Message 4 of 15
(3,721 Views)

Hi Felix,

 

I still can't find the PXI-CLK. I've attached my VI; the trigger line configuration is at the bottom of the first frame. The only options I can see for its source are "OnboardClock" and then the PFI lines on each card under headings "PXI1Slot3", "PXI1Slot4" etc.

 

I'm afraid I still don't even conceptually understand how to do what I want.. you said I should make the slave tasks use the master task's sample clock? But I want the master task to be running on a fast (at least 1MHz) clock, and the others to update only when something needs to change. How can they use the same clock?

 

Sorry for being so slow 🙂

 

Rob

0 Kudos
Message 5 of 15
(3,702 Views)

Hi there,

 

In order to see the PXI_Clk, you'll need to allow the selection of advanced terminals.  To do this, right click on the enumeration for the clock source, and select "I/O Name Filtering..." and check "Include Advanced Terminals".  If the card you are using is able to route in the PXI_Clk 10, it will show here.  You can also check the device routes in MAX to see if that clock will be available.

 

Jon

Applications Engineer
National Instruments
0 Kudos
Message 6 of 15
(3,677 Views)

I checked "Include Advanced Terminals", and could not find the PXI_Clk 10 (see attached image). Does this mean the cards cannot route in that signal?

 

Again, I apologise for being slow, but I do not understand the idea proposed by Felix (sharing the sample clocks). Perhaps I simply don't understand how clocks are assigned to tasks in DAQmx.

 

I want to set up the main analog and digital output tasks (let's call these the MAIN outputs) to update only when one of their channels needs to change value. So I have made an array which is generally low, but goes high when a change is required, and I output this from one of the digital lines on my 6733 card - let's call this the TRIG output. I then use this TRIG output to trigger updates of the MAIN output on the 6534 and the analog lines on the 6733 (actually, I have three of these - see the attached VI in my earlier post). As far as I understand, I want the TRIG output running on a fast clock, so that I have good timing resolution (at least 1us). But I want the MAIN output to only update when it is triggered. How else can I achieve this? If I use the same sample clock for each task, won't the MAIN output update at a rate of 1 or 10 MHz? That's not what I want...

 

Please help, I'm really struggling to understand this.

 

Thanks,

Rob

0 Kudos
Message 7 of 15
(3,653 Views)

Hi,

 

When discussing a sharing a clock across devices, one device must be selected as the master device.  This is the device that is providing the clock source.  In your case, the clock source is being provided in the form of a digital output from your 6534.  We need to somehow route this to the AO cards.  I think we can get by with just making one connection on the digital card, and then do the rest internally.  My idea is to route the digital output line back into a PFI line on the 6534.  We can then programitically route this PFI line to the PXI_trig0 line (see attached VI).  We can then use this line as the clock source for the analog outputs. 

 

When using a Master/Slave architecture, it is imperative that we start the slave tasks first.  Otherwise, we could miss the triggers being provided by the master clock.  Check out the attached example.

 

Jon S

Applications Engineer
National Instruments
0 Kudos
Message 8 of 15
(3,627 Views)

Sorry, had little time the last days. Also take my suggestions with a grain of salt; I don't have a PXI chassis right now (not even DAQmx installed actually), so Jon might be the better help.

* I'd just use the 20 MHz timebase. As you see from my first post -> link it's directly comming from the master clock div4.

* I think you should use one of the AO tasks as master. Make a simple test just 1 AO/DO so we can get closer. I still don't have gone through your complete triggering specs, so I might miss something.

* I don't like sequences. While the tech_note uses them, I ran into issues. Specifically if I got an error (on the master task) that produces an invalid trigger/clock line and then the slave task failed, make sure you get the error reported from the master. Debbunging (highlight execution) might produce a very different error as well as everthing is very-very slow compared to the DAQ-hardware. So make sure you catch the very first error.

 

Felix

0 Kudos
Message 9 of 15
(3,619 Views)

Thanks for the replies.


@Jonathan S wrote:
When discussing a sharing a clock across devices, one device must be selected as the master device.  This is the device that is providing the clock source.  In your case, the clock source is being provided in the form of a digital output from your 6534.  We need to somehow route this to the AO cards.  I think we can get by with just making one connection on the digital card, and then do the rest internally.  My idea is to route the digital output line back into a PFI line on the 6534.  We can then programitically route this PFI line to the PXI_trig0 line (see attached VI).  We can then use this line as the clock source for the analog outputs.


Actually, the way I have it set up now, the clock is a digital output from the 6733, not the 6534. I would have preferred to use the 6534 (because it is faster - the 6733 can't do pulses much shorter than 1us), but I didn't think it was possible to have one line on the 6534 running on a different clock to the other 31 - was I wrong about this? In any case, your idea of routing the trigger to a PXI_trig line worked perfectly! Now I have the DIO0 line on the 6733 connected externally to the PFI5 line on the same card, and route this programatically to PXI_Trig2, which the other cards then trigger from. Works great, and simplifies the connections a lot - thank you!

 

Now my only issue is that I'd like to use an internal clock rather than my external function generator.

 

With "Include Advanced Terminals" selected, I can't see the PXI_CLK10, but I can see "100kHzTimebase" and "20MHzTimebase". The 100kHz is too slow for what I want, and the 20MHz too fast (if I select it, I get a warning "sample clock rate specified is so high that it violates the settling time requirements for the generation"). Is there some way that I can get a 1MHz clock?

 

Thanks again,

Rob

0 Kudos
Message 10 of 15
(3,607 Views)