LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart X axis--Current time

Solved!
Go to solution

NIquist,

THANK YOU!  Someone has finally given me the answer on the crazy date code!  But, seeing as how we are now in the 21st century, shouldn't we....never mind!

I have used the code examples you gave me to get my vi doing exactly what the shop super wants.  I don't need to worry about sampling rates.  I sample the data to the screen every 5 seconds, but I only write the data off to the server every 5 minutes.   86400 seconds later, the file is closed and a new daily file begins.

Regards,

Ron

0 Kudos
Message 41 of 55
(1,460 Views)

NIquist,

I hope you don't mind, but I made a necessary modification to your vi.  I put in a shift register to take the 'end time' entry back around to the 'X scale offset and multipler', so now when I use your 'end time' selection, it automatically updates to give me my 24 hour window!!!!!! Thanks!!!!!!!!!

0 Kudos
Message 42 of 55
(1,459 Views)

rwbrook@integratedps.com wrote:

NIquist,

I hope you don't mind, but I made a necessary modification to your vi.  I put in a shift register to take the 'end time' entry back around to the 'X scale offset and multipler', so now when I use your 'end time' selection, it automatically updates to give me my 24 hour window!!!!!! Thanks!!!!!!!!!


Hey, nice idea.  And of course I don't mind if you modify my posted code.  That's what this forum is all about! Smiley Happy

Glad you got eveything working.

 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 43 of 55
(1,451 Views)

NIquist,

Can't figure it out.  Here is my vi.  The data input is from FieldPoint front ends, so you might have to put a couple of 'dice' on the inputs.  I transferred over the code from your example, checked every property setting and still have bogus times and dates.  If you have 5 and can give it a look, it would be much appreciated.  If any of it looks like a good idea to you, please feel free to use it.

The main purpose of this vi is to monitor three ovens on my shop floor.  The screen update is 5 seconds.  The data 'save' interval is 4 minutes.  New file starts every 24 hours.  The three ovens use natural gas and I estimated the gas usage for the afterburners as well as the main oven burners.  This data is tabulated and stored with the temps.  The software has been running successfully for 5 years, but the shop foreman asked for the time along the x axis.  That's what started all of this!!!

Oh by the way, another neat feature:  If the shop foreman clicks on the 'Oven Watch' button, the software sends a jpg of the oven chart every 30 minutes to my smartphone so I can monitor the progress of the burn.

Regards,

Ron

PS - You get to guess why the 'save' interval is 4 minutes.

0 Kudos
Message 44 of 55
(1,443 Views)

Just had time for a quick look but I suspect that you have data in the chart's history that's confusing things.  Try setting the History data property to empty arrays like I did with the property node before to loop in my example.  You could put the nodes in your "NewFileName" state since it runs first.  Clearing the chart like that is always a good habit when you're using charts to display long time-frame data.

 

You can also clear a chart history at run-time by right clicking on the chart > Clear Chart or in dev mode by right-click > Data Operations > Clear Chart.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 45 of 55
(1,434 Views)

NIquist,

I am embarrassed to ask.  I have tried and tried to understand (including looking up examples), on how to add a plot to a chart by increasing the array size in the 'history' vi.  Can't get it done.  I used your example chart and it worked great except I need four plots.  Again, could not get it done.

Ron

0 Kudos
Message 46 of 55
(1,431 Views)

I also tried to clear the data from the chart, both before running the vi and also while running.  It clears the data, but the time and dates are still out to lunch.  I can't believe this.  Your vi example runs like a dream.  Obviously (well for some of us, no so obvious) my vi is changing things.

Ron

0 Kudos
Message 47 of 55
(1,418 Views)

Hmmm, I'm at a loss to understand why your system would be different from mine.  Your code seems to work fine for me (but I didn't really run it for any length of time so maybe I'm missing something).

 

As far as changing the number of plots goes, you don't want to "Add Dimension" to the array to increase its size.  It's a constant made of a cluster in a 1D array so you just have to erase and replace it.  If you just right-click on the word "History" in the property node for the chart you can select Create > Constant and it will automatically create the appropriately sized constant.  Remember that if there's currently data in the chart the constant will have that data so you will have to clear it by right-click > Data Operations > Empty Array.

 

 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 48 of 55
(1,405 Views)

NIquist,

Thanks for teaching me how to create the array to clear the history.  I am still getting changing times and dates that make no sense.  So I have tried to dummy it down.  I create a time stamp that is the starting date and time of the file.  All I want to do is take that time stamp and add 24 hours to it,create another indictor and place it on the lower right side of my graph.  I know the number of seconds in 1 day is 86400.  Can't figure out how to add that to the starting time stamp.  I tried unbundling the 'current time' vi, adding 1 day to the 'day', nothing going.

Ron

0 Kudos
Message 49 of 55
(1,387 Views)

Niquist,

Found my mistake.  I was starting a new file every time instead of looping back to the aquire portion for the 86400 seconds.  So here is where I want to be.  I want to call for the present time and date from the computer and attache that to a 'X min' property node.  Then, add 24 hours to that and attach it to an 'X max' property node.  Shouldn't that work?

0 Kudos
Message 50 of 55
(1,381 Views)