From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with signal monitoring during signal sampling

Solved!
Go to solution

Hello,

 

I am relatively new to LabVIEW 8.0 and I am having a problem with being able to monitor signals as I acquire two simultaneous analogue signals.  I have the user input the sample rate and sample duration and then I run the scan, however upon running the scan, I cannot see any results on the graph until the sample duration has elapsed, at which point all of the data presents itself.  Previously I was able to see the data acquisition in real time and I do not know what I have done since then to have possibly stopped this from working.  I have attempted to introduce some sort of delay to perhaps allow the software time to apply the data to the graphs but I have had no success.

 

I have attached the VI of the data acquisition component.

 

Thank you kindly for reading this.

0 Kudos
Message 1 of 4
(2,105 Views)
I can't look at your VI but you have never been able to look at the data before the sample period is over. Of you sample at 1000S/sec and request 1000 samples, you will get an update every second. Request 100 samples and you get an update every .1 second. Request 2000 samples and you get an update every 2 seconds. Simple mathematical relationship.
0 Kudos
Message 2 of 4
(2,096 Views)

Thank you Dennis for your reply,

 

Based on what you have said and some further research I did, I decided to redo that portion of my coding to utilize Waveform charts instead.  It appears to have worked however it has caused a new problem.

 

Initially, though I was unable to view the data until the entire sampling period was over, I was able to save all of the data to a .txt file without any problems.  Currently, I have used a timed loop to break up the sample periods in such a way that the waveform charts are allowed to update periodically and simulate real-time data monitoring.  However, now when I proceed to save the data, I am only able to save the last sample period instead of the entire sample period.  I am assuming this is a consequence of my attempt at simulating real-time monitoring.  Is there a workaround for this or perhaps a way to avoid this issue altogether?

 

I have attached the updated VI as a reference.

 

Thanks for your assistance.

0 Kudos
Message 3 of 4
(2,087 Views)
Solution
Accepted by topic author torm

Hi

 

I would suggest you to try these two options:

 

1. In every iteration of the while loop, add your data to the data from the previous iteration, ie use a shift register to build up an arrya of waveform data that you acquired. When you save the data to a file, read this array data and not the current waveform value. You can read the array data by using a queue, or using any simple method to pass data between to blocks.

When you are using a local variable of the waveform chart, you are only reading the current value in the chart, not its history.

 

2. Use a property node of waveform charts to read the chart history, convert the 2D array of chart to 1D array using waveform cluster unbundle functions and write to the file when 'save' is clicked.

 

 

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 4 of 4
(2,081 Views)