//
// Download a 20 point Arbitrary waveform using ASCII.
//
printf ("Download a 20 point Arbitrary waveform using ASCII\n");
// Download 20 point waveform
{
double Real_array[20];
Fill_array(Real_array);
IWritePtr pWrite = IOObj->Write();
pWrite->Command ("data volatile, ", VARIANT_FALSE); // Command into buffer
for (int i = 0; i < 20; i++)
pWrite->PutArgument(i, Real_array[i]);
pWrite->Send ();
}
IOObj->Output("func:user volatile");
IOObj->Output("apply:user 10e3,1,0");
Check_Errors(IOObj);
Pause();
//
// Download a 6 point arbitrary waveform using Binary.
//
printf ("Download a 6 point Arbitrary waveform using Binary\n");
long Len;
_variant_t DataArray = "2047,-2047,2047,2047,-2047,-2047";
SAFEARRAY *pBlock;
// Create SCPI command with Binary block appended on end
Len = IOUtils->CreateIEEEBlock(DataArray, IIOUtils_Short, IIOUtils_BigEndian,
_variant_t("data:dac volatile, "), &pBlock);
IOObj->WriteBytes(Len, &pBlock);
SleepEx(100, 0);
IOObj->Output("apply:user 5000,1,0");
Check_Errors(IOObj);
Pause();
Suite à la page suivante...
Chapitre 6 Programmes d'application
Exemple : Microsoft Visual C++ pour Windows
// Comma separated list to buffer
// Send buffer to the instrument
// Select downloaded waveform
// Output waveform: 10kHz, 1Vpp
// Routine check for errors
// Send command and data
// Wait 100msec for interface
// (for RS-232 only)
// Output waveform: 5kHz, 1Vpp
// Routine check for errors
4
6
311