Campbell Scientific CR1000X User’s Manual

Page 1
Revision: 01/27/2021
Copyright © 2000 – 2021
Campbell Scientific
CSL I.D - 1217
Page 2

Guarantee

This equipment is guaranteed against defects in materials and workmanship. We will repair or replace products which prove to be defective during the guarantee period as detailed on your invoice, provided they are returned to us prepaid. The guarantee will not apply to:
Equipment which has been modified or altered in any way without the written permission of Campbell Scientific
Batteries Any product which has been subjected to misuse, neglect, acts of God or
damage in transit.
Campbell Scientific will return guaranteed equipment by surface carrier prepaid. Campbell Scientific will not reimburse the claimant for costs incurred
in removing and/or reinstalling equipment. This guarantee and the Company’s
obligation thereunder is in lieu of all other guarantees, expressed or implied, including those of suitability and fitness for a particular purpose. Campbell Scientific is not liable for consequential damage.
Please inform us before returning equipment and obtain a Repair Reference Number whether the repair is under guarantee or not. Please state the faults as clearly as possible, and if the product is out of the guarantee period it should be accompanied by a purchase order. Quotations for repairs can be given on request. It is the policy of Campbell Scientific to protect the health of its employees and provide a safe working environment, in support of this policy a
“Declaration of Hazardous Material and Decontamination” form will be
issued for completion.
When returning equipment, the Repair Reference Number must be clearly marked on the outside of the package. Complete the “Declaration of Hazardous Material and Decontaminationform and ensure a completed copy is returned with your goods. Please note your Repair may not be processed if you do not include a copy of this form and Campbell Scientific Ltd reserves the right to return goods at the customers’ expense.
Note that goods sent air freight are subject to Customs clearance fees which Campbell Scientific will charge to customers. In many cases, these charges are greater than the cost of the repair.
Campbell Scientific Ltd,
80 Hathern Road,
Shepshed, Loughborough, LE12 9GX, UK
Tel: +44 (0) 1509 601141
Fax: +44 (0) 1509 270924
Email: support@campbellsci.co.uk
www.campbellsci.co.uk
Page 3

About this manual

Please note that this manual was originally produced by Campbell Scientific Inc. primarily for the North American market. Some spellings, weights and measures may reflect this origin.
Some useful conversion factors:
Area: 1 in2 (square inch) = 645 mm2
Length: 1 in. (inch) = 25.4 mm
1 ft (foot) = 304.8 mm 1 yard = 0.914 m 1 mile = 1.609 km
In addition, while most of the information in the manual is correct for all countries, certain information is specific to the North American market and so may not be applicable to European users.
Differences include the U.S standard external power supply details where some information (for example the AC transformer input voltage) will not be applicable for British/European use. Please note,
however, that when a power supply adapter is ordered it will be suitable for use in your country.
Reference to some radio transmitters, digital cell phones and aerials may also not be applicable according to your locality.
Some brackets, shields and enclosure options, including wiring, are not sold as standard items in the European market; in some cases alternatives are offered. Details of the alternatives will be covered in separate manuals.
Part numbers prefixed with a “#” symbol are special order parts for use with non-EU variants or for special installations. Please quote the full part number with the # when ordering.
Mass: 1 oz. (ounce) = 28.35 g
1 lb (pound weight) = 0.454 kg
Pressure: 1 psi (lb/in2) = 68.95 mb
Volume: 1 UK pint = 568.3 ml
1 UK gallon = 4.546 litres 1 US gallon = 3.785 litres
Recycling information
At the end of this product’s life it should not be put in commercial or domestic refuse but sent for recycling. Any batteries contained within the product or used during the products life should be removed from the product and also be sent to an appropriate recycling facility.
Campbell Scientific Ltd can advise on the recycling of the equipment and in some cases arrange collection and the correct disposal of it, although charges may apply for some items or territories.
For further advice or support, please contact Campbell Scientific Ltd, or your local agent.
Campbell Scientific Ltd, 80 Hathern Road, Shepshed, Loughborough, LE12 9GX,
UK Tel: +44 (0) 1509 601141 Fax: +44 (0) 1509 270924
Email: support@campbellsci.co.uk
www.campbellsci.co.uk
Page 4

Safety

DANGER — MANY HAZARD S ARE ASSOCIATED WITH INSTALLING, USING, M AINTAINING, 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 COM P LE TE LY ASS E M BLE , 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.eu or by telephoning +44(0) 1509 828 888 (UK). You are responsible for conformance with governing codes and regulati ons, including safety regulati ons, and the integrity and locati on 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 co ncerns 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 with overhead o
nderground utility lines.
u
Maintain a distance of at least one-and-one-half times structure height, or 20 feet, or the distance r
equired 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.
r
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 5

Table of Contents

1. CR1000X data acquisition system components 1
1.1 The CR1000X Datalogger 2
1.1.1 Overview 2
1.1.2 Operations 2
1.1.3 Programs 3
1.2 Sensors 3
2. Wiring panel and terminal functions 5
2.1 Power input 8
2.1.1 Powering a data logger with a vehicle 9
2.1.2 Power LED indicator 9
2.2 Power output 9
2.3 Grounds 10
2.4 Communications ports 12
2.4.1 USB device port 12
2.4.2 Ethernet port 12
2.4.3 C terminals for communications 13
2.4.3.1 SDI-12 ports 13
2.4.3.2 RS-232, RS-422, RS-485, TTL, and LVTTL ports 13
2.4.3.3 SDM ports 13
2.4.4 CS I/O port 14
2.4.5 RS-232/CPI port 15
2.5 Programmable logic control 16
3. Setting up the CR1000X 18
3.1 Setting up communications with the data logger 18
3.1.1 USB or RS-232 communications 18
3.1.2 Virtual Ethernet over USB (RNDIS) 20
3.1.3 Ethernet communications option 21
3.1.3.1 Configuring data logger Ethernet settings 21
3.1.3.2 Ethernet LEDs 22
3.1.3.3 Setting up Ethernet communications between the data logger and computer 23
Table of Contents - i
Page 6
3.2 Testing communications with EZSetup 24
3.3 Making the software connection 26
3.4 Creating a Short Cut data logger program 26
3.5 Sending a program to the data logger 29
4. Working with data 31
4.1 Default data tables 31
4.2 Collecting data 32
4.2.1 Collecting data using LoggerNet 32
4.2.2 Collecting data using PC200W or PC400 32
4.3 Viewing historic data 33
4.4 Data types and formats 33
4.4.1 Variables 34
4.4.2 Constants 35
4.4.3 Data storage 36
4.5 About data tables 37
4.5.1 Table definitions 37
4.5.1.1 Header rows 38
4.5.1.2 Data records 39
4.6 Creating data tables in a program 40
5. Data memory 42
5.1 Data tables 42
5.2 Memory allocation 42
5.3 SRAM 43
5.3.1 USRdrive 44
5.4 Flash memory 45
5.4.1 CPU drive 45
5.5 MicroSD (CRD:drive) 45
5.5.1 Formatting microSD cards 46
5.5.2 MicroSDcard precautions 46
5.5.3 Act LED indicator 47
6. Measurements 48
6.1 Voltage measurements 48
6.1.1 Single-ended measurements 49
6.1.2 Differential measurements 49
6.1.2.1 Reverse differential 50
Table of Contents - ii
Page 7
6.2 Current-loop measurements 50
6.2.1 Example Current-Loop Measurement Connections 50
6.3 Resistance measurements 52
6.3.1 Resistance measurements with voltage excitation 53
6.3.2 Strain measurements 55
6.3.3 AC excitation 57
6.3.4 Accuracy for resistance measurements 58
6.4 Thermocouple Measurements 58
6.5 Period-averaging measurements 59
6.6 Pulse measurements 60
6.6.1 Low-level AC measurements 62
6.6.2 High-frequency measurements 62
6.6.2.1 P terminals 63
6.6.2.2 C terminals 63
6.6.3 Switch-closure and open-collector measurements 63
6.6.3.1 P Terminals 64
6.6.3.2 C terminals 64
6.6.4 Edge timing and edge counting 64
6.6.4.1 Single edge timing 64
6.6.4.2 Multiple edge counting 65
6.6.4.3 Timer input NAN conditions 65
6.6.5 Quadrature measurements 65
6.6.6 Pulse measurement tips 66
6.6.6.1 Input filters and signal attenuation 67
6.6.6.2 Pulse count resolution 67
6.7 Vibrating wire measurements 67
6.7.1 VSPECT® 67
6.8 Sequential and pipeline processing modes 68
6.8.1 Sequential mode 68
6.8.2 Pipeline mode 68
6.8.3 Slow Sequences 69
7. Communications protocols 70
7.1 General serial communications 71
7.1.1 RS-232 73
7.1.2 RS-485 74
7.1.3 RS-422 74
Table of Contents - iii
Page 8
7.1.4 TTL 75
7.1.5 LVTTL 75
7.1.6 TTL-Inverted 76
7.1.7 LVTTL-Inverted 76
7.2 Modbus communications 77
7.2.1 About Modbus 78
7.2.2 Modbus protocols 79
7.2.3 Understanding Modbus Terminology 80
7.2.4 Connecting Modbus devices 80
7.2.5 Modbus master-slave protocol 80
7.2.6 About Modbus programming 81
7.2.6.1 Endianness 81
7.2.6.2 Function codes 82
7.2.7 Modbus information storage 83
7.2.7.1 Registers 83
7.2.7.2 Coils 83
7.2.7.3 Data Types 84 Unsigned 16-bit integer 84 Signed 16-bit integer 84 Signed 32-bit integer 85 Unsigned 32-bit integer 85 32-Bit floating point 85
7.2.8 Modbus tips and troubleshooting 85
7.2.8.1 Error codes 85 Result code -01: illegal function 85 Result code -02: illegal data address 86 Result code -11: COM port error 86
7.3 Internet communications 86
7.3.1 IPaddress 87
7.3.2 HTTPS server 87
7.3.3 FTP server 87
7.4 DNP3 communications 89
7.5 Serial peripheral interface (SPI) and I2C 89
7.6 PakBus communications 89
7.7 SDI-12 communications 90
7.7.1 SDI-12 transparent mode 91
7.7.1.1 Watch command (sniffer mode) 92
Table of Contents - iv
Page 9
7.7.1.2 SDI-12 transparent mode commands 93
7.7.1.3 aXLOADOS! command 93
7.7.2 SDI-12 programmed mode/recorder mode 95
7.7.3 Programming the data logger to act as an SDI-12 sensor 95
7.7.4 SDI-12 power considerations 96
8. CR1000X maintenance 97
8.1 Data logger calibration 97
8.1.1 About background calibration 98
8.2 Data logger security 99
8.2.1 TLS 100
8.2.2 Security codes 100
8.2.3 Creating a .csipasswd file 101
8.2.3.1 Command syntax 103
8.3 Data logger enclosures 103
8.4 Internal battery 104
8.4.1 Replacing the internal battery 105
8.5 Electrostatic discharge and lightning protection 107
8.6 Power budgeting 109
8.7 Updating the operating system 109
8.7.1 Sending an operating system to a local data logger 110
8.7.2 Sending an operating system to a remote data logger 111
8.8 File management via powerup.ini 112
8.8.1 Syntax 113
8.8.2 Example powerup.ini files 114
9. Tips and troubleshooting 116
9.1 Checking station status 117
9.1.1 Viewing station status 118
9.1.2 Watchdog errors 118
9.1.3 Results for last program compiled 119
9.1.4 Skipped scans 119
9.1.5 Skipped records 119
9.1.6 Variable out of bounds 119
9.1.7 Battery voltage 119
9.2 Understanding NAN and INF occurrences 119
9.3 Timekeeping 120
Table of Contents - v
Page 10
9.3.1 Clock best practices 121
9.3.2 Time stamps 121
9.3.3 Avoiding time skew 122
9.4 CRBasic program errors 122
9.4.1 Program does not compile 123
9.4.2 Program compiles but does not run correctly 123
9.5 Resetting the data logger 124
9.5.1 Processor reset 124
9.5.2 Program send reset 124
9.5.3 Manual data table reset 125
9.5.4 Formatting drives 125
9.5.5 Full memory reset 125
9.6 Troubleshooting power supplies 125
9.7 Using terminal mode 126
9.7.1 Serial talk through and comms watch 129
9.7.2 SDI-12 transparent mode 129
9.7.2.1 Watch command (sniffer mode) 130
9.7.2.2 SDI-12 transparent mode commands 131
9.8 Ground loops 131
9.8.1 Common causes 132
9.8.2 Detrimental effects 132
9.8.3 Severing a ground loop 134
9.8.4 Soil moisture example 135
9.9 Improving voltage measurement quality 136
9.9.1 Deciding between single-ended or differential measurements 136
9.9.2 Minimizing ground potential differences 137
9.9.2.1 Ground potential differences 138
9.9.3 Detecting open inputs 138
9.9.4 Minimizing power-related artifacts 139
9.9.4.1 Minimizing electronic noise 140
9.9.5 Filtering to reduce measurement noise 141
9.9.5.1 CR1000X filtering details 141
9.9.6 Minimizing settling errors 142
9.9.6.1 Measuring settling time 142
9.9.7 Factors affecting accuracy 144
9.9.7.1 Measurement accuracy example 145
9.9.8 Minimizing offset voltages 145
Table of Contents - vi
Page 11
9.9.8.1 Compensating for offset voltage 147
9.9.8.2 Measuring ground reference offset voltage 148
9.10 Field calibration 149
9.11 File system error codes 149
9.12 File name and resource errors 151
9.13 Background calibration errors 151
10. Information tables and settings (advanced) 152
10.1 DataTableInfo table system information 153
10.1.1 DataFillDays 153
10.1.2 DataRecordSize 153
10.1.3 DataTableName 153
10.1.4 RecNum 153
10.1.5 SecsPerRecord 154
10.1.6 SkippedRecord 154
10.1.7 TimeStamp 154
10.2 Status table system information 154
10.2.1 Battery 154
10.2.2 BuffDepth 154
10.2.3 CalCurrent 154
10.2.4 CalGain 155
10.2.5 CalOffset 155
10.2.6 CalRefOffset 155
10.2.7 CalRefSlope 155
10.2.8 CalVolts 155
10.2.9 CardStatus 155
10.2.10 CommsMemFree 155
10.2.11 CompileResults 155
10.2.12 ErrorCalib 155
10.2.13 FullMemReset 156
10.2.14 LastSystemScan 156
10.2.15 LithiumBattery 156
10.2.16 Low12VCount 156
10.2.17 MaxBuffDepth 156
10.2.18 MaxProcTime 156
10.2.19 MaxSystemProcTime 156
10.2.20 MeasureOps 156
Table of Contents - vii
Page 12
10.2.21 MeasureTime 157
10.2.22 MemoryFree 157
10.2.23 MemorySize 157
10.2.24 Messages 157
10.2.25 OSDate 157
10.2.26 OSSignature 157
10.2.27 OSVersion 157
10.2.28 PakBusRoutes 157
10.2.29 PanelTemp 158
10.2.30 PortConfig 158
10.2.31 PortStatus 158
10.2.32 ProcessTime 158
10.2.33 ProgErrors 158
10.2.34 ProgName 158
10.2.35 ProgSignature 158
10.2.36 RecNum 159
10.2.37 RevBoard 159
10.2.38 RunSignature 159
10.2.39 SerialNumber 159
10.2.40 SkippedScan 159
10.2.41 SkippedSystemScan 159
10.2.42 StartTime 159
10.2.43 StartUpCode 160
10.2.44 StationName 160
10.2.45 SW12Volts 160
10.2.46 SystemProcTime 160
10.2.47 TimeStamp 160
10.2.48 VarOutOfBound 160
10.2.49 WatchdogErrors 161
10.2.50 WiFiUpdateReq 161
10.3 CPIStatus system information 161
10.3.1 BusLoad 161
10.3.2 ModuleReportCount 161
10.3.3 ActiveModules 162
10.3.4 BuffErr (buffer error) 162
10.3.5 RxErrMax 162
10.3.6 TxErrMax 162
Table of Contents - viii
Page 13
10.3.7 FrameErr (frame errors) 162
10.3.8 ModuleInfo array 162
10.4 Settings 163
10.4.1 Baudrate 163
10.4.2 Beacon 163
10.4.3 CentralRouters 164
10.4.4 CommsMemAlloc 164
10.4.5 ConfigComx 164
10.4.6 CSIOxnetEnable 165
10.4.7 CSIOInfo 165
10.4.8 DisableLithium 165
10.4.9 DeleteCardFilesOnMismatch 165
10.4.10 DNS 165
10.4.11 EthernetInfo 166
10.4.12 EthernetPower 166
10.4.13 FilesManager 166
10.4.14 FTPEnabled 166
10.4.15 FTPPassword 166
10.4.16 FTPPort 166
10.4.17 FTPUserName 166
10.4.18 HTTPEnabled 167
10.4.19 HTTPHeader 167
10.4.20 HTTPPort 167
10.4.21 HTTPSEnabled 167
10.4.22 HTTPSPort 167
10.4.23 IncludeFile 167
10.4.24 IPAddressCSIO 168
10.4.25 IPAddressEth 168
10.4.26 IPGateway 168
10.4.27 IPGatewayCSIO 168
10.4.28 IPMaskCSIO 168
10.4.29 IPMaskEth 169
10.4.30 IPTrace 169
10.4.31 IPTraceCode 169
10.4.32 IPTraceComport 169
10.4.33 IsRouter 169
10.4.34 MaxPacketSize 169
Table of Contents - ix
Page 14
10.4.35 Neighbours
10.4.36 NTPServer
10.4.37 PakBusAddress
10.4.38 PakBusEncryptionKey
10.4.39 PakBusNodes
10.4.40 PakBusPort
10.4.41 PakBusTCPClients
10.4.42 PakBusTCPEnabled
10.4.43 PakBusTCPPassword
10.4.44 PingEnabled
10.4.45 PCAP
10.4.46 pppDial
10.4.47 pppDialResponse
10.4.48 pppInfo
10.4.49 pppInterface
10.4.50 pppIPAddr
10.4.51 pppPassword
10.4.52 pppUsername
10.4.53 RouteFilters
10.4.54 RS232Handshaking
10.4.55 RS232Power
10.4.56 RS232Timeout
10.4.57 Security(1), Security(2), Security(3)
10.4.58 ServicesEnabled
10.4.59 TCPClientConnections
10.4.60 TCP_MSS
10.4.61 TCPPort
10.4.62 TelnetEnabled
10.4.63 TLSConnections (Max TLS Server Connections)
10.4.64 TLSPassword
10.4.65 TLSStatus
10.4.66 UDPBroadcastFilter
10.4.67 USBEnumerate
10.4.68 USRDriveFree
10.4.69 USRDriveSize
10.4.70 UTCOffset
10.4.71 Verify
170 170 170 170 170
171 171 171 171 171
171 172 172 172 172 172 173 173 173 173 173
174 174 174 174 174 174 174 174
175 175 175 175 175 175 176 176
Table of Contents - x
Page 15
11. CR1000X Specifications 177
11.1 System specifications 177
11.2 Physical specifications 178
11.3 Power requirements 178
11.4 Power output specifications 179
11.4.1 System power out limits (when powered with 12VDC) 179
11.4.2 12 V and SW12 V power output terminals 179
11.4.3 5 V and 3.3 V 180
11.4.4 C as power output 180
11.4.5 CSI/O pin 1 180
11.4.6 Voltage excitation 181
11.5 Analogue measurement specifications 181
11.5.1 Voltage measurements 181
11.5.2 Resistance measurement specifications 183
11.5.3 Period-averaging measurement specifications 184
11.5.4 Current-loop measurement specifications 184
11.6 Pulse measurement specifications 185
11.6.1 Switch closure input 185
11.6.2 High-frequency input 186
11.6.3 Low-level AC input 186
11.7 Digital input/output specifications 186
11.7.1 Switch closure input 187
11.7.2 High-frequency input 187
11.7.3 Edge timing 187
11.7.4 Edge counting 187
11.7.5 Quadrature input 187
11.7.6 Pulse-width modulation 188
11.8 Communications specifications 188
11.9 Standards compliance specifications 189
Appendix A. Glossary 190
Table of Contents - xi
Page 16

1. CR1000X data acquisition system components

A basic data acquisition system consists of sensors, measurement hardware, and a computer with programmable software. The objective of a data acquisition system should be high accuracy, high precision, and resolution as high as appropriate for a given application.
The components of a basic data acquisition system are shown in the following figure.
Following is a list of typical data acquisition system components:
l Sensors - Electronic sensors convert the state of a phenomenon to an electrical signal (see
Sensors (p. 3) for more information).
l Data logger - The data logger measures electrical signals or reads serial characters. It
converts the measurement or reading to engineering units, performs calculations, and reduces data to statistical values. Data is stored in memory to await transfer to a computer by way of an external storage device or a communications link.
l Data Retrieval and Communications - Data is copied (not moved) from the data logger,
usually to a computer, by one or more methods using data logger support software. Most communications options are bi-directional, which allows programs and settings to be sent to the data logger. For more information, see Sending a program to the data logger (p. 29).
1. CR1000X data acquisition system components 1
Page 17
l Datalogger Support Software - Software retrieves data, sends programs, and sets settings.
The software manages the communications link and has options for data display.
l Programmable Logic Control - Some data acquisition systems require the control of
external devices to facilitate a measurement or to control a device based on measurements. This data logger is adept at programmable logic control. See Programmable logic control (p. 16) for more information.
l Measurement and Control Peripherals - Sometimes, system requirements exceed the
capacity of the data logger. The excess can usually be handled by addition of input and output expansion modules.

1.1 The CR1000X Datalogger

The CR1000X is used in a broad range of measurement and control projects. Rugged enough for extreme conditions and reliable enough for remote environments, it plays a critical role in numerous complex applications. Used in applications all over the world, it is a powerful core component for your data acquisition system.

1.1.1 Overview

The CR1000X data logger is the main part of a data acquisition system (see CR1000X data
acquisition system components (p. 1) for more information). It has a central-processing unit
(CPU), analogue and digital measurement inputs, analogue and digital outputs, and memory. An operating system (firmware) coordinates the functions of these parts in conjunction with the onboard clock and the CRBasic application program.
The CR1000X can simultaneously provide measurement and communications functions. Low power consumption allows the data logger to operate for extended time on a battery recharged with a solar panel, eliminating the need for ac power. The CR1000X temporarily suspends operations when primary power drops below 9.6 V, reducing the possibility of inaccurate measurements.
The electronics are RF shielded and protected by the sealed, stainless-steel canister, making the CR1000X economical, small, and very rugged. A battery-backed clock assures accurate timekeeping.

1.1.2 Operations

The CR1000X measures almost any sensor with an electrical response, drives direct communications and telecommunications, reduces data to statistical values, performs calculations, and controls external devices. After measurements are made, data is stored in onboard, nonvolatile memory. Because most applications do not require that every measurement
1. CR1000X data acquisition system components 2
Page 18
be recorded, the program usually combines several measurements into computational or statistical summaries, such as averages and standard deviations.

1.1.3 Programs

A program directs the data logger on how and when sensors are measured, calculations are made, data is stored, and devices are controlled. The application program for the CR1000X is written in CRBasic, a programming language that includes measurement, data processing, and analysis routines, as well as the standard BASIC instruction set. For simple applications, Short Cut, a user-friendly program generator, can be used to generate the program. For more demanding programs, use the full featured CRBasic Editor.

1.2 Sensors

Sensors transduce phenomena into measurable electrical forms by modulating voltage, current, resistance, status, or pulse output signals. Suitable sensors do this with accuracy and precision. Smart sensors have internal measurement and processing components and simply output a digital value in binary, hexadecimal, or ASCII character form.
Most electronic sensors, regardless of manufacturer, will interface with the data logger. Some sensors require external signal conditioning. The performance of some sensors is enhanced with specialized input modules. The data logger, sometimes with the assistance of various peripheral devices, can measure or read nearly all electronic sensor output types.
The following list may not be comprehensive. A library of sensor manuals and application notes is available at www.campbellsci.eu/support to assist in measuring many sensor types.
l Analogue
o
Voltage
o
Current
o
Strain
o
Thermocouple
o
Resistive bridge
l Pulse
o
High frequency
o
Switch-closure
o
Low-level ac
o
Quadrature
l Period average l Vibrating wire (through interface modules)
1. CR1000X data acquisition system components 3
Page 19
l Smart sensors
o
SDI-12
o
RS-232
o
Modbus
o
DNP3
o
TCP/IP
o
RS-422
o
RS-485
1. CR1000X data acquisition system components 4
Page 20

2. Wiring panel and terminal functions

The CR1000X wiring panel provides ports and removable terminals for connecting sensors, power, and communications devices. It is protected against surge, over-voltage, over-current, and reverse power. The wiring panel is the interface to most data logger functions so studying it is a good way to get acquainted with the data logger. Functions of the terminals are broken down into the following categories:
l Analogue input l Pulse counting l Analogue output l Communications l Digital I/O l Power input l Power output l Power ground l Signal ground
2. Wiring panel and terminal functions 5
Page 21
Table 2-1: Analogue input terminal functions
12
34
56
78
910
1112
1314
1516
SE
1
2
3
4
5
6
7
8
RG1 RG2
DIFF
HL
Single-Ended
✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Voltage
Differential
H L H L H L H L H L H L H L H L
Voltage
Ratiometric/Bridge ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Thermocouple ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Current Loop
Period Average ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
HL
HL
HL
HL
HL
HL
HL
Table 2-2: Pulse counting terminal functions
P1 P2 C1-C8
Switch-Closure
High Frequency
Low-level Ac
NOTE: Conflicts can occur when a control port pair is used for different instructions (TimerInput(),
PulseCount(), SDI12Recorder(), WaitDigTrig()). For example, if C1 is used for SDI12Recorder(), C2 cannot be used for TimerInput(), PulseCount(), or WaitDigTrig().
Table 2-3: Analogue output terminal functions
VX1-VX4
Switched Voltage Excitation
2. Wiring panel and terminal functions 6
Page 22
Table 2-4: Voltage Output
C1-C81VX1-VX4 5V 12V SW12-1 SW12-2
5 VDC
3.3 VDC
12 VDC
1
C terminals have limited drive capacity. Voltage levels are configured in pairs.
Table 2-5: Communications terminal functions
C1 C2 C3 C4 C5 C6 C7 C8 RS-232/CPI
SDI-12
GPS PPS Rx Tx Rx Tx Rx Tx Rx
TTL 0-5 V Tx Rx Tx Rx Tx Rx Tx Rx
LVTTL 0-3.3 V Tx Rx Tx Rx Tx Rx Tx Rx
RS-232 Tx Rx Tx Rx
RS-485 (Half Duplex) A- B+ A- B+
RS-485 (Full Duplex) Tx- Tx+ Rx- Rx+
I2C SDA SCL SDA SCL SDA SCL SDA SCL
SPI MOSI SCLK MISO MOSI SCLK MISO
1
SDM
Data Clk Enabl Data Clk Enabl
CPI/CDM
1
SDM can be on either C1-C3 or C5-C7, but not both at the same time.
Communications functions also include Ethernet and USB.
Table 2-6: Digital I/O terminal functions
C1-C8
General I/O
Pulse-Width Modulation Output
Timer Input
2. Wiring panel and terminal functions 7
Page 23
Table 2-6: Digital I/O terminal functions
C1-C8
Interrupt
Quadrature

2.1 Power input

The data logger requires a power supply. It can receive power from a variety of sources, operate for several months on non-rechargeable batteries, and supply power to many sensors and devices. The data logger operates with external power connected to the green POWER IN port on the face of the wiring panel Wiring panel and terminal functions (p. 5). The positive power wire connects to the 12V terminal. The negative wire connects to G. The power terminals are internally protected against polarity reversal and high voltage transients. If the voltage on the POWERIN terminals exceeds 19 V, power is shut off to certain parts of the data logger to prevent damaging connected sensors or peripherals.
The primary power source, which is often a transformer, power converter, or solar panel, connects to the charging regulator, as does a nominal 12 VDC sealed rechargeable battery. A third connection connects the charging regulator to the 12V and G terminals of the POWER IN port. UPS (uninterruptible power supply) is often the best power source for long-term installations. If external alkaline power is used, the alkaline battery pack is connected directly to the POWER IN port. External UPS consists of a primary-power source, a charging regulator external to the data logger, and an external battery.
WARNING: Sustained input voltages in excess of those listed in the Power requirements (p. 178), can damage the transient voltage suppression.
Ensure that power supply components match the specifications of the device to which they are connected. When connecting power, switch off the power supply, insert the connector, then turn the power supply on. Troubleshooting power supplies (p. 125)
The CR1000X can receive power via the POWERIN port as well as 5 VDC via a USB connection. If both POWERINand USB are connected, power will be supplied by whichever has the highest voltage. If USB is the only power source, then the CS I/O port and the 12V, SW12, and 5V terminals will not be operational. When powered by USB (no other power supplies connected) Status field Battery = 0. Functions that will be active with a 5 VDC source ( USB) include sending programs, adjusting data logger settings, and making some measurements.
2. Wiring panel and terminal functions 8
Page 24
NOTE: The Status field Battery value and the destination variable from the Battery() instruction (often called batt_volt in the Public table) reference the external battery voltage. For information about the internal battery, see Internal battery (p. 104).

2.1.1 Powering a data logger with a vehicle

If a data logger is powered by a motor-vehicle power supply, a second power supply may be needed. When starting the motor of the vehicle, battery voltage often drops below the voltage required for data logger operation. This may cause the data logger to stop measurements until the voltage again equals or exceeds the lower limit. A second supply or charge regulator can be provided to prevent measurement lapses during vehicle starting.
In vehicle applications, the earth ground lug should be firmly attached to the vehicle chassis with 12 AWG wire or larger.

2.1.2 Power LED indicator

When the data logger is powered, the Power LED will turn on according to power and program states:
l Off: No power, no program running. l 1 flash every 10 seconds: Powered from BAT, program running. l 2 flashes every 10 seconds: Powered from CHG, program running. l 3 flashes every 10 seconds: Powered via USB, program running. l Always on: Powered, no program running.

2.2 Power output

The data logger can be used as a power source for communications devices, sensors and peripherals. Take precautions to prevent damage to these external devices due to over- or under­voltage conditions, and to minimize errors. Additionally, exceeding current limits causes voltage output to become unstable. Voltage should stabilize once current is again reduced to within stated limits. The following are available:
l 12V: unregulated nominal 12 VDC. This supply closely tracks the primary data logger supply
voltage; so, it may rise above or drop below the power requirement of the sensor or peripheral. Precautions should be taken to minimize the error associated with measurement of underpowered sensors.
2. Wiring panel and terminal functions 9
Page 25
l 5V: regulated 5 VDC. The 5 VDC supply is regulated to within a few millivolts of 5 VDC as
long as the main power supply for the data logger does not drop below the minimum supply voltage. It is intended to power sensors or devices requiring a 5 VDC power supply. It is not intended as an excitation source for bridge measurements. Current output is shared with the CSI/O port; so, the total current must be within the current limit.
SW12: program-controlled, switched 12 VDC terminals. It is often used to power devices
l
such as sensors that require 12 VDC during measurement. Voltage on a SW12 terminal will change with data logger supply voltage. CRBasic instruction SW12()controls the SW12 terminal. See the CRBasic Editor help for detailed instruction information and program examples: https://help.campbellsci.eu/crbasic/cr1000x/.
l CS I/O port: used to communicate with and often supply power to Campbell Scientific
peripheral devices.
CAUTION: Voltage levels at the 12V and switched SW12 terminals, and pin 8 on the CS I/O port, are tied closely to the voltage levels of the main power supply. Therefore, if the power received at the POWER IN 12V and G terminals is 16 VDC, the 12V and SW12 terminals and pin 8 on the CS I/O port will supply 16 VDC to a connected peripheral. The connected peripheral or sensor may be damaged if it is not designed for that voltage level.
VX terminals: supply precise output voltage used by analogue sensors to generate high
l
resolution and accurate signals. In this case, these terminals are regularly used with resistive­bridge measurements (see Resistance measurements (p. 52) for more information).
Using the
SWVX() instruction, VX terminals can also supply a selectable, switched, regulated 3.3 or 5
VDC power source to power digital sensors and toggle control lines.
l C terminals: can be set low or high as output terminals . With limited drive capacity, digital
output terminals are normally used to operate external relay-driver circuits. See also Digital
input/output specifications (p. 186).
See also Power output specifications (p. 179).

2.3 Grounds

Proper grounding lends stability and protection to a data acquisition system. Grounding the data logger with its peripheral devices and sensors is critical in all applications. Proper grounding will ensure maximum ESD protection and measurement accuracy. It is the easiest and least expensive insurance against data loss, and often the most neglected. The following terminals are provided for connection of sensor and data logger grounds:
2. Wiring panel and terminal functions 10
Page 26
l Signal Ground ( ) - reference for single-ended analogue inputs, excitation returns, and a
ground for sensor shield wires.
o
11 common terminals
l Power Ground (G) - return for 3.3 V, 5 V, 12 V, and digital sensors. Use of G grounds for
these outputs minimizes potentially large current flow through the analogue- voltage-measurement section of the wiring panel, which can cause single-ended voltage measurement errors.
o
4 common terminals
l Resistive Ground (RG) - used for non-isolated 0-20 mA and 4-20 mA current loop
measurements (see Current-loop measurements (p. 50) for more information). Also used for decoupling ground on RS-485 signals. Includes 100 Ω resistance to ground. Maximum voltage for RG terminals is ±16 V.
o
2 common terminals
l Earth Ground Lug ( ) - connection point for heavy-gauge earth-ground wire. A good earth
connection is necessary to secure the ground potential of the data logger and shunt transients away from electronics. Campbell Scientific recommends 14 AWG wire, minimum.
NOTE: Several ground wires can be connected to the same ground terminal.
A good earth (chassis) ground will minimize damage to the data logger and sensors by providing a low-resistance path around the system to a point of low potential. Campbell Scientific recommends that all data loggers be earth grounded. All components of the system (data loggers, sensors, external power supplies, mounts, housings) should be referenced to one common earth ground.
In the field, at a minimum, a proper earth ground will consist of a 5-foot copper-sheathed grounding rod driven into the earth and connected to the large brass ground lug on the wiring panel with a 14 AWG wire. In low-conductive substrates, such as sand, very dry soil, ice, or rock, a single ground rod will probably not provide an adequate earth ground. For these situations, search for published literature on lightning protection or contact a qualified lightning-protection consultant.
In laboratory applications, locating a stable earth ground is challenging, but still necessary. In older buildings, new VAC receptacles on older VAC wiring may indicate that a safety ground exists when, in fact, the socket is not grounded. If a safety ground does exist, good practice dictates to verify that it carries no current. If the integrity of the VAC power ground is in doubt, also ground the system through the building plumbing, or use another verified connection to earth ground.
2. Wiring panel and terminal functions 11
Page 27
See also:
l Ground loops (p. 131) l Minimizing ground potential differences (p. 137)

2.4 Communications ports

The data logger is equipped with ports that allow communications with other devices and networks, such as:
l Computers l Smart sensors l Modbus and DNP3 networks l Ethernet l Modems l Campbell Scientific PakBus® networks l Other Campbell Scientific data loggers
Campbell Scientific data logger communications ports include:
l CS I/O l RS-232/CPI l USB Device l Ethernet l C terminals

2.4.1 USB device port

One USB device port supports communicating with a computer through data logger support software or through virtual Ethernet (RNDIS), and provides 5 VDC power to the data logger (powering through the USB port has limitations - details are available in the specifications). The data logger USB device port does not support USBflash or thumb drives. Although the USB connection supplies 5 V power, a 12 VDC battery will be needed for field deployment.

2.4.2 Ethernet port

The RJ45 10/100 Ethernet port is used for IP communications.
2. Wiring panel and terminal functions 12
Page 28

2.4.3 C terminals for communications

C terminals are configurable for the following communications types:
l SDI-12 l RS-232 l RS-422 l RS-485 l TTL (0 to 5 V) l LVTTL (0 to 3.3 V) l SDM
Some communications types require more than one terminal, and some are only available on specific terminals. This is shown in the data logger specifications.
2.4.3.1 SDI-12 ports
SDI-12 is a 1200 baud protocol that supports many smart sensors. C1, C3, C5, and C7 can be configured as SDI-12 ports. Maximum cable lengths depend on the number of sensors connected, the type of cable used, and the environment of the application. Refer to the sensor manual for guidance.
For more information, see SDI-12 communications (p. 90).
2.4.3.2 RS-232, RS-422, RS-485, TTL, and LVTTL ports
RS-232, RS-422, RS-485, TTL, and LVTTL communications are typically used for the following:
l Reading sensors with serial output l Creating a multi-drop network l Communications with other data loggers or devices over long cables
Configure C terminals as serial ports using Device Configuration Utility or by using the
SerialOpen() CRBasic instruction. C terminals are configured in pairs for TTL, LVTTL, RS-232,
and half-duplex RS-422 and RS-485 communications. For full-duplex RS-422 and RS-485, four C terminals are required. See also Communications protocols (p. 70).
2.4.3.3 SDM ports
SDM is a protocol proprietary to Campbell Scientific that supports several Campbell Scientific digital sensor and communications input and output expansion peripherals and select smart sensors. It uses a common bus and addresses each node. CRBasic SDM device and sensor instructions configure terminals C1, C2, and C3 together to create an SDM port. Alternatively,
2. Wiring panel and terminal functions 13
Page 29
terminals C5, C6, and C7 can be configured together to be used as the SDM port by using the
SDMBeginPort()instruction.
See also Communications specifications (p. 188).

2.4.4 CS I/O port

One nine-pin port, labelled CS I/O, is available for communicating with a computer through Campbell Scientific communications interfaces, modems, and peripherals. Campbell Scientific recommends keeping CS I/O cables short (maximum of a few feet). See also Communications
specifications (p. 188).
Table 2-7: CS I/O pinout
Pin
Function
Number
1 5 VDC O 5 VDC: sources 5 VDC, used to power peripherals.
2 SG
3 RING I
4 RXD I
5 ME O
6 SDE O
7 CLK/HS I/O
Input(I)
Description
Output(O)
Signal ground: provides a power return for pin 1 (5V), and is used as a reference for voltage levels.
Ring: raised by a peripheral to put the CR1000X in the telecom mode.
Receive data: serial data transmitted by a peripheral are received on pin 4.
Modem enable: raised when the CR1000X determines that a modem raised the ring line.
Synchronous device enable: addresses synchronous devices (SD); used as an enable line for printers.
Clock/handshake: with the SDE and TXD lines addresses and transfers data to SDs. When not used as a clock, pin 7 can be used as a handshake line; during printer output, high enables, low disables.
2. Wiring panel and terminal functions 14
Page 30
Table 2-7: CS I/O pinout
Pin
Function
Number
Input(I)
Description
Output(O)
Nominal 12 VDC power. Same power as 12V and SW12
8 12VDC
terminals.
Transmit data: transmits serial data from the data logger to peripherals on pin 9; logic-low marking (0V), logic­high spacing (5V), standard-asynchronous ASCII: eight
9 TXD O
data bits, no parity, one start bit, one stop bit. User selectable baud rates: 300, 1200, 2400, 4800, 9600, 19200, 38400, 115200.

2.4.5 RS-232/CPI port

The data logger includes one RJ45 module jack labelled RS-232/CPI. CPI is a proprietary interface for communications between Campbell Scientific data loggers and Campbell Scientific CDM peripheral devices and smart sensors. It consists of a physical layer definition and a data protocol. CDM devices are similar to Campbell Scientific SDM devices in concept, but the CPI bus enables higher data-throughput rates and use of longer cables. CDM devices require more power to operate in general than do SDM devices. CPI ports also enable networking between compatible Campbell Scientific data loggers. Consult the manuals for CDM modules for more information.
CPI port power levels are controlled automatically by the CR1000X:
l Off: Not used. l High power: Fully active. l Low-power standby: Used whenever possible. l Low-power bus: Sets bus and modules to low power.
When used with a Campbell Scientific RJ45-to-DB9 converter cable, the RS-232/CPI port can be used as an RS-232 port. It defaults to 115200 bps (in autobaud mode), 8 data bits, no parity, and 1 stop bit. Use Device Configuration Utility or the SerialOpen() CRBasic instruction to change these options.
Table 2-8: RS-232/CPI pinout
Pin Number Description
1 RS-232: Transmit (Tx)
2 RS-232: Receive (Rx)
2. Wiring panel and terminal functions 15
Page 31
Table 2-8: RS-232/CPI pinout
Pin Number Description
3 100 Ω Res Ground
4 CPI: Data
5 CPI: Data
6 100 Ω Res Ground
7 RS-232 CTS CPI: Sync
8 RS-232 DTR CPI: Sync
9 Not Used

2.5 Programmable logic control

The data logger can control instruments and devices such as:
l Controlling cellular modem or GPS receiver to conserve power. l Triggering a water sampler to collect a sample. l Triggering a camera to take a picture. l Activating an audio or visual alarm. l Moving a head gate to regulate water flows in a canal system. l Controlling pH dosing and aeration for water quality purposes. l Controlling a gas analyzer to stop operation when temperature is too low. l Controlling irrigation scheduling.
Control decisions can be based on time, an event, or a measured condition. Controlled devices can be physically connected to C, VX, or SW12 terminals. Short Cut has provisions for simple on/off control. Control modules and relay drivers are available to expand and augment data logger control capacity.
C terminals are selectable as binary inputs, control outputs, or communication ports. These
l
terminals can be set low (0 VDC) or high (3.3 or 5 VDC) using the PortSet()or
WriteIO() instructions. See the CRBasic Editor help for detailed instruction information
and program examples: https://help.campbellsci.eu/crbasic/cr1000x/. Other functions include device-driven interrupts, asynchronous communications and SDI-12 communications. The high voltage for these terminals defaults to 5 V, but it can be changed to 3.3 V using the PortPairConfig()instruction. Terminals C4, C5, and C7 can also be configured for pulse width modulation with a maximum period of 36.4 s. A C terminal configured for digital I/O is normally used to operate an external relay-driver
2. Wiring panel and terminal functions 16
Page 32
circuit because the terminal itself has limited drive capacity.
l VX terminals can be set low or high using the PortSet() or SWVX() instruction. For
more information on these instructions, see the CRBasic help.
l SW12 terminals can be set low (0 V) or high (12 V) using the SW12() instruction (see the
CRBasic help for more information).
The following image illustrates a simple application wherein a C terminal configured for digital input, and another configured for control output are used to control a device (turn it on or off) and monitor the state of the device (whether the device is on or off).
In the case of a cell modem, control is based on time. The modem requires 12 VDC power, so connect its power wire to a data logger SW12 terminal. The following code snip turns the modem on for the first ten minutes of every hour using the TimeIsBetween() instruction embedded in an If/Then logic statement:
If TimeIsBetween (0,10,60,Min)Then
SW12(SW12_1,1,1) 'Turn phone on.
Else
SW12(SW12_1,0,1) 'Turn phone off.
EndIf
2. Wiring panel and terminal functions 17
Page 33

3. Setting up the CR1000X

The basic steps for setting up your data logger to take measurements and store data are included in the following sections:
3.1 Setting up communications with the data logger 18
3.2 Testing communications with EZSetup 24
3.3 Making the software connection 26
3.4 Creating a Short Cut data logger program 26
3.5 Sending a program to the data logger 29

3.1 Setting up communications with the data logger

The first step in setting up and communicating with your data logger is to configure your connection. Communications peripherals, data loggers, and software must all be configured for communications. Additional information is found in your specific peripheral manual, and the data logger support software manual and help.
You can configure your connection using any of the following options. The simplest is via USB. For detailed instruction, see:
3.1.1 USB or RS-232 communications 18
3.1.2 Virtual Ethernet over USB (RNDIS) 20
3.1.3 Ethernet communications option 21
For other configurations, see the LoggerNet EZSetup Wizard help. Context-specific help is given in each step of the wizard by clicking the Help button in the bottom right corner of the window. For complex data logger networks, use Network Planner. For more information on using the Network Planner, watch a video at https://www.campbellsci.eu/videos/loggernet-software-
network-planner .

3.1.1 USB or RS-232 communications

Setting up a USB or RS-232 connection is a good way to begin communicating with your data logger. Because these connections do not require configuration (like an IPaddress), you need
3. Setting up the CR1000X 18
Page 34
only set up the communications between your computer and the data logger. Use the following instructions or watch the Quickstart videos at https://www.campbellsci.eu/videos .
Follow these steps to get started. These settings can be revisited using the data logger support software Edit Datalogger Setup option .
1. Using data logger support software, launch the EZSetup Wizard.
l
LoggerNet users, click Setup , click the View menu to ensure you are in the EZ (Simplified) view, then click Add Datalogger.
l
PC400 and PC200W users, click Add Datalogger .
2. Click Next.
3. Select your data logger from the list, type a name for your data logger (for example, a site or project name), and click Next.
4. If prompted, select the Direct Connect connection type and click Next.
5. If this is the first time connecting this computer to a CR1000X via USB, click Install USBDriver, select your data logger, click Install, and follow the prompts to install the USBdrivers.
6. Plug the data logger into your computer using a USBor RS-232 cable. The USB connection supplies 5 V power as well as a communications link, which is adequate for setup. A 12V battery will be needed for field deployment. If using RS-232, external power must be provided to the data logger and a CPI/RS-232 RJ45 to DB9 cable is required to connect to the computer.
NOTE: The Power LED on the data logger indicates the program and power state. Because the data logger ships with a program set to run on power-up, the Power LED flashes 3 times every 10 seconds when powered over USB. When powered with a 12 V battery, it flashes 1 time every 10 seconds.
7. From the COM Port list, select the COMport used for your data logger.
8. USB and RS-232 connections do not typically require a COM Port Communication Delay ­this allows time for the hardware devices to "wake up" and negotiate a communications link. Accept the default value of 00 seconds and click Next.
9. The baud rate and PakBus address must match the hardware settings for your data logger. The default PakBus address is 1. A USB connection does not require a baud rate selection. RS-232 connections default to 115200 baud.
3. Setting up the CR1000X 19
Page 35
10. Set an Extra Response Time if you have a difficult or marginal connection and you want the data logger support software to wait a certain amount of time before returning a communication failure error.
11. LoggerNet and PC400 users can set a Max Time On-Line to limit the amount of time the data logger remains connected. When the data logger is contacted, communication with it is terminated when this time limit is exceeded. A value of 0 in this field indicates that there is no time limit for maintaining a connection to the data logger.
12. Click Next.
13. By default, the data logger does not use a security code or a PakBus encryption key. Therefore, the Security Code can be set to 0 and the PakBus Encryption Key can be left blank. If either setting has been changed, enter the new code or key. See Data logger
security (p. 99) for more information.
14. Click Next.
15. Review the Setup Summary. If you need to make changes, click Previous to return to a previous window and change the settings.
Setup is now complete, and the EZSetup Wizard allows to you click Finish or click Next to test communications, set the data logger clock, and send a program to the data logger. See Testing
communications with EZSetup (p. 24) for more information.

3.1.2 Virtual Ethernet over USB (RNDIS)

The data logger supports RNDIS (virtual Ethernet over USB). This allows the data logger to communicate via TCP/IP over USB. Watch a video
https://www.campbellsci.eu/videos/ethernet-over-usb or use the following instructions.
1. Supply power to the data logger. If connecting via USB for the first time, you must first install USB drivers by using Device Configuration Utility (select your data logger, then on the main page, click Install USBDriver). Alternately, you can install the USBdrivers using EZ Setup. A USB connection supplies 5 V power (as well as a communication link), which is adequate for setup, but a 12 V battery will be needed for field deployment.
3. Setting up the CR1000X 20
Page 36
NOTE: Ensure the data logger is connected directly to the computer USB port (not to a USBhub). We recommended always using the same USB port on your computer.
2. Physically connect your data logger to your computer using a USB cable, then in Device Configuration Utility select your data logger.
3. Retrieve your IPAddress. On the bottom, left side of the screen, select IP as the Connection Type, then click the browse button next to the Server Address box. Note the IP Address (default is 192.168.66.1). If you have multiple data loggers in your network, more than one data logger may be returned. Ensure you select the correct data logger by verifying the data logger serial number or station name (if assigned).
4. A virtual IP address can be used to connect to the data logger using Device Configuration Utility or other computer software, or to view the data logger internal web page in a
browser. To view the web page, open a browser and enter linktodevice.eu or the IP address you retrieved in the previous step (for example, 192.168.66.1) into the address bar.
To secure your data logger from others who have access to your network, we recommend that you set security. For more information, see Data logger security (p. 99).
NOTE: Ethernet over USB (RNDIS) is considered a direct communications connection. Therefore, it is a trusted connection and csipasswd does not apply.

3.1.3 Ethernet communications option

The CR1000X offers a 10/100 Ethernet connection. Use Device Configuration Utility to enter the data logger IPAddress, Subnet Mask, and IPGateway address. After this, use the EZSetup Wizard to set up communications with the data logger. If you already have the data logger IPinformation, you can skip these steps and go directly to Setting up Ethernet communications
between the data logger and computer (p. 23). Watch a video https://www.campbellsci.eu/videos/datalogger-ethernet-configuration or use the following
instructions.
3.1.3.1 Configuring data logger Ethernet settings
1. Supply power to the data logger. If connecting via USB for the first time, you must first install USB drivers by using Device Configuration Utility (select your data logger, then on the main page, click Install USBDriver). Alternately, you can install the USBdrivers using EZ Setup. A USB connection supplies 5 V power (as well as a communication link), which is
3. Setting up the CR1000X 21
Page 37
adequate for setup, but a 12 V battery will be needed for field deployment.
2. Connect an Ethernet cable to the 10/100 Ethernet port on the data logger. The yellow and green Ethernet port LEDs display activity approximately one minute after connecting. If you do not see activity, contact your network administrator. For more information, see Ethernet
LEDs (p. 22).
3. Using data logger support software (LoggerNet, PC400, or PC200W), open Device Configuration Utility .
4. Select the CR1000X Series data logger from the list
5. Select the port assigned to the data logger from the Communication Port list. If connecting via Ethernet, select Use IPConnection.
6. By default, this data logger does not use a PakBus encryption key; so, the PakBus Encryption Key box can be left blank. If this setting has been changed, enter the new code or key. See Data logger security (p. 99) for more information.
7. Click Connect.
8. On the Deployment tab, click the Ethernet subtab.
9. The Ethernet Power setting allows you to reduce the power consumption of the data logger. If there is no Ethernet connection, the data logger will turn off its Ethernet interface for the time specified before turning it back on to check for a connection. Select Always On, 1 Minute, or Disable.
10. Enter the IP Address, Subnet Mask, and IP Gateway. These values should be provided by your network administrator. A static IP address is recommended. If you are using DHCP, note the IP address assigned to the data logger on the right side of the window. When the IP Address is set to the default, 0.0.0.0, the information displayed on the right side of the window updates with the information obtained from the DHCP server. Note, however, that this address is not static and may change. An IP address here of 169.254.###.### means the data logger was not able to obtain an address from the DHCP server. Contact your network administrator for help.
11. Apply to save your changes.
3.1.3.2 Ethernet LEDs
When the data logger is powered, and Ethernet Power setting is not disabled, the 10/100 Ethernet LEDs will show the Ethernet activity:
l Solid Yellow: Valid Ethernet link. l No Yellow: Invalid Ethernet link. l Flashing Yellow: Ethernet activity.
3. Setting up the CR1000X 22
Page 38
l Solid Green: 100 Mbps link. l No Green: 10 Mbps link.
3.1.3.3 Setting up Ethernet communications between the data logger and computer
Once you have configured the Ethernet settings or obtained the IPinformation for your data logger, you can set up communications between your computer and the data logger over Ethernet. Watch a video https://www.campbellsci.eu/videos/ezsetup-ethernet-connection or use the following instructions.
This procedure only needs to be followed once per data logger. However, these settings can be revised using the data logger support software Edit Datalogger Setup option .
1. Using data logger support software, open EZSetup.
l
LoggerNet users, select Setup from the Main category on the toolbar, click the View menu to ensure you are in the EZ(Simplified) view, then click Add Datalogger.
l
PC400 users, click Add Datalogger .
NOTE: PC200W does not support IP connections.
2. Click Next.
3. Select the CR1000X Series from the list, enter a name for your station (for example, a site or project name), Next.
4. Select the IPPort connection type and click Next.
5. Type the data logger IPaddress followed by a colon, then the port number of the data logger in the Internet IPAddress box (these were set up through the Ethernet
communications option (p. 21)) step. They can be accessed in Device Configuration Utility
on the Ethernet subtab. Leading 0s must be omitted. For example:
l IPv4 addresses are entered as 192.168.1.2:6785
l IPv6 addresses must be enclosed in square brackets. They are entered as
[2001:db8::1234:5678]:6785
3. Setting up the CR1000X 23
Page 39
6. The PakBus address must match the hardware settings for your data logger. The default PakBus address is1.
l Set an Extra Response Time if you want the data logger support software to wait a
certain amount of time before returning a communications failure error.
l LoggerNet and PC400 users can set a Max Time On-Line to limit the amount of time
the data logger remains connected. When the data logger is contacted, communications with it is terminated when this time limit is exceeded. A value of 0 in this field indicates that there is no time limit for maintaining a connection to the data logger. Next.
7. By default, the data logger does not use a security code or a PakBus encryption key. Therefore the Security Code can be set to 0 and the PakBus Encryption Key can be left blank. If either setting has been changed, enter the new code or key. See Data logger
security (p. 99). Next.
8. Review the Communication Setup Summary. If you need to make changes, click Previous to return to a previous window and change the settings.
Setup is now complete, and the EZSetup Wizard allows you Finish or select Next. The Next steps take you through testing communications, setting the data logger clock, and sending a program to the data logger. See Testing communications with EZSetup (p. 24) for more information.

3.2 Testing communications with EZSetup

1. Using data logger support software EZSetup, access the Communication Test window. This window is accessed during EZ Setup (see USB or RS-232 communications (p. 18) for more information). Alternatively, you can double-click a data logger from the station list to open the EZ Setup Wizard and access the Communication Test step from the left side of the window.
3. Setting up the CR1000X 24
Page 40
2. Ensure the data logger is connected to the computer, select Yes to test communications, then click Next to initiate the test. To troubleshoot an unsuccessful test, see Tips and
troubleshooting (p. 116).
3. With a successful connection, the Datalogger Clock window displays the time for both the data logger and the computer.
l The Adjusted Server Date/Time displays the current reading of the clock for the
computer or server running your data logger support software. If the Datalogger Date/Time and Adjusted Server Date/Time don't match, you can set the data logger clock to the Adjusted Server Date/Time by clicking Set Datalogger Clock.
l Use the Time Zone Offset to specify a positive or negative offset to apply to the
computer time when setting the data logger clock. This offset will allow you to set the clock for a data logger that needs to be set to a different time zone than the time zone of the computer (or to accommodate for changes in daylight saving time).
4. Click Next.
5. The data logger ships with a default GettingStarted program. If the data logger does not have a program, you can choose to send one by clicking Select and Send Program. Click Next.
6. LoggerNet only - Use the following instructions or watch the Scheduled/Automatic Data
Collection video :
3. Setting up the CR1000X 25
Page 41
l The Datalogger Table Output Files window displays the data tables available to be
collected from the data logger and the output file name. By default, all data tables set up in the data logger program will be included for collection. Make note of the Output File Name and location. Click Next.
l Check Scheduled Collection Enabled to have LoggerNet automatically collect data
from the data logger on the Collection Interval entered. When the Base Date and Time are in the past, scheduled collection will begin immediately after finishing the EZSetup wizard. Click Next twice.
7. Click Finish.

3.3 Making the software connection

Once you have configured your hardware connection (see Setting up communications with the
data logger (p. 18), your data logger and computer can communicate. You'll use the Connect
screen to send a program, set the clock, view real-time data, and manually collect data.
l
LoggerNet users, select Main and Connect on the LoggerNet toolbar, select the data logger from the Stations list, then Connect .
l
PC400 and PC200W users, select the data logger from the list and click Connect .
To disconnect, click Disconnect .
For more information see the Connect Window Tutorial .

3.4 Creating a Short Cut data logger program

You must provide a program for the data logger in order for it to make measurements, store data, or control external devices. There are several ways to write a program. The simplest is to use the program generator called Short Cut. For more complex programming the CRBasic Editor is used. The program file may use the extension .CR1X, .CRB or .DLD.
Data logger programs are executed on a precise schedule termed the scan interval, based on the data logger internal clock.
Measurements are first stored in temporary memory called variables in the Public Table. Variables are usually overwritten each scan. Periodically, generally on a time interval, the data logger stores data in tables. The Data Tables are later copied to a computer using your data logger support software.
3. Setting up the CR1000X 26
Page 42
Use Short Cut software to generate a program for your data logger. ShortCut is included with your data logger support software.
This section will guide you through programming a CR1000X data logger to measure the voltage of the data logger power supply, the internal temperature of the data logger, and a thermocouple. With minor changes, these steps can apply to other measurements. Use the
following instructions or watch the Quickstart part 3 video .
1. Using data logger support software, launch ShortCut.
l
LoggerNet users, click Program then ShortCut .
l
PC400 and PC200W users, click ShortCut .
2. Click Create New Program.
3. Select CR1000X Series and click Next.
NOTE: The first time ShortCut is run, a prompt will ask for a noise rejection choice. Select 60 Hz Noise Rejection for North America and areas using 60 Hz ac voltage. Select 50 Hz Noise Rejection for most of the Eastern Hemisphere and areas that operate at 50 Hz.
A second prompt lists sensor support options. Campbell Scientific, Inc. (US) is usually the best fit outside of Europe.
To change the noise rejection or sensor support option for future programs, use the Program menu.
4. A list of Available Sensors and Devices and Selected Measurements Available for Output
display. Battery voltage BattV and internal temperature PTemp_C are selected by default. During operation, battery and temperature should be recorded at least daily to assist in monitoring system status.
5. Use the Search feature or expand folders to locate your sensor or device. Double-click on a sensor or measurement in the Available Sensors and Devices list to configure the device (if needed) and add it to the Selected list. For the example program, expand the Sensors/Temperature folder and double-click Type T Thermocouple.
6. If the sensor or device requires configuration, a window displays with configuration options. Click Help at the bottom of the window to learn more about any field or option. For the example program, accept the default options:
l 1 Type TTCsensor l Temp_C as the Temperature label, and set the units to Deg C l PTemp_C as the Reference Temperature Measurement.
7. Click OK.
3. Setting up the CR1000X 27
Page 43
8. Click Wiring Diagram on the left side of the window to see how to wire the sensor to the data logger. With the power disconnected from the data logger, insert the wires as directed in the diagram. Ensure you clamp the terminal on the conductor, not the wire insulation. Use the included flat-blade screwdriver to open/close the terminals.
9. Click Sensors on the left side of the window to return to the sensor selection window, then click Next at the bottom of the window.
10. Type 1 in the How often should the data logger measure its sensor(s)? box.
11. Use the Output Setup options to specify how often measurements are to be made and how often outputs are to be stored. Note that multiple output intervals can be specified, one for each output table (Table1 and Table2 tabs). For the example program, only one table is needed. Click the Table2 tab and click Delete Table.
12. In the Table Name box, type a name for the table. For example:OneMin.
13. Select a Data Output Storage Interval. For example: to 1 minute.
14. Click Next.
15. Select the measurement from the Selected Measurements Available for Output list, then click an output processing option to add the measurement to the Selected Measurements for Output list. For the example program, select BattV and click the Average button to add it to the Selected Measurements for Output list. Repeat this procedure for PTemp_C and Temp_C.
16. Click Finish and give the program a meaningful name such as a site identifier. Click Save.
17. If LoggerNet or other data logger support software is running on your computer, and the data logger is connected to the computer (see Making the software connection (p. 26) for more information), you can choose to send the program. Generally it is best to collect data first; so, we recommend sending the program using the instructions in Sending a program
to the data logger (p. 29).
3. Setting up the CR1000X 28
Page 44
TIP: It is good practice is to always retrieve data from the data logger before sending a program; otherwise, data may be lost. See Collecting data (p. 32) for detailed instruction.
If your data acquisition requirements are simple, you can probably create and maintain a data logger program exclusively with ShortCut. If your data acquisition needs are more complex, the files that ShortCut creates are a great source for programming code to start a new program or add to an existing custom program using CRBasic. See the CRBasic Editor help for detailed information on program structure, syntax, and each instruction available to the data logger
https://help.campbellsci.eu/crbasic/cr1000x/.
NOTE: Once a Short Cut generated program has been edited with CRBasic Editor, it can no longer be modified with ShortCut.

3.5 Sending a program to the data logger

TIP: It is good practice is to always retrieve data from the data logger before sending a program; otherwise, data may be lost. See Collecting data (p. 32) for detailed instruction.
Some methods of sending a program give the option to retain data when possible. Regardless of the program upload tool used, data will be erased when a new program is sent if any change occurs to one or more data table structures in the following list:
l Data table name(s) l Data output interval or offset l Number of fields per record
l Number of bytes per field l Field type, size, name, or position l Number of records in table
Use the following instructions or watch the Quickstart part 4 video .
1. Connect the data logger to your computer (see Making the software connection (p. 26) for more information).
2. Using your data logger support software, click Send New... or Send Program (located in the Current Program section on the right side of the window).
3. Navigate to the program, select it, and click Open. For example: navigate to C:\Campbellsci\SCWin and select MyTemperature.CR1X.
3. Setting up the CR1000X 29
Page 45
4. Confirm that you would like to proceed and erase all data tables saved on the data logger. The program will send and compile.
5. Review the Compile Results window for errors, messages and warnings.
6. Click Details, select the Table Fill Times tab. Ensure that the times shown are expected for your application. Click OK.
After sending a program, it is a good idea to monitor the Public Table to make sure sensors are taking good measurements. See Working with data (p. 31) for more information.
3. Setting up the CR1000X 30
Page 46

4. Working with data

4.1 Default data tables

By default, the data logger includes three tables: Public, Status, and DataTableInfo. Each of these tables only contains the most recent measurements and information.
l The Public table is configured by the data logger program, and updated at the scan
interval set within the data logger program, It shows measurement and calculation results as they are made.
l The Status table includes information about the health of the data logger and is updated
only when viewed.
l The DataTableInfo table reports statistics related to data tables. It also only updates when
viewed.
l User-defined data tables update at the schedule set within the program.
For information on collecting your data, see Collecting data (p. 32).
Use these instructions or follow the Connect Window tutorial to monitor real-time data.
LoggerNet users, select the Main category and Connect on the LoggerNet toolbar, select the data logger from the Stations list, then click Connect . Once connected, select a table to view
using the Table Monitor.
PC400 and PC200Wusers, click Connect , then Monitor Data. When this tab is first opened for a data logger, values from the Public table are displayed. To view data from other tables, click Add , select a table or field from the list, then drag it into a cell on the Monitor Data tab.
4. Working with data 31
Page 47

4.2 Collecting data

The data logger writes to data tables based on intervals and conditions set in the CRBasic program (see Creating data tables in a program (p. 40) for more information). After the program has been running for enough time to generate data records, data may be collected by using data logger support software. During data collection, data is copied to the computer and still remains on the data logger. Collections may be done manually, or automatically through scheduled
collections set in LoggerNet Setup. Use these instruction or follow the Collect Data Tutorial .

4.2.1 Collecting data using LoggerNet

1.
From the LoggerNet toolbar, click Main and Connect , select the data logger from the Stations list, then Connect .
2.
Click Collect Now .
3. After the data is collected, the Data Collection Results window displays the tables collected and where they are stored on the computer.
4. Select a data file, then View File to view the data. See Viewing historic data (p. 33)

4.2.2 Collecting data using PC200W or PC400

1.
Click Connect on the main PC200W or PC400 window.
2. Go to the Collect Data tab.
4. Working with data 32
Page 48
3. Select an option for What to Collect. Either option creates a new file if one does not already exist.
l New data from data logger (Append to data files): Collects only the data in the
selected tables stored since the last data collection and appends this data to the end of the existing table files on the computer. This is the default, and most often used option.
l All data from data logger (Overwrite data files): Collects all of the data in the selected
tables and replaces the existing data files on the computer.
4. By default, all output tables set up in the data logger program are selected for collection.
5. Click Start Data Collection.
6. After the data is collected, the Data Collection Results window displays the tables collected and where they are stored on the computer.
7. Select a data file, then View File to view the data. See Viewing historic data (p. 33)

4.3 Viewing historic data

Open data files using View Pro. View Pro contains tools for reviewing data in tabular form as well as several graphical layouts for visualization. Use these instructions or follow the View Data
Tutorial .
Once the data logger has had enough time to store multiple records, you should collect and review the data.
1. To view the most recent data, connect the data logger to your computer and collect your data (see Collecting data (p. 32) for more information).
2. Open View Pro:
l
LoggerNet users click Data then View Pro on the LoggerNet toolbar.
l
PC200W and PC400 users click View Data Files via View Pro .
3.
Click Open , navigate to the directory where you saved your tables (the default directory is C:\Campbellsci\[your data logger software application]). For example: navigate to the C:\Campbellsci\LoggerNet folder and select OneMin.dat.

4.4 Data types and formats

Data takes different formats as it is created and manipulated in the data logger, as it is displayed through software, and as it is retrieved to a computer file. It is important to understand the different data types, formats and ranges, and where they are used.
4. Working with data 33
Page 49
Table 4-1: Data types, ranges and resolutions
Data type Description Range Resolution Where used
Float
IEEE four-byte
floating point
four-byte
Long
signed integer
four-byte
Boolean
signed integer
+/–1.8 *10^–38 to
+/–3.4 *10^38
–2,147,483,648 to
+2,147,483,647
–1, 0
24 bits
variables
(about 7 digits)
1 bit variables, output
True (–1) or
False ( 0)
variables,
sample output
variables,
String ASCII String
sample output
IEEE four-byte
+/–1.8 *10^–38 to
24 bits
internal calculations,
IEEE4
floating point
IEEE eight-byte
+/–3.4 *10^38
+/–2.23 *10^–308 to
(about 7 digits)
53 bits
output
internal calculations,
IEEE8
floating point
Campbell Scientific
FP2
two-byte floating point
+/–1.8 *10^308
–7999 to +7999
(about 16 digits)
13 bits
(about 4 digits)
output
output
NSEC eight-byte time stamp nanoseconds variables, output

4.4.1 Variables

In CRBasic, the declaration of variables (via the DIM or the PUBLIC statement) allows an optional type descriptor As that specifies the data type. The data types are Float, Long,
Boolean, and String. The default type is Float.
Example variables declared with optional data types
Public PTemp As Float, Batt_volt Public Counter As Long Public SiteName As String * 24
As Float specifies the default data type. If no data type is explicitly specified with the As
statement, then Float is assumed. Measurement variables are stored and calculations are performed internally in IEEE 4 byte floating point with some operations calculated in double precision. A good rule of thumb is that resolution will be better than 1 in the seventh digit.
As Long specifies the variable as a 32 bit integer. There are two possible reasons a user would
do this: (1) speed, since the CR1000X Operating System can do math on integers faster than with
Floats, and (2) resolution, since the Long has 31 bits compared to the 24 bits in the Float. A
good application of the As Long declaration is a counter that is expected to get very large.
4. Working with data 34
Page 50
As Booleanspecifies the variable as a 4 byte Boolean. Boolean variables are typically used for
flags and to represent conditions or hardware that have only 2 states (e.g., On/Off, High/Low). A Boolean variable uses the same 32 bit long integer format as a Longbut can set to only one of two values: True, which is represented as –1, and false, which is represented with 0. When a
Floator Longinteger is converted to a Boolean, zero is False (0), any non-zero value will set
the Boolean to True (-1). The Boolean data type allows application software to display it as an On/Off, True/False, Red/Blue, etc.
The CR1000X uses –1 rather than some other non-zero number because the AND and OR operators are the same for logical statements and binary bitwise comparisons. The number -1 is expressed in binary with all bits equal to 1, the number 0 has all bits equal to 0. When –1 is anded with any other number the result is the other number, ensuring that if the other number is non­zero (true), the result will be non-zero.
As String * sizespecifies the variable as a string of ASCII characters, NULL terminated,
with an optional size specifying the maximum number of characters in the string. A string is convenient in handling serial sensors, dial strings, text messages, etc. When size is not specified, a default of 24 characters will be used (23 usable bytes and 1 terminating byte).
As a special case, a string can be declared As String* 1. This allows the efficient storage of a single character. The string will take up 4 bytes in memory and when stored in a data table, but it will hold only one character.
Structures (StructureType/EndStructureType) are an advanced technique used to organize variables and display data in a structured manner. They can significantly shorten program code, especially for instructions that output an array of values, such as AVW200(),GPS(), and SDI12Recorder(). For example, a single StructureTypemay be used to organize and display data for multiple vibrating wire sensors or many SDI-12 sensors without creating aliases for each sensor. See the CRBasic Editor help for detailed instruction information and program examples: https://help.campbellsci.eu/crbasic/cr1000x/.

4.4.2 Constants

The Constdeclaration is used to assign a name that can be used in place of a value in the data logger CRBasic program. Once a value is assigned to a constant, each time the value is needed in the program, the programmer can type in the constant name instead of the value itself. The use of the Constdeclaration can make the program easier to follow, easier to modify, and more secure against unintended changes. Unlike variables, constants cannot be changed while the program is running.
Constants must be defined before they are used in the program. Constants can be defined in a
ConstTable/EndConstTableconstruct allowing them to be changed using the keyboard
display, the C command in terminal mode, or via a custom menu.
4. Working with data 35
Page 51
Constants can also be typed For example:Const A as Long = 9999, and Const B as String = “MyString”. Valid data types for constants are: Long, Float, Double, and String. Other data types return a compile error.
When the CRBasic program compiles, the compiler determines the type of the constant (Long,
Float, Double, or String) from the expression. This data type is communicated to the
software. The software formats or restricts the input based on the data type communicated to it by the data logger.
You can declare a constant with or without specifying a data type. If a data type is not specified, the compiler determines the data type from the expression. For example: Const A = 9999 will use the Long data type. Const A = 9999.0 will use the Floatdata type.

4.4.3 Data storage

Data can be stored in either IEEE4 or FP2 formats. The format is selected in the program instruction that outputs the data, i.e. minimum, maximum, etc.
While Float (IEEE 4 byte floating point) is used for variables and internal calculations, FP2 is adequate for most stored data. Campbell Scientific 2 byte floating point (FP2) provides 3 or 4 significant digits of resolution, and requires half the memory space as IEEE4 (2 bytes per value vs 4).
Table 4-2: Resolution and range limits of FP2 data
Zero Minimum magnitude Maximum Magnitude
0.000 ±0.001 ±7999.
The resolution of FP2 is reduced to 3 significant digits when the first (left most) digit is 8 or greater. Thus, it may be necessary to use IEEE4 output or an offset to maintain the desired resolution of a measurement. For example, if water level is to be measured and output to the nearest 0.01 foot, the level must be less than 80 feet for FP2 output to display the 0.01 foot increment. If the water level is expected to range from 50 to 90 feet the data could either be output in IEEE4 or could be offset by 20 feet (transforming the range to 30 to 70 feet).
Table 4-3: FP2 decimal location
Absolute value Decimal location
0 – 7.999 X.XXX
8 – 79.99 XX.XX
80 – 799.9 XXX.X
800 – 7999. XXXX.
4. Working with data 36
Page 52
NOTE:
String and Boolean variables can be output with the Sample() instruction. Results of
Sampling a Boolean variable will be either -1 or 0 in the collected Data Table. A Boolean displays in the Numeric Monitor Public and Data Tables as true or false.

4.5 About data tables

A data table is essentially a file that resides in data logger memory (for information on data table storage, see Data memory (p. 42)). The file consists of five or more rows. Each row consists of columns, or fields. The first four rows constitute the file header. Subsequent rows contain data records. Data tables may store individual measurements, individual calculated values, or summary data such as averages, maximums, or minimums.
Typically, files are written to based on time or event. The number of data tables is limited to 250. You can retrieve data based on a schedule or by manually choosing to collect data using data logger support software (see Collecting data (p. 32)).
Table 4-4: Example data
TOA5, MyStation, CR1000X, 1142, CR1000X.Std.01, CPU:MyTemperature.CR1X, 1958, OneMin
TIMESTAMP RECORD BattV_Avg PTemp_C_Avg Temp_C_Avg
TS RN Volts Deg C Deg C
Avg Avg Avg
2019-03-08 14:24:00 0 13.68 21.84 20.71
2019-03-08 14:25:00 1 13.65 21.84 20.63
2019-03-08 14:26:00 2 13.66 21.84 20.63
2019-03-08 14:27:00 3 13.58 21.85 20.62
2019-03-08 14:28:00 4 13.64 21.85 20.52
2019-03-08 14:29:00 5 13.65 21.85 20.64

4.5.1 Table definitions

Each data table is associated with descriptive information, referred to as a“table definition,” that becomes part of the file header (first few lines of the file) when data is downloaded to a computer. Table definitions include the data logger type and OS version, name of the CRBasic program associated with the data, name of the data table (limited to 20 characters), and alphanumeric field names.
4. Working with data 37
Page 53
4.5.1.1 Header rows
The first header row of the data table is the environment line, which consists of eight fields. The following list describes the fields using the previous table entries as an example:
l
TOA5 - Table output format. Changed via LoggerNet Setup Standard View, Data Files tab.
l MyStation - Station name. Changed via LoggerNet Setup, Device Configuration Utility, or
CRBasic program.
l CR1000X - Data logger model. l 1142 - Data logger serial number. l CR1000X.Std.01 - Data logger OS version. l CPU:MyTemperature.CR1X - Data logger program name. Changed by sending a new
program (see Sending a program to the data logger (p. 29) for more information).
l 1958 - Data logger program signature. Changed by revising a program or sending a new
program (see Sending a program to the data logger (p. 29) for more information).
l OneMin - Table name as declared in the running program (see Creating data tables in a
program (p. 40) for more information).
The second header row reports field names. Default field names are a combination of the variable names (or aliases) from which data is derived, and a three-letter suffix. The suffix is an abbreviation of the data process that outputs the data to storage. A list of these abbreviations follows in Data processing abbreviations (p. 39).
If a field is an element of an array, the field name will be followed by a indices within parentheses that identify the element in the array. For example, a variable named Values, which is declared as a two-by-two array in the data logger program, will be represented by four field names: Values(1,1), Values(1,2), Values(2,1), and Values(2,2). There will be one value in the second header row for each scalar value defined by the table.
If the default field names are not acceptable to the programmer, the FieldNames() instruction can be used in the CRBasic program to customize the names. TIMESTAMP, RECORD, BattV_Avg, PTemp_C_Avg, and Temp_C_Avg are the default field names in the previous
Example data (p. 37).
The third header row identifies engineering units for that field. These units are declared at the beginning of a CRBasic program using the optional Units() declaration. In Short Cut, units are chosen when sensors or measurements are added. Units are strictly for documentation. The data logger does not make use of declared units, nor does it check their accuracy.
The fourth header row reports abbreviations of the data process used to produce the field of data.
4. Working with data 38
Page 54
Table 4-5: Data processing abbreviations
Data processing name Abbreviation
Totalize
Average
Maximum
Minimum
Sample at Max or Min
Standard Deviation
Moment
Sample No abbreviation
Histogram1
Histogram4D
FFT
Covariance
Level Crossing
Tot
Avg
Max
Min
SMM
Std
MMT
Hst
H4D
FFT
Cov
LCr
WindVector
Median
ET
Solar Radiation (from ET)
Time of Max
Time of Min
WVc
Med
ETsz
RSo
TMx
TMn
4.5.1.2 Data records
Subsequent rows are called data records. They include observed data and associated record keeping. The first field is a time stamp (TS), and the second field is the record number (RN).
The time stamp shown represents the time at the beginning of the scan in which the data is written. Therefore, in record number 3 in the previous Example data (p. 37), Temp_C_Avg shows the average of the measurements taken over the minute beginning at 14:26:01 and ending at 14:27:00. As another example, consider rainfall measured every second with a daily total rainfall recorded in a data table written at midnight. The record time stamped 2019-03-08 00:00:00 will contain the total rainfall beginning at 2019-03-07 00:00:01 and ending at 2019-03-08 00:00:00.
4. Working with data 39
Page 55

4.6 Creating data tables in a program

Data is stored in tables as directed by the CRBasic program. In Short Cut, data tables are created in the Output steps (see Creating a Short Cut data logger program (p. 26)). Data tables are created within the CRBasic data logger program using the DataTable()/EndTable instructions. They are placed after variable declarations and before the BeginProg instruction. Between DataTable() and EndTable() are instructions that define what data to store and under what conditions data is stored. A data table must be called by the CRBasic program for data processing and storage to occur. Typically, data tables are called by the CallTable() instruction once each Scan. These instructions include:
DataTable()
'Output Trigger Condition(s)
'Output Processing Instructions
EndTable
See the CRBasic Editor help for detailed instruction information and program examples: https://
help.campbellsci.eu/crbasic/cr1000x/.
Use the DataTable()instruction to define the number of records, or rows, allocated to a data table. You can set a specific number of records, which is recommended for conditional tables, or allow your data logger to auto-allocate table size. With auto-allocation, the data logger balances the memory so the tables “fill up” (newest data starts to overwrite the oldest data) at about the same time. It is recommended you reserve the use of auto-allocation for data tables that store data based only on time (tables that store data based on the DataInterval()instruction). Event or conditional tables are usually set to a fixed number of records. View data table fill times for your program on the Station Status > Table Fill Times tab (see Checking station status (p. 117) for more information). An example of the Table Fill Times tab follows. For information on data table storage see Data memory (p. 42).
4. Working with data 40
Page 56
4. Working with data 41
Page 57

5. Data memory

The data logger includes three types of memory: SRAM, Flash, and Serial Flash. A memory card slot is also available for an optional microSD card. Note that the data logger USB port does not support USB flash or thumb drives (see Communications ports (p. 12) for more information).

5.1 Data tables

Measurement data is primarily stored in data tables within SRAM. Data is usually erased from this area when a program is sent to the data logger.
During data table initialization, memory sectors are assigned to each data table according to the parameters set in the program. Program options that affect the allocation of memory include the Sizeparameter of the DataTable()instruction, the Intervaland Unitsparameters of the DataInterval()instruction. The data logger uses those parameters to assign sectors in a way that maximizes the life of its memory. See the CRBasic Editor help for detailed instruction information and program examples: https://help.campbellsci.eu/crbasic/cr1000x/.
By default, data memory sectors are organized as ring memory. When the ring is full, oldest data is overwritten by newest data. Using the FillStopstatement sets a program to stop writing to the data table when it is full, and no more data is stored until the table is reset. To see the total number of records that can be stored before the oldest data is overwritten, or to reset tables, go to Station Status > Table Fill Times in your data logger support software.
Data concerning the data logger memory are posted in the Status and DataTableInfo tables. For additional information on these tables, see Information tables and settings (advanced) (p. 152).
For additional information on data logger memory, visit the Campbell Scientific blog article,"How to Know when Your Datalogger Memory is Getting Full."

5.2 Memory allocation

Data table SRAM and the CPU drive are automatically partitioned by the data logger. The USR drive can be partitioned as needed. The CRD drive is automatically partitioned when a memory card is installed.
The CPU and USR drives use the FAT file system. There is no limit, beyond practicality and available memory, to the number of files that can be stored. While a FAT file system is subject to fragmentation, performance degradation is not likely to be noticed since the drive has a relatively small amount of solid state RAM and is accessed very quickly.
5. Data memory 42
Page 58

5.3 SRAM

SRAM holds program variables, communications buffers, final-data memory, and, if allocated, the USR drive. An internal lithium battery retains this memory when primary power is removed.
The structure of the data logger SRAMmemory is as follows:
l Static Memory: This is memory used by the operating system, regardless of the running
program. This sector is rebuilt at power-up, program recompile, and watchdog events.
Operating Settings and Properties: Also known as the "Keep" memory, this memory is used
l
to store settings such as PakBus address, station name, beacon intervals, and allowed neighbour lists. This memory also stores dynamic properties such as known routes and communications timeouts.
l CRBasic Program Operating Memory: This memory stores the currently compiled and
running user program. This sector is rebuilt on power-up, recompile, and watchdog events.
l Variables & Constants: This memory stores constants and public variables used by the
CRBasic program. Variables may persist through power-up, recompile, and watchdog events if the PreserveVariables instruction is in the running program.
l Final-Data Memory: This memory stores data. Auto-allocated tables fill whatever memory
remains after all other demands are satisfied. A compile error occurs if insufficient memory is available for user-allocated data tables. This memory is given lowest priority in SRAM memory allocation.
l Communication Memory 1: Memory used for construction and temporary storage of
PakBus packets.
l Communication Memory 2: Memory used to store the list of known nodes and routes to
nodes. Routers use more memory than leaf nodes because routes store information about other routers in the network. You can increase the Communication Allocation field in Device Configuration Utility to increase this memory allocation.
5. Data memory 43
Page 59
l USR drive: Optionally allocated. Holds image files. Holds a copy of final-data memory
when TableFile() instruction used. Provides memory for FileRead() and
FileWrite() operations. Managed in File Control. Status reported in Status table fields
USRDriveSize and USRDriveFree.
5.3.1 USRdrive
Battery-backed SRAM can be partitioned to create a FAT USR drive, analogous to partitioning a second drive on a computer hard disk. Certain types of files are stored to USR to reserve limited CPU drive memory for data logger programs and calibration files. Partitioning also helps prevent interference from data table SRAM. The USR drive holds any file type within the constraints of the size of the drive and the limitations on filenames. Files typically stored include image files from cameras, certain configuration files, files written for FTP retrieval, HTML files for viewing with web access, and files created with the TableFile() instruction. Measurement data can also be stored on USR as discrete files by using the TableFile() instruction. Files on USR can be collected using data logger support software Retrieve command in File Control, or automatically using the LoggerNet Setup > File Retrieval tab functions.
USR is not affected by program recompilation or formatting of other drives. It will only be reset if the USR drive is formatted, a new operating system is loaded, or the size of USR is changed. USR size is set manually by accessing it in the Settings Editor, or programmatically by loading a CRBasic program with a USR drive size entered in a SetSetting() instruction. Partition the USR drive to at least 11264 bytes in 512-byte increments. If the value entered is not a multiple of 512 bytes, the size is rounded up. Maximum size of USR 2990080 bytes.
WARNING: Partitioning or changing the size of the USRdrive will delete stored data from tables. Collect data first.
NOTE: Placing an optional USR size setting in the CRBasic program overrides manual changes to USR size. When USR size is changed manually, the CRBasic program restarts and the programmed size for USR takes immediate effect.
Files in the USRdrive can be managed through data logger support software File Control or through the FileManage() instruction in CRBasic program.
5. Data memory 44
Page 60

5.4 Flash memory

The data logger operating system is stored in a separate section of flash memory. To update the operating system, see Updating the operating system (p. 109).
Serial flash memory holds the CPU drive, web page, and data logger settings. Because flash memory has a limited number of write/erase cycles, care must be taken to avoid continuously writing to files on the CPU drive.

5.4.1 CPU drive

The serial flash memory CPU drive contains data logger programs and other files. This memory is managed in File Control.
NOTE: When writing to files under program control, take care to write infrequently to prevent premature failure of serial flash memory. Internal chip manufacturers specify the flash technology used in Campbell Scientific CPU: drives at about 100,000 write/erase cycles. While Campbell Scientific's in-house testing has found the manufacturers' specifications to be very conservative, it is prudent to note the risk associated with repeated file writes via program control.
Also, see System specifications (p. 177) for information on data logger memory.
5.5 MicroSD (CRD:drive)
The data logger has a microSD card slot for removable, supplemental memory. The card can be configured as an extension of the data logger final-data memory or as a repository of discrete data files. In data file mode, sub folders are not supported.
Use CardOut()to create a new DataTable saved on a card. When storing high-frequency data, or when storing data to cards greater than 2 GB, TableFile()with Option 64 may be a better method to write final storage data to a card.
See the CRBasic Editor help for detailed instruction information and program examples: https://
help.campbellsci.eu/crbasic/cr1000x/.
The CRD: drive uses microSD cards exclusively. Campbell Scientific recommends and supports only the use of microSD cards obtained from Campbell Scientific. These cards are industrial­grade and have passed Campbell Scientific hardware testing. Use of consumer grade cards substantially increases the risk of data loss. Following are listed advantages Campbell Scientific cards have over less expensive commercial-grade cards:
5. Data memory 45
Page 61
l Less susceptible to failure and data loss. l Match the data logger operating temperature range. l Provide faster read/write times. l Include vibration and shock resistance. l Have longer life spans (more read/write cycles).
A "card controller error"indicates that the data logger has failed to communicate with the card. It is an error caused by the micro-controller built into the microSD card. If the error repeats itself, try an industrial-grade card.
A maximum of 30 data tables can be created using CardOut() on a microSD card. When a data table is sent to a microSD card, a data table of the same name in SRAM is used as a buffer for transferring data to the card. When the card is present, the Status table will show the size of the table on the card. If the card is removed, the size of the table in SRAM is shown. For more information, see File system error codes (p. 149).
When a new program is compiled that sends data to the card, the data logger checks if a card is present and if the card has adequate space for the data tables. If no card is present, or if space is inadequate, the data logger will warn that the card is not being used. However, the CRBasic program runs anyway and data is stored to SRAM. When a card is inserted later, data accumulated in the SRAM table is copied to the card.
A microSD card can also facilitate the use of powerup.ini (see File management via powerup.ini (p. 112) for more information).

5.5.1 Formatting microSD cards

The data logger accepts microSD cards formatted as FAT16 or FAT32; however, FAT32 is recommended. Otherwise, some functionality, such as the ability to manage large numbers of files (>254) is lost. The data logger formats memory cards as FAT32.
Because of the way the FAT32 card format works, you can avoid long data logger compile times with a freshly formatted card by first formatting the new card on a computer, then copying a small file to the card from the computer, and then deleting the file with the computer. When the small file is copied to the card, the computer updates a sector on the card that allows the data logger program to compile faster. This only needs to be done once when the card is formatted. If you have the data logger update the card sector, the first data logger program compile with the card can take up to 10 minutes. After that, compile times will be normal.
5.5.2 MicroSDcard precautions
Observe the following precautions when using optional memory cards:
5. Data memory 46
Page 62
l Before removing a card from the data logger, disable the card by pressing the Eject button
and wait for the green LED. You then have 15 seconds to remove the card before normal operations resume.
l Do not remove a memory card while the drive is active, or data corruption and damage to
the card may result.
l Prevent data loss by collecting data before sending a program. Sending a program to the
data logger often erases all data.
l See System specifications (p. 177) for information on maximum card size.

5.5.3 Act LED indicator

When the data logger is powered and a microSD card installed, the Act (Activity) LED will turn on according to card activity or status:
l Red flash: Card read/write activity l Solid green: Formatted card inserted, powered up. This LEDalso indicates it is OKto
remove card. The Eject button must be pressed before removing a card to allow the data logger to store buffered data to the card and then power it off.
l Solid orange: Error l Dim/flashing orange: 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.
5. Data memory 47
Page 63

6. Measurements

6.1 Voltage measurements 48
6.2 Current-loop measurements 50
6.3 Resistance measurements 52
6.4 Thermocouple Measurements 58
6.5 Period-averaging measurements 59
6.6 Pulse measurements 60
6.7 Vibrating wire measurements 67
6.8 Sequential and pipeline processing modes 68

6.1 Voltage measurements

Voltage measurements are made using an Analogue-to-Digital Converter (ADC). A high­impedance Programmable-Gain Amplifier (PGA) amplifies the signal. Internal multiplexers route individual terminals within the amplifier. The CRBasic measurement instruction controls the ADC gain and configuration – either single-ended or differential input. Information on the differences between single-ended and differential measurements can be found here: Deciding between
single-ended or differential measurements (p. 136).
A voltage measurement proceeds as follows:
1. Set PGAgain for the voltage range selected with the CRBasic measurement instruction
parameter Range. Set the ADC for the first notch frequency selected with fN1.
2. If used, turn on excitation to the level selected with ExmV.
3. Multiplex selected terminals (SEChan or DiffChan).
4. Delay for the entered settling time (SettlingTime).
5. Perform the analogue-to-digital conversion.
6. Repeat for input reversal as determined by parameters RevEx and RevDiff.
7. Apply multiplier (Mult) and offset (Offset) to measured result.
Conceptually, analogue voltage sensors output two signals: high and low. For example, a sensor that outputs 1000 mV on the high signal and 0 mV on the low has an overall output of 1000 mV.
6. Measurements 48
Page 64
A sensor that outputs 2000 mV on the high signal and 1000 mV on the low also has an overall output of 1000 mV. Sometimes, the low signal is simply sensor ground (0 mV). A single-ended measurement measures the high signal with reference to ground; the low signal is tied to ground. A differential measurement measures the high signal with reference to the low signal. Each configuration has a purpose, but the differential configuration is usually preferred.
In general, use the smallest input range that accommodates the full-scale output of the sensor. This results in the best measurement accuracy and resolution (see Analogue
measurement specifications (p. 181) for more information).
A set overhead reduces the chance of overrange. Overrange limits are available in the specifications. The data logger indicates a measurement overrange by returning a NAN for the measurement.
WARNING:
Sustained voltages in excess of ±20 V applied to terminals configured for analogue input will damage CR1000X circuitry.

6.1.1 Single-ended measurements

A single-ended measurement measures the difference in voltage between the terminal configured for single-ended input and the reference ground. For example, single-ended channel 1 is comprised of terminals SE 1 and . Single-ended terminals are labelled in blue. For more information, see Wiring panel and terminal functions (p. 5). The single-ended configuration is used with the following CRBasic instructions:
l
VoltSE()
l
BrHalf()
l
BrHalf3W()
l
TCSE()
l
Therm107()
l
Therm108()
l
Therm109()
See the CRBasic Editor help for detailed instruction information and program examples: https://
help.campbellsci.eu/crbasic/cr1000x/.

6.1.2 Differential measurements

A differential measurement measures the difference in voltage between two input terminals. For example, DIFF channel 1 is comprised of terminals 1H and 1L, with 1H as high and 1L as low. For
6. Measurements 49
Page 65
more information, see Wiring panel and terminal functions (p. 5). The differential configuration is used with the following CRBasic instructions:
l
VoltDiff()
l
BrFull()
l
BrFull6W()
l
BrHalf4W()
l
TCDiff()
6.1.2.1 Reverse differential
Differential measurements have the advantage of an input reversal option, RevDiff. When RevDiff is set to True, two differential measurements are made, the first with a positive polarity and the second reversed. Subtraction of opposite polarity measurements cancels some offset voltages associated with the measurement.
For more information on voltage measurements, see Improving voltage measurement quality (p.
136) and Analogue measurement specifications (p. 181).

6.2 Current-loop measurements

RG terminals can be configured to make analogue current measurements using the
CurrentSE() instruction. When configured to measure current, terminals each have an internal
resistance of 101 Ω in the current measurement loop. The return path of the sensor must be connected directly to the RG terminal. The
following image shows a simplified schematic of a
current measurement.

6.2.1 Example Current-Loop Measurement Connections

The following table shows example schematics for connecting typical current sensors and devices. See also Current-loop measurement specifications (p. 184).
6. Measurements 50
Page 66
Sensor Type Connection Example
2-wire transmitter using data logger power
2-wire transmitter using external power
3-wire transmitter using data logger power
6. Measurements 51
Page 67
Sensor Type Connection Example
3-wire transmitter using external power
4-wire transmitter using data logger power
4-wire transmitter using external power

6.3 Resistance measurements

Bridge resistance is determined by measuring the difference between a known voltage applied to the excitation (input) of a resistor bridge and the voltage measured on the output arm. The data logger supplies a precise voltage excitation via VX terminals. Return voltage is measured on
6. Measurements 52
Page 68
analogue input terminals configured for single-ended (SE) or differential (DIFF) input. The result of the measurement is a ratio of measured voltages.
See also Resistance measurement specifications (p. 183).

6.3.1 Resistance measurements with voltage excitation

CRBasic instructions for measuring resistance with voltage excitation include:
l BrHalf() - half bridge l BrHalf3W() - three-wire half bridge l BrHalf4W() - four-wire half bridge l BrFull() - four-wire full bridge l BrFull6W() - six-wire full bridge
See the CRBasic Editor help for detailed instruction information and program examples:
https://help.campbellsci.eu/crbasic/cr1000x/.
Resistive-Bridge Type and
Circuit Diagram
Half Bridge
Three Wire Half Bridge
1
1,2
CRBasic Instruction and
Relational Formulas
Fundamental Relationship
CRBasic Instruction:
BrHalf()
Fundamental Relationship:
CRBasic Instruction:
BrHalf3W()
Fundamental Relationship:
6. Measurements 53
Page 69
Resistive-Bridge Type and
Circuit Diagram
CRBasic Instruction and
Relational Formulas
Fundamental Relationship
Four Wire Half Bridge
Full Bridge
1,2
1,2
CRBasic Instruction:
BrHalf4W()
Fundamental Relationship:
CRBasic Instruction:
BrFull()
Fundamental Relationship:
These relationships apply
to
BrFull()
and BrFull6W()
Six Wire Full Bridge
1
CRBasic Instruction:
BrFull6W()
Fundamental Relationship:
1
Key: Vx= excitation voltage; V1, V2= sensor return voltages; Rf= fixed, bridge or completion resistor; Rs=
variable or sensing resistor.
2
Campbell Scientific offers terminal input modules to facilitate this measurement.
Offset voltage compensation applies to bridge measurements. In addition to RevDiff and MeasOff parameters discussed in Minimizing offset voltages (p. 145), CRBasic bridge
6. Measurements 54
Page 70
measurement instructions include the RevEx parameter that provides the option to program a second set of measurements with the excitation polarity reversed. Much of the offset error inherent in bridge measurements is canceled out by setting RevDiff, RevEx, and MeasOff to True.
Measurement speed may be reduced when using RevDiff, MeasOff, and RevEx. When more than one measurement per sensor is necessary, such as occurs with the BrHalf3W(),
BrHalf4W(), and BrFull6W() instructions, input and excitation reversal are applied
separately to each measurement. For example, in the four-wire half-bridge (BrHalf4W()), when excitation is reversed, the differential measurement of the voltage drop across the sensor is made with excitation at both polarities and then excitation is again applied and reversed for the measurement of the voltage drop across the fixed resistor. The results of the measurements (X) must then be processed further to obtain the resistance value, which requires additional program execution time.
CRBasic Example 1: Four-Wire Full Bridge Measurement and Processing
'This program example demonstrates the measurement and 'processing of a four-wire resistive full bridge. 'In this example, the default measurement stored 'in variable X is deconstructed to determine the 'resistance of the R1 resistor, which is the variable 'resistor in most sensors that have a four-wire 'full-bridge as the active element. 'Declare Variables
Public X Public X_1 Public R_1 Public R_2 = 1000 'Resistance of fixed resistor R2 Public R_3 = 1000 'Resistance of fixed resistor R3 Public R_4 = 1000 'Resistance of fixed resistor R4
'Main Program
BeginProg
Scan(500,mSec,1,0)
'Full Bridge Measurement:
BrFull(X,1,mV250,1,Vx1,1,4000,True,True,0,60,1.0,0.0)
X_1 = ((-1 * X) / 1000) + (R_3 / (R_3 + R_4)) R_1 = (R_2 * (1 - X_1)) / X_1
NextScan
EndProg

6.3.2 Strain measurements

A principal use of the four-wire full bridge is the measurement of strain gauges in structural stress analysis. StrainCalc() calculates microstrain (µɛ) from the formula
for the specific bridge
6. Measurements 55
Page 71
configuration used. All strain gauges supported by StrainCalc() use the full-bridge schematic. 'Quarter-bridge', 'half-bridge' and 'full-bridge' refer to the number of active elements in the bridge schematic. In other words, a quarter-bridge strain gauge has one active element, a half-bridge has two, and a full-bridge has four.
StrainCalc()requires a bridge-configuration code. The following table shows the equation
used by each configuration code. Each code can be preceded by a dash (-). Use a code without the dash when the bridge is configured so the output decreases with increasing strain. Use a dashed code when the bridge is configured so the output increases with increasing strain. A dashed code sets the polarity of Vr to negative.
Table 6-1: StrainCalc() configuration codes
BrConfig Code Configuration
Quarter-bridge strain gauge:
1
Half-bridge strain gauge. One gauge parallel to strain, the other at 90°to strain:
2
Half-bridge strain gauge. One gauge parallel to +ɛ, the other parallel to -ɛ:
3
Full-bridge strain gauge. Two gauges parallel to +ɛ, the other two parallel to -ɛ:
4
6. Measurements 56
Page 72
Table 6-1: StrainCalc() configuration codes
BrConfig Code Configuration
Full-bridge strain gauge. Half the bridge has two gauges parallel to
+ɛ and -ɛ, and the other half to +νɛ and -νɛ
5
Full-bridge strain gauge. Half the bridge has two gauges parallel to
+ɛ and -νɛ , and the other half to -νɛ and +ɛ:
6
Where:
ν : Poisson's Ratio (0 if not applicable).
GF: Gauge Factor.
Vr: 0.001 (Source-Zero) if BRConfig code is positive (+).
Vr: –0.001 (Source-Zero) if BRConfig code is negative (–).
and where:
"source": the result of the full-bridge measurement (X = 1000 • V1 / Vx) when multiplier = 1 and offset = 0.
"zero": gauge offset to establish an arbitrary zero.

6.3.3 AC excitation

Some resistive sensors require AC excitation. AC excitation is defined as excitation with equal positive (+) and negative (–) duration and magnitude. These include electrolytic tilt sensors, soil moisture blocks, water-conductivity sensors, and wetness-sensing grids. The use of single polarity DC excitation with these sensors can result in polarization of sensor materials and the substance measured. Polarization may cause erroneous measurement, calibration changes, or rapid sensor decay.
Other sensors, for example, LVDTs (linear variable differential transformers), require AC excitation because they require inductive coupling to provide a signal. DC excitation in an LVDT will result in no measurement.
CRBasic bridge-measurement instructions have the option to reverse polarity to provide AC excitation by setting the RevEx parameter to True.
6. Measurements 57
Page 73
NOTE: Take precautions against ground loops when measuring sensors that require AC excitation. See also Ground loops (p. 131).
For more information, see Accuracy for resistance measurements (p. 58).

6.3.4 Accuracy for resistance measurements

Consult the following technical papers for in-depth treatments of several topics addressing voltage measurement quality:
l Preventing and Attacking Measurement Noise Problems l Benefits of Input Reversal and Excitation Reversal for Voltage Measurements l Voltage Measurement Accuracy, Self- Calibration, and Ratiometric Measurements
NOTE: Error discussed in this section and error-related specifications of the CR1000X do not include error introduced by the sensor, or by the transmission of the sensor signal to the data logger.
For accuracy specifications of ratiometric resistance measurements, see Resistance measurement
specifications (p. 183). Voltage measurement is variable V1 or V2 in resistance measurements.
Offset is the same as that for simple analogue voltage measurements.
Assumptions that support the ratiometric-accuracy specification include:
l Data logger is within factory calibration specification. l Input reversal for differential measurements and excitation reversal for excitation voltage
are within specifications.
l Effects due to the following are not included in the specification:
o
Bridge-resistor errors
o
Sensor noise
o
Measurement noise

6.4 Thermocouple Measurements

Thermocouple measurements are special case voltage measurements.
NOTE:Thermocouples are inexpensive and easy to use. However, they pose several challenges to the acquisition of accurate temperature data, particularly when using external reference junctions.
A thermocouple consists of two wires, each of a different metal or alloy, joined at one end to form the measurement junction. At the opposite end, each wire connects to terminals of a
6. Measurements 58
Page 74
voltage measurement device, such as the data logger. These connections form the reference junction. If the two junctions (measurement and reference) are at different temperatures, a voltage proportional to the difference is induced in the wires. This phenomenon is known as the Seebeck effect.
Measurement of the voltage between the positive and negative terminals of the voltage­measurement device provides a direct measure of the temperature difference between the measurement and reference junctions. A third metal (for example, solder or data logger terminals) between the two dissimilar-metal wires form parasitic-thermocouple junctions, the effects of which cancel if the two wires are at the same temperature. Consequently, the two wires at the reference junction are placed in close proximity so they remain at the same temperature.
Knowledge of the reference junction temperature provides the determination of a reference junction compensation voltage, corresponding to the temperature difference between the reference junction and 0°C. This compensation voltage, combined with the measured thermocouple voltage, can be used to compute the absolute temperature of the thermocouple junction.
TCDiff()and TCSE()thermocouple instructions determine thermocouple temperatures
using the following sequence. First, the temperature (°C) of the reference junction is determined. Next, a reference junction compensation voltage is computed based on the temperature difference between the reference junction and 0°C. If the reference junction is the data logger analogue-input terminals, the temperature is conveniently measured with the PanelTemp() instruction. The actual thermocouple voltage is measured and combined with the reference junction compensation voltage. It is then used to determine the thermocouple-junction temperature based on a polynomial approximation of NIST thermocouple calibrations.
See the CRBasic Editor help for detailed instruction information and program examples: https://
help.campbellsci.eu/crbasic/cr1000x/.

6.5 Period-averaging measurements

Use PeriodAvg()to measure the period (in microseconds) or the frequency (in Hz) of a signal on a single-ended channel. For these measurements, the data logger uses a high-frequency digital clock to measure time differences between signal transitions, whereas pulse-count measurements simply accumulate the number of counts. As a result, period-average measurements offer much better frequency resolution per measurement interval than pulse­count measurements. See also Pulse measurements (p. 60).
SE terminals on the data logger are configurable for measuring the period of a signal. The measurement is performed as follows: low-level signals are amplified prior to a voltage
comparator. The internal voltage comparator is referenced to the programmed threshold. The
6. Measurements 59
Page 75
threshold parameter allows referencing the internal voltage comparator to voltages other than 0 V. For example, a threshold of 2500 mV allows a 0 to 5 VDC digital signal to be sensed by the internal comparator without the need for additional input conditioning circuitry. The threshold allows direct connection of standard digital signals, but it is not recommended for small­amplitude sensor signals.
A threshold other than zero results in offset voltage drift, limited accuracy (approximately ±10 mV) and limited resolution (approximately 1.2 mV).
See also Period-averaging measurement specifications (p. 184).
TIP: Both pulse count and period-average measurements are used to measure frequency output sensors. However, their measurement methods are different. Pulse count measurements use dedicated hardware - pulse count accumulators, which are always monitoring the input signal, even when the data logger is between program scans. In contrast, period-average measurements use program instructions that only monitor the input signal during a program scan. Consequently, pulse count scans can occur less frequently than period-average scans. Pulse counters may be more susceptible to low-frequency noise because they are always "listening", whereas period-averaging measurements may filter the noise by reason of being "asleep" most of the time.
Pulse count measurements are not appropriate for sensors that are powered off between scans, whereas period-average measurements work well since they can be placed in the scan to execute only when the sensor is powered and transmitting the signal.

6.6 Pulse measurements

The output signal generated by a pulse sensor is a series of voltage waves. The sensor couples its output signal to the measured phenomenon by modulating wave frequency. The data logger detects the state transition as each wave varies between voltage extremes (high-to-low or low-to­high). Measurements are processed and presented as counts, frequency, or timing data. Both pulse count and period-average measurements are used to measure frequency-output sensors. For more information, see Period-averaging measurements (p. 59).
6. Measurements 60
Page 76
The data logger includes terminals that are configurable for pulse input as shown in the following image.
Table 6-2: Pulse input terminals and the input types they can measure
Input Type Pulse Input Terminal
P1
P2
High-frequency
C (all)
P1
Low-level AC
P2
P1
P2
Switch-closure
C (all)
Using the PulseCount() instruction, P C terminals are configurable for pulse input to measure counts or frequency. Maximum input frequency is dependent on input voltage. If pulse input voltages exceed the maximum voltage, third-party external-signal conditioners should be employed. Do not measure voltages greater than 20 V.
6. Measurements 61
Page 77
NOTE: Conflicts can occur when a control port pair is used for different instructions (TimerInput(),
PulseCount(), SDI12Recorder(), WaitDigTrig()). For example, if C1 is used for SDI12Recorder(), C2 cannot be used for TimerInput(), PulseCount(), or WaitDigTrig().
Terminals configured for pulse input have internal filters that reduce electronic noise, and thus reduce false counts. Internal AC coupling is used to eliminate DC offset voltages. For tips on working with pulse measurements, see Pulse measurement tips (p. 66).
Output can be recorded as counts, frequency or a running average of frequency.
For more information, see Pulse measurement specifications (p. 185).
See the CRBasic Editor help for detailed instruction information and program examples:
https://help.campbellsci.eu/crbasic/cr1000x/.

6.6.1 Low-level AC measurements

Low-level AC (alternating current or sine-wave) signals can be measured on P terminals. AC generator anemometers typically output low-level AC.
Measurement output options include the following:
l Counts l Frequency (Hz) l Running average
Rotating magnetic-pickup sensors commonly generate ac voltage ranging from millivolts at low­rotational speeds to several volts at high-rotational speeds.
CRBasic instruction: PulseCount(). See the CRBasic Editor help for detailed instruction information and program examples: https://help.campbellsci.eu/crbasic/cr1000x/.
Low-level AC signals cannot be measured directly by C terminals. Peripheral terminal expansion modules, such as the Campbell Scientific LLAC4, are available for converting low-level AC signals to square-wave signals measurable by C terminals.
For more information, see Pulse measurement specifications (p. 185).

6.6.2 High-frequency measurements

High-frequency (square-wave) signals can be measured on terminals:
l P or C
6. Measurements 62
Page 78
Common sensors that output high-frequency pulses include:
l Photo-chopper anemometers l Flow meters
Measurement output optionss include counts, frequency in hertz, and running average. Note that the resolution of a frequency measurement can be different depending on the terminal used in the PulseCount() instruction. See the CRBasic help for more information.
The data logger has built-in pull-up and pull-down resistors for different pulse measurements which can be accessed using the PulseCount()instruction. Note that pull down options are usually used for sensors that source their own power.
6.6.2.1 P terminals
l CRBasic instruction: PulseCount()
High-frequency pulse inputs are routed to an inverting CMOS input buffer with input hysteresis. See Pulse measurement specifications (p. 185) for more information.
6.6.2.2 C terminals
l CRBasic instructions: PulseCount()
See Pulse measurement specifications (p. 185) for more information.

6.6.3 Switch-closure and open-collector measurements

Switch-closure and open-collector (also called current-sinking) signals can be measured on terminals:
l P or C
Mechanical switch-closures have a tendency to bounce before solidly closing. Unless filtered, bounces can cause multiple counts per event. The data logger automatically filters bounce. Because of the filtering, the maximum switch-closure frequency is less than the maximum high­frequency measurement frequency. Sensors that commonly output a switch-closure or an open­collector signal include:
l Tipping-bucket rain gauges l Switch-closure anemometers l Flow meters
6. Measurements 63
Page 79
The data logger has built-in pull-up and pull-down resistors for different pulse measurements which can be accessed using the PulseCount() instruction. Note that pull down options are usually used for sensors that source their own power.
Data output options include counts, frequency (Hz), and running average.
6.6.3.1 P Terminals
An internal 100 kΩ pull-up resistor pulls an input to 5 VDC with the switch open, whereas a switch-closure to ground pulls the input to 0 V.
CRBasic instruction: PulseCount(). See the CRBasic Editor help for detailed instruction
l
information and program examples: https://help.campbellsci.eu/crbasic/cr1000x/.
Switch Closure on P Terminal Open Collector on P Terminal
6.6.3.2 C terminals
Switch-closure mode is a special case edge-count function that measures dry-contact switch­closures or open collectors. The operating system filters bounces.
l CRBasic instruction: PulseCount().
See also Pulse measurement specifications (p. 185).

6.6.4 Edge timing and edge counting

Edge time, period, and counts can be measured on P or C terminals. Feedback control using pulse-width modulation (PWM) is an example of an edge timing application.
6.6.4.1 Single edge timing
A single edge or state transition can be measured on C terminals. Measurements can be expressed as a time (µs), frequency (Hz) or period (µs).
CRBasic instruction: TimerInput()
6. Measurements 64
Page 80
6.6.4.2 Multiple edge counting
Time between edges, time from an edge on the previous terminal, and edges that span the scan interval can be measured on C terminals. Measurements can be expressed as a time (µs), frequency (Hz) or period (µs).
l CRBasic instruction: TimerInput()
6.6.4.3 Timer input NAN conditions
NAN is the result of a TimerInput() measurement if one of the following occurs:
l Measurement timer expires l The signal frequency is too fast
For more information, see:
l Pulse measurement specifications (p. 185) l Digital input/output specifications (p. 186) l Period-averaging measurement specifications (p. 184)

6.6.5 Quadrature measurements

The Quadrature() instruction is used to measure shaft or rotary encoders. A shaft encoder outputs a signal to represent the angular position or motion of the shaft. Each encoder will have two output signals, an A line and a B line. As the shaft rotates the A and B lines will generate digital pulses that can be read, or counted, by the data logger.
In the following example, channel A leads channel B, therefore the encoder is determined to be moving in a clockwise direction. If channel B led channel A, it would be determined that the encoder was moving in a counterclockwise direction.
6. Measurements 65
Page 81
Terminals C1-C8 can be configured as digital pairs to monitor the two channels of an encoder. The Quadrature() instruction can return:
l The accumulated number of counts from channel A and channel B. Count will increase if
channel A leads channel B. Count will decrease if channel B leads channel A.
l The net direction. l Number of counts in the A-leading-B direction. l Number of counts in the B-leading-A direction.
Counting modes:
l Counting the increase on rising edge of channel A when channel A leads channel B.
Counting the decrease on falling edge of channel A when channel B leads channel A.
l Counting the increase at each rising and falling edge of channel A when channel A leads
channel B. Counting the decrease at each rising and falling edge of channel A when channel A leads channel B.
l Counting the increase at each rising and falling edge of both channels when channel A
leads channel B. Counting the decrease at each rising and falling edge of both channels when channel B leads channel A.
For more information, see Digital input/output specifications (p. 186).

6.6.6 Pulse measurement tips

The PulseCount()instruction uses dedicated 32-bit counters to accumulate all counts over the programmed scan interval. The resolution of pulse counters is one count. Counters are read at the beginning of each scan and then cleared. Counters will overflow if accumulated counts
exceed 4,294,967,296 (232), resulting in erroneous measurements. See the CRBasic Editor help for detailed instruction information and program examples:
https://help.campbellsci.eu/crbasic/cr1000x/.
Counts are the preferred PulseCount() output option when measuring the number of tips from a tipping-bucket rain gauge or the number of times a door opens. Many pulse-output sensors, such as anemometers and flow meters, are calibrated in terms of frequency (Hz) so are usually measured using the PulseCount() frequency-output option.
Use the LLAC4 module to convert non-TTL-level signals, including low-level ac signals, to TTL levels for input to C terminals
Conflicts can occur when a control port pair is used for different instructions (TimerInput(),
PulseCount(), SDI12Recorder(), WaitDigTrig()). For example, if C1 is used for SDI12Recorder(), C2 cannot be used for TimerInput(), PulseCount(), or WaitDigTrig().
6. Measurements 66
Page 82
Understanding the signal to be measured and compatible input terminals and CRBasic instructions is helpful. See Pulse input terminals and the input types they can measure (p. 61).
6.6.6.1 Input filters and signal attenuation
Terminals configured for pulse input have internal filters that reduce electronic noise. The electronic noise can result in false counts. However, input filters attenuate (reduce) the amplitude (voltage) of the signal. Attenuation is a function of the frequency of the signal. Higher-frequency signals are attenuated more. If a signal is attenuated too much, it may not pass the detection thresholds required by the pulse count circuitry. See Pulse measurement specifications (p. 185) for more information. The listed pulse measurement specifications account for attenuation due to input filtering.
6.6.6.2 Pulse count resolution
Longer scan intervals result in better resolution. PulseCount() resolution is 1 pulse per scan. On a 1 second scan, the resolution is 1 pulse per second. The resolution on a 10 second scan interval is 1 pulse per 10 seconds, which is 0.1 pulses per second. The resolution on a 100 millisecond interval is 10 pulses per second.
For example, if a flow sensor outputs 4.5 pulses per second and you use a 1 second scan, one scan will have 4 pulses and the next 5 pulses. Scan to scan, the flow number will bounce back and forth. If you did a 10 second scan (or saved a total to a 10 second table), you would get 45 pulses. The total is 45 pulses for every 10 seconds. An average will correctly show 4.5 pulses per second. You wouldn't see the reading bounce on the longer time interval.

6.7 Vibrating wire measurements

The data logger can measure vibrating wire sensors through vibrating-wire interface modules. Vibrating wire sensors are the sensor of choice in many environmental and industrial applications that need sensor stability over very long periods, such as years or even decades. A thermistor included in most sensors can be measured to compensate for temperature errors.

6.7.1 VSPECT®

Measuring the resonant frequency by means of period averaging is the classic technique, but Campbell Scientific has developed static and dynamic spectral-analysis techniques (VSPECT) that produce superior noise rejection, higher resolution, diagnostic data, and, in the case of dynamic VSPECT, measurements up to 333.3 Hz. For detailed information on VSPECT, see Vibrating Wire
Spectral Analysis Technology.
6. Measurements 67
Page 83

6.8 Sequential and pipeline processing modes

The data logger has two processing modes: sequential mode and pipeline mode. In sequential mode, data logger tasks run more or less in sequence. In pipeline mode, data logger tasks run more or less in parallel. Mode information is included in a message returned by the data logger, which is displayed by software when the program is sent and compiled, and it is found in the Status Table, CompileResults field. The CRBasic Editor pre-compiler returns a similar message.
The default mode of operation is pipeline mode. However, when the data logger program is compiled, the data logger analyzes the program instructions and automatically determines which mode to use. The data logger can be forced to run in either mode by placing the
PipeLineMode or SequentialMode instruction at the beginning of the program (before
the BeginProg instruction).
For additional information, visit the Campbell Scientific blog article, "Understanding CRBasic
Program Compile Modes: Sequential and Pipeline."

6.8.1 Sequential mode

Sequential mode executes instructions in the sequence in which they are written in the program. After a measurement is made, the result is converted to a value determined by processing arguments that are included in the measurement instruction, and then program execution proceeds to the next instruction. This line-by-line execution allows writing conditional measurements into the program.
NOTE: The exact time at which measurements are made in sequential mode may vary if other measurements or processing are made conditionally, if there is heavy communications activity, or if other interrupts occur (such as accessing a Campbell Scientific memory card).

6.8.2 Pipeline mode

Pipeline mode handles measurement, most digital, and processing tasks separately, and, in many cases, simultaneously. Measurements are scheduled to execute at exact times and with the highest priority, resulting in more precise timing of measurements, and usually more efficient processing and power consumption.
In pipeline mode, it will take less time for the data logger to execute each scan of the program. However, because processing can lag behind measurements, there could be instances, such as
6. Measurements 68
Page 84
when turning on a sensor using the SW12() instruction, that the sensor might not be on at the correct time to make the measurement.
Pipeline scheduling requires that the program be written such that measurements are executed every scan. Because multiple tasks are taking place at the same time, the sequence in which the instructions are executed may not be in the order in which they appear in the program. Therefore, conditional measurements are not allowed in pipeline mode. Because of the precise execution of measurement instructions, processing in the current scan (including updating public variables and data storage) is delayed until all measurements are complete. Some processing, such as transferring variables to control instructions, like PortSet() and ExciteV(), may not be completed until the next scan.
When a condition is true for a task to start, it is put in a queue. Because all tasks are given the same priority, the task is put at the back of the queue. Every 1 ms (or faster if a new task is triggered) the task currently running is paused and put at the back of the queue, and the next task in the queue begins running. In this way, all tasks are given equal processing time by the data logger.

6.8.3 Slow Sequences

Priority of a slow sequence (SlowSequence)in the data logger will vary, depending upon whether the data logger is executing its program in pipeline mode or sequential mode. With the important exception of measurements, when running in pipeline mode all sequences in the program have the same priority. When running in sequential mode, the main scan has the highest priority for measurements, followed by background calibration (which is automatically run in a slow sequence), then the first slow sequence, the second slow sequence, and so on. The effects of this priority are negligible; however, since, once the tasks begin running, each task is allotted a 10 msec time slice, after which, the next task in the queue runs for 10 msec. The data logger cycles through the queue until all instructions for all sequences are complete.
6. Measurements 69
Page 85

7. Communications protocols

Data loggers communicate with data logger support software, other Campbell Scientific data loggers, and other hardware and software using a number of protocols including PakBus, Modbus, DNP3, CPI, SPI, and TCP/IP. Several industry-specific protocols are also supported. CAN-bus is supported when using the Campbell Scientific SDM-CAN communications module. See also Communications specifications (p. 188).
7.1 General serial communications 71
7.2 Modbus communications 77
7.3 Internet communications 86
7.4 DNP3 communications 89
7.5 Serial peripheral interface (SPI) and I2C 89
7.6 PakBus communications 89
7.7 SDI-12 communications 90
Some communications services, such as satellite networks, can be expensive to send and receive information. Best practices for reducing expense include:
l Declare Public only those variables that need to be public. Other variables should be
declared as Dim.
l Be conservative with use of string variables and string variable sizes. Make string variables
as big as they need to be and no more. The default size, if not specified, is 24 bytes, but the minimum is 4 bytes. Declare string variables Public and sample string variables into data tables only as needed.
When using GetVariables()/ SendVariables()to send values between data
l
loggers, put the data in an array and use one command to get the multiple values. Using one command to get 10 values from an array and swath of 10 is more efficient (requires only 1 transaction) than using 10 commands to get 10 single values (requires 10 transactions). See the CRBasic Editor help for detailed instruction information and program examples: https://help.campbellsci.eu/crbasic/cr1000x/.
7. Communications protocols 70
Page 86
l Set the data logger to be a PakBus router only as needed. When the data logger is a router,
and it connects to another router like LoggerNet, it exchanges routing information with that router and, possibly (depending on your settings), with other routers in the network. Network Planner set this appropriately when it is used. This is also set through the IsRouter setting in the Settings Editor. For more information, see the Device Configuration Settings Editor Information tables and settings (advanced) (p. 152).
l Set PakBus beacons and verify intervals properly. For example, there is no need to verify
routes every five minutes if communications are expected only every 6 hours. Network Plannerwill set this appropriately when it is used. This is also set through the Beacon and Verify settings in the Settings Editor. For more information, see the Device Configuration Settings Editor Beacon() and Verify() settings.
For information on Designing a PakBus network using the Network Planner tool in LoggerNet, watch the following video:

7.1 General serial communications

The data logger supports two-way serial communications. These communications ports can be used with smart sensors that deliver measurement data through serial data protocols, or with devices such as modems, that communicate using serial data protocols.
CRBasic instructions for general serial communications include:
l
SerialOpen()
l
SerialClose()
l
SerialIn()
l
SerialInRecord()
l
SerialInBlock()
l
SerialOut()
l
SerialOutBlock()
See the CRBasic Editor help for detailed instruction information and program examples: https://
help.campbellsci.eu/crbasic/cr1000x/.
To communicate over a serial port, it is important to be familiar with protocol used by the device with which you will be communicating. Refer to the manual of the sensor or device to find its
7. Communications protocols 71
Page 87
protocol and then select the appropriate options for each CRBasic parameter. See the application note Interfacing Serial Sensors with Campbell Scientific Dataloggers for more programming details and examples.
Configure C terminals as serial ports using Device Configuration Utility or by using the
SerialOpen() CRBasic instruction. C terminals are configured in pairs for TTL, LVTTL, RS-232,
and half-duplex RS-422 and RS-485 communications. For full-duplex RS-422 and RS-485, four C terminals are required.
FIGURE 7-1. Single-ended full-duplex communications
FIGURE 7-2. Differential-pair full-duplex communications
7. Communications protocols 72
Page 88
FIGURE 7-3. Differential-pair half-duplex communications

7.1.1 RS-232

RS-232 supports point to point communications between one master and one slave device. See
FIGURE 7-1 (p. 72). Data bits are sent from master to slave across the transmit (Tx) line with
respect to DC ground. The Tx line idle state is between -25V and -3V, depending on the transmitter. The transition from negative voltage to above 3V begins data transmission.
NOTE: Most RS-232 devices are also compatible communicating with the data logger using TTL­inverted.
NOTE: The data logger uses about -7 V to represent logic 1, and about 5.8 V to represent logic 0.
FIGURE 7-4. RS-232 Tx voltage with respect to GND
7. Communications protocols 73
Page 89

7.1.2 RS-485

RS-485 supports communications between 32 masters and 32 slaves. See FIGURE 7-3 (p. 73) and
FIGURE 7-2 (p. 72). It uses a differential voltage between two lines (A & B) to transmit data. When
the voltage of B with respect to A is between -0.2 V and -6 V that is interpreted as logic 0. When the differential voltage in the range of positive 0.2 V to 6 V that is interpreted as logic 1.
NOTE: The CR1000X uses about -1 V to represent logic 0, and about 1 V to represent logic 1.
FIGURE 7-5. RS-485 Voltage B with respect to A

7.1.3 RS-422

RS-422 communications protocol is similar to RS-485. The difference is that RS-422 ranges from ­6 V to 6 V instead of -5 V to 5 V. Also, RS-422 only supports communications from 1 master to 10 slaves, but not return communications from all 10 slaves. In full-duplex point-to-point (1 master, 1 slave) RS-422 communications, both devices can transmit and receive. Half-duplex can be used in cases where sensors broadcast data to a receiving data logger. See FIGURE 7-3 (p. 73) and
FIGURE 7-2 (p. 72).
NOTE: Use the RS-485 communications type when setting up the data logger for RS-422 communications. Most RS-422 sensors will work with RS-485 protocol.
7. Communications protocols 74
Page 90
FIGURE 7-6. RS-422 Voltage B with respect to A

7.1.4 TTL

TTL supports point to point communications between one master and one slave device. See
FIGURE 7-1 (p. 72). Data bits are sent from master to slave with a voltage between transmit (Tx)
and ground. The transmit line idle state is 5 V (logic 1). Data is sent after one clock cycle once the voltage is pulled low (to 0 V).
FIGURE 7-7. TTL Tx voltage with respect to GND

7.1.5 LVTTL

The only difference between low-voltage TTL (LVTTL) and TTL is that the voltage range is 0 V to
3.3 V. See FIGURE 7-1 (p. 72).
7. Communications protocols 75
Page 91
FIGURE 7-8. LVTTL Tx voltage with respect to GND

7.1.6 TTL-Inverted

The only difference between TTL-inverted and TTL is that the logic is inverted. The idle state for TTL-inverted is 0 V instead of 5 V. See FIGURE 7-1 (p. 72). Data is sent after the voltage is pulled high (to 5 V).
NOTE: Many RS-232 devices are compatible with this communications protocol.
FIGURE 7-9. TTL-inverted Tx voltage with respect to GND

7.1.7 LVTTL-Inverted

The only difference between LVTTL-inverted and TTL-inverted is that the voltage range is 0 V to
3.3 V. See FIGURE 7-1 (p. 72).
7. Communications protocols 76
Page 92
FIGURE 7-10. LVTTL-inverted Tx voltage with respect to GND

7.2 Modbus communications

The data logger supports Modbus RTU, Modbus ASCII, and Modbus TCP protocols and can be programmed as a Modbus master or Modbus slave. These protocols are often used in SCADA networks. Data loggers can communicate using Modbus on all available communication ports. The data logger supports RTU and ASCII communication modes on RS-232 and RS-485 connections.
CRBasic Modbus instructions include:
l
ModbusMaster()
l
ModbusSlave()
l
MoveBytes()
See the CRBasic Editor help for detailed instruction information and program examples:
https://help.campbellsci.eu/crbasic/cr1000x/.
For additional information on Modbus, see:
l About Modbus (p. 78) l Why Modbus Matters: An Introduction l How to Access Live Measurement Data Using Modbus l Using Campbell Scientific Dataloggers as Modbus Slave Devices in a SCADA Network
Because Modbus has a set command structure, programming the data logger to get data from field instruments can be much simpler than from some other serial sensors. Because Modbus uses a common bus and addresses each node, field instruments are effectively multiplexed to a data logger without additional hardware.
When doing Modbus communications over RS-232, the data logger, through Device Configuration Utility or the Settings editor, can be set to keep communication ports open and awake, but at higher power usage. Set RS-232Power to Always on. Otherwise, the data logger
7. Communications protocols 77
Page 93
goes into sleep mode after 40 seconds of communications inactivity. Once asleep, two packets are required before it will respond. The first packet awakens the data logger; the second packet is received as data. This would make a Modbus master fail to poll the data logger, if not using retries.
More information on Modbus can be found at:
l www.simplyModbus.ca/FAQ.htm l www.Modbus.org/tech.php l www.lammertbies.nl/comm/info/modbus.html

7.2.1 About Modbus

Modbus is a communications protocol that enables communications among many devices connected to the same network. Modbus is often used in supervisory control and data acquisition (SCADA) systems to connect remote terminal units (RTUs) with a supervisory computer - allowing them to relay measurement data, device status, control commands, and configuration information.
The popularity of Modbus has grown because it is freely available and because its messaging structure is independent of the type of physical interface or connection that is used. Modbus can coexist with other types of connections on the same physical interface at the same time. You can operate the protocol over several data links and physical layers.
Modbus is supported by many industrial devices, including those offered by Campbell Scientific. Not only can intelligent devices such as microcontrollers and programmable logic controllers (PLCs) communicate using Modbus, but many intelligent sensors have a Modbus interface that enables them to send their data to host systems. Examples of using Modbus with Campbell Scientific data loggers include:
l Interfacing data loggers and Modbus-enabled sensors. l Sending and retrieving data between data loggers and other industrial devices. l Delivering environmental data to SCADA systems. l Integrating Modbus data into PakBus networks, or PakBus data into Modbus networks.
7. Communications protocols 78
Page 94

7.2.2 Modbus protocols

There are three standard variants of Modbus protocols:
l Modbus RTU — Modbus RTU is the most common implementation available for Modbus.
Used in serial communications, data is transmitted in a binary format. The RTU format follows the commands/data with a cyclic redundancy check checksum.
NOTE: The Modbus RTU protocol standard does not allow a delay between characters of 1.5 times or more the length of time normally required to receive a character. This is analogous to “pizza” being understood, and “piz za” being gibberish. It's important to note that communications hardware used for Modbus RTU, such as radios, must transfer data as entire packets without injecting delays in the middle of Modbus messages.
l Modbus ASCII — Used in serial communications, data is transmitted as an ASCII
representation of the hexadecimal values. Timing requirements are loosened, and a simpler longitudinal redundancy check checksum is used.
l Modbus TCP/IP or Modbus TCP — Used for communications over TCP/IP networks. The
TCP/IP format does not require a checksum calculation, as lower layers already provide
7. Communications protocols 79
Page 95
checksum protection. The packet structure is similar to RTU, but uses a different header. Devices labelled as Modbus gateways will convert from Modbus TCP to Modbus RTU.
Campbell Scientific data loggers support Modbus RTU, Modbus ASCII, and Modbus TCP protocols. If the connection is over IP, Campbell Scientific data loggers always use Modbus TCP. Modbus slave functionality over other comports use RTU. When acting as a master, the data logger can be switched between ASCII and RTU protocols using an option in the
ModbusMaster() instruction. See the CRBasic Editor help for detailed instruction information
and program examples: https://help.campbellsci.eu/crbasic/cr1000x/.

7.2.3 Understanding Modbus Terminology

Many of the object types are named from using Modbus in driving relays: a single-bit physical output is called a coil, and a single-bit physical input is called a discrete input or a contact.
Information is stored in the slave device in up to four different tables. Two tables store on/off discrete values (coils) and two store numerical values (registers). The coils and registers each have a read-only table and read/write table.

7.2.4 Connecting Modbus devices

data loggers can communicate with Modbus on all available communication ports. Consideration should be given to proper surge protection of any cabled connection. Between systems of significantly different ground potential, optical isolation may be appropriate. For additional information on grounds, see Grounds (p. 10).
The common serial interface used for Modbus RTU connections is RS-485 half-duplex, or two­wire RS-485. This connection uses one differential pair for data, and another wire for a signal ground. When twisted pair cable is used, the signal can travel long distances. Resistors are often used to reduce noise. Bias resistors are used to give a clean default state on the signal lines. For long cable lengths, termination resistors, which are usually 120 ohms, are needed to stop data corruption due to reflections. Signal grounds are terminated to earth ground with resistors to prevent ground loops, but allow a common mode signal. The resistors to ground are usually integral to the equipment. The resistive ground is labelled as RG on Campbell Scientific equipment.

7.2.5 Modbus master-slave protocol

Modbus is a master-slave protocol. The device requesting the information is called the Modbus master, and the devices supplying information are Modbus slaves. In a standard Modbus network, there is one master and up to 247 slaves. A master does not have a Modbus address. However, each Modbus slave on a shared network has a unique address from 1 to 247.
7. Communications protocols 80
Page 96
A single Modbus master device initiates commands (requests for information), sending them to one or more Modbus slave devices on the same network. Only the Modbus master can initiate communications. Modbus slaves, in turn, remain silent, communicating only when responding to requests from the Modbus master.
Every message from the master will begin with the slave address, followed by the function code, function parameters, and a checksum. The slave will respond with a message beginning with its address, followed by the function code, data, and a checksum. The amount of data in the packet will vary, depending on the command sent to the slave. Slave devices only process one command at a time. So, the master needs to wait for a response, or timeout before sending the next command.
A broadcast address is specified to allow simultaneous communications with all slaves. Because response time of slave devices is not specified by the standard, and device manufacturers also rarely specify a maximum response time, broadcast features are rarely used. When implementing a system, timeouts in the master will need to be adjusted to account for the observed response time of the slaves.
Campbell Scientific data loggers can be programmed to be a Modbus master or Modbus slave ­or even both at the same time! This proves particularly helpful when your data logger is a part of two wider area networks. In one it uses Modbus to query data (as a master) from localized sensors or other data sources, and then in the other, it serves that data up (as a slave) to another Modbus master.

7.2.6 About Modbus programming

Modbus capability of the data logger must be enabled through configuration or programming. See the CRBasic Editor help for detailed information on program structure, syntax, and each instruction available to the data logger.
CRBasic Modbus instructions include:
l
ModbusMaster()
l
ModbusSlave()
l
MoveBytes()
See the CRBasic Editor help for detailed instruction information and program examples: https://
help.campbellsci.eu/crbasic/cr1000x/.
7.2.6.1 Endianness
Endianness refers to the sequential order in which bytes are arranged into larger numerical values when stored in memory. Words may be represented in big-endian or little-endian format,
7. Communications protocols 81
Page 97
depending on whether bits or bytes or other components are ordered from the big end (most significant bit) or the little end (least significant bit).
In big-endian format, the byte containing the most significant bit is stored first, then the following bytes are stored in decreasing significance order, with the byte containing the least significant bit stored last. Little-endian format reverses this order: the sequence stores the least significant byte first and the most significant byte last. Endianness is used in some Modbus programming so it is important to note that the CR1000X is a big-endian instrument.
7.2.6.2 Function codes
A function code tells the slave which storage entity to access and whether to read from or write to that entity. Different devices support different functions (consult the device documentation for support information). The most commonly used functions (codes 01, 02, 03, 04, 05, 15, and 16 ) are supported by Campbell Scientific data loggers.
Most users only require the read- register functions. Holding registers are read with function code 03. Input registers are read with function code 04. This can be confusing, because holding registers are usually listed with an offset of 40,000 and input registers with an offset of 30,000. Don’t mix up the function codes. Double check the register type in the device documentation.
Function Code Action Entity
01 (01 hex) Read Discrete Output Coils
05 (05 hex) Write single Discrete Output Coil
15 (0F hex) Write multiple Discrete Output Coils
02 (02 hex) Read Discrete Input
04 (04 hex) Read Input Registers
03 (03 hex) Read Holding Registers
06 (06 hex) Write single Holding Register
16 (10 hex) Write multiple Holding Registers
The write-register functions will only work on holding registers. Function 06 only changes one 16­bit register, whereas function 16, changes multiple registers. Note, when writing registers, the Variable parameter for the ModbusMaster() instruction refers to a source, not a destination.
7. Communications protocols 82
Page 98

7.2.7 Modbus information storage

With the Modbus protocol, most of the data values you want to transmit or receive are stored in registers. Information is stored in the slave device in four different entities. Two store on/off discrete values (coils) and two store numerical values (registers). The four entities include:
l Coils – 1-bit registers, used to control discrete outputs (including Boolean values),
read/write.
l Discrete Input – 1-bit registers, used as inputs, read only. l Input Registers – 16-bit registers, used as inputs, read only. l Holding Registers – 16-bit registers; used for inputs, output, configuration data, or any
requirement for “holding” data; read/write.
See the CRBasic Editor help for detailed instruction information and program examples: https://
help.campbellsci.eu/crbasic/cr1000x/.
7.2.7.1 Registers
In a 16-bit memory location, a 4-byte value takes up two registers. The Modbus protocol always refers to data registers with a starting address number, and a length to indicate how many registers to transfer.
Campbell Scientific uses 1-based numbering (a common convention for numbering registers in equipment) in the ModbusMaster()instruction. With 1-based numbering, the first data location is referred to as register number 1. Some equipment uses 0-based numbering (check the equipment documentation). With 0-based numbering, the first register is referred to as 0.
Reading register numbers can be complicated by the fact that register numbers are often written with an offset added. Input registers are written with an offset of 30000. So, the first input register is written as 30001, with 1-based numbering. Holding registers are numbered with an offset of
40000. You must remove the offset before writing the number as the Start parameter of
ModbusMaster().
There are rare instances when equipment is designed with the registers mapped including the offset. That means 40001 in the documentation is really register number 40001. Those are rare instances, and the equipment is deviating from standards. If 1 or 2 don’t work for the Start parameter, try 40001 and 40002.
7.2.7.2 Coils
Discrete digital I/O channels in Modbus are referred to as coils. The term coil has its roots in digital outputs operating solenoid coils in an industrial environment. Coils may be read only or read/write. A read only coil would be a digital input. A read/write coil is used as an output. Coils
7. Communications protocols 83
Page 99
are read and manipulated with their own function codes, apart from the registers. Many modern devices do not use coils at all.
When working with coils, the data logger requires Boolean variables. When reading coils, each Boolean in an array will hold the state of one coil. A value of True will set the coil, a value of False will unset the coil.
7.2.7.3 Data Types
Modbus does not restrict what data types may be contained within holding and input registers. Equipment manufacturers need to indicate what binary data types they are using to store data. Registers are 16-bit, so 32-bit data types use 2 registers each. Some devices combine more registers together to support longer data types like strings. The ModbusMaster() instruction has a ModbusOption parameter that supports several different data types.
When data types use more than 1 register per value, the register order within the data value is important. Some devices will swap the high and low bytes between registers. You can compensate for this by selecting the appropriate ModbusOption.
Byte order is also important when communicating data over Modbus. Big Endian byte order is the reverse of Little Endian byte order. It may not always be apparent which a device uses. If you receive garbled data, try reversing the byte order. Reversing byte order is done using the
MoveBytes() instruction. There is an example in CRBasic help for reversing the bytes order of
a 32-bit variable.
After properly reading in a value from a Modbus device, you might have to convert the value to proper engineering units. With integer data types, it is common to have the value transmitted in hundredths or thousandths.
Unsigned 16-bit integer
The most basic data type used with Modbus is unsigned 16-bit integers. It is the original Modbus data type with 1 register per value. On the data logger, declare your destination variable as type Long. A Long is a 32-bit signed integer that contains the value received. Select the appropriate ModbusOption to avoid post-processing.
Signed 16-bit integer
Signed 16-bit integers use 1 register per value. On the data logger, declare your destination variable as type Long. A Long is a 32-bit signed integer that contains the value received . Select the appropriate ModbusOption to avoid post-processing.
7. Communications protocols 84
Page 100
Signed 32-bit integer
Signed 32-bit integers require two registers per value. This data type corresponds to the native Long variable type in Campbell data loggers. Declare your variables as type Long before using them as the Variable parameter in ModbusMaster(). Select the appropriate ModbusOption to avoid post-processing.
Unsigned 32-bit integer
Unsigned 32-bit integers require two registers per value. Declare your variables as type Long before using them as the Variable parameter in ModbusMaster(). The Long data type is a signed integer, and does not have a range equal to that of an unsigned integer. If the integer value exceeds 2,147,483,647 it will display incorrectly as a negative number. If the value does not exceed that number, there are no issues with a variable of type Long holding it.
32-Bit floating point
32-bit floating point values use 2 registers each. This is the default FLOAT data type in Campbell Scientific data loggers. Select the appropriate ModbusOption to avoid post-processing.

7.2.8 Modbus tips and troubleshooting

Most of the difficulties with Modbus communications arise from deviations from the standards, which are not enforced within Modbus. Whether you are connecting via Modbus to a solar inverter, power meter, or flow meter, the information provided here can help you overcome the challenges, and successfully gather data into a Campbell data logger. Further information on Modbus can be found at:
l www.simplyModbus.ca/FAQ.htm l www.Modbus.org/tech.php l www.lammertbies.nl/comm/info/modbus.html
7.2.8.1 Error codes
Modbus defines several error codes, which are reported back to a master from a slave.
ModbusMaster() displays these codes as a negative number. A positive result code indicates
no response was received.
Result code -01: illegal function
The illegal function error is reported back by a Modbus slave when either it does not support the function at all, or does not support that function code on the requested registers. Different devices support different functions (consult the device documentation). If the function code is supported, make sure you are not trying to write to a register labelled as read-only. It is common
7. Communications protocols 85
Loading...