02-24-2025 05:09 AM
Hello everyone, I have a measuring bench for speed sensors composed of a gear wheel, a motor and a chopper. I also have a NI PCI 6221 acquisition card I have to acquire signal amplitudes and frequency and put them in graphs but as you can see in the photo my blocks do not see anything, they just return 0. On other programs where I do tests I have error 20315 which appears with the message "The Waveform dt parameter is <= 0" However, I checked the status of my card and everything is fine Do you have any ideas?
Thanks
Solved! Go to Solution.
02-24-2025 07:32 AM
Good morning, @katramz.
From the one "picture" that you presented, I can't "see the solution" to your question "Why doesn't my code do what I want it to do", but I can see many improvements you can (and should) make that will serve you well in your LabVIEW development. I'm guessing that you have picked up LabVIEW largely by yourself, perhaps coming from a background of text-based programming, and didn't learn the "secrets" of Data Flow programming.
Here are a few "red flags" that I immediately noticed:
Sorry that I couldn't directly comment on the problem you are having. I'm not familiar with the Toolkit you are using (the one getting data from the Dynamic Data Wires), but that might be a place to start. Have you tried opening MAX and creating a Test Panel for your 6221 to read a few A/D values and make sure they aren't really all 0? [Maybe it's "hardware", not "software"?]
If you want more comments on your code, you'll have to provide more code, preferably something we can open with LabVIEW instead of an "image viewer" ...
Bob Schor
02-24-2025 08:16 AM
Hello and thank you for the response in fact it's quite old coding that I'm just trying to make work again. In my other labview files I use while loops and error threads but I run into the same problem. Unfortunately I have to use my 7 wires because I have 7 sensors to test at the same time and my acquisition card cannot use two blocks "read" at the same time.
For example I give you another photo of code where I use various means to obtain a frequency (a signal split, an array or a cluster) and I block in the same way
I will try to take your comments into account, but normally even if it is not the best way to code it should work.. And I don't understand why I detect no frequency
02-24-2025 08:18 AM
I also opened NI Max yes, everything was good
02-24-2025 02:45 PM - edited 02-24-2025 02:45 PM
You can wire the array of waveforms (returned by DAQmx Read in your code) directly to the IIR Filter.
When you are debugging LabVIEW code, find the first VI that returns unexpected results.
I hypothesize that you are not getting data from the DAQmx Read. The error message definitely indicates the downstream VIs don't like dt = 0.
Recommendations:
02-24-2025 10:07 PM - edited 02-24-2025 10:09 PM
I suggest using the MAX Test Panels for AO and AI, and verify that you are acquiring expected signals. Then, use the AO Test Panel to control the analog output and use your code to perform analog input. After you have verified your analog input code, reenable your analog output code.
If you attach your code, we can be more helpful.
02-25-2025 06:53 AM
Hello,
I will try with your code and adding the error bars, but I still have to connect my array to my read block because it has to visualize my 7 inputs
By connecting only one of my sensors to my input 1, on NI max I have the right signal (it is a hall effect sensor, so square signal)
02-25-2025 05:28 PM - edited 02-25-2025 05:29 PM
I understand that you have to analyze your acquired data. The code snippet was provided as an example of how you can connect one array of waveforms directly to the Filter VI.
If you are treating one or more of your channels like a tachometer, consider using the Tachometer Processing functions in the Sound and Vibration Toolkit (Full). The SVT VIs have a lot of run time in the field.
Again, if you attach your code, this community can be more helpful.
02-26-2025 07:32 AM
Hello yes sorry I did not have access to the forum from the PC on which I have LabView but I managed to put it. I made a second code following your suggestions (error bars, deletion of sequences) I share it with you. I can now acquire amplitudes but very weak, but this may concern my sensor and not the code
02-26-2025 05:32 PM
I know you are trying to get some old code working, but you might be better off building parts of the code that are more easily verifiable and adding as you go.
Here is a snippet that acquires from 7 ai channels, low-pass filters the signals, and extracts the biggest tone:
The extracted tones output looks like this:
That looks like what I expected given the input signals connected to my ai channels.
I would like you to get to the point where you are acquiring and processing ai channels and happy with those results before adding more features.