10-21-2021 08:52 AM
Hi guys,
I am reading and logging measurement from PV plant (from inverters) every minute. Everything works well with reading and logging data. But when I make UI I need to show my data in real time, every data on own chart and with real time x-axis. I tried it on waveform chart where I need upload my measurement every minute but I have many problems with time axis and manipulating with offset, multiplier, etc.
I think that I need really simple thing, but I cant make it.
If you have some example for chart with x axis in real time and collecting data every minute (something like attachment picture, but for one minute) i will be soooo thankful!
10-21-2021 11:11 AM - edited 10-21-2021 11:12 AM
@Mojmalije1. wrote:
I tried it on waveform chart where I need upload my measurement every minute but I have many problems with time axis and manipulating with offset, multiplier, etc.
I think that I need really simple thing, but I cant make it.
Unless you show us what you tried, we cannot tell what you are doing wrong! What's the datatype of the signal (scalar, dynamic, etc.)
Multiplier and offset should only be set once at the start of the program. Offset to current time and multiplier to 60. Time axis style should be absolute time.
10-21-2021 02:56 PM
Thanks for you answer!
I upload my .vi which I use for UI. In cases 60 and 63 there are charts and property nodes, so if you have some advice how to show data on chart continiously every minute.
10-21-2021 08:16 PM
Most people don't yet have LabVIEW 2021, so please "save for previous" before attaching. Thanks.
10-21-2021 11:21 PM
I can't open your sample either but here is how I use the chart property node to set it
This probably looks a little different because the is part a sub-vi that initializes a bunch of charts and uses references so the Property Nodes are "strict".
Clear the chart History
X-Scale Multiplier is the log interval in seconds.
X-Scale offset is set to the current time
Remember to turn off the X-Axis auto scale.
10-24-2021 09:28 AM
I did the same thing but I have problem as you can see on uploded picture. The real time and time on the chart is not the same. Also, new colleced measurements don't matched with real time measurements.
10-24-2021 10:58 AM
Hi Mojmalije,
@Mojmalije1. wrote:
The real time and time on the chart is not the same. Also, new colleced measurements don't matched with real time measurements.
Because you fiddle with XAxis gain/offset in each iteration, but you shouldn't…
Btw. do you really think it's a good idea to have a case structure with 72 cases? And not to cleanup the whole code to use atleast straight wires?
10-24-2021 12:02 PM - edited 10-24-2021 12:47 PM
@Mojmalije1. wrote:
I did the same thing but I have problem as you can see on uploded picture. The real time and time on the chart is not the same. Also, new colleced measurements don't matched with real time measurements.
Oh, I should have said that you only have to do this once at startup to initialize the graph, not every time you write to the graph.
If you set the X-Axis "Zero" (X-Scale Offset) to the current time and your data uses the current time when the data was acquired as their X-Axis then all the data should line up properly.
I could look at your code at home on LV2020 Community Edition. It looks like you were trying to make a State Machine but you have basically made a Stacked Sequence instead.
I have set up a monitoring system for a grid tie solar system before that literally ran for years in our lab collecting data at sometimes one second intervals. Every day at Midnight I would save my data file, clear my charts, preset the X-axis from midnight to midnight, and open a new data file for that day. I would show you an example but I am not at work now and won't be for two weeks.
10-24-2021 05:15 PM - edited 10-24-2021 05:32 PM
Thank you for answer @GerdW
@ RTSLVU
I put it now outside of the while loop. Is this okey now? (I cant simulate in this moment because I am not in laboratory)
I dont understand what mean to set X Axis Zero. If you could put your example because from your describe I need something similar. My program will be shown for visiters to see how power and energy of PV system change during the day so it is okey if I put data from midnight for midnightt.
So if you could put it example as soon as you can, , I will be very very thankful to you!!! I spent many days trying to make this and it starts to be frustrated little bit.
Thank you!
10-24-2021 07:22 PM
@Mojmalije1. wrote:
Thank you for answer @GerdW
@ RTSLVU
I put it now outside of the while loop. Is this okey now? (I cant simulate in this moment because I am not in laboratory)
I dont understand what mean to set X Axis Zero. If you could put your example because from your describe I need something similar. My program will be shown for visiters to see how power and energy of PV system change during the day so it is okey if I put data from midnight for midnightt.
So if you could put it example as soon as you can, , I will be very very thankful to you!!! I spent many days trying to make this and it starts to be frustrated little bit.
Thank you!
I wish I could but I am on vacation for two weeks. But I might have posted an example or two from that program as this type of question comes up all the time.
About setting the X-Axis "zero" to the current time. Think about it, "zero" is the beginning of the X-Axis (and Y-Axis) If you wanted the X-Axis to be relative time "Zero" would actually be 0 seconds and each "minute mark" would be at 60 second intervals. So if you want your X-Axis to be in Absolute Time then the X-Axis "Zero" would have to be the time when the program is launched (the current time).
I will look at my old posts and see if I can find a better example