05-29-2023 08:47 AM
Hi,
I am trying to adapt an example VI for the Keithley DAQ6510 to my needs. The read function seems to only return data from the buffer every one second. I would like to adapt this code to return data at intervals of less than one second.
From reading the instrument manual, I know I need to set up a buffer and use the fetch command to read values from it periodically. However, the attached VI returns an error on the instrument front panel Error 4910 - No readings exist within buffer.
Can someone with knowledge of this device/command provide some feedback on my implementation?
Thanks,
JD
06-02-2023 09:42 AM
I have spent a bit more time with this VI and some recommendations from Keithley, but I am still stuck with a minimum sample rate of one sample per second.
Suggestions from Keithley:
1) Reduce NPLC.
2) Use Autozero once or OFF.
3) Use fixed range instead of autorange.
I have made these changes, but it still seems like I am not receiving data from the buffer any faster. Or rather that the buffer is only filling up with one scan of my channels per second.
VI attached for reference.
06-07-2023 04:05 PM
I had a quick look at the code provided. I do not have the driver downloaded so I can't comment on your choise of measurement settings. But here are a few things to consider..
1) Why do you read the full buffer every time? Is that just the most recent measurements, or an array that increases in size as time goes on? (Just read the most recent measurements.) Alternately, measure 10-1000 times and then read all the data back for that set of measurements, wait N seconds and repeat. Use the instrument status register to tell you measurements are ready for reading.
2) You are writing to file on every measurement. If you are saving the file on an old spinning HD or a network drive this can be a slow process, especially as the file grows bigger. Why not use a shift register and write to file once at the end or a case statement and only write to file every 100 readings? Of use a TDMS file format.
3) You can set NPLC to 0.1 or 0.01. Check manual for the lowest value. NPLC = 1 means 1/60Hz or 16.67ms/reading/channel. So for 6 channels that means 0.1s, but there's overhead and measurement delays (which looks like 1s in your front panel) for each reading type to consider. By far the longest part is going to be transferring the data to PC and writing to disk.
Craig