LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Logging challenge

Solved!
Go to solution

Oh, thanks a lot Ravens fan, you said something about circular buffer. Am I to implement it using arrays? Also, how is that going to guarantee that the trigger event would result in lossing 10  seconds old data?

 

Its a bit of magic for now.

 

Thanks for the great assistance.

0 Kudos
Message 11 of 24
(1,474 Views)

Oh, thanks a lot Ravens fan, you said something about circular buffer. Am I to implement it using arrays? Also, how is that going to guarantee that the trigger event would result in lossing 10  seconds old data?

 

Its a bit of magic for now.

 

Thanks for the great assistance.

0 Kudos
Message 12 of 24
(1,474 Views)
Solution
Accepted by topic author maxidivine

Yes.  Use arrays to store the last 10 values in a circular buffer.

 

See attached.  There are two queues, two consumer loops.  One for each type of file.

0 Kudos
Message 13 of 24
(1,462 Views)
Once again Ravens fan, thanks a lot for schooling me there. No more sleepless nights as far as that is concerned. The logging VI is for simulated signals that should be store. Now I am not using DAQ or acquring any signals at the moment, I am simulting all of them by generating the values myself. can I handle issues like sampling rate and the number of samples per second that I collect solely from the producer loop by specifying a delay time and do I take into consideration system health, relating to overheads on memory as a result? The system is a 2g ram system.
0 Kudos
Message 14 of 24
(1,455 Views)

Thanks Ravens fan,

 

I am putting the bits of VI together, the logging one to begin with. In the VI attached, I used sequence structures. This was because task '3' (in the sequence) is supposed to finish before task 5 starts to run. The drawback is that the loop at '3' must finish before progress to the next sequence and the data from all the sequence must be logged real time, the same time.

 

Am I to use producer/consumer architecture just like the data logging  VI to ensure that all the data gets logged at the same time because with the current set up, the speed value at 3 would remain constant after the loop at 3 ends.

 

I need an assistance so I can include the logging VI to the main VI.

 

Thanks a lot.

0 Kudos
Message 15 of 24
(1,438 Views)

Yes.  Use Producer/Consumer again.  Your data logging consumer loops would be separate underneath your current sequence structure.  You would enqueue the data into the two queues wherever the data is coming from in the sequence structure.

Message 16 of 24
(1,430 Views)

Thanks a lot for the advice. This is where the problem lies. The way the sequence struckture is configured, sequence '3' has a loop which increases the speed. The loop stops when a certain value of speed is reached and control is passed to further sequences. At some future point however, the speed value should be brought down lower.

 

The producer/consumer would not be able to log the points where the speed increases initially at sequence 3 since the loop must complete before control is passed out of the sequence.

 

Is there a way I can reduce the speed as well, even after control has been passed to sequence '5'?

 

Thanks for your time.

0 Kudos
Message 17 of 24
(1,414 Views)

Hi, thanks for all assistance.

 

The reset button(switch when pressed), when pressed, sets the scale to 0. The scale reads 100 (full) normally. Data is logged to the main log file (data1.txt) continuously.The trip button (latch when released) creates a trip file (data2.txt) with data 10 seconds before and after the trip button is pressed.

 

Two challenges:

 

1. I have challenge making the reset button and the trip button performing the same function of creating the trip file when either of them is pressed. When I use 'latch when released' action for the reset button, it sets the scale to 0, it goes back to 100. I linked the trip button and the reset button with an 'Or' gate but the trip file functionality changed.

The task is: When the reset button is pressed (instead of the trip button), the scale should be set to zero (and stay 0) and at the same the trip file should be created and populated. The trip button should create the same trip file as usual when pressed (instead of the reset button).

 

2. I would like the main log file (data1.txt) to run for 12 hours (43200 secs) (creating 43200 records) and after that, the file should get cleared and the data logging started all over gain in the same file (cyclic logging).I had trouble achieving this without ending the VI.

 

0 Kudos
Message 18 of 24
(1,381 Views)

Hi, I still have this challenge with cyclic data logging.

 

Assistance please.

 

Thanks a lot.

0 Kudos
Message 19 of 24
(1,326 Views)

Hi all,

 

Thanks for your assiatance. I still have these two challenges and I haven't got any response from anyone yet. I would appreciate an idea as to how I can tackle them.

 

Thanks.

0 Kudos
Message 20 of 24
(1,287 Views)