LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

faire des acquisition sur des entrées analogique sur 2 frequence différente

Solved!
Go to solution

Bonjour , je suis stagiaire, mon travaille consiste à exploité des carte national instrument pour faire des acquisition, dans mon application je fais l'acquisition de 4 paramètre dont un micro ce qui fais que j'ai besoin d'une fréquence échantillonnage  plus élevé à 80 kHz , et je veux faire de l’acquisition pendant 1h cela entraine des problème de mémoire pleine . donc je veux faire l'acquisition des 3 paramètre à une fréquence de 1kHz et faire l'acquisition de micro à 80khz séparément.

La solution que j'ai trouver est de ajouter une horloge échantillonnage externe mais j'ai toujours l'erreur code 50103 je travaille sur la carte NI USB 6212 ? est ce que je procède correctement ? ET est ce que les carte NI permet ce que je veux faire? ou je dois changé?

merci d'avance pour votre réponse

0 Kudos
Message 1 of 10
(478 Views)
Solution
Accepted by topic author ameletudiante99

Hi amel,

 


@ameletudiante99 wrote:

Hello, I am a trainee, my work consists of using national instrument cards to make acquisitions, in my application I acquire 4 parameters including a microphone which means that I need a higher sampling frequency at 80 kHz, and I want to acquire for 1 hour, this causes full memory problems. so I want to acquire the 3 parameters at a frequency of 1kHz and acquire the microphone at 80khz separately.

The solution I found is to add an external sampling clock but I still get error code 50103 I am working on the NI USB 6212 card? am I doing this correctly? AND do the NI cards allow what I want to do? or should I change?


  • Your NI6212 only has one ADC and uses a multiplexer to read several channels. Because of that you can only use one sample rate for all channels (and the max aggregate samplerate is 400kS/s, which is fine for 4 channels of 80kS/s each).
  • You can read all 4 channels at 80kS/s, but decimate 3 of them down to 1kS/s.
  • You don't need to (or better: should not) keep all samples in memory for one hour or more: read samples, process them (like decimation), and save them to your hard drive.
  • You could even use DAQmx to stream your data to disk into TDMS files! Do some post processing after the measurement has finished…
  • There are other DAQ cards from NI with independent AI channels (one ADC per channel), but they are more expensive than your NI6212…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(468 Views)

Rebonjour

 

je vous remercie pour votre réponse, je comprends mieux maintenant.

 

0 Kudos
Message 3 of 10
(452 Views)

Bonjour , je fais de l'acquisition de 4 paramètre avec la carte ni 6212 , je veux faire un sous échantillonnage sur le 3 premiers paramètre que je veux acquérir , je veux faire cela en calculant la moyenne de 8 échantillon à chaque fois , je fais l'acquisition en continue donc je peux pas savoir combien d'itération pour la boucle for et quand je fais avec la boucle while j'ai seulement la derniers valeurs sur mon fichiers.

comment je peux faire cela ?

une autre question est ce que il y a une méthode pour libérer de la mémoire en cours d’exécution je fais les acquisition à 80kHz ce qui fait que je suis limité en terme de durée d'acquisition ?

Merci d'avance pour votre réponse

0 Kudos
Message 4 of 10
(406 Views)

Hi amel,

 


@ameletudiante99 wrote:

Hello, I am acquiring 4 parameters with the NI 6212 card, I want to do subsampling on the first 3 parameters that I want to acquire, I want to do this by calculating the average of 8 samples each time, I do the acquisition continues so I cannot know how many iterations for the for loop and when I do with the while loop I only have the last values on my files.

how can I do this?


You could use a loop to iterate of the waveforms, then manipulate the Y array of the waveforms (and their dt value).

LabVIEW comes with several "Decimate" functions: have you tried any of them?

 


@ameletudiante99 wrote:

another question is is there a method to free up memory while I am doing the acquisitions at 80kHz which means that I am limited in terms of acquisition duration?


I repeat my previous suggestion: don't collect data in memory, but save them to disk as soon as possible…

 

Could you please translate your messages to English? This is a worldwide forum, with English being the most-used language. Otherwise there is a French regional board

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 10
(395 Views)

Bonjour,

merci pour votre réponse oui j'ai essayer ça as bien fonctionner .

pour la mémoire normalement j'enregistre directement sur un fichier , je parle de la mémoire du tampon par ce que après quelque minute d'acquisition j'ai une erreur que j'ai pas assez de place sur le buffer

 

0 Kudos
Message 6 of 10
(380 Views)

Good morning,

thank you for your answer yes I tried it worked well.

for the memory normally I record directly on a file, I am talking about the buffer memory because after a few minutes of acquisition I have an error that I do not have enough space on the buffer


Capture.PNG ‏49 KB
Add tags

0 Kudos
Message 7 of 10
(379 Views)
Solution
Accepted by topic author ameletudiante99

Hi amel,

 


@ameletudiante99 wrote:

for the memory normally I record directly on a file, I am talking about the buffer memory because after a few minutes of acquisition I have an error that I do not have enough space on the buffer.


Because you don't follow the recommendations for "higher speed" DAQmx acquisitions!

  • For your sample rate of 80kS/s you should read a fixed amount of samples with each DAQmxRead call (aka per iteration)! The usual recommendation is to read 1/10 of the sample rate, so this would be 8000 samples per iteration in your case…
  • File handling is rather slow, so you might also use a producer-consumer scheme to decouple DAQ from file handling.
  • I already suggested to use DAQmx to stream your data to a TDMS file: no need to implement any file handling (in the DAQ loop) on your own!
  • What's the point of wiring a 100s to your DAQmxRead function, but leaving the "number of samples" input unwired?
  • In your image you only read one channel, but in your previous messages you always wrote about 4 channels: there's some kind of mismatch…

Explanation for this error: your loop iterates to slow to handle the DAQ data - because you read only a few samples per iteration. This way the samples slowly are collected in the (DAQmx internal) buffer until this buffer is full.

When reading larger amounts of samples at once you reduce the (DAQmx driver, file handling) overhead quite a lot, and so the DAQmx buffer doesn't fill up.

 

Generic suggestion: when you write about such errors you should ALWAYS provide the full error message along with the error number you get (most probably -200279 in your case)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(370 Views)

hi
I didn't know all this, thank you very much
how high speed acquisition can make me optimize the use of my memory I don't understand this point.
and you are right for the tdms files I used "daqmx Configure Logging TDMSvi" is there a way to have the data for each channel in a single file so that I can do a subsampling on the first 3 parameters?

 

amel

0 Kudos
Message 9 of 10
(359 Views)
Solution
Accepted by topic author ameletudiante99

Hi amel,

 


@ameletudiante99 wrote:

you are right for the tdms files I used "daqmx Configure Logging TDMSvi" is there a way to have the data for each channel in a single file so that I can do a subsampling on the first 3 parameters?


Put all 4 channels into one DAQmx task!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(353 Views)