EasyManua.ls Logo

Agilent Technologies E5071C - Page 1066

Agilent Technologies E5071C
2685 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Programming
1293
'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

Table of Contents