AnsweredAssumed Answered

Problem communicating with E5071C using Socket and SICL in Visual Basic

Question asked by analyzer100 on Jan 2, 2015
Latest reply on Jan 9, 2015 by analyzer100
I've been having some problems talking to an E5071C from Visual Basic using SICL.

I have setup the Analyzer in the IO Libraries as shown in the attached screen dump. I can send and receive data to and from the instrument using the interactive IO application using both LAN and SOCKET methods.

However, when I try to do this in Visual Basic, it always fails when using the SOCKET method (although the LAN method works fine). The following code works fine:

     TestId = iopen("lan(10.20.86.185):inst")  'Please note, I replaced the [ ] with ( ), as they werent displaying correctly on the post
     Call itimeout(TestId, (160 * 1000&))
     nargs = ivprintf(TestId, "*IDN?" + Chr$(10), 0&)
     nargs = ifread(TestId, ReadText, 50, 0&, actual)
     iclose (TestId)
     Msgbox ReadText

But this code, always timesout on the ifread command when using the SOCKET method:

     TestId = iopen("lan,5025(10.20.86.185)")  'Please note, I replaced the [ ] with ( ), as they werent displaying correctly on the post     
     Call itimeout(TestId, (160 * 1000&))
     nargs = ivprintf(TestId, "*IDN?" + Chr$(10), 0&)
     nargs = ifread(TestId, ReadText, 50, 0&, actual)
     iclose (TestId)
     Msgbox ReadText

Can anyone see any reason why the first code works, and the other does not?  

Attachments

Outcomes