LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time in seconds on x-axis

Hi Lauren

This LabView code is fine for single sensor. But when I extended this code for 6 sensors as shown in data_acquisition.vi, it started giving problems. There is no continuous waveform and scrollbar becomes visible and invisible. I am not able to scroll back the data. I don't know why waveform is cutting at intermittent times. Also, in the front panel, if you right-click on the chart then you will see Y-Scale as invisible. I am in need of continuous waveform without any cut and with x-scrollbar. I used the x-scrollbar by right clicking on the chart>>visible items>>x-scrollbar.  But it is intermittently becoming visible and invisible.

   Am I missing anything in the code for multiple sensors? You can refer data_acquisition.vi code for 6 sensors posted in earlier message of this thread.

 

Thanks you for your help.

0 Kudos
Message 11 of 14
(856 Views)

Hi Pramod,

The reason that the data is occurring in broken chunks has to do with the acquisition and looping method rather than the number of sensors.  If you disable the autoscale function on the x-axis and extend the range, you can see that even with only one sensor, the data is read in chunks.  This occurs because the data reads a set number of points at the beginning of each loop, and then waits for a given amount of time before reading more information.  When it is graphed using the build waveform function, the spacing is determined by your delta T value.  Since the beginning of each loop reads the initial time and compares it to the current time, the next round picks up at that point in time rather then where it left off.

Eliminating any wait functions within the loop should help reduce the gap.  Otherwise, you may want to consider using lower level functions.  If you take a look at the examples in the Example Finder, there is one specifically designed to continuously acquire and graph data, and log it to a binary file.

Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 12 of 14
(824 Views)

Hi Lauren

The problem of continuous waveform acquisition has been solved after little-bit change in wiring connections. Although I am seeing the data in cut format in front panel, when I run the saved LVM file by Read LVM, it is showing continuous waveform. But it is not showing the waveform for last second. I am using multiplier of 30 and 0 offset in the x-scale tab.

I have attached the Read_LVM.vi for reading the data through Read LVM. Can you please tell whether it is correct way of coding to view the saved data?

Another problem is the data_acquisition.vi code is running for 6 seconds only. After that it is asking to stop the code. Can you please inform what can be done to run the code for more than 6 seconds? I am using 1000 no. of samples and 10000 Hz sampling rate.

  Thank you

 Pramod

0 Kudos
Message 13 of 14
(812 Views)

Hi Pramod,

I believe that the reason you are running into this error has to do with the rate you are reading data compared to the rate you are writing data.  Since you are writing 1000 points every 100 ms, you would to read from the file at the same rate.  I created a basic VI that uses a notifier in order to read 1000 points from the file everytime the write to measurement file completes a cycle.  This way it cannot attempt to read points from the file before they have been written.

I have attached this VI, which may hopefully serve as a good starting point.

Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 14 of 14
(794 Views)