AnsweredAssumed Answered

reading blockdata

Question asked by gerhard47 on Aug 23, 2012
From the frequency analyzer B&Kjaer type 7667 I would like to copy the memory files to a pc (Win XP).
The 7667 can send these files as block data (block data start with e.g. #3158)

I made a screenshot with interactive IO of the Agilent Connection Expert
The screenshot shows the results of the "IDN?" command and the command "S_D? 4" to retreive memory file 4 from the analyzer.
So far so good but I need the file in my pc.
Therefore I studied the Agilent sample programs and found the routine below. 
The analyzer goes active with this routine but the PC hangs after the timeout at the line :  RTA.WriteString "S_D? 4" & RTA_file

Can you give me a hint how to solve this?

Regards,
Gerhard

-------------------------------------------
Private Sub CommandButton2_Click()

    '*** This sequence is a sample code in which the file is transferred

    '*** from the E5061B to the external controller.
    Dim hFile As Long
    Dim isOpen As Boolean
    Dim ioMgr As VisaComLib.ResourceManager
    Set ioMgr = New VisaComLib.ResourceManager

    Dim RTA As VisaComLib.FormattedIO488
    Set RTA = New VisaComLib.FormattedIO488 

    Set RTA.IO = ioMgr.Open("GPIB0::15::INSTR") 'gpib addr of the analyzer
    RTA.IO.Timeout = 10000

    Dim byteData() As Byte
    Dim E5061B_File As String
    Dim PC_File As String


    RTA.WriteString "S_D? 4" & RTA_file 'Spectrum_Data of file 4 to retreive
    byteData = RTA.ReadIEEEBlock(BinaryType_UI1)
    hFile = FreeFile()

    Open PC_File For Binary Access Write Shared As hFile
    isOpen = True
    

    Put #hFile, , byteData

    If isOpen Then Close #hFile

    RTA.IO.Close

End Sub
-----------------------------------------------  

Attachments

Outcomes