03-18-2015 10:18 AM
this what the waveform chart looks like, it doesnt move forward it just stays there blinking... I set the offset to 1870 and the multiplier to 1, and used a double IM Power dBm as the chart input
03-18-2015 10:26 AM
03-18-2015 10:37 AM
Okay, first some questions...
How are you supplying data to your chart? Is your chart control inside a loop being fed with one data point at a time, or is it outside the loop being fed an array of values, or a waveform, or what? (If "it doesn't move forward" I can only assume you are only supplying it with one data point).
Can you reproduce the errant behaviour in a little 'noddy' vi (a temporary vi that just does one simple little thing so you can try out a concept, like the vi I posted earlier). You will probably find that if you write a little noddy with a chart and some dummy data and use the same update structure as your main vi, you will suddenly see why it isn't working. If you can get the temp one working, you can look and see how it differs from your main vi. If your temp one does the same as your main one, you can post it here and we can take a look and probably help.
Stu.
03-18-2015 10:47 AM
I am just writing IM Power to the chart using a shift register inside a while loop to keep the data acquisition continous, the main vi is really extensive and what I am showing is like half of it but you can ignore all of it and check the black frames
03-18-2015 10:51 AM
Edu.
This is the actual link, sorry it was my mistake.
http://digital.ni.com/public.nsf/allkb/18B56D8556D44BF18625753D006EFF7C?OpenDocument
03-18-2015 10:53 AM
Thanks David, I'll give it a try
03-18-2015 11:22 AM
Does this loop just run once (ie. one sweep from 1870 to 1900) or does it keep repeating?
What is your chart history length set to?
The way you have it at the moment, you do not need the shift register. Since it is just a single double you are adding to the chart each time, the chart will keep its own history. All your shift register does is just delay the update until the next loop iteration.
The Offset/Multiplier/Max values should be set outside the loop - I just tried this and setting them inside the loop every time screws things up when the chart fills up (not sure why at the mo but it does!)
03-18-2015 11:29 AM
Yes I know I do not need the shft register I was trying another approach before and I just forgot to delete it, the loop keeps repeating... and every iteration sets a point on the chart... the history is set to 30, and I just moved the Offset and range values outside the loop... the only problem I have now is that the x axis does not stay in the range (1870 to 1900) it just keeps incrementing.. but the plot is behaving like it should, which is great, almost there...
03-18-2015 02:19 PM
Thats because, as far as the chart is concerned, you are just adding more and more points to the end of the trace. If you do your last measurement at 1900 and go back and take another one at 1870, the chart has no concept of that - it just adds the new data point to the end of the buffer (because as a chart it takes only Y values and assumes the X value is just the next data point in the sequence).
If you want to keep updating the sweep over and over with the same x values then you will need to handle things differently. Similar to the XY chart example, I would keep an array of the 30 data points and update the array, then feed the entire array to a waveform graph. You don't get the fancy sweeping vertical line that you get with a chart in sweep mode, but otherwise its close enough.
This little noddy shows the idea using a waveform graph and two plots.
03-18-2015 03:50 PM
Hi,
the issue with the x axis continues, and now the VI creates 30 plots instead of 2... as you can see both plots are set to display IM Power.. but instead of getting 2 , I am getting 30... which makes no sense cause' I believe it is wired just like your VI ... and the X axis continues to increment.. is it because the chart needs to be inside its own cycle?