PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing Analog and Digital Output

Hello everybody,

 

as the title says, I want to synchronize a digital output with an analog output. I know that there is an LabView-example for this using counter channels. But I would like to know, if the synchronization can be done in another way, without involving counters. I also had a look at the DAQ-trigger functions, but I am not sure if I understood the description.

I attached a snippet to show an idea for the synchronization of several digital outputs and analog outputs. The generated waveforms are just dummies and I will replace them afterwards.

 

Is this way a good way to synchronize the outputs? Could I also export a "Start trigger" instead of the "Sample clock"? As far as I understood, the Export Trigger.vi exports the analog output clock to the specified destination, which is then reused for the digital outputs. But why do I have to use the timing Vi for the digital outputs seperately, if the digital outputs will use the analog output clock? And what happens, if the sampling rate for the digital sample clock mismatches the analog output clock? As I export the analog output clock (or at least I believe that I do this), the digital clock should be overwritten, shouldn't it?

 

Thanks in advance!

DAQ-Snippet.png

0 Kudos
Message 1 of 10
(5,597 Views)

Hey MrKSE,

 

if you want to synchronize multiple tasks, it would be helpfull for me to know the used hardware. I can only see that you are using a PXI chassis, but I can't find any information about the chassis and the card(s). Do you want to synchonize multiple cards or is the analog and digital output on the same card?

 

In general it is not necessary to use a counter to synchronize a digital output with an analog output. It is possible to do it in this way, but this is only one possible solution. A counter is often necessary if you want to synchronize multiple tasks with different sampling rates, but this doesn't look like your application.

 

Regards, Stephan

0 Kudos
Message 2 of 10
(5,546 Views)

Hey Stephan,

 

sorry I thought one could reuse this snippet with the default values! As I understand, the two outputs arise from different cards in the same chassis. The analog outputs are the PXI-Slot 2 and the digital outputs are at slot 3- if that helps. Both cards are connected to different "connector blocks".

 

Regards,

MrMKSE

0 Kudos
Message 3 of 10
(5,541 Views)

Its hard to determine, how to synchronize two devices if you don't know which devices should be synchronized. The DAQmx driver supports more than 400 different measurement devices and different devices offers different capabilities.

 

This webpage may helps you:

 

Timing and Synchronization Features of NI-DAQmx - National Instruments
http://www.ni.com/product-documentation/4322/en/

 

If you take a look on figure 2, you will see a way to synchonize a analog input and an analog output task. You can may take this example, you only need to change the analog input task to the digital output task.

 

Stephan

Message 4 of 10
(5,531 Views)

Thank you, I also had a look at that post, but I wasn't sure, whether I can simply exchange analog input and digital output. As my predecessor used the routine to export a trigger for synchronization (which I have to reconstruct/change now), I thought that something like that would be necessary

 

I will post the devices asap (unfortunately, I am not at the chassis at the moment).

 

 

 

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

The analog outputs are on a PXI-6733, the digital outputs on PXI-6220!

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

I think the attached example can be used to synchonize a PXI-6733 and a PXI-6220.

 

The example works with simulated hardware, but I did not tested it with real hardware.

 

Stephan

0 Kudos
Message 7 of 10
(5,513 Views)

Thank you! I will test this on Saturday an give feedback 😉

 

Edit: But you cannot explain me, which consequences the "export of the sample clock" in my example has, can you?

0 Kudos
Message 8 of 10
(5,490 Views)

Hey MrKSE,

 

I can only provide a short answer, because im really busy.

 

The Sample Clock for the Digital Output task is configurated to use the PXI_Trig0 line on the backplane of the chassis.The chassis provide 8 line on the backplane to route user defined signals from one card to another.

You now tell the driver to route the Sample Clock of the card in slot 2 to the PXI_Trig0 line of the backplane. The card in SLot 3 can now import the Sample Clock from the PXI_Trig0 line on the backplane. Both cards use the now the same Sample Clock (E.g. 80Mhz)

The problem with this type of synchronisation is that both task use the same clock, but they don't start at the same time with the generation of the Digital and Anlog Task. The Sample Clock is free running clock.

 

0 Kudos
Message 9 of 10
(5,484 Views)

First of all: I am very sorry that I reply so late, but I only work on Saturdays on that system.

 

Thank you for your explanation. For some reason, it seems to work good even with the posted kind of synchronization, but this might be conicidence. Accordingly, I will try to use your easy-to-understad example.

 

You said, that it worked for simulated devices. How did you examine that this worked? At the moment, I am using an oscilloscope with a high sampling rate and record the two channels to evaluate the synchronization. Is there even a better way, for example using the DAQ?

 

 

And is it necessary to create tasks or are virtual channels enough? Can I configure the Sample Clock in a SubVi separately from the Write Vis?

Best wishes

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