LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using graph scroll bar and then reading out offset of x scale, how?

Solved!
Go to solution

Hello,

 

I have a problem with a graph.

The maximum of the graph is the current time. x scale auto adjustment is off. The x scale scroll bar is visible.

 

The user should be able to scroll back the graph using the scroll bar during run time, but it does not work.

 

As soon as a new value is being displayed, the scroll bar jumps to the right.

I tried to read out the offset of the x scale via a property node and set the new value of the x scale-maximum to current time minus offset, but that also does not work, because if I read out the offset of the x scale, the offset is allways 0, even if I scroll to the left.

 

How can I read out the offset of the graph, if it is scrolled to the left?

 

Greetings

Johannes

 

LabVIEW 7.1

 

 

 

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 1 of 13
(4,247 Views)

Here is an example of a graph of some data, but there are more problems:

- The data rate is 20/s, but the chart does only display one value/second

- the scroll bar stays on the left side

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 2 of 13
(4,232 Views)

It is getting more and more weird.

 

check out this version. Press the Pause button, start the VI and enjoy  🙂

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 3 of 13
(4,226 Views)

All right, this is a much better version.

The above mentioned problems are still there.

Any help will be appreciated very much!

 

 

Chart_Test.GIF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Message Edited by johanneshoer on 11-10-2009 11:10 AM
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 4 of 13
(4,213 Views)

Couple questions.  Why aren't you using Build Array.  You are using Insert into Array and putting the new value in at element 0.

 

I think there could be a race condition between the updating the data in the waveform chart up top, and the resetting of the scale ranges down below.

 

EDIT:  This reply was based on the VI posted in reply #3.

Message Edited by Ravens Fan on 11-10-2009 12:12 PM
Message 5 of 13
(4,211 Views)

@ Ravens Fan

 

I don't know why I am not using build array. Will it work? I'll try.

 

It was hard work to create that VI. Check out this thread http://forums.ni.com/ni/board/message?board.id=170&message.id=448121#M448121

and you'll see how it developed. I tried a lot of things and this version worked for me. Maybe there is an easier way. If you know an easier way, please tell me.

If the data array becomes large (some thousand values), the execution will slow down. I hope there is a more effective way.

 

 

Chart_Test_13.GIF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 6 of 13
(4,185 Views)

The idea behind this vi:

 

A XY Graph with n Plots (n > 1) needs a 2 dimensional array of clusters of time + value
Right?
So I put all the data in a 2 dimensional array.

 

Since I want to add new data on the right of the graph and delete old data on the left, I found no other solution that doing that with array funcions.

 

You see the "conversion" of the data on the right side of the screenshot? I have to do it, because if I connect the xy graph directly to the data wire, I get an errer "you have connected two arrays of different dimensions" and "you have connected two clusters with different contents"

This conversion probably needs a lot of CPU time, so I'll try to change it, but I don't know how...

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 7 of 13
(4,182 Views)

The idea behind this vi:

A XY Graph with n Plots (n > 1) needs a 1 dimensional array of n clusters of arrays of clusters of time + value.
Right? It is quite complicate.


So I put all the data in such an array.

Since I want to add new data on the right of the graph and delete old data on the left, I found no other solution that doing that with array funcions.

 

You see the "conversion" of the data on the right side in the screenshot in the message above? I have to do it, because if I connect the xy graph directly to the data wire, I get an error "you have connected two arrays of different dimensions" and "you have connected two clusters with different contents"

 

I think this conversion takes a lot of cpu time, so I modified the data wire, so that I can directly connect the XY graph to it, but now I have the problem that deleting and adding new data is a mess.
Please have a look at this version (picture). It became more complicate.

 

Isn't there an easier way to handle data? I could use two wires for the data. That would be fine here, but not in my other VI, where I have 11 plots...

 Chart_Test_14.GIF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 8 of 13
(4,175 Views)

Hi Johanneshoer,

 

I made a quick addition to the graph to include a separate toolbar that connects to be used instead of the offset control.

Of course, you still need to make sure that the scrollbar can navigate the correct range, but this works already for the range of data in your example.

 

The modified VI is attached.

 

Best regards,

0 Kudos
Message 9 of 13
(4,160 Views)

Hi jtag,

 

thank you, but unfortunately I cannot open it, it is made with LabVIEW 9.

I have LabVIEW 7.1

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 10 of 13
(4,154 Views)