Page 1 of 1

Trigger (bus) after a complete scan

Posted: December 15th, 2015, 10:31 am
by CH2009
Hello

I have a DMM2701 with a multiplexing card 7706, my concern is that I would like to use the bus trigger to allow the dmm to perform another scan. First use a bus trigger which allow the dmm to perform a scan, then wait that all the scan is completed (several channels), read the data for the entire scan, and when the reading is finished, perform a new bus trigger etc... I would like to put the scpi commands in a loop. Currently I have time delay error if I do not insert a sufficient delay just after the after the command *TRG. If I use 2, 3, 4 or more channels, I would like avoid to every time change the delay value which depends if we use line synchronization, offset compensation, 2-wire or 4-wire resistances measurements ...etc

Thanks a lot

Below my code (it works but I would like avoid the delay):

viWrite(io,(ViBuf)"*TRG\n",5,&count);
Delay(0.3);


viWrite(io,(ViBuf)":TRAC:NEXT?\n",12,&count);
viRead(io,(ViBuf)buffer,100,&count);

bufferDataPosition = atof (&buffer[0]);

switch ((int)fmod(bufferDataPosition,3))
{
case 0:
bufferDataPosition = bufferDataPosition - 3;
break;
case 1:
bufferDataPosition = bufferDataPosition - 2;
break;
case 2:
bufferDataPosition = bufferDataPosition - 1;
break;
}

sprintf(buffer, ":TRAC:DATA:SEL? %i,3\n",(int)bufferDataPosition);

viWrite(io, (ViBuf) buffer, strlen(buffer), &count);
viRead(io,(ViBuf)buffer,1000,&count);


Scan (buffer, "%s>%6f[x]", measuredData);

Fmt (buffer, "%s<%f", measuredData[0]);
Fmt (buffer, "%s<%f", measuredData[1]);
Fmt (buffer, "%s<%f", measuredData[2]);
Fmt (buffer, "%s<%f", measuredData[3]);
Fmt (buffer, "%s<%f", measuredData[4]);
Fmt (buffer, "%s<%f", measuredData[5]);

printf("%10.0f %10.3f %10.3f %10.3f %10.3f %10.3f %10.3f\n",
bufferDataPosition, measuredData[0], measuredData[1],
measuredData[2], measuredData[3], measuredData[4],
measuredData[5]);

Re: Trigger (bus) after a complete scan

Posted: December 15th, 2015, 12:30 pm
by Dale C
After the *TRG the unit will start scanning.
You can either use the delay or set up the unit to SRQ on buffer full.
There will be a delay either way. The unit needs the time to go through the channels and make the measurements.
For SRQ on buffer try these commands.
*SRE 1
:STAT:MEAS:ENAB 512

I believe that will SRQ on buffer full.
Or you could set the timeout in your program to longer than it takes the unit to scan and measure the channels.
Either method is a viable solution.