01-05-2026 09:05 AM - edited 01-05-2026 09:24 AM
I have a LabVIEW VI that opens a REST client and, inside a While Loop, sends multiple HTTP POST requests to read data from sensors. The responses are converted to numeric values, displayed on charts/indicators, and logged to an XLSX file using Set Dynamic Data Attributes and Write To Measurement File, with the loop rate controlled by a Wait (ms). For timestamps I use Get Date/Time In Seconds that links to each of the Set Dynamic Attributes. The charts and displays appear to update correctly, but there are problems with the Excel logging. When the update rate is set higher than 1 sample/s, the saved magnitudes are wrong and are only correct at exact 1-second points (1 s, 2 s, 3 s, etc.); the values in between are incorrect. When the update rate is set to 1 sample/s, the values are initially correct, but after ~30 minutes the effective time interval starts drifting above 1 s. This looks like a buffering, timing, or logging issue rather than a sensor problem. I’ve attached the VI and would appreciate advice on how the VI should be restructured so that the values and timestamps written to Excel are correct and stable over long runs and at higher update rates.
I am also attaching the vi where I tried to implement the buffer using the Feedback Node and Case Structure. However there is a problem as the Case Structure is never executed as the buffer at the start is 0.
Solved! Go to Solution.
01-05-2026 09:38 AM
In short, the most probably cause is that data is building up and too many actions in the same loop is causing slow down over time due to data size.
And, by the looks of your implementation, you're a beginner and an important tip is to build structured and modular code and not a ginormous VI (typically the content of block diagram shouldn't take scrolling on a FHD display) and your code requires a lot of scrolling even on a 2k display.
A way to make your code readable and debug friendly is to implement this as producer-consumer, where the REST calls are in the producer, data processing and logging happens in the consumer loop.
01-06-2026 05:56 AM - edited 01-06-2026 05:58 AM
I've created Producer-Consumer loops but it does not trigger the acquisition. I moved the Write To Measurement File vi into the consumer loop and I added Queue functions.
The app starts and display data just fine, but the dialog to chose the file that I want to save into does not appear.
01-07-2026 03:32 AM
I found what the problem was.
The Error Out from the producer Enqueue Element was fed into the Write To Measurement File's Error In, that is inside the consumer loop. Removing this wire solved the problem with the loop not starting.
01-07-2026 06:12 AM
Hi Stan,
@stan_k_112 wrote:
I found what the problem was.
So you learned about "THINK DATAFLOW!", the very basic principle in LabVIEW? 🙂
01-07-2026 01:22 PM
@stan_k_112 wrote:
I found what the problem was.
The Error Out from the producer Enqueue Element was fed into the Write To Measurement File's Error In, that is inside the consumer loop. Removing this wire solved the problem with the loop not starting.
Sounds fishy to me. It sounds like you created a race condition that you are winning... so far.