Hi Sally,
Here is the snippet of code from the example program with all of the variables set. With these values, the program runs for me. I'm using a PCI-MIO-16E-1 which is very similar to your hardware.
i16 iStatus = 0;
i16 iRetVal = 0;
i16 iDevice = 1;
i16 iChan = 1;
i16 iGain = 1;
f64 dSampRate = 1000.0;
u32 ulCount = 100;
f64 dGainAdjust = 1.0;
f64 dOffset = 0.0;
i16 iUnits = 0;
i16 iSampTB = 0;
u16 uSampInt = 0;
static i16 piBuffer[100] = {0};
i16 iDAQstopped = 0;
u32 ulRetrieved = 0;
static f64 pdVoltBuffer[100] = {0.0};
i16 iIgnoreWarning = 0;
i16 iYieldON = 1;
If you are wanting to acquire 4 seconds worth of data you would increase the count to 4000 and you will want to increase the buffer size to 4000 as w
ell. I made these changes and the code took 4 seconds to execute and then returned the data.
So, the variables that would need to be changed are as follows:
u32 ulCount = 4000;
static i16 piBuffer[4000] = {0};
static f64 pdVoltBuffer[4000] = {0.0};
I have attached the .c file to this discussion so you can take a look at all of the code to make sure you haven't changed anything else. Acquiring at 1kHz should be fine to acquire a 60 Hz wave.
Regards,
Todd D.