From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NEED CHART WITH 1-MINUTE TIME X AXIS

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!

0 Kudos
Message 1 of 18
(1,436 Views)

@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.

0 Kudos
Message 2 of 18
(1,385 Views)

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.

0 Kudos
Message 3 of 18
(1,372 Views)

Most people don't yet have LabVIEW 2021, so please "save for previous" before attaching. Thanks.

0 Kudos
Message 4 of 18
(1,361 Views)

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".

pnCapture.PNG

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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 18
(1,346 Views)

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.

Download All
0 Kudos
Message 6 of 18
(1,323 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 18
(1,316 Views)

@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.

========================
=== Engineer Ambiguously ===
========================
Message 8 of 18
(1,307 Views)

Thank you for answer  @

 

 

@ 

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!

0 Kudos
Message 9 of 18
(1,286 Views)

@Mojmalije1. wrote:

Thank you for answer  @

 

 

@ 

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

========================
=== Engineer Ambiguously ===
========================
Message 10 of 18
(1,281 Views)