NL121 Ethernet Module
14
If the user name is “anonymous” with no password, enter
ftp://nnn.nnn.nnn.nnn
where nnn.nnn.nnn.nnn is the IP address of
the datalogger.
6.3.2
FTP Client
The datalogger can be an FTP client for the purpose of putting, getting, and
managing files on an FTP server. It can also be used to transfer table data easily.
This is done using the
FTPClient()
instruction. The following program is an
example of using
FTPClient()
to send a file to another datalogger and get a file
from that datalogger. For more information, see the
FTPClient()
instruction in
the
CRBasic Editor
help.
PROGRAM
'CR1000
'FTPClient.cr1
Public Result1, Result2
BeginProg
Scan (20,Sec,1,1)
Result1 = FTPClient("192.168.7.85","user","password","USR:pic.jpg","USR:pic.jpg",0)
Result2 = FTPClient("192.168.7.85","user","password","USR:file.html”,"USR:file.html",1)
NextScan
EndProg
6.4
Telnet
Telnetting to the datalogger IP address allows access to the same commands as the
Terminal Emulator in the
LoggerNet Connect
screen
Datalogger
menu.
6.5
Ping
Pinging the datalogger IP address may be used to verify communication.
6.6
Serial Server
With an NL121 attached, the datalogger can be programmed to act as a serial
server over the Ethernet port. (A serial server is a device that allows serial
communication over a TCP/IP port.) This function may be useful when
communicating with a serial sensor over an Ethernet.
6.6.1
Serial Input
The
TCPOpen()
instruction must be used first to open a TCP socket. An example
of this instruction is shown below. For more information on this instruction, see
the
CRBasic Editor
help.
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. For more information on this instruction, see the
CRBasic Editor
help.
SerialIn(
Received,socket,0,13,100
)
NOTE