Product manual

Section 2. TCP/IP Functionality
PROGRAM
' CR1000
' FTPClient.cr1
Public Result1, Result2
BeginProg
Scan (20,Sec,1,1)
Result1 = FTPClient("192.168.7.85","user","password","CRD:pic.jpg","CRD:pic.jpg",0)
Result2 =
FTPClient("192.168.7.85","user","password","CRD:file.html”,"CRD:file.html",1)
NextScan
EndProg
2.4 Telnet
Telnetting to the datalogger’s IP address allows access to the same commands
as the Terminal Emulator in LoggerNet Connect screen’s Datalogger menu.
2.5 Ping
Pinging the datalogger’s IP address may be used to verify communications.
2.6 Serial Server
With an NL115 attached, the datalogger can be configured to act as a serial
server over the 10 Base T port. (A serial server is a device that allows serial
communications over a TCP/IP port.) This function may be useful when
communicating with a serial sensor over an Ethernet.
2.6.1 Serial Input
The TCPOpen instruction must be used first to open up a TCP socket. An
example of this instruction is shown below. The first parameter in TCPOpen is
the IP address to open a socket to. “” means to listen on this port rather than
connect. The second parameter is the port number to be used. The third
parameter is buffer size. For a SerialIn() instruction that will use this
connection, it gives a buffer size. The TCPOpen instruction returns the socket
number of the open connection or ‘0’ if it cannot open a connection.
socket = TCPOpen (“”,6784,100)
Once a socket has been opened with the TCPOpen instruction, serial data may
be received with a SerialIn Instruction. An example of this instruction is
shown below. The first parameter is the string variable into which the
incoming serial data will be stored. The second parameter is the socket
2-7