01-12-2012 10:58 AM
I am using LabWindows/CVI to programmatically control an Agilent DSO6054L oscilloscope. I have version 2.9 of the ag6000 IVI driver installed.
I am setting up the scope for an edge trigger and then calling the ReadWaveform function. If the trigger occurs, all is well. However, if a timeout occurs, I cannot get the scope to return to an idle state. All of the documentation indicates that calling the ag6000_Abort function will return the scope to the idle state. This is not the case for me. ag6000_Abort does return a successful status code, but calls to other scope functions (ag6000_error_query, ag6000_SetAttribute, etc) result in a timeout exception.
I have attached an NI-spy capture file which does show a BFFF0015 status code on the call to ReadWaveform (I believe) but maybe that is because the trigger did not occur.
The following are the steps I am taking to set up the scope for the edge trigger:
ag6000_init(RESOURCE_NAME, VI_TRUE, VI_FALSE, &m_scopeHandle);
ag6000_AutoSetup(m_scopeHandle);
ag6000_ConfigureTimebaseMode(m_scopeHandle, AG6000_VAL_TIMEBASE_NORMAL);
ag6000_ConfigureTimebase(m_scopeHandle, AG6000_VAL_TIMEBASE_REF_CENTER, VI_FALSE);
ag6000_ConfigureChannel(m_scopeHandle, m_a_ChannelNames[SCOPE_CHANNEL_1], 8.00, 0.00, AG6000_VAL_DC, 10.00, VI_TRUE);
.
.
ag6000_ConfigureChannel(m_scopeHandle, m_a_ChannelNames[SCOPE_CHANNEL_4], 8.00, 0.00, AG6000_VAL_DC, 10.00, VI_TRUE);
ag6000_ConfigureTrigger(m_scopeHandle, AG6000_VAL_EDGE_TRIGGER, 60e-9);
ag6000_ConfigureRefLevels(m_scopeHandle, 10.0, 50.0, 90.0);
ag6000_ConfigureTriggerCoupling(m_scopeHandle, AG6000_VAL_DC);
ag6000_ConfigureAcquisitionType(m_scopeHandle, AG6000_VAL_NORMAL);
ag6000_ConfigureAcquisitionMode(m_scopeHandle, AG6000_VAL_ACQ_MODE_EQTIME);
ag6000_ConfigureTriggerModifier(m_scopeHandle, AG6000_VAL_NO_TRIGGER_MOD);
ag6000_ConfigureEdgeTriggerSource(m_scopeHandle, m_a_ChannelNames[source], level, slope);
errorCode = ag6000_ReadWaveform( m_scopeHandle,
m_a_ChannelNames[source],
NUM_SCOPE_DATA_POINTS,
timeoutMs,
chan1Info->waveformData,
&(chan1Info->actualNumPoints),
&(chan1Info->x0),
&(chan1Info->xDelta) );
if (errorCode == AG6000_ERROR_MAX_TIME_EXCEEDED)
{
ag6000_Abort(m_scopeHandle);
}
Any calls to the scope after this point result in a timeout.
Thanks for any insight!
Laura
01-12-2012 03:58 PM
Well ag6000_Abort actually sends :Stop; which is the same as pressing the front panel stop button.
I think you'll need to send "Run" before anything else will work. Looking at it from another point. if the trigger never happened the scope IS in the idle-waiting for trigger state and the call to abort is really not needed.