12-05-2017 11:58 AM
Yep, that will do it!
My coding "standard" for parallel loops is to stack them vertically, emphasizing their parallel nature. When using Channel Wires to pass data between loops, I go ahead and "violate" the "Run Wires Straight, Left-to-Right" rule and make them "Square Z shaped" (right, down, left, down, right) to (a) exit the top loop, (b) go down to the space between the loops, (c) go past the left edge of the lower loop, (d) drop down, and (e) enter the lower loop). I figure that Channel Wires ("Pipes") are distinctive enough that this is an easily-explained "exception".
Bob Schor
12-08-2017 02:48 PM
First, thanks to Bob for pointing this out. Second, it seems absurd to me that we have to experiment with this most basic element of LabVIEW to learn how to use it properly. I have struggled with an X scale issue for a long time, and through experiments, found how to change the X scale most of the time. I even submitted a service request a couple of years ago to try and figure this out. That supposedly led to an R&D bug report, but no idea what happened to that.
Just did another experiment today and not only set the Max and Multiplier twice, but also the Minimum and Offset. This appears to make the X scale change in the way you would expect.
Why would National Instruments not tell us about this strange requirement when working with property nodes? Would save users a lot of time to know this up front instead of having to probe the Waveform Chart like it is a black box.
There, I feel better. But I do hope someone at NI reads this.
12-09-2017 01:29 PM - edited 12-09-2017 01:31 PM
Actually, I think I know the answer, and it is not entirely NI's fault (except they could point this out and suggest the "Do It Twice" trick that I stumbled upon -- if nobody else claims priority for pointing this out, I suggest calling it "The BS Trick" ...).
I once tried to work out how the various properties interacted. I actually wrote down an equation that contained Min, Max, Offset, and Multiplier as parameters, Data (the value being plotted) as the Input, and X (the value in "Graph Units") as the output. I'm not about to do it again, for fear of hurting myself, but you'll find that since there are 4 parameters, the system is "over-specified" (it is basically a linear equation, which has two parameters) and if you change them one-at-a-time (which is how Property Nodes work), the order matters. I recall writing a note to myself about 8 years ago (who knows where it is now) where I figured out what to do first in a particular situation -- I don't think I had yet stumbled on the Vincent Twice trick yet ...
Bob Schor
12-11-2017 08:10 AM
"The BS Trick" it is! Thanks for elaborating on this and sharing what you've learned. Very helpful.
04-25-2018 12:20 PM
Hi Bob,
Just wanted to elaborate on this question a little further as I continue to develop. I have noticed that my waveform chart will only display about a second of data and I have not been able to increase this any further. I have it set up as a strip chart and basically want to show a few seconds of data regardless of the collection trial length. Any advice here? The properties we modified haven't allowed me to alter this (or maybe I am unaware of it).
Thanks,
Anton
04-25-2018 01:12 PM
Well, there's some interaction with number of points, time per point, X min, X max, X scale factor, etc. Did you try to set up a little Simulation routine where you know the data being presented, you can vary the parameters of the data, and you can also set the various parameters for the Chart? I'm currently not wearing my glasses, so I can't see the block diagram of your VI that you have displayed on your screen to understand what you are doing ... [that's not a serious statement, but, it is true, I am not wearing my glasses].
Bob Schor
04-26-2018 12:04 PM
Hi Bob,
The picture is actually one you posted 🙂
I have played around but can't seem to manipulate the chart's x-axis. I basically want the chart to adapt to the user's values for sampling rate and duration, and display a few seconds of data instead of 1. They would be collecting biopotentials so it would be useful to see an entire waveform (e.g. ECG cycle).
For this sample application, I am sampling at 2048 Hz and collecting for 10s. Let's say I want to have my strip chart display 2s of data - I set my multiplier = 1/2048 and X Maximum = 2048*2. This I thought would display 4096 data points but if I export the data to excel it is only 1024 points. I changed the chart history length to 2048 and now it displays 2048 points but the X-axis doesn't make sense to me - it just shows an increment of 1 (and I am not even sure what the x scale in this case represents).
04-26-2018 02:14 PM
Chart History Length describes (I believe) the size of the internal Chart buffer so you can "scroll backwards". As a practical matter, you only have so many pixels on your screen, so it may not make sense to display every point (plus that will slow down the plot).
If you are referring to my Chart Demo shown in the Solution, I just ran it with a 10 Hz signal sampled at 100 Hz, 100 samples at a time, with X Max of 200 and X Mult of 1. It paint two sets of samples, and the X axis increments by 200 (I configured it as a Scope Chart). If I make it a Sweep Chart, it is much less satisfying to view because it scrolls and I can't see any detail (not to mention every pixel needs to update each time a new one is added).
Bob Schor
04-27-2018 02:21 PM
Hi Bob,
So if I understand correctly, altering the Chart History Length is not the solution I am looking for ...?
Do you have any suggestions on how I could alter my program to display 1) as a strip chart, 2) show between 2-5s of data, and 3) reflect # of samples along the X axis?
Thanks in advance,
Anton
04-27-2018 03:25 PM
@atrinh wrote:
Do you have any suggestions on how I could alter my program to display 1) as a strip chart, 2) show between 2-5s of data, and 3) reflect # of samples along the X
My suggestion is don't do that!. Run my demo. Leave the sampling rate and sample size at 100, change the X size to 200, and run it. Looks nice, correct? Now change the chart type to a strip chart. Run. Looks awful, correct?
Try it again with a higher sample rate of 500, X size of 500. Now you're getting close to plotting "too much data". Set X size to 1000 -- now it's really too much, even in Scope mode.
Higher sampling rates will be even worse!
The trick is to not plot all the data, especially if you use a strip chart. Strip charts "look nice" when updated at 20-50 points/second, which you can do by "decimating" your data before plotting it. If you plotted one point in 100, you'd be plotting 20 points/second. You can also average 100 points and plot the mean, or the median, or the max, or the min (or all four).
Bob Schor