Example programs | Option Timestamp |
|
|
Example programs
Standard acquisition mode
//
plTimeStamps = (ptr32) malloc (MAX_TIMESTAMPS * 8);
//
SpcSetParam (hDrv, | SPC_COMMAND, | SPC_RESET); |
|
|
| |
// | start timestamp module | // | Standard mode set |
| ||
SpcSetParam | (hDrv, | SPC_TIMESTAMP_CMD, | TS_MODE_STANDARD); | Zero | ||
SpcSetParam | (hDrv, | SPC_TIMESTAMP_CMD, | TS_RESET); | // | Counter is set to |
//
for (i=0; i<4; i++)
{
SpcSetParam (hDrv, SPC_COMMAND, | SPC_START); | // Start recording |
do |
|
|
{ |
| // Wait for Status Ready |
SpcGetParam (hDrv, SPC_STATUS, &lStatus); | ||
} |
|
|
while (lStatus != SPC_READY); |
|
|
} |
|
|
//
SpcGetData (hDrv, CH_TIMESTAMP, (int32) &lCount, MAX_TIMESTAMPS, (dataptr) plTimeStamps); for (i=0; i<lCount; i++)
printf ("Timestamp: %d\tHIGH: %08lx\tLOW: %08lx\n", i, plTimeStamps[2*i+1], plTimeStamps[2*i]);
//
free (plTimeStamps);
}
Acquisition with Multiple Recording
// | board and flush the FIFO |
| ||
SpcSetParam (hDrv, | SPC_COMMAND, | SPC_RESET); |
| |
// | // 1 channel for recording | |||
SpcSetParam (hDrv, | SPC_CHENABLE, | 1); | ||
SpcSetParam (hDrv, | SPC_SAMPLERATE, | 1000000); | // Samplerate 1 MHz. | |
SpcSetParam (hDrv, | SPC_TRIGGERMODE, | TM_TTLPOS); | // External positive Edge | |
SpcSetParam (hDrv, | SPC_MULTI, | 1); | // Enable Multiple Recording | |
SpcSetParam (hDrv, | SPC_MEMSIZE, | 8192); | // 8k Memsize | |
SpcSetParam (hDrv, | SPC_POSTTRIGGER, | 1024); | // Each segment 1k = 8 segments | |
SpcSetParam (hDrv, | SPC_MULTI, | 1); | // Enable Multiple Recording | |
// | start timestamp module | // Standard Timestamp mode set | ||
SpcSetParam (hDrv, | SPC_TIMESTAMP_CMD, TS_MODE_STANDARD); | |||
SpcSetParam (hDrv, | SPC_TIMESTAMP_CMD, TS_RESET); | // Counter is set to Zero | ||
// | board | SPC_START); | // Start recording | |
SpcSetParam (hDrv, | SPC_COMMAND, | |||
do | { |
|
|
|
|
|
| // Wait for Status Ready | |
| SpcGetParam (hDrv, SPC_STATUS, &lStatus); | |||
| } |
|
|
|
while (lStatus != SPC_READY); |
|
| ||
// |
|
SpcGetData (hDrv, CH_TIMESTAMP, (int32) &lCount, 8, (dataptr) plTimeStamps);
//
for (i=0; i<lCount; i++)
printf (“Segment: %d | Counter: %08lx %08lx\n”, i, plTimeStamps[2*i+1], plTimeStamps[2*i]); |
86 | MC.31xx Manual |