12-05-2006 05:00 AM
12-05-2006 02:00 PM
12-06-2006 05:12 AM
12-06-2006 05:29 PM
12-07-2006 02:49 PM
12-13-2006 06:52 AM
12-13-2006 09:23 AM
Here's code describing what I meant. I didn't compile and run this so forgive any typos. I noticed that setting the scanInterval to 0 in SCAN_Start would result in two samples per channel, so check that. If the default is not low to high on PFI7 then you shouldn't get any data.
// Single Scan via external scan clock control.
i16 status = 0;
i16 deviceNumber = 1;
// Configure port 0 for output
// Wire line 0 to PFI 7
i16 port = 0;
i16 mode = 0;
i16 direction = 1; // output
status = DIG_Prt_Config (deviceNumber, port, mode, dir);
// Make sure it is low
i16 line = 0; // digital output line to write to
i16 state = 0;
status = DIG_Out_Line (deviceNumber, port, line, state);
// Set up the 8 channel scan
i16 numChans = 8;
i16 chanVector [] = {0,1,2,3,4,5,6,7};
i16 gainVector [] = {1,1,1,1,1,1,1,1};
status = SCAN_Setup (deviceNumber, numChans, chanVector, gainVector);
// Start the scan specifying external scan control
i16 buffer [16] = {0};
u32 count = 16; //I think this is the minimum for an 8 channel scan
i16 sampTimebase = 1; // denotes the 1 MHz timebase
u16 sampInterval = 6; // so this is a 6 uSec interval between channels
i16 scanTimebase = 0; // enables external control, default is low to high on PFI7 I think
// use the Select_Signal function to change that default
u16 scanInterval = 10; // doesn't really matter as long as it is not 0
status = SCAN_Start (deviceNumber, buffer, count, sampTimebase, sampInterval, scanTimebase, scanInterval);
i16 daqStopped = 0;
u32 retrieved = 0;
status = DAQ_Check (deviceNumber, &daqStopped, &retrieved);
// after this call daqStopped should be 0 and retrieved should be 0
// Send a rising edge to the scan clock
state = 1;
status = DIG_Out_Line (deviceNumber, port, line, state);
status = DAQ_Check (deviceNumber, &daqStopped, &retrieved);
// after this call daqStopped should be 0 and retrieved should be 8
// you're done.
status = DAQ_Clear (deviceNumber);
state = 0;
status = DIG_Out_Line (deviceNumber, port, line, state);
12-13-2006 11:23 AM