06-11-2024 07:32 AM - edited 06-11-2024 08:04 AM
Hi,
I'm trying to get a value every millisecond. I measure the reading time and I notice that some measurements are greater than a millisecond, not much but still. I get the correct value but sometimes it's to long (results in picture below, max 27 ms).
I tried to change the reading functions, "sampleQuantityMode", buffer size, rating but the problem is still there. Same result with code examples.
These are the results after 10 minutes running (Second col : time for reading single sample / Third col : occurences).
Console app in C# with Visual Studio 2022. Daq NI PCIe-6321
Can you tell me where is the issue and what am I missing ?
Thanks a lot
06-11-2024 09:34 AM
You may get a better response by reposting to the Multifunction DAQ forum:
Multifunction DAQ - NI Community
This forum is intended for people using real targets (NI Linux RT, etc.).
That said:
I am not a C# expert, so I may have this wrong, but it looks like you are reading a single sample inside the while loop. This means the loop is setting the sample rate, and as while loop execution time varies you are seeing different times. You should set the DAQ card up to perform hardware timing and read blocks of data. Take a look at examples that perform continues, or finite hardware timing.
06-11-2024 11:22 AM - edited 06-11-2024 11:23 AM
Sorry. You can delete this topic.
Thanks for the response.