06-17-2010 11:16 AM
So I have the elements entering the queue but I am still doing something wrong.. Is this how to get the elements out to an array? Because it shows that nothing is in the array when I run it but the elements are there.
06-17-2010 11:48 AM
06-17-2010 12:12 PM
Something doesn't seem right about writing the history of the velocity chart back to the velocity chart. I'd have to experiment to be sure, but wouldn't that just double up what you are showing? Let's say your history was a single cycle of a sine wave, writing that history back to the chart would then show two cycles of a sine wave.
06-17-2010 12:12 PM - edited 06-17-2010 12:16 PM
ah ok I got that. but I am still doing something wrong. Only an array of 1 element is comming out when I want an array of all the elements(up to 5 min) coming out constantly.
Also I am not writing to the chart and history. Only the history so there would not be the double up.
06-17-2010 12:16 PM
To be honest, I was responding directly to your question. I don't really understand what you're trying to do with queues here, and you haven't shown the rest of your code. You're enquing only one element, so obviously the queue will only return an array of one element. What else did you expect?
A chart has history, so there's no need to use a queue in the first place. If you wire the DBL value to the chart it appends it to the history. It sounds to me like what you really need to do is to simply set the history depth of the chart based on how much data you want the chart to display. That depth would be based on your sampling rate, and your desired window size.
06-17-2010 12:23 PM
Kevin's wrote:
Also I am not writing to the chart and history. Only the history so there would not be the double up.
In the top part of your screenshot, you are taking from the queue and writing to the history. In the bottom, you are taking from the history and then writing to the chart which will thus add a whole other set of history into the chart. There could be a race condition depending on whether the top history writing or the bottom chart writing occurs first.
06-17-2010 12:26 PM - edited 06-17-2010 12:28 PM
ok to explain exactly what I am trying to do...
I have 4 different measurements of data coming in at 10hz. I have it so they are on 4 charts and display 5 min of data.
But what I am trying to do now is get it so I have 1 chart and have it so I can click a radio button to display which measurement I want to see graphed. So I need all of the measuerments being saved in different historys so when I click on the button to display the certain measurement the 5 min history is loaded and the measurement such as velocity is immediately shown on the chart and it continues to up date.
I thought using a queue would be good to do this, but I am new so I do not know.
Sorry for not being clear at the begining
Also I understand now what you mean that it is writing twice
06-17-2010 12:37 PM
Write each one to 4 charts. You don't have to show them.
Then based on the radio button, write the history of the selected chart to the new 5th chart.
06-17-2010 12:42 PM
06-17-2010 12:45 PM