03-04-2024 05:48 AM
Hello everyone,
I'm new to the NI DAQ world and in need of assistance with fixing some LabVIEW code we're using for data recording. The code was developed by someone else, and I've attached a screenshot of it along with some data recorded at a 5K sampling frequency.
Firstly, I'd like to clarify the difference between the sampling rate and frequency that we input in the VI. I've experimented with different values, but the resulting data doesn't seem to make sense. When I keep both values the same and record data for 4 seconds, I get 25K data points. However, when I input different values, with a higher frequency and lower sample count, the time and sample rate product doesn't match as it does when the samples and frequency are equal.
An important issue I'm facing is that when attempting to record data with this code at a 5K sampling rate (or any other rate), it skips data every 5000 data points (sampling rate) (please refer to the attached data; rows 5001 and 5002 exhibit a jump). I've tried adding delays and timeouts, but none of these seem to resolve the issue. I'm unsure if it's related to the while loop and N samples, rather than acquiring data continuously. My knowledge of LabVIEW is quite basic, and I'm not confident in modifying the existing code. Any help would be greatly appreciated.
Thanks.
03-05-2024 06:05 PM
Hello,
May I know which device are you using? Further, which sampling mode are you planning to use? Is it Hardware timed or software timed? Is it continuous or finite? This could affect the performance of your code, further you are adding multiple Express VIs in the same loop that could make a poor performance, and there are other timing functions that could make the "timing" of your loop such Wait (ms) and Wait Until Next ms Multiple instead of the Express that consumes more memory:
Personally, I suggest you to go to LabVIEW Help>Find Examples (Filter them according to your device) and check the Hardware Input and Output Folder for examples you can explore for and starting point.
Here some useful links:
Romell Meléndez
Technical Support Engineer NI