03-01-2007 04:12 AM
03-05-2007 04:31 AM
hi..
thank u very much for ur reply... i tried what u have suggested... i am passing FALSE for bQuery n bReset.. still i am getting framing error...
even the baud rate is not getting set to 19200 when i use ISerialPtr interface.....but there is no exception... in the next statement , i am getting the framing error in the instrument...
but the baudrate is getting set when i send the command thru IMessagePtr interface.... but here also it will throw the exception in the next statement....the same framing error in the instrument.... but in the instrument i can see the baud rate set at 19.2k.....
why is this framing error coming?... why cant we initialize the driver even after clearing this framing error(i need to power off n on to proceed, if after i changed the baud rate to 9.6k)... even the Agilent IO connectivity tool is not connecting without powering off...
we can use the message string interface instead of all other interface to send the command right?
plz see my code below
_bstr_t resourceDescriptor = "ASRL2::INSTR";
_bstr_t driverSetupOptions = "QueryInstrStatus=true, DriverSetup= Trace=false, TraceName=TraceOut";
// Initialize the driver
printf("Initializing the driver\n");
spDrvr->Initialize(resourceDescriptor, VARIANT_FALSE, VARIANT_FALSE, driverSetupOptions);
spDrvr->System->TimeoutMilliseconds = 20000;
// Preset the instrument
spDrvr->System->Preset();
// Wait for preset to complete
spDrvr->System->WaitForOperationComplete(20000);
IMessagePtr spMsg = spVisaSession;
spMsg->WriteString( "SYST:COMM:SER:BAUD 19200\n");
Sleep( 1000);
/* IFormattedIO488Ptr spFmtIO = spDrvr->System->IO;
IVisaSessionPtr spVisaSession = spFmtIO->IO;
ISerialPtr spSerial = spVisaSession;
spSerial->BaudRate = 19200;*/
// Select Channel A and set INIT:CONT OFF
spDrvr->Channels->Item["A"]->Trigger->ContinuousEnabled = false;
03-05-2007 11:48 PM
03-13-2007 02:24 AM