LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph offset

Hello Application Engineers,

 

I am trying to do a baseline offset for a multiple XY graph so as to get a normalized XY graph starting from point zero. A random generator is used to produce raw data at a fast speed, say 50 ms per set (of three data, (X, Y1, Y2 and Y3)), then one set data is extracted for XY graph at every 15 sets of raw data, or say it 15 sets per graph. 

 

I want to use an average  (Y10, Y20, Y30) of  the first 10-graph's data  as a base line, then all frame's data is off-setted by the baseline value (average), meaning the normalized xy graph all start from a zero point. The normalized i-th data should be

(Xi, Y1i - Y10, Y2i - Y20, Y3i - Y30) 

 

First, I used an array to simulate such a process, see the XY-graph_offset.vi, it worked as I wanted, however, after migrating it to the application program, XY-graph-offset_app.vi,    it did not come with expected result. I played around and was not able to fix it.

 

Enqueue and dequeue are used in the app, but you can ignore them and just focus on the data offset part. 

 

My offset program includes 4 parts:

1. calculate average of the first 10 graph's data,

2. replace the first 10 graph's data using the value after offset,

3. replace the new data using the value after offset,

4. graph the normalized data. 

 

Could someone help me with the troubleshooting?

 

 Gu

 

Download All
0 Kudos
Message 1 of 4
(2,025 Views)

Capture.PNG

 

Hi, it's very simple to solve this problem.

You have to check which value is the highest and than the value "+1"(highest value +1 = calculated value).

The calculated value goes in Y-Max and so you have a konstant Offset.

Y-Min is zero

Look at de picture.

Robot Very Happy

Spoiler
 


 

0 Kudos
Message 2 of 4
(1,982 Views)

Hi KarlBStrich,

 

Thank you for your response. But I did not get your point. My real application is similar to the one posted previously, the random data generation represents my live data acquisition.

 

For troubleshooting, I added a few indicators to the program, which is attached here below. one indicator is the baseline offset loop count, it supposed to just run once to calculate the average of the first 10 graph data when the graph iteration reaches 10. The interesting thing is that the extracted-subarray for averaging and result of the average are both correct, however, the loop counter can go up to 15, meaning repeating the average calculation 15 times. I do not understand why it can happen. The graph iteration equal to 10 condition can only be met 1 time. How can the baseline offset loop count go over 1 and up to 15?

 

Gu

0 Kudos
Message 3 of 4
(1,958 Views)

My idea is correct

 

0 Kudos
Message 4 of 4
(1,919 Views)