Agilent Technologies E5071C Manual page 1066

Hide thumbs Also See for E5071C:
Table of Contents

Advertisement

'Create a new socket
socketId = socket(AF_INET, SOCK_STREAM, 0) '
If socketId = SOCKET_ERROR Then '
MsgBox ("ERROR: socket = " + Str$(socketId)) '...........(2)
OpenSocket = COMMAND_ERROR '
Exit Function '
End If '
'Open a connection to a server
I_SocketAddress.sin_family = AF_INET '
I_SocketAddress.sin_port = htons(PortNumber) '...........(3)
I_SocketAddress.sin_addr = ipAddress '
I_SocketAddress.sin_zero = String$(8, 0) '
x = connect(socketId, I_SocketAddress, Len(I_SocketAddress)) '
If socketId = SOCKET_ERROR Then '
MsgBox ("ERROR: connect = " + Str$(x)) '..(4)
OpenSocket = COMMAND_ERROR '
Exit Function '
End If '
OpenSocket = socketId
End Function
Communication
The procedure corresponding to Communication is SendCommand.
SendCommand transmits a message (SCPI command) specified with the
input parameter "command" to the E5071C using the send function of
WinSock API. The send function takes a socket descriptor (input), a
message to be transmitted (input), message length (input) and a flag
(input) as its parameters.
SendCommand
Function SendCommand(ByVal command As String) As Integer
Programming
1293

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents