LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

broken array wire

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.

 

untitled.PNG

0 Kudos
Message 11 of 21
(1,368 Views)
You have to wire a True constant to the Get Queue Status function in order to fetch the elements. By default it returns only the status, not including the actual elements. Please read the documentation on the queue functions.
0 Kudos
Message 12 of 21
(1,357 Views)

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.

0 Kudos
Message 13 of 21
(1,349 Views)

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.

Message Edited by Kevin's on 06-17-2010 12:16 PM
0 Kudos
Message 14 of 21
(1,348 Views)

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.

0 Kudos
Message 15 of 21
(1,345 Views)

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.

0 Kudos
Message 16 of 21
(1,342 Views)

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

Message Edited by Kevin's on 06-17-2010 12:27 PM
Message Edited by Kevin's on 06-17-2010 12:28 PM
0 Kudos
Message 17 of 21
(1,337 Views)

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.

0 Kudos
Message 18 of 21
(1,326 Views)
oooo wow ok Sorry. haha Should have just told you what I was doing from the begining. I will try that. Thanks a lot.
0 Kudos
Message 19 of 21
(1,318 Views)
You could also just use one chart to begin with and have it display 4 plots. A chart (or graph for that matter) is not limited to just one plot. See the examples that ship with LabVIEW. You could then use the checkboxes to control which plot is visible. This latter part has been asked numerous times, and examples have been posted. Search for "programmatically enable plots", or "control visibility of plots", or something similar.
0 Kudos
Message 20 of 21
(1,316 Views)