LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquisition using NI cDAQ 9191

Hi Jawad,

 

I have run the code as shown in figure given by you yesterday.

No, you did NOT as I did…

Why did you wire a constant at the FOR loop? Did I show you that?

Why do you wonder about the code behaviour when YOU only supply ONE waveform after the loop?

Did you even try to debug your own code???

 

code#2 is made by saving data in array first, and then writing to measurement file

No, it is not. Where do you "save in array first"???

It is basically the same as code#1 - the only difference is the constant at the FOR loop iteration input (which is still UNNEEDED because of autoindexing!)…

 

It didn't resolved the issue with multiple number of groups in stored TDMS file.

To solve this problem you should GET RID OF EXPRESS VIS!

See the example VI "TDMS Write Time Domain Data" - this basically does exactly what you want to reach: saving time domain data in a loop into a single group of a TDMS file…

Did you even try to find a suitable example VI? There is a huge library coming with LabVIEW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 21 of 36
(1,202 Views)

Output display of filtered signal is again indifferent. Also i am still unable to get correct TDMS. Can anyone look into attached code to see the issues?

0 Kudos
Message 22 of 36
(1,194 Views)

Remember i am a novice in LV with programming skills not so good:(

0 Kudos
Message 23 of 36
(1,193 Views)

Hi Jawad,

 

Output display of filtered signal is again indifferent.

Now you are using an ExpressVI again for the filtering. Why?

 

Also i am still unable to get correct TDMS.

In the example VI the TDMSWrite was inside the DAQ loop.

You put the TDMSWrite AFTER the DAQ loop - why?

And why do you create another loop around all the previous code???

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 24 of 36
(1,191 Views)

Bundle of thnx 🙂 Finally in m getting single group in my tdms file. But the TDMS saves only a portion of data from full length of running the code. For example if i run the code for 10 sec it saves 1 or 1.5 seconds data. If i run for 20 sec it saves 2 sec of data. Similarly running the code 30 sec saves 3 sec data. And all the saved samples are with a delay of 4 sec with respect to start running the code. Hence remaining portion of data gets lost. I need to save all the samples from the start when i press the run button, till end (when i stop running the code). The code is attached with the post. TDMS file view is also attached you can see it saves 2 sec data although i ran the code for 15 sec. Please highlight the issue in code, how to correct?

 

Download All
0 Kudos
Message 25 of 36
(1,181 Views)

The second issue is with the display of waveform. It can be seen from the attachment with the post. In all the 9 waveforms, it appears like vertical bars, bu actually its not like this. This thing makes it difficult for me to monitor the behavior of data in real time. How can I fix it?

0 Kudos
Message 26 of 36
(1,179 Views)

Hi Jawad,

 

Please highlight the issue in code, how to correct?

Have you take a look at all those example VIs coming with LabVIEW?

There also is a huge list of VIs explaining nearly all bits of the DAQmx driver!

And all of them show how and when to initialize and close DAQmx tasks!

 

Why do you initialize the DAQmx task in the loop? Why do you close and clean up the task in the loop?

Do the init BEFORE the loop, do the close/cleanup AFTER the loop!

Do the DAQ reading IN the loop…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 27 of 36
(1,164 Views)

It is not all saving a tdms after doing this 😞

0 Kudos
Message 28 of 36
(1,145 Views)

Hi Jawad,

 

did you talk with irsa about your problems?

 

It is not all saving a tdms after doing this

Which error do you get? What's the problem?

Did you try to debug your VI? What is the result of your debugging?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 29 of 36
(1,134 Views)

Yes i discussed but cannot get a solution. 

Actually code do not give an error, it simply do not save a tdms. May be placing all the DAQ VIs inside loop was correct.

0 Kudos
Message 30 of 36
(1,132 Views)