“Products manufactured by CSI are warranted by CSI to be free from defects in
materials and workmanship under normal use and service for twelve months
from the date of shipment unless otherwise specified in the corresponding
product manual. (Product manuals are available for review online at
www.campbellsci.com.) Products not manufactured by CSI, but that are resold
by CSI, are warranted only to the limits extended by the original manufacturer.
Batteries, fine-wire thermocouples, desiccant, and other consumables have no
warranty. CSI’s obligation under this warranty is limited to repairing or
replacing (at CSI’s option) defective Products, which shall be the sole and
exclusive remedy under this warranty. The Customer assumes all costs of
removing, reinstalling, and shipping defective Products to CSI. CSI will return
such Products by surface carrier prepaid within the continental United States of
America. To all other locations, CSI will return such Products best way CIP
(port of entry) per Incoterms ® 2010. This warranty shall not apply to any
Products which have been subjected to modification, misuse, neglect, improper
service, accidents of nature, or shipping damage. This warranty is in lieu of all
other warranties, expressed or implied. The warranty for installation services
performed by CSI such as programming to customer specifications, electrical
connections to Products manufactured by CSI, and Product specific training, is
part of CSI's product warranty. CSI EXPRESSLY DISCLAIMS AND
EXCLUDES ANY IMPLIED WARRANTIES OF MERCHANTABILITY
OR FITNESS FOR A PARTICULAR PURPOSE. CSI hereby disclaims,
to the fullest extent allowed by applicable law, any and all warranties and
conditions with respect to the Products, whether express, implied or
statutory, other than those expressly provided herein.”
Page 4
Assistance
Products may not be returned without prior authorization. The following
contact information is for US and international customers residing in countries
served by Campbell Scientific, Inc. directly. Affiliate companies handle
repairs for customers within their territories. Please visit
www.campbellsci.com to determine which Campbell Scientific company serves
your country.
To obtain a Returned Materials Authorization (RMA), contact CAMPBELL
SCIENTIFIC, INC., phone (435) 227-9000. After an application engineer
determines the nature of the problem, an RMA number will be issued. Please
write this number clearly on the outside of the shipping container. Campbell
Scientific’s shipping address is:
CAMPBELL SCIENTIFIC, INC.
RMA#_____
815 West 1800 North
Logan, Utah 84321-1784
For all returns, the customer must fill out a “Statement of Product Cleanliness
and Decontamination” form and comply with the requirements specified in it.
The form is available from our web site at www.campbellsci.com/repair. A
completed form must be either emailed to repair@campbellsci.com or faxed to
(435) 227-9106. Campbell Scientific is unable to process any returns until we
receive this form. If the form is not received within three days of product
receipt or is incomplete, the product will be returned to the customer at the
customer’s expense. Campbell Scientific reserves the right to refuse service on
products that were exposed to contaminants that may cause health or safety
concerns for our employees.
Page 5
Precautions
DANGER — MANY HAZARDS ARE ASSOCIATED WITH INSTALLING, USING, MAINTAINING, AND WORKING ON OR AROUND
TRIPODS, TOWERS, AND ANY ATTACHMENTS TO TRIPODS AND TOWERS SUCH AS SENSORS, CROSSARMS, ENCLOSURES,
ANTENNAS, ETC. FAILURE TO PROPERLY AND COMPLETELY ASSEMBLE, INSTALL, OPERATE, USE, AND MAINTAIN TRIPODS,
TOWERS, AND ATTACHMENTS, AND FAILURE TO HEED WARNINGS, INCREASES THE RISK OF DEATH, ACCIDENT, SERIOUS
INJURY, PROPERTY DAMAGE, AND PRODUCT FAILURE. TAKE ALL REASONABLE PRECAUTIONS TO AVOID THESE HAZARDS.
CHECK WITH YOUR ORGANIZATION'S SAFETY COORDINATOR (OR POLICY) FOR PROCEDURES AND REQUIRED PROTECTIVE
EQUIPMENT PRIOR TO PERFORMING ANY WORK.
Use tripods, towers, and attachments to tripods and towers only for purposes for which they are designed. Do not exceed design
limits. Be familiar and comply with all instructions provided in product manuals. Manuals are available at www.campbellsci.com or
by telephoning (435) 227-9000 (USA). You are responsible for conformance with governing codes and regulations, including safety
regulations, and the integrity and location of structures or land to which towers, tripods, and any attachments are attached. Installation
sites should be evaluated and approved by a qualified engineer. If questions or concerns arise regarding installation, use, or
maintenance of tripods, towers, attachments, or electrical connections, consult with a licensed and qualified engineer or electrician.
General
•Prior to performing site or installation work, obtain required approvals and permits. Comply
with all governing structure-height regulations, such as those of the FAA in the USA.
•Use only qualified personnel for installation, use, and maintenance of tripods and towers, and
any attachments to tripods and towers. The use of licensed and qualified contractors is highly
recommended.
•Read all applicable instructions carefully and understand procedures thoroughly before
beginning work.
•Wear a hardhat and eye protection, and take other appropriate safety precautions while
working on or around tripods and towers.
•Do not climb tripods or towers at any time, and prohibit climbing by other persons. Take
reasonable precautions to secure tripod and tower sites from trespassers.
•Use only manufacturer recommended parts, materials, and tools.
Utility and Electrical
•You can be killed or sustain serious bodily injury if the tripod, tower, or attachments you are
installing, constructing, using, or maintaining, or a tool, stake, or anchor, come in contact withoverhead or underground utility lines.
•Maintain a distance of at least one-and-one-half times structure height, 20 feet, or the distance
required by applicable law, whichever is greater, between overhead utility lines and the
structure (tripod, tower, attachments, or tools).
•Prior to performing site or installation work, inform all utility companies and have all
underground utilities marked.
•Comply with all electrical codes. Electrical equipment and related grounding devices should
be installed by a licensed and qualified electrician.
Elevated Work and Weather
• Exercise extreme caution when performing elevated work.
• Use appropriate equipment and safety practices.
• During installation and maintenance, keep tower and tripod sites clear of un-trained or non-
essential personnel. Take precautions to prevent elevated tools and objects from dropping.
•Do not perform any work in inclement weather, including wind, rain, snow, lightning, etc.
Maintenance
•Periodically (at least yearly) check for wear and damage, including corrosion, stress cracks,
frayed cables, loose cable clamps, cable tightness, etc. and take necessary corrective actions.
•Periodically (at least yearly) check electrical ground connections.
WHILE EVERY ATTEMPT IS MADE TO EMBODY THE HIGHEST DEGREE OF SAFETY IN ALL CAMPBELL SCIENTIFIC PRODUCTS,
THE CUSTOMER ASSUMES ALL RISK FROM ANY INJURY RESULTING FROM IMPROPER INSTALLATION, USE, OR
MAINTENANCE OF TRIPODS, TOWERS, OR ATTACHMENTS TO TRIPODS AND TOWERS SUCH AS SENSORS, CROSSARMS,
ENCLOSURES, ANTENNAS, ETC.
Page 6
Page 7
Table of Contents
PDF viewers: These page numbers refer to the printed version of this document. Use the
PDF reader bookmarks tab for links to specific sections.
Campbell Scientific’s NL116 Ethernet/CompactFlash® Module provides two
independent capabilities: (1) it enables Ethernet communications and (2) stores
data on a removable CompactFlash
communicate over a local network or a dedicated Internet connection via
Ethernet. It also expands on-site data storage and provides the user with a
convenient method of transporting data from the field back to the office. This
small, rugged communication device connects to the 40-pin peripheral port on
a CR1000 or CR3000 datalogger.
This manual describes how to use LoggerNet to connect to your datalogger
with an NL116 attached. You can also use other software packages such as
PC400, RTDAQ, or LoggerLink Mobile Apps for iOS and Android.
Campbell Scientific recommends that only CF cards that have passed our
testing be used with the NL116. For more information on CF cards, see
Campbell Scientific’s application note CF Card Information (3SM-F). Note
that it is not necessary to purchase the CF cards directly from Campbell
Scientific as long as the manufacturer and model number match those shown in
the application note.
®
(CF) card. It allows the datalogger to
Before using the NL116, please study:
• Section 2, Cautionary Statements
• Section 3, Initial Inspection
• Section 4, Quickstart
The Quickstart section explains how to quickly begin using an NL116 for
straightforward Ethernet communications and data-storage operations. The
remainder of the manual is a technical reference which describes in detail such
operations as: IP functionality, file formats, datalogger programming, and data
retrieval.
2. Cautionary Statements
•READ AND UNDERSTAND the Precautions section at the front of this
manual.
•The NL116 requires CR1000 or CR3000 operating system version 28 or
later.
•The first time an NL116 is attached to a datalogger, the datalogger’s
memory has to be reorganized to allow room in memory for the IP stack.
To avoid the loss of data, collect your data before attaching the NL116 to a
datalogger.
•The NL116 is rugged, but it should be handled as a precision scientific
instrument.
(p. 1)
(p. 2)
(p. 2)
1
Page 10
NL116 Ethernet and CompactFlash® Module
CAUTION
CAUTION
NOTE
• Shielded Ethernet cable should be used for cable lengths longer than 9 ft.
• Always power down the datalogger before installing to or removing the
NL116 from the datalogger.
3. Initial Inspection
Upon receipt of the NL116, inspect the packaging and contents for damage.
File damage claims with the shipping company.
4. Quickstart
This section describes the basics of communicating via Ethernet and storing
and retrieving datalogger data. These operations are discussed in detail in
Section 7, Operation
4.1 Physical Setup
Always collect your data before attaching the NL116.
(p. 12).
Always power down the datalogger before installing to or
removing the NL116 from the datalogger.
After powering down the datalogger, plug the NL116 into the datalogger
peripheral port (see FIGURE 4-1). Attach Ethernet cable to the Ethernet port.
Restore power to the datalogger. Insert formatted CF card. (For instructions
on formatting a CF card, see Appendix A, CF Card Maintenance
A CF card does not need to be present in order to use the NL116’s
IP functionality.
(p. A-1).)
FIGURE 4-1. NL116 attached to a CR1000
2
Page 11
4.2 Communicating via Ethernet
NOTE
4.2.1 Step 1: Configure Datalogger
a. Connect serial cable from PC COM port to the datalogger RS-232 port.
b. Open Campbell Scientific’s Device Configuration Utility (DevConfig).
Select the Device Type of the datalogger (CR1000 or CR3000), the
appropriate Communication Port, and Baud Rate. Connect to the
datalogger.
c. Under the TCP/IP tab, input the IP Address, Subnet Mask, and IP
Gateway. These values should be provided by your network
administrator.
Alternatively, note the Eth IP address assigned to the datalogger via
DHCP. However, note that this address is not static and may change.
NL116 Ethernet and CompactFlash® Module
FIGURE 4-2. DevConfig setup
d. Press the Apply button to save the changes and then close DevConfig.
A temporary IP address may be obtained from a DHCP server.
For more information, see Section 7.1.8, DHCP(p. 19).
3
Page 12
NL116 Ethernet and CompactFlash® Module
NOTE
The NL116 must be connected to the datalogger before
configuring the datalogger with DevConfig. If it is not connected,
the TCP/IP settings will not be displayed.
4.2.2 Step 2: LoggerNet Setup
The next step is to run LoggerNet and configure it to connect to the datalogger
via the Ethernet port.
a. In the EZ View of the LoggerNet Setup screen, press Add. Press Next to
advance to the Datalogger Type and Name screen. Select your
datalogger type and press Next.
FIGURE 4-3. Setup screen (EZ View) Datalogger Type
4
Page 13
NL116 Ethernet and CompactFlash® Module
b. Select IP Port and press Next.
FIGURE 4-4. Setup screen (EZ View) Connection Type
5
Page 14
NL116 Ethernet and CompactFlash® Module
c. Input the datalogger’s IP address and port number and press Next. The IP
address and port number are input on the same line separated by a colon.
IPv6 addresses will need to be enclosed in square brackets. An IPv4
address may look like 192.168.1.100:6785. An IPv6 address may look
like [2001:db8::1234:5678]:6785. (The datalogger default port number is
6785. It can be changed using DevConfig.)
FIGURE 4-5. Setup screen (EZ View) IP Port Settings
6
Page 15
NL116 Ethernet and CompactFlash® Module
d. Input the PakBus Address of the datalogger.
FIGURE 4-6. Setup screen (EZ View) Datalogger Settings
e. Press Next until you reach the Communication Setup Summary screen.
Press Finish to complete the setup.
4.2.3 Step 3: Connect
You are now ready to connect to your datalogger using the LoggerNet Connect
screen.
Datalogger program transfer, table-data display, and data collection are now
possible.
4.3 Programming the Datalogger to Save Data to the
CompactFlash
The CardOut() instruction is used in the datalogger program to send data to
the CF card. CardOut() must be entered within each DataTable declaration
that is to store data on the CF card. The file is saved on the card with the name
stationname.tablename and a .DAT extension.
The CardOut() instruction has the following parameters:
®
Card
StopRing: A constant is entered for the StopRing parameter to specify whether
the DataTable created should be a ring-mode table (0) or a fill-and-stop table
(1).
7
Page 16
NL116 Ethernet and CompactFlash® Module
CAUTION
CAUTION
Size: A constant is entered in the Size to define the size of the DataTable on
the Card. Size can be defined as a fixed number of records, as auto-allocate, or
as the size of the datalogger memory.
To set the table size to a fixed number of records, enter that value. Enter a –1
to set the size to auto-allocate. If set to auto-allocate, all memory that remains
after creating fixed-sized tables will be allocated to this table. If multiple data
tables are declared with a –1 for size, the available memory will be divided
among the tables. The datalogger attempts to allocate memory to the tables so
that all tables are filled at the same time. Enter –1000 to set the size of the
table on the card to the size of the table in the datalogger’s memory.
In the following example, the minimum batt_volt and a sample of PTemp are
written to the card each time the data table is called. The StopRing parameter
is 0 for ring mode. This means that once the data table is full, new data will
begin overwriting old data. The size parameter is –1, so all available space on
the card will be allocated to the table.
DataTable(Table1,1,-1)
CardOut(0 ,-1)
Minimum(1,batt_volt,FP2,0,False)
Sample(1,PTemp,IEEE4)
EndTable
To prevent losing data, collect data from the CF card before
sending the datalogger a new or modified program. When
a program is sent to the datalogger using the Send button in
the Connect screen of LoggerNet or PC400, an attribute is
sent along with the program that commands the datalogger
to erase all data on the CF card from the currently-running
program.
For other methods of saving data to the CF card, see the TableFile() instruction
in the CRBasic Editor help.
4.4 CF Card Data Retrieval
Data stored on cards can be retrieved through a communication link to the
datalogger or by removing the card and carrying it to a computer with a CF
adapter. With large files, transferring the CF card to a computer may be faster
than collecting the data over a communication link. CF card-data retrieval is
discussed in detail in Section 7.4, CF Card Data-Retrieval Details
Removing a card while it is active can cause garbled data
and can actually damage the card. Always press the
Initiate Removal button and wait for a green light before
removing card.
(p. 26).
8
Page 17
5. Overview
CAUTION
CAUTION
NL116 Ethernet and CompactFlash® Module
LoggerNet File Control should not be used to retrieve an
open file (for example, a file created using CardOut or the
latest file created by TableFile, option 64) from a CF card.
Using File Control to retrieve the data can result in a
corrupted data file. However, File Control can be used to
retrieve closed files such as JPEG images or files (other
than the latest) created by TableFile, option 64.
®
FIGURE 5-1. NL116 Ethernet/CompactFlash
The NL116 Ethernet/CompactFlash
®
Module enables Ethernet communication
with the datalogger. It also has a slot for a Type I or Type II CompactFlash
Module
®
(CF) card (3.3 V, 75 mA).
The NL116/CF card combination can be used to expand the datalogger
memory, transport data/programs from the field site(s) to the office, upload
power-up functions, and store JPEG images from a Campbell Scientific
camera. Data stored on cards can be retrieved through a communications link
to the datalogger or by removing the card and carrying it to a computer. The
computer can read the CF card either with the CF1 adapter or 17752
reader/writer. The CF1 adapter allows the PC’s PCMCIA card slot to read the
CF card; the 17752 reader/writer allows the PC’s USB port to read the CF card.
User-supplied CF adapters may also be used.
LoggerNet File Control should not be used to retrieve an
open file (for example, a file created using CardOut or the
latest file created by TableFile, option 64) from a CF card.
Using File Control to retrieve the data can result in a
corrupted data file. However, File Control can be used to
retrieve closed files such as JPEG images or files (other
than the latest) created by TableFile, option 64.
9
Page 18
NL116 Ethernet and CompactFlash® Module
5.1 Buttons and Status LED
There is one red-green-orange LED (light-emitting diode) and two buttons:
Initiate Removal and eject. The Status LED indicates the status of the
module. The LED will flash red when the CF card is being accessed, solid
green when it is OK to remove the card, solid orange to indicate an error, and
flashing orange if the card has been removed and has been out long enough that
CPU memory has wrapped and data is being overwritten without being stored
to the card. The Initiate Removal button must be pressed before removing a
card to allow the datalogger to store any buffered data to the card and then
power off. The eject button is used to eject the CF card. Note that if the eject
button cannot be pressed, it may have been disabled by bending it to the right.
Straighten and press the eject button to eject the CF card.
5.2 Power
The Ethernet/CompactFlash® module is powered by 12 Vdc received from the
datalogger through the peripheral port.
Additional power consumption occurs if the Status LED is continuously lit.
At 12 Vdc, an additional 1 mA is drawn by the red or green LED; an additional
2 mA is drawn by the orange LED.
5.3 CF Card Data Retention
The module accepts CF cards which do not require power to retain data.
Typically, a CF card can be erased and rewritten a minimum of 100,000 times.
Industrial CF cards, graded for 2,000,000 write cycles, are recommended for
most applications.
6. Specifications
Datalogger Compatibility: CR1000, CR3000 (both require OS
Storage Capacity: Depends on card size
Maximum individual file size is 2 GB
Power Requirements: 12 V supplied through datalogger’s
Current Drain: 64 mA w/Ethernet Active @ 10 Mb
58 mA w/Ethernet Active @ 100 Mb
3 mA w/Ethernet Not Active, CF Card Only
Note: Ethernet can be put into a low-
version 28 or later)
peripheral port
power state (not connected to the network,
essentially off) using the IPNetPower() or
EthernetPower() instruction.
Operating Temperature Range: –40 to 70 °C Standard
–55 to 85 °C Extended
10
Page 19
NL116 Ethernet and CompactFlash® Module
Compliance Information:Application of Council Directive(s):
Electrical Equipment for measurement,
control and laboratory use – EMC
requirements – for use in industrial
locations.
2011/65/EU The Restriction of Hazardous
Substances Directive (RoHS2)
Cable Requirements:Use a straight-through Ethernet cable
when the cable is run from the hub to the
NL116. Use a shielded cable when the
cable length is more than 9 ft.
Note: The maximum recommended
segment length for 10BaseT and
100BaseTx networks using CAT5 cable is
100 meters. Segment length is the length
of cable between the NL device and the
Ethernet repeater, hub, switch, or router it
is connected to.
full and half duplex, all auto-negotiated.
Typical access speeds vary and range from
20 KBytes/sec to 200 KBytes/sec
depending on multiple factors (*** see
note).
Memory Configuration:User-selectable for either ring style
(default) or fill-and-stop.
Dimensions: 10.2 x 8.9 x 6.4 cm (4.0 x 3.5 x 2.5 in)
Weight: 154 g (5.4 oz)
*** The NL116 will automatically negotiate the speed and duplex mode used for the
Ethernet link. However, the speed at which data can be transferred to and from a
datalogger over the NL116 depends on multiple factors including:
• the datalogger processor speed, that is, CR1000 vs CR3000
• how busy the datalogger is performing measurement, processing, control and
other communication tasks; measurement tasks take priority over
communication tasks
• the IP protocol used for the data transfer and how/if the link is encrypted
• where the data is being transferred from or to, for example, USR vs CRD
• limitation of the IP connection due to congestion, the number of “hops”, and
the quality of the physical media between the client and host
Below are some example data transfer rates observed over an ideal connection. A
laptop computer was connected directly to the NL116 interface, transferring a 1.7 MB
file to and from the datalogger USR drive.
11
Page 20
NL116 Ethernet and CompactFlash® Module
CR1000
(Sending from computer to datalogger; retrieving from datalogger to computer)
• PakBus: 30 KBytes/sec; 30 KBytes/sec
• FTP/HTTP: 55 Bytes/sec; 90 KBytes/sec
CR3000
(Sending from computer to datalogger; retrieving from datalogger to computer)
• PakBus: 65 KBytes/sec; 65 KBytes/sec
• FTP/HTTP: 135 KBytes/sec; 210 KBytes/sec
7. Operation
7.1 TCP/IP Functionality
This section describes the main TCP/IP functionality of a datalogger with an
NL116 attached. Additional functionality may be added in the future. For
more information, refer to the Information Services section of the datalogger
manual and CRBasic Editor help.
7.1.1 Communicating Over TCP/IP
Once the datalogger, the NL116, and LoggerNet have been set up as described
in Sections 4.1, Physical Setup
communication is possible over TCP/IP. This includes program send and data
collection. These are straightforward operations and are accomplished through
the LoggerNet Connect screen. For more information, see the LoggerNet
manual.
(p. 2), and 4.2, Communicating via Ethernet (p. 3),
7.1.1.1 Data Callback
Data callback and datalogger-to-datalogger communications are also possible
over TCP/IP, as well as the creation of simple HTML pages to view datalogger
variables using a web browser.
The following program is an example of doing data callback over TCP/IP. It
first checks to see if a port to the LoggerNet server already exists. (The
LoggerNet server is assumed to be at the default PakBus address, 4094.) If not,
a socket to LoggerNet is opened using the TCPOpen() instruction. The
SendVariables() instruction is then used to send data.
12
Page 21
NL116 Ethernet and CompactFlash® Module
PROGRAM
' CR1000
' IP_Callback.cr1
' LoggerNet server Pak Bus Address assumed = 4094
' PC IP address assumed = 192.168.7.231
' LoggerNet IPPort "IP Port Used for Call-Back" = 6785
' LoggerNet IPPort "Call-Back Enabled" is checked
' LoggerNet CR1000 "Call-Back Enabled" is checked
' LoggerNet PakBusPort "PakBus Port Always Open" is checked
' IP Call-back using auto-discover (-1) neighbor in SendVariables
Public PanelTemperature, BatteryVoltage, Result1, dummy1
Communication between dataloggers is possible over TCP/IP. In order to do
this, a socket must be opened between the two dataloggers using the
TCPOpen() instruction or using the PakBus/TCP Client setting. Note that
only one datalogger should be set up to open the connection. The socket
opened by the TCPOpen() instruction or the PakBus/TCP Client setting is
used by the instructions performing datalogger-to-datalogger communication.
The example program below gets the battery voltage from a remote datalogger
and sends its panel temperature to the remote datalogger. The remote
datalogger is at IP address 192.168.7.125 and port 6785 is used for
communication between the dataloggers. The remote datalogger must have its
battery voltage stored in a public variable, BattVolt. It must also have a public
variable declared, PTemp_Base. This will be used to store the panel
temperature of the base datalogger.
13
Page 22
NL116 Ethernet and CompactFlash® Module
PROGRAM
'CR1000
'DL-to-Dl_Comms_1.cr1
'Send this program to CR1000 #1
'Remote CR1000 #2 has PBA = 2, IP addr = 192.168.7.125, and port 6785
Public BattVolt,, BattVolt_Remote
Public PTemp
Public Result1, Result2
Typing the datalogger’s IP address into a web browser will bring up its home
page, as shown in FIGURE 7-1. This default home page provides links to the
current record in all tables, including data tables, the Status table, the
DataTableInfo table, and the Public table. Clicking on a Newest Record link
will bring up the latest record for that table. It will be automatically refreshed
every 10 seconds. Links are also provided to the last 24 records in each data
table. Clicking on a Last 24 Records link will bring up the last 24 records for
that table. The Last 24 Records display must be manually refreshed. In
addition, links are provided to all HTML files, all XML files, and all JPEG
files in the datalogger.
14
Page 23
NL116 Ethernet and CompactFlash® Module
NOTE
7.1.3 FTP
7.1.3.1 FTP Server
FIGURE 7-1. Datalogger home page
If there is a default.html file on the datalogger, this will automatically become
the user-configurable home page.
The WebPageBegin/WebPageEnd declarations and the HTTPOut()
instruction can be used in a datalogger program to create HTML or XML files
that can be viewed by the browser. For more information on using these
instructions, see the datalogger manual or CRBasic Editor help.
See Web Server API in the contents of the CRBasic Editor help for more
information on using HTTP to access datalogger data.
FileOpen() and FileWrite() can be used to create HTML pages,
but this requires first writing the file to the datalogger USR, CRD,
or USB drive. It is less convenient, and the page will be only as
current as it is written to the file.
With an NL116 attached, the datalogger will automatically run an FTP server.
This allows Windows Explorer to access the datalogger’s file system via FTP.
In the FTP world, the “drives” on the datalogger are mapped into directories
(or folders). The “root directory” on the datalogger will include CPU and
possibly USR, USB, and/or CRD. The files will be contained in one of these
directories. Files can be pasted to and copied from the datalogger “drives” as if
they were drives on the PC. Files on the datalogger drives can also be deleted
through FTP.
15
Page 24
NL116 Ethernet and CompactFlash® Module
FIGURE 7-2. FTP root directory
FIGURE 7-3. FTP CRD directory
16
Page 25
In order to use FTP, the datalogger’s FTP User Name and FTP Password must
NOTE
NOTE
be set. This is done using DevConfig.
Step 1: Configure Datalogger
a. Connect serial cable from PC COM port to datalogger RS-232 port.
b. Open Campbell Scientific’s DevConfig. Select the Device Type of the
datalogger (CR1000 or CR3000), the appropriate Communication Port
and Baud Rate. Connect to the datalogger.
e. Under the Network Services tab, verify that FTP Enabled is checked.
Input the FTP User Name and FTP Password.
f. Press the Apply button to save the changes and then close DevConfig.
Using anonymous as the user name with no password allows FTP
access without inputting a user name or password.
Step 2: Access File System
a. The datalogger must be set up for Ethernet communications as explained
in Sections 4.1, Physical Setup
(p. 3) (Step 1 only).
NL116 Ethernet and CompactFlash® Module
(p. 2), and 4.2, Communicating via Ethernet
7.1.3.2 FTP Client
b. Open a Windows Explorer window. Enter
ftp://username:password@nnn.nnn.nnn.nnn where nnn.nnn.nnn.nnn is
the IP address of the datalogger.
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.
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.
Telnetting to the datalogger’s IP address allows access to the same commands
as the Terminal Emulator in the LoggerNet Connect screen Datalogger menu.
7.1.5 Ping
7.1.6 Serial Server
7.1.6.1 Serial Input
7.1.6.2 Serial Output
Pinging the datalogger’s IP address may be used to verify communications.
With an NL116 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.
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)
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(“192.168.7.85”,6784,100)
18
Page 27
Once a socket has been opened with the TCPOpen() instruction, serial data
may be sent out with SerialOut(). An example of this instruction is shown
below. For more information on this instruction, see the CRBasic Editor help.
result = SerialOut(socket,sent,"",0,100)
7.1.7 TCP ModBus
With an NL116 attached, the datalogger can be set up as a TCP ModBus
Master or Slave device. For information on configuring the datalogger as a
TCP ModBus Master or Slave, see the ModBus section of the datalogger
manual.
7.1.8 DHCP
The IP address of the datalogger may be obtained through DHCP, if a DHCP
server is available. The DHCP address will be automatically assigned if there
is a DHCP server available and no static IP address has been entered. The IP
address should be available a few minutes after the datalogger has been
powered up with the NL116 attached and Ethernet cable plugged in. The IP
address can be found with the DevConfig Settings tab under TCP/IP Info. It
can also be found using a CR1000KD attached to the datalogger. Go to
Configure, Settings | Settings (general), scroll down to IPInfo and press the
right arrow.
NL116 Ethernet and CompactFlash® Module
An IP address obtained through DHCP is not static but is leased for a period of
time set by the network administrator. The address may change, if the
datalogger is powered down.
7.1.9 DNS
The datalogger provides a DNS client that can query a DNS server to resolve a
fully qualified domain name. When a DNS server is available, domain names
can be used in place of the IP address in the datalogger instructions.
7.2 File Formats
This section covers the different types of files stored on the CF card.
7.2.1 Data Files
The datalogger stores data on the CF card in TOB3 format. TOB3 is a binary
format that incorporates features to improve reliability of the CF cards. TOB3
allows the accurate determination of each record’s time without the space
required for individual timestamps.
TOB3 format is different than the data file formats created when data is
collected via a communication link. Data files read directly from the CF card
generally need to be converted into another format to be used.
When TOB3 files are converted into another format, the number of records
may be slightly greater or fewer than the number requested in the data-table
declaration. There is always some additional memory allocated. When the file
is converted, this will result in additional records if no lapses occurred. If more
lapses occurred than were anticipated, there may be fewer records in the file
than were allocated.
19
Page 28
NL116 Ethernet and CompactFlash® Module
CAUTION
NOTE
The CardConvert software included in LoggerNet, PC400, and PC200W will
convert data files from one format into another.
7.2.2 Program Files
The CF card can be used to provide extra program-storage space for the
datalogger. Program files can be copied to the card while it is attached as a
drive on the computer. They can also be sent to the card using LoggerNet File Control. They may also be copied from CPU memory to the card (or from the
card to CPU memory) using the CR1000KD.
7.2.3 Power-up Files (Powerup.ini)
Users can insert a properly-configured CF card into the NL116, cycle through
the datalogger power, and have power-up functions automatically performed.
Power-up functions of CompactFlash
®
cards can include:
a) Sending programs to the CR1000 or CR3000
b) Setting attributes of datalogger program files
c) Setting disposition of old CF files
d) Sending an OS to the CR1000 or CR3000
e) Formatting memory drives
f) Deleting data files
Test the power-up functions in the office before going into
the field to ensure the power-up file is configured correctly.
The key to the CF power-up function is the powerup.ini file, which contains a
list of one or more command lines. At power-up, the powerup.ini command
line is executed prior to compiling the program. Powerup.ini performs three
operations:
1) Copies the specified program file to a specified memory drive
2) Sets a file attribute on the program file
3) Optionally deletes CF data files from the overwritten (just previous)
program
Powerup.ini takes precedence during power-up. Though it sets file attributes
for the programs it uploads, its presence on the CF does not allow those file
attributes to control the power-up process. To avoid confusion, either remove
the CF card or delete the powerup.ini file after the powerup.ini upload.
7.2.3.1 Creating and Editing Powerup.ini
Powerup.ini is created with a text editor, then saved as “powerup.ini”.
Some text editors (such as WordPad) will attach header
information to the powerup.ini file, causing it to abort. Check the
text of a powerup.ini file with the datalogger keyboard display to
see what the datalogger actually sees.
20
Page 29
NL116 Ethernet and CompactFlash® Module
TABLE 7-1. Powerup.ini Commands
Comments can be added to the file by preceding them with a single-quote
character ('). All text after the comment mark on the same line is ignored.
Syntax
Syntax allows functionality comparable to File Control in LoggerNet.
Powerup.ini is a text file that contains a list of commands and parameters. The
syntax for the file is:
Command,File,Device
where
Command = one of the numeric commands in TABLE 7-1.
File = file on CF associated with the action. Name can be up to 22
characters.
Device = the device to which the associated file will be copied
Options are CPU:, USR:, and CRD:. If left blank or with an invalid
option, it will default to CPU:.
Command Description
1 Run always, preserve CF data files
2 Run on power-up
5 Format
6 Run now, preserve CF data files
9 Load OS (File = .obj)
13 Run always, erase CF data files now
14 Run now, erase CF data files now
By using PreserveVariables() instruction in the datalogger CRBasic program,
with options 1 and 6, data and variables can be preserved. The powerup.ini
code is shown below.
EXAMPLE 7-1. Powerup.ini code.
'Command = numeric power-up command
'File = file on CF associated with the action
'Device = the device to which File will be copied. Defaults to CPU:
'Command,File,Device
13,Write2CRD_2.cr1,CPU:
7.2.3.2 Applications
•Command 1 copies the specified program to the designated drive and sets
the run attribute of the program to Run Always. Data on a CF card from
the previously running program will be preserved.
21
Page 30
NL116 Ethernet and CompactFlash® Module
•Command 2 copies the specified program to the designated drive. The
program specified in command 2 will be set to Run Always unless
command 6 or 14 is used to set a separate Run Now program.
• Command 5 formats the designated drive.
• Command 6 copies the specified program to the designated drive and sets
the run attribute of the program to Run Now. Data on a CF card from the
previously running program will be preserved.
•Command 7 copies the specified file to the designated drive with no run
attributes.
•Command 13 copies the specified program to the designated drive and sets
the run attribute of the program to Run Always. Data on a CF card from
the previously running program will be erased.
•Command 14 copies the specified program to the designated drive and sets
the run attribute to Run Now. Data on a CF card from the previously
running program will be erased.
7.2.3.3 Program Execution
After File is processed, the following rules determine what datalogger program
to run:
1) If the Run Now program is changed, it will be the program that runs.
2) If no change is made to the Run Now program, but the Run on Power-up
program is changed, the new Run on Power-up program runs.
3) If neither the Run on Power-up nor the Run Now programs are changed,
the previous Run on Power-up program runs.
7.2.3.4 Example Powerup.ini Files
Examples 7-2 through 7-7 are example powerup.ini files.
EXAMPLE 7-2. Run Program on Power-up.
'Copy pwrup.cr1 to USR:, will run only when powered up later
2,pwrup.cr1,usr:
EXAMPLE 7-3. Format the USR: Drive.
'Format the USR: drive
5,,usr:
EXAMPLE 7-4. Send OS on Power-up.
'Load this file into FLASH as the new OS
9,CR1000.Std.28.obj
22
Page 31
NL116 Ethernet and CompactFlash® Module
Parameter
Data Type
Enter
StopRing
Constant
A code to specify if the data table on the CF card is fill-and-stop or ring (newest data
overwrites oldest).
Value
Result
0
Ring
1
Fill and stop
Size
The size to make the data table. The number of data sets (records) for which to allocate
table. This data is called a record.
Note
Enter –1000 and the size of the table on the card will match the size of the
partitioning algorithm attempts to have the tables full at the same time.
EXAMPLE 7-5. Run Program from CRD: Drive.
'Leave program on CRD:, run always, erase CRD: data files
13,toobigforcpu.cr1,crd:
EXAMPLE 7-6. Run Program Always, Erase CF Data.
'Run always, erase CRD: data files
13,pwrup_1.cr1,crd
EXAMPLE 7-7. Run Program Now, Erase CF Data.
'Copy run.cr1 to CPU:, erase CF data, run CPU:run.cr1, but not if later powered up
14,run.cr1,cpu:
7.2.4 Camera Files
JPEG images taken by a CC640 digital camera (retired) connected to the
datalogger can be stored to the CF card rather than CPU memory. This is done
by configuring the PakBus setting Files Manager for the datalogger. This can
be done using DevConfig or PakBus Graph.
7.3 Programming
7.3.1 The CardOut() Instruction
The CardOut() instruction is used to send data to a CF card. CardOut() must
be entered within each DataTable() declaration that is to store data to the CF
card. Data is stored to the card when a call is made to the data table.
CardOut(StopRing, Size)
Constant
memory in the CF card. Each time a variable or interval trigger occurs, a line (or row) of
data is output with the number of values determined by the output instructions within the
internal table on the datalogger. Enter any other negative number and all
remaining memory (after creating any fixed-size data tables) will be allocated to
the table or partitioned among all tables with a negative value for size. The
23
Page 32
NL116 Ethernet and CompactFlash® Module
7.3.2 Program Examples
7.3.2.1 Ring Mode
The following program outputs the maximum and minimum of the panel
temperature to the card once a second. The first parameter of the CardOut()
instruction is 0, which sets the table on the card to ring mode. The second
parameter is negative, so all available memory on the card will be allocated to
the data table. Once all available memory is used, new data will begin
overwriting the oldest.
PROGRAM
'CR1000
Public temp
DataTable (Table1,1,-1)
CardOut (0, -1)
Maximum (1,temp,FP2,False,False)
Minimum (1,temp,FP2,False,False)
EndTable
The following program outputs a sample of the panel temperature to the card
once a second. The first parameter of the CardOut() instruction is 1, which
sets the table on the card to fill-and-stop mode. The second parameter (1000)
is the number of records which will be written before the table is full and data
storage stops. Once 1000 records have been stored, data storage to the
specified table on CRD: and CPU: datalogger memory drives will stop.
To restart data storage to the fill-and-stop table, the table must be reset.
24
Page 33
7.3.2.3 Mixed Modes
NL116 Ethernet and CompactFlash® Module
To reset a table after a fill-and-stop table has been filled and stopped, either use
the reset button in LoggerNet (Connect | Datalogger | Station Status | Table Fill Times, Reset Tables) or use the CRBasic ResetTable() instruction.
The following program stores four data tables to the card. The first two tables
will output samples of the panel temperature and battery voltage to the card
once a second. The first parameter of the CardOut() instruction is 1, which
sets the tables on the card to fill-and-stop mode. The second parameter is
1000, so 1000 records will be written to each table before stopping.
Tables 3 and 4 will output the maximum and minimum of the panel
temperature and battery voltage to the card every five seconds. (The tables will
be called once a second. The DataInterval() instruction causes data to only be
stored every five seconds.) The first parameter of the CardOut() instruction is
0, which sets the tables on the card to ring mode. The second parameter is
negative, so all available memory on the card will be allocated to these tables,
once space for the fixed-size tables has been allocated. The datalogger will
attempt to size the tables so that both will be full at the same time.
The size of each data table in CPU memory is set as part of the DataTable()
instruction and the size of each data table on the CF card is set with the
CardOut() instruction. Because they are set independently, they can be
different. It is important to note that if the CPU memory is set to fill-and-stop
mode, once a table is full, all data storage to the table will stop. No more
records will be stored to the CPU memory or the card.
7.4 CF Card Data-Retrieval Details
Data stored on CF cards can be retrieved through a communication link to the
datalogger or by removing the card and carrying it to a computer.
7.4.1 Via a Communication Link
Data can be transferred to a computer via a communication link using one of
Campbell Scientific’s datalogger support software packages (for example,
PC200W, PC400, LoggerNet). There is no need to distinguish whether the
data is to be collected from the CPU memory or a CF card. The software
package will look for data in both the CPU memory and the CF card.
The datalogger manages data on a CF card as final-storage table data, accessing
the card as needed to fill data-collection requests initiated with the Collect
button in datalogger support software. If desired, binary data can be collected
using the File Control utility in datalogger support software. Before collecting
data this way, stop the datalogger program to ensure data is not written to the
CF card while data is retrieved. Otherwise, data corruption and confusion will
result.
7.4.1.1 Fast Storage/Data-Collection Constraints
When LoggerNet collects data from ring tables that have filled, there is the
possibility of missing records due to the collection process. LoggerNet uses a
“round-robin” collection algorithm that collects data from multiple tables in
small blocks as it sequences around to all the tables. Collection starts at the
oldest data for each table. When a ring table has filled, the oldest data is
overwritten by current data.
With filled ring tables, as collection begins LoggerNet queries the datalogger
for the oldest data starting with the first table. When this data block is
returned, LoggerNet goes to the next table and so on until all of the tables are
initially collected. By the time LoggerNet makes the second pass requesting
more data from the tables, the possibility exists that some of that data may have
been overwritten, depending on how fast the datalogger is storing data (that is,
data storage rate, number of table values, and number of tables).
Normally, LoggerNet gets ahead of the storing datalogger and the remaining
data is collected without gaps; however, if the datalogger is storing data fast
enough, it is possible to get into an always-behind scenario where LoggerNet
never catches up and the datalogger repeatedly overwrites uncollected data.
26
Page 35
The possibility of missing records is greater when collecting
CAUTION
CAUTION
NOTE
data via IP. This is due to the high demand of IP on
processor time. The risk is greatest with a CR1000
datalogger using IP, because of its slower processor speed
relative to the CR3000.
7.4.2 Transporting CF Card to Computer
With large files, transferring the CF card to a computer may be faster than
collecting the data over a link.
Removing a card while it is active can cause garbled data
and can actually damage the card. Do not switch off the
datalogger power if a card is present and active.
To remove a card, press the Initiate Removal button on the NL116. The
datalogger will transfer any buffered data to the card and then power off. The
Status LED will turn green when it is OK to remove the card. The card will be
reactivated after 20 seconds if it is not removed.
When the CF card is inserted into a computer, the data files can be copied to
another drive or used directly from the CF card just as one would from any
other disk. In most cases, however, it will be necessary to convert the file
format before using the data.
NL116 Ethernet and CompactFlash® Module
When dealing with large data files, it may be faster to use an
external card reader (such as pn 17752) rather than a PC card slot.
7.4.2.1 Converting File Formats
Files can be converted using LoggerNet CardConvert. Open CardCovert from
the Data category on the LoggerNet toolbar. Click on Select Card Drive.
Select where the files to be converted are stored and press OK. Next, click on
Change Output Dir and select where you would like the converted files to be
stored. Place check marks next to the files to be converted. A default
destination filename is given. It can be changed by right-clicking with the
filename highlighted. Press the Destination File Options button to select what
file format to convert to and other options. Press Start Conversion to begin
converting files. Green checkmarks will appear next to each filename as
conversion is complete. Refer to CardConvert online help for more
information.
27
Page 36
NL116 Ethernet and CompactFlash® Module
CAUTION
FIGURE 7-4. CardConvert
7.4.2.2 Reinserting the Card
If the same card is inserted again into the NL116, the datalogger will store all
data to the card that has been generated since the card was removed that is still
in the CPU memory. If the data tables have been left on the card, new data will
be appended to the end of the old files. If the data tables have been deleted,
new ones will be generated.
Check the status of the card before leaving the datalogger.
If a CF card was not properly accepted, the Status LED will
flash orange. In that case, the user needs to reformat and
erase all data contained on the CF card. Formatting or
erasing a CF card might be done on a PC or datalogger.
The procedure for formatting a CF card is explained in
Appendix A, CF Card Maintenance(p. A-1).
7.4.2.3 Card Swapping
When transporting a CF card to a computer to retrieve data, most users will
want to use a second card to ensure that no data is lost. For this method of
collection, use the following steps.
1. Insert formatted card (“CF-A”) in NL116 attached to datalogger.
2. Send Program containing CardOut() instruction(s).
28
Page 37
NL116 Ethernet and CompactFlash® Module
3. When ready to retrieve data, press the NL116 Initiate Removal button to
remove the card. The LED will be red while the most-current data is
stored to the card and then turn green. Eject the card while the LED is
green.
4. Put in the clean card (“CF-B”).
5. Use CardConvert to copy data from CF-A to PC and convert. The default
CardConvert filename will be TOA5_stationname_tablename.dat. Once
the data is copied, use Windows Explorer to delete all data files from the card.
6. At the next card swap, eject CF-B and insert the clean CF-A.
7. Running CardConvert on CF-B will result in separate data files containing
records since CF-A was ejected. CardConvert can increment the filename
to TOA5_stationname_tablename_0.dat.
8. The data files can be joined using a software utility such as WordPad or
Excel.
CardConvert File CF-A Record Numbers CF-B Record Numbers
TOA5_tablename.dat 0-100
TOA5_tablename.dat 101-1234
TOA5_tablename.dat 1235-….
29
Page 38
NL116 Ethernet and CompactFlash® Module
30
Page 39
Appendix A. CF Card Maintenance
A.1 Formatting CF Card
The CF card can be formatted using 1) Windows Explorer, 2) the CR1000KD,
or 3) LoggerNet File Control.
A.1.1 Windows Explorer
To format card using Windows Explorer:
1) Insert CF card into CF adapter or CF reader.
2) Windows Explorer should identify a drive as a removable disk.
3) Select that drive and right-click.
4) Choose Format.
A-1
Page 40
Appendix A. CF Card Maintenance
5) Choose FAT32 under file system, give the card a label, and press Start.
(The datalogger will work with either FAT or FAT32.)
A.1.2 CR1000KD
To format card using the CR1000KD:
1) Insert CF card into NL116.
2) From the main menu of CR1000KD, choose PCCard.
3) Choose Format Card.
4) Choose Yes to proceed.
A.1.3 LoggerNet File Control
To format card using LoggerNet File Control:
1) Insert CF card into NL116.
2) Use LoggerNet to connect to datalogger.
A-2
Page 41
Appendix A. CF Card Maintenance
3) Choose FileControl under the Tools menu of the Connect screen.
4) Highlight CRD.
5) Press Format.
6) Press Yes to confirm.
A.2 Checking CF Card Integrity
The Windows Check Disk tool can be used to check the integrity of a CF card.
To access the Check Disk tool:
1) Insert CF card into CF reader.
2) Windows Explorer should identify a drive as removable disk.