AnsweredAssumed Answered

E4440A Remote controlling by VB .NET

Question asked by bob001 on Feb 21, 2014
Hi

I just start to learn E4440A and visual basic .NET.(with VS 2012) 

I am assuming that There are some ways to remote contorlling E4440A

I installed Agilent driver and Crete project for VB .net ( And I am using GPIB cable to make physical connection between My PC and E4440A

I import AgilentSAn and AgilentSAnSA because I was thinking that these two library will make communication between My PC and E4440A

Here is what I code for remote controlling E4440A 

Dim agDrvr As New Agilent.AgilentSAn.Interop.AgilentSAn
Dim agsa As New Agilent.AgilentSAnSA.Interop.AgilentSAnSA

Dim iviDrvr As Ivi.SpecAn.Interop.IIviSpecAn
iviDrvr = agDrvr
  agDrvr.Initialize("GPIB0::18::INSTR", True, True, "QueryInstrStatus=true, Simulate=true, DriverSetup=Model=E4440A, TraceName=TraceOut.xml")

   agsa = agDrvr.Personality.Select("SA")
        agDrvr.Utility.Reset()
        agsa.Input.Port = Agilent.AgilentSAnSA.Interop.AgilentSAnSAInputPortEnum.AgilentSAnSAInputPortAmplitudeReference
        agsa.Level.Reference = 10
        agsa.Frequency.Center = 40000000
        agsa.Frequency.Span = 50000000
        agsa.Traces.Initiate()
        agDrvr.System.WaitForOperationComplete(1000)
        agsa.Marker.ActiveMarker = 1
        agsa.Marker.Search(Agilent.AgilentSAnSA.Interop.AgilentSAnSAMarkerSearchEnum.AgilentSAnSAMarkerSearchMax)
        agsa.Marker.SetValueFromMarker(Agilent.AgilentSAnSA.Interop.AgilentSAnSAMarkerValueEnum.AgilentSAnSAMarkerValueReferenceLevel)
        agsa.Marker.FrequencyCounter.Enabled = True
        agsa.Marker.SetValueFromMarker(Agilent.AgilentSAnSA.Interop.AgilentSAnSAMarkerValueEnum.AgilentSAnSAMarkerValueCenter)
        agsa.SweepCoupling.ResolutionBandwidthAuto = True
        agsa.Marker.Type = Agilent.AgilentSAnSA.Interop.AgilentSAnSAMarkerTypeEnum.AgilentSAnSAMarkerTypeOff
        ReadInstruemtError(agDrvr)
        MsgBox("dONE")


However, when I checked E4440A setting, it doesn't seem to change anything.

I am not really sure why it is not changing it.

Do i have import other libraries ? Or Do I miss some steps to make communication between My PC and E4440A ?

Thanks  

Outcomes