LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Independent analog generation with DAQmx

Hello,
I am using a PXI 6713 analog output card to generate voltage waveforms.
The card has 8 individual DAC, so I tried to create one DAQmx task for each channel in order to generate individually what I needed and, more important for us, to trig them individually.

Unfortunately, it seems not possible to create several DAQmx tasks for waveform generation on the same card... Did anybody try to perform that ?

I saw on the forum that it was possible to generate waveforms simultaneously on several channels and discrete values on others at same time. I tried that and it works well indeed. But I would like to know if there is a way to perform waveform generation individually and if possible started with digital triggers.
0 Kudos
Message 1 of 5
(3,308 Views)
I have been using the PCI-6713 to generate waveforms.
Once thing to note is there is a common clock, and buffers for all the channels (used in voltage generation). When you set the buffer size and update rate, you really are setting the values for all the channels.
You cannot , for example, set the update clock at (25,000) and buffer at (5000) for channel 0, and 35000, and 3500 for channel 1. The wave forms generated on two channels are therefore not indepenent and are related in frequency.

I could only generate wave forms for multiple channels at the same time
0 Kudos
Message 2 of 5
(3,301 Views)
OK, I understand the principle of generation of the board, and the associated limitation regarding the output frequency.

I am looking for a workaround to perform my analog generation. I had the idea of using a "circular buffer" for the DAQmx Write. I explain the tip with an example : using a buffer of 2000 samples, the generation is running continuously, with regeneration of the signal when the end of the buffer is reached. I try to write cyclically new blocks of 1000 samples in the buffer, according to the type of signal I want to generate.

The behavior I expect is that I write these first 1000 samples, I trig the generation, and while it is running I prepare the next samples and write it to the buffer. When the DAQmx task reaches the second half of the buffer, I overwrite the first half with new data (using the "Write Offset" property), and so on.

I know this kind of job is possible, since we already used it with traditional NI-DAQ.
My first practical tests make me feel the buffer is resized, and at that time takes 100% CPU at each loop where I re-write to the buffer.

I would be happy to know if others successfully performed this kind of operation with DAQmx.
0 Kudos
Message 3 of 5
(3,278 Views)
Bonjour,

Quelques informations importantes :

1/ L'horloge de mise à jour (update clock) est communément partagée par tous les CNA des sorties analogiques. Il n'est donc pas possible d'avoir une mise à jour de 1000 Hz sur une sortie et une autre de 2000 Hz sur une autre sortie.

2/ Il n'y a qu'un trigger par tâche donc un seul trigger pour toutes les voies de sorties qui sont utilisées.

3/ La technique du buffer circulaire sur N voies de sorties est tout à fait possible sous DAQmx. Il suffit de mettre une fonction DAQmxWrite dans la boucle et de générer le nouveau motif à chaque cycle d'écriture. C'est ce qu'on faisait pour NI-DAQ traditionnel et voici un exemple en LV 7.1 + DAQmx 7.3 pour la carte PXI-6713.

En espérant vous avoir renseigné au mieux.

Frédéric BOULLOT
Ingénieur d'Applications
NIF
0 Kudos
Message 4 of 5
(3,266 Views)
Merci pour votre exemple.
Je souhaite effectivement générer des signaux analogiques de fréquences différentes, mais bien sûr en utilisant une fréquence de génération commune à toutes les voies (par exemple 1 signal sinus à 100Hz et un triangle à 40Hz en utilisant une horloge de génération à 1kHz).

J'ai construit un VI similaire au votre, mais il est important pour moi de ne pas placer de boucle While qui accapare tout le CPU. J'essaie donc d'écrire dans le buffer aux moments opportuns, en observant des propriétés du buffer cycliquement dans une boucle avec un timer. Pour l'instant, le VI d'écriture "bloque" encore le CPU pendant un temps relativement important, de façon pas tout à fait reproductible... il y a je pense moyen d'optimiser tout ceci encore.

Existe-t-il un VI d'exemple qui illustre un tel fonctionnement ?
0 Kudos
Message 5 of 5
(3,259 Views)