08-25-2025 03:27 PM
Hello. I'm trying to measure current, but it keeps dropping periodically on the waveform chart. Any ideas on how to fix this?
08-25-2025 04:51 PM
Maybe it's telling you the truth.
08-25-2025 05:08 PM - edited 08-25-2025 05:14 PM
@rsr_17 wrote:
Hello. I'm trying to measure current, but it keeps dropping periodically on the waveform chart. Any ideas on how to fix this?
The zero-phase filter is designed for offline analysis. From the function help:
...With a zero phase filter, the output sequence Filtered X has no phase distortion. Although the zero phase filter is non-causal, it is useful in offline applications such as filtering a sound file saved on disk.
You will get the expected filtered output on your chart if you apply a continuous low-pass Butterworth filter using the waveform conditioning VI:
When debugging future issues, search for the first block that produces unexpected outputs when fed expected inputs.
When posting to the forums, please upload a simple VI that reproduces the issue. Save the VI with typical data saved as default value(s) - that way we don't need hardware to help.
08-25-2025 05:55 PM - edited 08-25-2025 05:57 PM
We typically don't debug images, so for better help, attach your VI. Save for previous, 2020 or below, and make sure all controls have typical default values.
From the code picture alone, we can tell that you don't have much experience with LabVIEW, Maybe once you clean up the code, other things might fall into place.
08-26-2025 08:56 AM
08-27-2025 04:32 PM
Great point. I attached the VI. I also don't have much LabVIEW experience, so your feedback is greatly appreciated. See below in blue for answers to your questions.
08-28-2025 07:30 AM
Based on your answers, I updated your VI:
Key changes:
Question:
Are you measuring current or voltage? Your code adds a voltage channel to the DAQmx task. Do you need to scale voltage to current? Even if you have a shunt resistor of 1 Ohm, I would add the scaling, so that it is explicit in the code.
Good luck!
08-28-2025 10:17 AM - edited 08-28-2025 10:18 AM
dsb@NI wrote:
Based on your answers, I updated your VI:
As much as I request including the VI with forum posts, I should have attached the updated VI, so here it is.
08-28-2025 10:43 AM - edited 08-28-2025 10:53 AM
@rsr_17 wrote:
Great point. I attached the VI.
You did not use "save fore previous" as requested and attached a 2025 version, thus I cannot look at your VI.
08-28-2025 10:52 AM
@rsr_17 wrote:
- If you only want one channel, why are you reading N channels? Only one channel is needed. The NChan option seemed to produce the best results purely from looking at the chart
That makes absolutely no sense! What differs? What is your definition of "best"?
@rsr_17 wrote:
- How does the chart look if you bypass the filter? What are you actually trying to achieve with it? There is significant noise without the filter (pic below). It's difficult to comprehend what is going on. Are you asking what I'm trying to achieve with the filter specifically or the code overall?
What is the meaning of the data and what result do you ultimately need.
@rsr_17 wrote:
- What is the loop rate and how many points do you get with each iteration? The loop rate appears to be 100000 Hz. The method it is calculated is included in the VI
Your loop is free running, will be highly irregular, and will vary dramatically between different machine hardware. This rate is not deterministic. You did not answer my question on how many points you get with each iteration. There is a big difference between 1 point a 100kHz and a million points at 100kHz.