AnsweredAssumed Answered

Syncronising HP4395 to slow sweeps

Question asked by DDobbyn on Jun 1, 2009
Latest reply on Jun 1, 2009 by DDobbyn
Hi All,
I am trying to synchronise my external program to a slow sweep but am not sure how to use the *OPC? method.
My code in VBA is

      With SpecAna
            .WriteString ";CENT " & Freq         ' Center on freq
            .WriteString ";ATTA " & CoarseAttn   ' Set attenuation
            .WriteString ";SPAN " & CoarseSpan   ' Set span
            .WriteString ";BW " & CoarseBW       ' Set bandwidth
            .WriteString ";SING"                 ' Trigger a single reading
            .WriteString "*OPC?", True
             DummyString = .ReadString
            .WriteString ";MKR ON;SEAM PEAK"
            .WriteString ";OUTPMKR?"
            .WriteString "*OPC?", True
            DummyString = .ReadString
            MarkerValue = .ReadString
       End With


How does *OPC? work?
Will the first *OPC? suspend the program operation until *OPC? return 1? or do I need to put in a loop to examine DummyString?

Also how can I wait for a command to  be processed and still get the return value.  For example, see my second *OPC? in the code where I want to wait for OUTPMKR? to be complete. Will the *OPC? overwrite the buffer, then my MarkerValue variable does not get the value from OUTPMKR?

Thanks in advance,
D.  

Outcomes