11-10-2009 07:06 AM
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
Solved! Go to Solution.
11-10-2009 09:07 AM
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
11-10-2009 09:57 AM
It is getting more and more weird.
check out this version. Press the Pause button, start the VI and enjoy 🙂
11-10-2009 11:08 AM - edited 11-10-2009 11:10 AM
All right, this is a much better version.
The above mentioned problems are still there.
Any help will be appreciated very much!
11-10-2009 11:12 AM - edited 11-10-2009 11:12 AM
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.
11-11-2009 03:40 AM
@ 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.
11-11-2009 04:04 AM
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...
11-11-2009 05:02 AM
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...
11-11-2009 10:29 AM
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,
11-11-2009 11:55 AM
Hi jtag,
thank you, but unfortunately I cannot open it, it is made with LabVIEW 9.
I have LabVIEW 7.1