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: 

Data in buffer

Currrently i am working in an application which require to store data in buffer continously and parallely monitoring for an alarm to occur once alarm occurs it should record the 5 Sec prior data before the  alarm triggers and post 5 Sec data in a file. What will be the best method to follow. How to handle buffer size.
0 Kudos
Message 1 of 6
(2,602 Views)

Hi srinivas,

you can use a buffer with a fixed size. Use it as an endless buffer. Start at 0 and write til the end, if you are at the end start with 0. You need a buffer which can store the data of 5 sec. If the alarm occurs you can add the additional data to your buffer and store it to a file.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 6
(2,591 Views)

Hi there

 

Several solutions. my favorite one:

 

Use a Functional Global Variable (an uninitialized shift register in your while loop to hold the array data), add the scalar data at the front of the array and then resize the array to the size needed to store 5 secs of data. Pass the scalar data also to a chart graph for display. To save the last 5 secs of data take the whole content of the array and write it to disc.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 3 of 6
(2,588 Views)

If possibe can you send a small VI .

0 Kudos
Message 4 of 6
(2,579 Views)

 

i'll send a VI tomorrow

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 5 of 6
(2,572 Views)

 

Hi there

 

here's the VI. Remember, it's just a suggestion, there are other ways to implement this (e.g. queues).

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 6 of 6
(2,540 Views)