LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

Data logging every 10 seconds

Hi,

I started learning labview in the last few weeks and I would be so thankful if you give me a hand. I want to log data every 10 seconnds. I already checked the solutions with the elapsed-time-function in the forum but it seems that it only works with the Mean VI. Can you please take some of your time and look into this VI ?

best regards

Ezzow

Message 1 of 19
(1,378 Views)

Message 2 of 19
(1,359 Views)

Re: Data logging every 10 seconds

Can you please explain how can I integrate your solution in my Code? I'm new to the whole technology. Thank you so much.

Message 3 of 19
(1,355 Views)

Re: Data logging every 10 seconds

There are a lot of open questions.

• Do you want to only save the current data every 10 seconds?
• Do you want to accumulate data for 10 seconds then save all to disk?
• We cannot tell from the picture anything about the express VI configurations and dynamic data content. Showing such a picture to explain a problem is useless.
• How many points do you get per iteration?
• What is the current loop rate?
• Most more advanced users get rid of express VIs and dynamic data pretty quickly. It's just not flexible enough.

Message 4 of 19
(1,330 Views)

Re: Data logging every 10 seconds

@Ezzow wrote:

Can you please explain how can I integrate your solution in my Code? I'm new to the whole technology. Thank you so much.

Put the Write To Measurement File express VI in the true case as before.

Remove the Elapsed time express VI (the compare of timestamps replaces that).

Message 5 of 19
(1,322 Views)

Re: Data logging every 10 seconds

Thank you @altenbach for your time.

@altenbach wrote:

There are a lot of open questions.

• Do you want to only save the current data every 10 seconds?

I want to save one point every 10 seconds. I mean from all the data between t=0s and t=10s in a loop. Which means I should get one point every 10 seconds.

When I use the same code with the Mean VI instead of the derivative VI (to calculate the average) it works perfectly.

• We cannot tell from the picture anything about the express VI configurations and dynamic data content. Showing such a picture to explain a problem is useless.

I also attached the complete VI in my first post.

• How many points do you get per iteration?

I only simulated a simple Sinus signal with a frequency of 10.1 Hz. I'm not sure how much points it generates per iteration.

• What is the current loop rate?

I'm afraid I can't answer this question. It's a normal while loop.

• Most more advanced users get rid of express VIs and dynamic data pretty quickly. It's just not flexible enough.

I'll try it later with the real data of a thermocouple that I connected to a CompactRio.

Message 6 of 19
(1,290 Views)

Re: Data logging every 10 seconds

Thank you @altenbach for your time!

• Do you want to only save the current data every 10 seconds?
• Do you want to accumulate data for 10 seconds then save all to disk?

I want to save one point every 10 seconds without causing any delay to the original signal. In addition I want to be able to change this time interval anytime. Maybe to save one point every 2 seconds .. The thing is that the same code works perfectly when I put a Mean VI (to calculate the average) instead of a derivative VI like the one on the picture.

• We cannot tell from the picture anything about the express VI configurations and dynamic data content. Showing such a picture to explain a problem is useless.

I also attached the original VI in my first post. Maybe it does answer this question ? 🙂

• How many points do you get per iteration?
• What is the current loop rate?

I'm afraid I can't answer these two questions. I only generated a simple sinus signal using the signal simulator (Express - Input - signal simulator).

• Most more advanced users get rid of express VIs and dynamic data pretty quickly. It's just not flexible enough.

Well, I'm just testing with the signal simulator. My real data comes from different sensors which are connected to a CompactRio system. I don't no if there is a big difference to log data between the signal simulator and the real data.

Message 7 of 19
(1,296 Views)

Re: Data logging every 10 seconds

@Ezzow wrote:

• How many points do you get per iteration?
• What is the current loop rate?

I'm afraid I can't answer these two questions. I only generated a simple sinus signal using the signal simulator (Express - Input - signal simulator).

I cannot open Vis in LabVIEW 2021. If you would "save for previous" I could look at your express configurations. "Simulate signal" has plenty of configuration options (samples/second, # of samples, run as fast as possible vs. simulate timing, etc.) Since you configured it, you must know it! For example, you cannot take the derivative of a single point. Right (unless you use a ptbypt tool)

Message 8 of 19
(1,286 Views)

Re: Data logging every 10 seconds

It's working now with the same code I had at first 🤔

However, I'm facing another problem now. The function ''write to measurement file'' is not working as I acquired the real Data from an my RTD sensor using a CompactRio-9047. In other words I don't get my Data saved in any folder in the computer. I also read that CompactRio system must have its own storage space. Could you give me a hand ?

I also don't understand why my signal isn't appropriately derivated. Normally I should get for a linear function after the derivation a constant one. However, it's not the case. Does LabView derivate in other ways or did I mess something?

I also attached the code I used.

Message 9 of 19
(1,196 Views)

Re: Data logging every 10 seconds

@Ezzow wrote:

I also don't understand why my signal isn't appropriately derivated. Normally I should get for a linear function after the derivation a constant one. However, it's not the case. Does LabView derivate in other ways or did I mess something?

The input seems to be a sine, the derivative is a cosine. Looks right to me.

Message 10 of 19
(1,182 Views)