LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data logging every 10 seconds

Solved!
Go to solution

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 ? 

 

Ezzow_0-1649773045918.png

 

 

best regards 

Ezzow

0 Kudos
Message 1 of 19
(1,391 Views)

wiebeCARYA_0-1649775251516.png

 

0 Kudos
Message 2 of 19
(1,372 Views)

Thanks   for your time. 

 

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

 

 

0 Kudos
Message 3 of 19
(1,368 Views)

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,343 Views)

@Ezzow wrote:

Thanks   for your time. 

 

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

0 Kudos
Message 5 of 19
(1,335 Views)

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. 

 




0 Kudos
Message 6 of 19
(1,303 Views)

Thank you @altenbach for your time! 

 

I'll try to answer your 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?

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. 

 

0 Kudos
Message 7 of 19
(1,309 Views)

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

 

 

0 Kudos
Message 8 of 19
(1,299 Views)

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 ? 

Ezzow_0-1650357491438.png

 

 

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. 

 

Thank you for your time.

0 Kudos
Message 9 of 19
(1,209 Views)

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

0 Kudos
Message 10 of 19
(1,195 Views)