LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time based XY graphs code control problem

Solved!
Go to solution

Hello,

I'm Trying to work with two XY time-based graphs.

The data (Y axis) is received in non-constant time intervals (And that's why I use XY graph).

My goal:

The first graph is used as kind of scrollbar for the other, displaying the whole received data over the running time.

The other graph displays an enlarged scope of the data, determined by the location of the first graph cursor location.

 

Well, I did it. But I'm very unhappy with the final result.

1) The block diagram is so inelegant (And I don't mean the mess).

2) For some reason, the second graph does not fill its entire scope.

 

Can you help me with this and find A better solution than I Added?

 

Thank you,

Ran

 

 

0 Kudos
Message 1 of 4
(2,788 Views)
  • Use "built array" instead of "insert into array" to append new data. More natural!
  • Use a single complex 1D array instead of two DBL arrays (xy graphs take complex array and graph RE vs IM automatically). Half the code! Use RE/IM to complex before appending a new complex element.
  • Don't write and read the cursor position in parallel, just read from the scrollbar and branch the wire (eliminate the "read" node for posX.
  • Ultimately, you'll run out of memory.
  • Use the correct datatypes. You have some coercion dots.
  • Sometime cursor.index is better than cursor.PosX. I am sure you can rewrite your code in terms or array indices.
  • ...
0 Kudos
Message 2 of 4
(2,772 Views)

Hi and thank you very much for your fast reply..

1. I replaced the "build array"

2. At first, I replaced the two arrays with one complex array that consists the time element and data element. but as I continued to work, I found that it cannot meet with my later requirement to add a few more plots, functional to the time element.

Iv'e tried to cluster them together, but no luck..

How do i do that?

3. Took care of the cursor's position read.

4. I will buy a new memory card 🙂 I have to see the whole data on the first graph. Hence, use the shift register to hold it.

5. Iv'e corrected the coercion dots.

6. Using a cursor index leads me nowhere. It never changes. Though Maybe I don't really know how to use it.

7. ....

 

Here is my latest sketch..

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

@ran0 wrote:

I found that it cannot meet with my later requirement to add a few more plots, functional to the time element.

Iv'e tried to cluster them together, but no luck..

How do i do that?

 


Use "build cluster array" to combine multiple complex arrays into a xy-graph with multiple plots.

 

 


@ran0 wrote:

 

6. Using a cursor index leads me nowhere. It never changes. Though Maybe I don't really know how to use it.

 


That only works of the cursor is locked to the plot (i.e. it can only be placed on an existing data point, so change the cursor mode. (a free cursor can be anywhere in-between points)

Message 4 of 4
(2,705 Views)