Campbell Scientific NL121 NL121 Ethernet Module - Page 22

Telnet, Serial Server

Page 22 highlights

NL121 Ethernet Module b. Open a Windows Explorer window. Enter ftp://username:[email protected] where nnn.nnn.nnn.nnn is the IP address of the datalogger. NOTE 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) 14

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

NL121 Ethernet Module
b.
Open a Windows Explorer window.
Enter
ftp://username:[email protected]
where nnn.nnn.nnn.nnn is
the IP address of the datalogger.
If the user name is “anonymous” with no password, enter
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
)
NOTE
14