09-01-2022 09:44 AM
I'm sure this is simple for anyone with more LabVIEW knowhow than me (which is probably most of you!)
I need to track production output over a 24 hour period. I have a vi that updates the result graph once per hour. My problem is the x-axis needs to run from 6am to 6am. I can see how I use an offset to create a 6 am start, but if I set it to cover 24 hours the graph wants to display hour 30 as the x-axis max.
Can anyone share a tip for how to get the x axis to go from 06:00 to 23:00 and than on to 0:00 and 06:00? (Appending a picture of the loop I'm using for testing.)
09-01-2022 10:58 AM
An intriguing problem you posed -- how to design a Waveform Graph that has the following Properties:
I don't use Graphs much (my data works better with Charts), and I don't remember (and am too lazy to look up) how to specify the width of a Graph. But I created a Waveform Graph and "by inspection", found that it contained 1000 points, so I'm going to take this as "fixed", for the time being.
Here's what I did, and my reasoning:
One of the things I really like about LabVIEW is how much fun it is to put together a (self-)teaching example, where you make up "known data" and then try to analyze (or plot) it to learn about analysis (or plotting).
Try out what I just described (and did for myself to be sure it would work).
Bob Schor
09-01-2022 12:32 PM
Excellent info Bob, thank you very much. I'd never looked at those time settings before so thank you for showing me how to reach and use them.
I'll tinker around a bit and when I get my routine running I'll be back to mark your answer as 'Accepted'. Or ask more questions. 😉
09-01-2022 01:15 PM
Well, I'm a little embarrassed. I just wrote a little VI to generate a 5-cycle-a-day waveform for 24 hours, 1000 points, and when I wired it into my "constructed" Waveform Graph (oh -- it's a Graph, dummy, you are not familiar with Graphs, just Charts, maybe that's the mistake), it gave me a 5-cycle sinusoid, as expected, but but X axis was not showing Time (it did show seconds, however ...).
Back to the drawing board.
Bob "Close, but No Cigar" Schor
09-01-2022 03:58 PM
Arrrggghhh! It was really easy to drop a Graph and get the X (time) labels to be 7:00 PM, 9:00 PM, 11:00 PM, 1:00 AM, ... 7:00 pm, and I hinted at why it stopped and started at 7 PM (you really don't want to know), but the "easy fix" I envisioned to let you set the starting and stopping time, and the easy of plotting Graph data showed how simple-minded my "clever" approach really was.
Graphs and Charts are really old (meaning not very "flexible" due to 30+ years of "history" and "compatibility"), and (accordingly) have somewhat limited "flexibility" in making the kind to "nice-looking" visual images that you are interested in seeing.
That does not mean that it can't be done, but (at least from my feeble attempts to do it "simply") it may take a bit of extra work to make "attractive".
I'd suggest several approaches:
Bob Schor
09-02-2022 10:50 AM
Bob,
Thanks for the suggestion to check the Idea Exchange. I found a discussion there that seems like it should help: https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Simple-chart-with-time-as-X-Axis/idi-p/1252436#commen...
09-02-2022 01:01 PM - edited 09-02-2022 01:04 PM
@another_novice wrote:
I'm sure this is simple for anyone with more LabVIEW knowhow than me (which is probably most of you!)
I need to track production output over a 24 hour period. I have a vi that updates the result graph once per hour. My problem is the x-axis needs to run from 6am to 6am. I can see how I use an offset to create a 6 am start, but if I set it to cover 24 hours the graph wants to display hour 30 as the x-axis max.
Can anyone share a tip for how to get the x axis to go from 06:00 to 23:00 and than on to 0:00 and 06:00? (Appending a picture of the loop I'm using for testing.)
Here is what I did for tracking daily solar production:
I set my X- axis properties like this:
86400 is the number of seconds in one day
When I launch my program and every night at Midnight I clear the graphs and set their X axis min and max to 12:00AM to 12:00AM with the attached ZeroHour vi.
I also set the X axis increment to 1 hour (3600 seconds)