-
CR800 Measurement and Control System Revision: 5/13 C o p y r i g h t © 2 0 0 0 - 2 0 1 3 C a m p b e l l S c i e n t i f i c , I n c .
-
-
Warranty The CR800 Measurement and Control Datalogger is warranted for three (3) years subject to this limited warranty: “PRODUCTS MANUFACTURED BY CAMPBELL SCIENTIFIC, INC. are warranted by Campbell Scientific, Inc. (“Campbell”) to be free from defects in materials and workmanship under normal use and service for twelve (12) months from date of shipment unless otherwise specified in the corresponding Campbell pricelist or product manual.
-
-
Assistance Products may not be returned without prior authorization. The following contact information is for US and International customers residing in countries served by Campbell Scientific, Inc. directly. Affiliate companies handle repairs for customers within their territories. Please visit www.campbellsci.com to determine which Campbell Scientific company serves your country. To obtain a Returned Materials Authorization (RMA), contact CAMPBELL SCIENTIFIC, INC., phone (435) 227-2342.
-
-
Table of Contents Section 1. Introduction ...................................................27 1.1 HELLO ................................................................................................... 27 1.2 Typography ............................................................................................. 27 Section 2. Cautionary Statements.................................29 Section 3. Initial Inspection ...........................................31 Section 4. Quickstart Tutorial ...............
-
Table of Contents Section 5. System Overview ..........................................57 5.1 CR800 Datalogger................................................................................... 58 5.1.1 Clock.............................................................................................. 59 5.1.2 Sensor Support............................................................................... 59 5.1.3 CR800 Wiring Panel...................................................................... 60 5.1.
-
Table of Contents 7.2 Temperature Range ................................................................................. 81 7.3 Enclosures ............................................................................................... 81 7.4 Power Sources......................................................................................... 82 7.4.1 CR800 Power Requirement ........................................................... 83 7.4.2 Calculating Power Consumption ..................................
-
Table of Contents 7.7.3.5 Declared Sequences ........................................................... 125 7.7.3.5.1 Data Tables............................................................... 125 7.7.3.5.2 Subroutines ............................................................... 131 7.7.3.5.3 Incidental Sequences ................................................ 132 7.7.3.6 Execution and Task Priority............................................... 132 7.7.3.6.1 Pipeline Mode..............................
-
Table of Contents 7.8.2.9 Micro-Serial Server............................................................ 173 7.8.2.10 Modbus TCP/IP................................................................ 173 7.8.2.11 DHCP............................................................................... 173 7.8.2.12 DNS ................................................................................. 173 7.8.2.13 SMTP ............................................................................... 173 7.8.
-
Table of Contents 7.8.13.8 Formatting String Hexadecimal Variables ....................... 241 7.8.14 Data Tables ................................................................................ 241 7.8.15 PulseCountReset Instruction...................................................... 242 7.8.16 Program Signatures.................................................................... 243 7.8.16.1 Text Signature .................................................................. 243 7.8.16.
-
Table of Contents 8.1.5.1.1 High-frequency Pulse (P1 - P2)................................ 300 8.1.5.1.2 Low-Level ac (P1 - P2) ............................................ 300 8.1.5.1.3 Switch Closure (P1 - P2) .......................................... 300 8.1.5.2 Pulse Input on Digital I/O Channels C1 - C4..................... 301 8.1.5.2.1 High Frequency Mode.............................................. 301 8.1.5.2.2 Low-Frequency Mode .............................................. 302 8.1.5.
-
Table of Contents 8.4 Telecommunications and Data Retrieval............................................... 332 8.4.1 Hardware and Carrier Signal ....................................................... 333 8.4.2 Protocols ...................................................................................... 333 8.4.3 Initiating Telecommunications (Callback)................................... 333 8.5 PakBus Overview.................................................................................. 334 8.5.
-
Table of Contents 8.6.3.6 Clock Functions ................................................................. 370 8.6.3.6.1 ClockSet Command.................................................. 370 8.6.3.6.2 ClockCheck Command............................................. 372 8.6.3.7 Files Management .............................................................. 374 8.6.3.7.1 Sending a File to a Datalogger ................................. 374 8.6.3.7.2 FileControl Command ........................................
-
Table of Contents 10.4.1 RS-232 ....................................................................................... 411 10.4.2 Communicating with Multiple PCs ........................................... 411 10.4.3 Comms Memory Errors ............................................................. 411 10.4.3.1 CommsMemFree(1) ......................................................... 411 10.4.3.2 CommsMemFree(2) ......................................................... 413 10.4.3.3 CommsMemFree(3) .........
-
Table of Contents A.6.4 Compound-assignment operators ............................................... 472 A.6.5 Logical Operators ....................................................................... 473 A.6.6 Trigonometric Functions ............................................................ 474 A.6.6.1 Derived Functions ............................................................. 474 A.6.6.2 Intrinsic Functions............................................................. 474 A.6.
-
Table of Contents F.2.5 Passive Signal Conditioners ........................................................ 539 F.2.5.1 Resistive Bridge TIM Modules.......................................... 539 F.2.5.2 Voltage Dividers ................................................................ 540 F.2.5.3 Current-Shunt Modules...................................................... 540 F.2.6 Terminal-Strip Covers ................................................................. 540 F.3 Cameras.........................
-
Table of Contents Figure 19: PC200W Connect button ............................................................. 51 Figure 20: PC200W Monitor Data tab – Public table ................................... 52 Figure 21: PC200W Monitor Data tab – Public table ................................... 52 Figure 22: PC200W Monitor Data tab – Public and OneMin Tables............ 53 Figure 23: PC200W Collect Data tab............................................................ 54 Figure 24: PC200W View data utility........
-
Table of Contents Figure 75: Data from TrigVar program....................................................... 224 Figure 76: Alarms toggled in bit-shift example .......................................... 229 Figure 77: Bool8 data from bit-shift example (numeric monitor) ............... 229 Figure 78: Bool8 data from bit-shift example (PC data file)....................... 230 Figure 79: PT100 in four-wire half-bridge..................................................
-
Table of Contents Figure 130: Accuracy, Precision, and Resolution ....................................... 449 List of Tables Table 1. Single-Ended and Differential Input Channels ............................... 37 Table 2. Pulse-Input Channels and Measurements........................................ 39 Table 3. PC200W EZSetup Wizard Example Selections .............................. 45 Table 4. Current Source and Sink Limits ...................................................... 84 Table 5.
-
Table of Contents Table 51. CRBasic Parameters Varying Measurement Sequence and Timing.................................................................................................. 274 Table 52. Analog Voltage Input Ranges with Options for Common Mode Null (CMN) and Open Input Detect (OID) .......................................... 276 Table 53. Analog Measurements and Offset Voltage Compensation.......... 278 Table 54. CRBasic Measurement Integration Times and Codes ................. 280 Table 55.
-
Table of Contents Table 103. Special Keyboard-Display Key Functions ................................ 383 Table 104. Typical Gzip File Compression Results.................................... 395 Table 105. Internal Lithium-Battery Specifications.................................... 398 Table 106. Warning Message Examples ..................................................... 404 Table 107. Math Expressions and CRBasic Results ................................... 409 Table 108.
-
Table of Contents Table 156. LoggerNet Adjuncts and Clients1,2 ............................................ 548 Table 157. Software Tools .......................................................................... 548 Table 158. Software Development Kits ...................................................... 549 1258H 286H 1259H 287H 1260H List of CRBasic Examples CRBasic Example 1. Using an "Include File" to Control SW12................. 105 CRBasic Example 2. "Include File" to Control SW12 ...........
-
Table of Contents CRBasic Example 49. Formatting Strings .................................................. 241 CRBasic Example 50. Two Data Intervals in One Data Table ................... 241 CRBasic Example 51. Program Signatures................................................. 243 CRBasic Example 52. Miscellaneous Features ........................................... 244 CRBasic Example 53. Running Average and Running Total of Rain......... 247 CRBasic Example 54. Use of Multiple Scans....................
-
Table of Contents 26
-
Section 1. Introduction 1.1 HELLO Whether in extreme cold in Antarctica, scorching heat in Death Valley, salt spray from the Pacific, micro-gravity in space, or the harsh environment of your office, Campbell Scientific dataloggers support research and operations all over the world. Our customers work a broad spectrum of applications, from those more complex than any of us imagined, to those simpler than any of us thought practical. The limits of the CR800 are defined by our customers.
-
Section 1. Introduction Italic — titles of publications, software, sections, tables, figures, and examples. Bold italic — CRBasic instruction parameters and arguments within the body text. Blue — CRBasic instructions when set on a dedicated line. Italic teal — CRBasic program comments Lucida Sans Typewriter font — CRBasic code, input commands, and output responses when set apart on dedicated lines or in program examples.
-
Section 2. Cautionary Statements The CR800 is a rugged instrument and will give years of reliable service if a few precautions are observed: • Protect from over-voltage • Protect from water • Protect from ESD Disuse accelerates depletion of the internal battery, which backs up several functions. The internal battery will be depleted in three years or less if a CR800 is left on the shelf. When the CR800 is continuously used, the internal battery may last up to 10 or more years.
-
Section 2.
-
Section 3. Initial Inspection • The CR800 datalogger ship with, o 1 each pn 8125 small, flat-bladed screwdriver o 1 each pn 1113 large, flat-bladed screwdriver o 1 each pn 3315 five-inch long, type-T thermocouple for use as a tutorial device o One datalogger program pre-loaded into the CR800 o 4 each pn 505 screws for use in mounting the CR800 to an enclosure backplate. o 4 each pn 6044 nylon hardware inserts for use in mounting the CR800 to a Campbell Scientific enclosure backplate.
-
Section 3.
-
Section 4. Quickstart Tutorial This tutorial presents an introduction to CR800 data acquisition. 4.1 Primer – CR800 Data-Acquisition Data acquisition with the CR800 is the result of a step-wise procedure involving the use of electronic sensor technology, the CR800, a telecommunications link, and datalogger support software (p. 76). 4.1.1 Components of a Data-Acquisition System A typical data-acquisition system is conceptualized in figure Data-Acquisition System Components (p. 34).
-
Section 4. Quickstart Tutorial modems, radios, satellite transceivers, and TCP/IP network modems are available for the most demanding applications. Figure 1: Data-acquisition system components 4.1.2 CR800 Module and Power Supply 4.1.2.1 Wiring Panel As shown in figure CR800 Wiring Panel (p. 35), the wiring panel provides terminals for connecting sensors, power and communications devices. Internal surge protection is incorporated with the input channels.
-
Section 4.
-
Section 4. Quickstart Tutorial 4.1.2.2 Power Supply The CR800 is powered by a nominal 12 Vdc source. Acceptable power range is 9.6 to 16 Vdc. External power connects through the green POWER IN on the face of the CR800. The POWER IN connection is internally reverse-polarity protected. 4.1.2.3 Backup Battery A lithium battery backs up the CR800 clock, program, and memory in case of power loss. See Internal Battery (p. 76). 4.1.
-
Section 4. Quickstart Tutorial Figure 4: Analog sensor wired to differential channel #1 Table 1. Single-Ended and Differential Input Channels Differential Channel Single-Ended Channel 1H 1 1L 2 2H 3 2L 4 3H 5 3L 6 4.1.3.2 Bridge Sensors Many sensors use a resistive bridge to measure phenomena. Pressure sensors and position sensors commonly use a resistive bridge. Examples: • A specific resistance in a pressure transducer strain gage correlates to a specific water pressure.
-
Section 4. Quickstart Tutorial Figure 5: Half-bridge wiring -- wind vane potentiometer Figure 6: Full-bridge wiring -- pressure transducer 4.1.3.3 Pulse Sensors Pulse sensors are measured on CR800 pulse-measurement channels. 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 CR800 detects each wave as the wave transitions between voltage extremes (high to low or low to high).
-
Section 4. Quickstart Tutorial Note A period-averaging sensor has a frequency output, but it is connected to a single-ended analog input channel and measured with the PeriodAverage() instruction (see Period Averaging (p. 307) ). 4.1.3.3.1 Pulses Measured Figure Pulse Sensor Output Signal Types (p. 39) illustrates three pulse sensor output signal types. Figure 7: Pulse-sensor output signal types 4.1.3.3.2 Pulse-Input Channels Table Pulse-Input Channels and Measurements (p.
-
Section 4. Quickstart Tutorial 4.1.3.3.3 Pulse Sensor Wiring Wiring a pulse sensor to a CR800 is straight forward, as shown in figure PulseInput Wiring -- Anemometer Switch (p. 40). Pulse sensors have two active wires, (ground) one of which is always ground. Connect the ground wire to a channel. Connect the other wire to a pulse channel. Sometimes the sensor will require power from the CR800, so there will be two more wires – one of which is always ground. Connect power ground to a G channel.
-
Section 4.
-
Section 4. Quickstart Tutorial 4.1.4 Digital I/O Ports The CR800 has four digital I/O ports selectable as binary inputs or control outputs. These are multi-function ports. Edge timing, switch closure, and highfrequency pulse functions are introduced in Pulse Sensors (p. 38) and discussed at length in Pulse (p. 297). Other functions include device-driven interrupts, asynchronous communications and SDI-12 communications. Figure Control and Monitoring with Digital I/O (p.
-
Section 4. Quickstart Tutorial 4.2 Hands-On: Measuring a Thermocouple This tutorial is designed to illustrate the function of the CR800. During the exercise, the following items will be described: • Attaching a thermocouple to analog differential terminals • Creating a program for the CR800 • Making a simple thermocouple measurement • Sending data from the CR800 to a PC • Viewing the data from the CR800 4.2.
-
Section 4. Quickstart Tutorial 6. After confirming the correct polarity on the wire connections, insert the green power connector into its receptacle on the CR800. 7. Connect the RS-232 cable between the RS-232 port on the CR800 and the RS232 port on the PC (or to the USB-to-RS-232 cable). 8. Move the on/off switch on the PS100 to the On position. Figure 12: Power and RS-232 connections 4.2.3 PC200W Software Setup 1. Install the PC200W software onto a PC.
-
Section 4. Quickstart Tutorial Figure 13: PC200W main window Table 3. PC200W EZSetup Wizard Example Selections Start the wizard to follow table entries. Screen Name Introduction Datalogger Type and Name Information Needed Provides and introduction to the EZSetup Wizard along with instructions on how to navigate through the wizard. Select the CR800 from the scroll window. Accept the default name of "CR800." Select the correct PC COM port for the RS-232 connection. Typically, this will be COM1.
-
Section 4. Quickstart Tutorial Table 3. PC200W EZSetup Wizard Example Selections Start the wizard to follow table entries. Screen Name Communications Test Information Needed A communications test between the CR800 and PC can be performed in this screen. For this tutorial, the test is not required. Press Finish to exit the wizard. After exiting the wizard, the main PC200W window becomes visible. The window has several tabs available. By default, the Clock/Program tab is visible.
-
Section 4. Quickstart Tutorial Figure 14: Short Cut temperature sensor folder 4.2.4.2 Procedure: (Short Cut Steps 7 to 9) 7. Double-click Wiring Panel Temperature to add it to Selected. Alternatively, single-click Wiring Panel Temperature, then click on . 8. Double-click Type T Thermocouple to add it to Selected. A prompt appears requesting the number of sensors. Enter "1." A second prompt will appear requesting the thermocouple reference temperature source.
-
Section 4. Quickstart Tutorial Figure 15: Short Cut thermocouple wiring 4.2.4.3 Procedure: (Short Cut Steps 10 to 11) Historical Note In the space-race era, measuring thermocouples in the field was a complicated and cumbersome process incorporating a thermocouple wire with three junctions, a micro-voltmeter, a vacuum flask filled with an ice slurry, and a thick reference book. One thermocouple junction was connected to the microvoltmeter. Another sat in the vacuum flask.
-
Section 4. Quickstart Tutorial 11. Outputs displays the list Selected Sensors on the left and data storage tables, under Selected Outputs, on the right. Figure 16: Short Cut outputs tab 4.2.4.4 Procedure: (Short Cut Steps 12 to 16) 12. By default, there are two tables initially available. Both tables have a Store Every field and a along with a drop-down list from which to select the time units. These are used to set the time interval when data are stored. 13.
-
Section 4. Quickstart Tutorial Figure 17: Short Cut output table definition 4.2.4.5 Procedure: (Short Cut Step 17 to 18) 17. Click Finish to compile the program. Give the program the name QuickStart. A summary screen will appear showing the compiler results. Any errors during compiling will also be displayed.
-
Section 4. Quickstart Tutorial 18. Close this window by clicking on X in the upper right corner. 4.2.5 Send Program and Collect Data PC200W Support Software Objectives: This portion of the tutorial will use PC200W to send the program to the CR800, collect data from the CR800, and store the data on the PC. 4.2.5.1 Procedure: (PC200W Step 1) 1. From the PC200W Clock/Program tab, click on Connect button to establish communications with the CR800.
-
Section 4. Quickstart Tutorial CR800. To view the OneMin table, select an empty cell in the display area, then click Add.
-
Section 4. Quickstart Tutorial 4.2.5.3 Procedure: (PC200W Step 5) 5. In the Add Selection window Tables field, click on OneMin, then click Paste. The OneMin table is now displayed.
-
Section 4. Quickstart Tutorial 4.2.5.4 Procedure: (PC200W Step 6) 6. Click on the Collect Data tab. From this window, data are chosen to be collected as well as the location where the collected data will be stored. Figure 23: PC200W Collect Data tab 4.2.5.5 Procedure: (PC200W Steps 7 to 9) 7. Click the OneMin box so a check mark appears in the box. Under What to Collect, select New data from datalogger. This selects the to be collected. 8. Click on Collect.
-
Section 4.
-
Section 4. Quickstart Tutorial 4.2.5.6 Procedure: (PC200W Steps 10 to 11) 10. Click on to open a file for viewing. In the dialog box, select the CR800_OneMin.dat file and click Open. 11. The collected data are now shown. Figure 25: PC200W View data table 4.2.5.7 Procedure: (PC200W Steps 12 to 13) 12. Click on any data column. To display the data in a new line graph, click on . Figure 26: PC200W View line graph 13. Close the Graph and View windows, and then close the PC200W program.
-
Section 5. System Overview A Campbell Scientific data-acquisition system is made up of the following basic components: • Sensors • Datalogger o Clock o Measurement and control circuitry o Telecommunications circuitry o User-entered CRBasic program • Telecommunications device • Datalogger support software (p. 76) (computer or mobile) The figure Features of a Data-Acquisition System (p. 58) illustrates a common CR800-based data-acquisition system.
-
Section 5. System Overview Figure 27: Features of a data-acquisition system 5.1 CR800 Datalogger The CR800 datalogger is one part of a data acquisition system. It is a precision instrument designed for demanding, low-power measurement applications. CPU, analog and digital measurements, analog and digital outputs, and memory usage are controlled by the operating system in conjunction with the user program and on-board clock.
-
Section 5. System Overview Sensors transduce phenomena into measurable electrical forms, outputting voltage, current, resistance, pulses, or state changes. The CR800, sometimes with the assistance of various peripheral devices, can measure nearly all electronic sensors. The CR800 measures analog voltage and pulse signals, representing the magnitudes numerically.
-
Section 5. System Overview A library of sensor manuals and application notes are available at www.campbellsci.com to assist in measuring many sensor types. Consult with a Campbell Scientific applications engineer for assistance in measuring unfamiliar sensors. 5.1.3 CR800 Wiring Panel The wiring panel of the CR800 is the interface to many CR800 functions. These functions are best introduced by reviewing features of the CR800 wiring panel. The figure Wiring Panel (p.
-
Section 5. System Overview as compared to pulse-count measurements. The frequency resolution of pulsecount measurements can be improved by extending the measurement interval by increasing the scan interval and by averaging. For information on frequency resolution, see Frequency Resolution. Pulse — 2 channels (P1 to P2) configurable for counts or frequency of the following signal types.
-
Section 5. System Overview 5.1.3.3 Grounding Terminals Read More! See Grounding (p. 86). Proper grounding will lend stability and protection to a data acquisition system. It is the easiest and least expensive insurance against data loss-and the most neglected.
-
Section 5. System Overview 5.1.3.5 Communications Ports Read More! See sections RS-232 and TTL Recording (p. 308), Telecommunications and Data Retrieval (p. 332), and PakBus Overview (p. 334). The CR800 is equipped with four communications ports. Communication ports allow the CR800 to communicate with other computing devices, such as a PC, or with other Campbell Scientific dataloggers.
-
Section 5. System Overview panel temperature at each scan, and the one-minute sample of panel temperature. TCTemps displays two thermocouple temperatures., Custom Keyboard and Display Menus (p. 486), and Keyboard Display (p. 69). 5.1.4 CR1000KD Keyboard Display The CR1000KD, illustrated in figure CR1000KD Keyboard Display, is a peripheral optional to the CR800. See the appendix Keyboard Displays (p. 545) for more information on available keyboard displays.
-
Section 5. System Overview • Charge sources o Solar panels o Wind generators o Vac / Vac or Vac / Vdc wall adapters Refer to the appendix Power Supplies (p. 542) for specific model numbers of approved power supplies. NOTE While the CR800 has an input voltage range of 9.6 to 16 Vdc, peripherals (telecommunications devices, sensors, etc.) connected to and powered by the CR800 may not have the same input voltage limits.
-
Section 5. System Overview program is active at a given time. Two Campbell Scientific software applications, Short Cut and CRBasic Editor, are used to create CR800 programs. • Short Cut creates a datalogger program and wiring diagram in four easy steps. It supports most sensors sold by Campbell Scientific and is recommended for creating simple programs to measure sensors and store data. • Programs generated by Short Cut are easily imported into CRBasic Editor for additional editing.
-
Section 5. System Overview o CRBasic variables o Final Storage o Communications memory o USR: drive User allocated FAT32 RAM drive Photographic images (See the appendix Cameras (p. 540) ) Data files from TableFile() instruction (TOA5, TOB1, CSIXML and CSIJSON) o Keep memory (OS variables not initialized) o Dynamic runtime memory allocation Note CR800s with serial numbers smaller than 3605 were usually supplied with only 2 MB of SRAM.
-
Section 5. System Overview 5.1.8.4 Data Format on Computer CR800 data stored on a PC via support software is formatted as either ASCII or Binary depending on the file type selected in the support software. Consult the software manual for details on available data-file formats. 5.1.9 Communications Read More! See Telecommunications and Data Retrieval (p. 332). The CR800 communicates with external devices to receive programs, send data, or act in concert with a network.
-
Section 5. System Overview 5.1.9.2 Modbus Read More! See Modbus (p. 350). The CR800 supports Modbus master and Modbus slave communication for inclusion in Modbus SCADA networks. 5.1.9.3 DNP3 Communication Read More! See DNP3 (p. 347). The CR800 supports DNP3 slave communication for inclusion in DNP3 SCADA networks. 5.1.9.4 Keyboard Display Read More! See Using the Keyboard Display (p. 382). The external keyboard / display is a powerful tool for field use.
-
Section 5. System Overview Figure 28: Custom menu example 5.1.10 Security CR800 applications may include the collection of sensitive data, operation of critical systems, or networks accessible by many individuals. The CR800 is supplied void of active security measures. By default, RS-232, Telnet, FTP and HTTP services, all of which give high level access to CR800 data and programs, are enabled without password protection.
-
Section 5. System Overview 5.1.10.1 Vulnerabilities While "security through obscurity" may have provided sufficient protection in the past, Campbell Scientific dataloggers increasingly are deployed in sensitive applications. Devising measures to counter malicious attacks, or innocent tinkering, requires an understanding of where systems can be compromised and how to counter the potential threat. Note Older CR800 operating systems are more vulnerable to attack than recent updates.
-
Section 5. System Overview • Get historical records or other files present on the datalogger drive spaces. • More access is given when a .csipasswd is in place (so make sure users with administrative rights have strong log-in credentials) 5.1.10.2 Pass-code Lockout Pass-code lockouts (historically known simply as "security codes") are the oldest method of securing a Campbell Scientific datalogger.
-
Section 5. System Overview greater than it will also be unlocked, so unlocking level 1 (entering the Level 1 security code) also unlocks levels 2 and 3. Functions affected by setting each level of security are: • Level 1 — Collecting data, setting the clock, and setting variables in the Public table are unrestricted, requiring no security code. If the user enters the Security1 code non-read-only values in the Status table can be changed and the datalogger program can be changed or retrieved.
-
Section 5. System Overview 5.1.10.3.2 PakBus Instructions The following CRBasic PakBus instructions have provisions for password protection: • ModemCallBack() • SendVariable() • SendGetVariables() • SendFile() • GetVariables() • GetFile() • GetDataRecord() 5.1.10.3.3 IS Instructions The following CRBasic instructions that service CR800 IP capabilities have provisions for password protection: • EMailRecv() • EMailSend() • FTPClient() 5.1.10.3.
-
Section 5. System Overview One use of file encryption may be to secure proprietary code but make it available for copying. 5.1.10.5 Communications Encryption PakBus is the CR800 root communication protocol. By encrypting certain portions of PakBus communications, a high level of security is given to datalogger communications. See PakBus Encryption (p. 346) for more information. 5.1.10.
-
Section 5. System Overview 5.1.11.3 Calibration Read More! See Self-Calibration (p. 285). The CR800 uses an internal voltage reference to routinely calibrate itself. Campbell Scientific recommends factory recalibration every two years. If calibration services are required, refer to the section entitled Assistance (p. 5) at the front of this manual. 5.1.11.4 Internal Battery Caution Misuse or improper installation of the lithium battery can cause severe injury.
-
Section 5. System Overview applications in LoggerNet Remote are run on a separate computer, and are used to manage the LoggerNet Linux server. • VISUALWEATHER Weather Station Software supports Campbell Scientific weather stations. Version 3.0 or higher supports custom weather stations or the ET107, ET106, and MetData1 pre-configured weather stations. The software allows you to initialize the setup, interrogate the station, display data, and generate reports from one or more weather stations.
-
Section 5.
-
Section 6. CR800 Specifications 1.1 CR800 specifications are valid from ─25° to 50°C in non‐condensing environments unless otherwise specified. Recalibration is recommended every two years. Critical specifications and system configurations should be confirmed with a Campbell Scientific applications engineer before purchase. 2.
-
Section 6.
-
Section 7. Installation 7.1 Moisture Protection When humidity tolerances are exceeded and condensation occurs, damage to CR800 electronics can result. Effective humidity control is the responsibility of the user. Internal CR800 module moisture is controlled at the factory by sealing the module with a packet of silica gel inside. The desiccant is replaced whenever the CR800 is repaired at Campbell Scientific.
-
Section 7. Installation Figure 29: Enclosure 7.4 Power Sources Note Reliable power is the foundation of a reliable data-acquisition system. When designing a power supply, consideration should be made regarding worstcase power requirements and environmental extremes. For example, the power requirement of a weather station may be substantially higher during extreme cold, while at the same time, the extreme cold constricts the power available from the power supply.
-
Section 7. Installation Power supplies available from Campbell Scientific can be reviewed in the appendix Power Supplies (p. 542), or at www.campbellsci.com. Contact a Campbell Scientific application engineer if assistance in selecting a power supply is needed, particularly with applications in extreme environments. 7.4.1 CR800 Power Requirement The CR800 operates on dc voltage ranging from 9.6 to 16 Vdc. It is internally protected against accidental polarity reversal.
-
Section 7. Installation should be connected to the CR800. The diode OR connection causes the supply with the largest voltage to power the CR800 and prevents the second backup supply from attempting to power the vehicle. Figure 30: Connecting to vehicle power supply 7.4.5 Powering Sensors and Devices Read More! See Power Sources (p. 82). The CR800 wiring panel is a convenient power distribution device for powering sensors and peripherals that require a 5- or 12-Vdc source.
-
Section 7. Installation Table 4. Current Source and Sink Limits 1 Terminal Limit < 1.80 A @ 70°C < 1.50 A @ 85°C 5 5V + CS I/O (combined) 1 < 200 mA "Source" is positive amperage; "sink" is negative amperage (-). 2 Exceeding current limits limits will cause voltage output to become unstable. Voltage should stabilize once current is again reduced to within stated limits. 3 A polyfuse is used to limit power. Result of overload is a voltage drop. To reset, disconnect and allow circuit to cool.
-
Section 7. Installation Note Table Current Source and Sink Limits (p. 84) has more information on excitation load capacity. 7.4.5.3 Continuous Unregulated (Nominal 12 Volt) Voltage on the 12V terminals will change with CR800 supply voltage. 7.4.5.4 Switched Unregulated (Nominal 12 Volt) The SW12 terminal is often used to control low power devices such as sensors that require 12 Vdc during measurement. Current sourcing must be limited to 900 mA or less at 20°C. See table Current Source and Sink Limits (p.
-
Section 7. Installation products, so it should always be requested when ordering. Spark gaps for these devices must be connected to either the earth ground lug, the enclosure ground, or to the earth (chassis) ground. A good earth (chassis) ground will minimize damage to the datalogger and sensors by providing a low-resistance path around the system to a point of low potential. Campbell Scientific recommends that all dataloggers be earth (chassis) grounded.
-
Section 7. Installation Figure 31: Schematic of grounds 7.5.1.1 Lightning Protection The most common and destructive ESDs are primary and secondary lightning strikes. Primary lightning strikes hit instrumentation directly. Secondary strikes induce voltage in power lines or wires connected to instrumentation.
-
Section 7. Installation In addition to protections discussed in ESD Protection (p. 86), use of a simple lightning rod and low-resistance path to earth ground is adequate protection in many installations. A lightning rod serves two purposes. Primarily, it serves as a preferred strike point. Secondarily, it dissipates charge, reducing the chance of a lightning strike. Figure Lightning-Protection Scheme (p.
-
Section 7. Installation 7.5.2 Single-Ended Measurement Reference Low-level, single-ended voltage measurements are sensitive to ground potential fluctuations. The grounding scheme in the CR800 has been designed to eliminate ground potential fluctuations due to changing return currents from 12V, SW12, 5V, and C1 – C4 terminals. This is accomplished by utilizing separate signal grounds ( ) and power grounds (G).
-
Section 7. Installation lead resistance result in different ground potential at the two instruments. For this reason, a differential measurement should be made on the analog output from the external signal conditioner. 7.5.4 Ground Looping in Ionic Measurements When measuring soil-moisture with a resistance block, or water conductivity with a resistance cell, the potential exists for a ground loop error.
-
Section 7. Installation Figure 33: Model of a ground loop with a resistive sensor 7.6 CR800 Configuration The CR800 ships from Campbell Scientific to communicate with Campbell Scientific datalogger support software (p. 76) via RS-232. Some applications, however, require changes to the factory defaults. Most settings address telecommunication variations between the CR800 and a network or PC.
-
Section 7. Installation • Provide a terminal emulator useful in configuring devices not directly supported by DevConfig graphical user interface. • Show Help as prompts and explanations. Help for the appropriate settings for a particular device can also be found in the user manual for that device. • Update from www.campbellsci.com. As shown in figure DevConfig CR800 Facility (p.
-
Section 7. Installation 7.6.2 Sending the Operating System The CR800 is shipped with the operating system pre-loaded. However, OS updates are made available at www.campbellsci.com and can be sent to the CR800. Note Beginning with OS 25, the OS has become large enough that a CR800 with serial number ≤ 3604, which has only 2 MB of SRAM, may not have enough memory to receive it under some circumstances.
-
Section 7.
-
Section 7. Installation 7.6.2.2 Sending OS with Program Send Operating system files can be sent using the Program Send command. Beginning with the OS indicated in table OS Version Introducing Preserve Settings via Program Send (p. 96), this has the benefit of usually (but not always) preserving CR800 settings. Table 5.
-
Section 7. Installation Configuration (p. 98) ) that gives the user a chance to save and print the settings for the device. Clicking the Factory Defaults button on the settings editor will send a command to the device to revert to its factory default settings. The reverted values will not take effect until the final changes have been applied. This button will remain disabled if the device does not support the DevConfig protocol messages.
-
Section 7. Installation Figure 38: Summary of CR800 configuration 7.6.3.1.1 Deployment Tab Illustrated in figure DevConfig Deployment Tab (p. 98), the Deployment tab allows the user to configure the datalogger prior to deploying it. Deployment tab settings can also be accessed through the Setting Editor tab and the Status table.
-
Section 7. Installation Datalogger Sub-Tab • Serial Number displays the CR800 serial number. This setting is set at the factory and cannot be edited. • OS Version displays the operating system version that is in the CR800. • Station Name displays the name that is set for this station. The default station name is the CR800 serial number. • PakBus® Address allows users to set the PakBus® address of the datalogger. The allowable range is between 1 and 4094.
-
Section 7. Installation Selected Port. This control is disabled if the end range value is less than the begin range value. • Remove Range will remove the range specified by the values of the Begin and End controls from the list of neighbors to the datalogger on the port specified by Selected Port. This control is disabled if the range specified is not present in the list. • Help is displayed at the bottom of the Deployment tab. When finished, Apply the settings to the datalogger.
-
Section 7. Installation • USR: Drive Size specifies the size in bytes allocated for the "USR:" ram disk drive. • RS-232 Power/Handshake | Port Always On controls whether the RS-232 port will remain active even when communication is not taking place. Note If RS-232 handshaking is enabled (handshaking buffer size is non-zero), RS-232 Power/Handshake | Port Always On setting must be checked.
-
Section 7. Installation • Current Program displays the current program known to be running in the datalogger. This value is empty if there is no current program. • The Last Compiled field displays the time when the currently running program was last compiled by the datalogger. As with the Current Program field, this value is read from the datalogger if it is available. • Last Compile Results shows the compile results string as reported by the datalogger.
-
Section 7. Installation Careful programming is required when changing settings via CRBasic to ensure users are not inadvertently blocked from communicating with the CR800, the remedy for which may be a site visit. 7.6.3.3 Durable Settings Many CR800 settings can be changed remotely over a telecommunications link either directly or as part of the CRBasic program. This convenience comes with the risk of inadvertently changing settings and disabling communications.
-
Section 7.
-
Section 7. Installation CRBasic Example 1. Using an "Include File" to Control SW12 'Assumes that the Include file in CRBasic example "Include File" to Control SW12 (p. 105) 'is loaded onto the CR800 CPU: Drive. 'The Include file will control power to the cellular phone modem.
-
Section 7. Installation CRBasic Example 3. Simple Default.cr8 File 'This default.cr8 file controls the SW12 switched power terminal BeginProg Scan(1,Sec,0,0) If TimeIntoInterval(15,60,Sec) Then SW12(1) If TimeIntoInterval(45,60,Sec) Then SW12(0) NextScan EndProg 7.6.3.4 Program Run Priorities 1. When the CR800 starts, it executes commands in the powerup.ini file (on Campbell Scientific mass-storage media (USB: drive)), including commands to set program file (i.e., .
-
Section 7. Installation 7.6.3.5 Network Planner Figure 45: Network Planner Setup 7.6.3.5.1 Overview Network Planner allows the user to: • create a graphical representation of a network, as shown in figure Network Planner Setup (p. 107). • determine settings for devices and LoggerNet. • program devices and LoggerNet with new settings. Why is Network Planner needed? • PakBus protocol allows complex networks to be developed. • Setup of individual devices is difficult.
-
Section 7. Installation For more detailed information on Network Planner, please consult the LoggerNet manual, which is available at www.campbellsci.com. 7.6.3.5.2 Basics PakBus Settings • Device addresses are automatically allocated but can be changed. • Device connections are used to determine whether neighbor lists should be specified. • Verification intervals will depend on the activities between devices. • Beacon intervals will be assigned but will have default values. • Network role (e.g.
-
Section 7. Installation sensors and external devices. Quickstart Tutorial (p. 33) works through a measurement example using Short Cut. For many complex applications, Short Cut is still a good place to start. When as much information as possible is entered, Short Cut will create a program template from which to work, already formatted with most of the proper structure, measurement routines, and variables. The program can then be edited further using CRBasic Program Editor. 7.7.1.
-
Section 7. Installation CRBasic Example 4. Inserting Comments 'Declaration of variables starts here. Public Start(6) 'Declare the start time array 7.7.2 Sending Programs The CR800 requires that a CRBasic program file be sent to its memory to direct measurement, processing, and data-storage operations. The program file can have the extension cr8 or .dld and can be compressed using the GZip algorithm before sending it to the CR800.
-
Section 7. Installation Table 6. Program Send Options that Reset Memory* LoggerNet | Connect | Program Send PC400 | Clock/Program | Send Program PC200W | Clock/Program | Send Program RTDAQ | Clock/Program | Send Program DevConfig | Logger Control | Send Program *Reset memory and set program attributes to Run Always Figure 46: CRBasic Editor Program Send File Control window Table 7.
-
Section 7. Installation 7.7.3 Syntax 7.7.3.1 Numerical Formats Four numerical formats are supported by CRBasic. Most common is the use of base-10 numbers. Scientific notation, binary, and hexadecimal formats may also be used, as shown in table Formats for Entering Numbers in CRBasic (p. 112). Only standard, base-10 notation is supported by Campbell Scientific hardware and software displays. Table 8. Formats for Entering Numbers in CRBasic Format Example Base-10 Equivalent Value Standard 6.832 6.
-
Section 7. Installation 7.7.3.2 Structure Table CRBasic Program Structure (p. 113) delineates CRBasic program structure. CRBasic example Program Structure (p. 114) demonstrates the proper structure of a CRBasic program. Table 9. CRBasic Program Structure Declarations Define CR800 memory usage. Declare constants, variables, aliases, units, and data tables. Declare constants List fixed constants. Declare Public variables List / dimension variables viewable during program execution.
-
Section 7. Installation CRBasic Example 6. Proper Program Structure 'Declarations 'Define Constants Const RevDiff = 1 Const Del = 0 'default Const Integ = 250 Const Mult = 1 Const Offset = 0 Declare constants 'Define public variables Public RefTemp Public TC(6) 'Define Units Units RefTemp = degC Units TC = DegC 'Define data tables DataTable(Temp,1,2000) DataInterval(0,10,min,10) Average(1,RefTemp,FP2,0) Average(6,TC(),FP2,0) EndTable Declare public variables, dimension array, and declare units.
-
Section 7. Installation 7.7.3.3 Command Line CRBasic programs are made up of a series of statements. Each statement normally occupies one line of text in the program file. Statements are made up of instructions, variables, constants, expressions, or a combination of these. "Instructions" are CRBasic commands. Normally, only one instruction is included in a statement. However, some instructions, such as If and Then, are allowed to be included in the same statement.
-
Section 7. Installation 7.7.3.4 Single-Line Declarations Public, Dim, and ReadOnly variables are declared at the beginning of a CRBasic program, as are Constants, Units, Aliases, StationNames, DataTables, and Subroutines. Table Rules for Names (p. 140) lists declaration names and allowed lengths. 7.7.3.4.1 Variables A variable is a packet of memory given an alphanumeric name through which pass measurements and processing results during program execution.
-
Section 7. Installation simply declare a variable array as shown below: Public TempC(4), This creates in memory the four variables TempC(1), TempC(2), TempC(3), and TempC(4). A variable array is useful in program operations that affect many variables in the same way. CRBasic example Using a variable array in calculations (p. 117) shows program code using a variable array to reduce the amount of code required to convert four temperatures from Celsius degrees to Fahrenheit degrees.
-
Section 7. Installation CRBasic Example 8. Using Variable Array Dimension Indices Dim aaa As Long Dim bbb As Long Dim ccc As Long Public VariableName(4,4,4) As Float BeginProg Scan() aaa = 3 bbb = 2 ccc = 4 VariableName(aaa,bbb,ccc) = 2.718 NextScan EndProg Dimensioning Strings Strings can be declared to a maximum of two dimensions. The third "dimension" is used for accessing characters within a string. See String Operations (p. 237). String length can also be declared.
-
Section 7. Installation Table 10. Data Types Name: Command or Argument FP2 Description / Word Size Campbell Scientific floating point / Where Used Final data storage 2 byte As Float IEEE Floating Point / Notes Default final storage data type. Use FP2 for stored data requiring 3 or 4 significant digits. If more significant digits are needed, use IEEE4 or an offset. Resolution / Range Zero Minimum Maximum 0.000 ±0.001 ±7999. Absolute Value Decimal Location 0 -- 7.999 X.XXX 8 -- 79.
-
Section 7. Installation Table 10. Data Types Name: Command or Argument Description / Word Size As Boolean Signed Integer / BOOLEAN 4 byte Where Used Notes Resolution / Range Use to store TRUE or FALSE states, such as with flags and control ports. 0 is always false. -1 is always true. Depending on the application, any other number may be interpreted as true or false. See True = -1, False = 0 (p. 145).To save memory, consider using UINT2 or BOOL8.
-
Section 7.
-
Section 7. Installation Variable Initialization By default, variables are set equal to zero at the time the datalogger program compiles. Variables can be initialized to non-zero values in the declaration. Examples of syntax are shown in CRBasic example Initializing Variables (p. 122). CRBasic Example 11. Initializing Variables Public aaa As Long = 1 Public bbb(2) As String *20 = {"String_1", "String_2"} Public ccc As Boolean = True ‘Initialize variable ddd elements 1,1 1,2 1,3 & 2,1.
-
Section 7. Installation CRBasic Example 12. Using the Const Declaration Public PTempC, PTempF Const CtoF_Mult = 1.8 Const CtoF_Offset = 32 BeginProg Scan(1,Sec,0,0) PanelTemp(PTempC,250) PTempF = PTempC * CtoF_Mult + CtoF_Offset NextScan EndProg Predefined Contants Several words are reserved for use by CRBasic. These words cannot be used as variable or table names in a program. Predefined constants include some instruction names, as well as valid alphanumeric names for instruction parameters.
-
Section 7. Installation Table 11. Predefined Constants and Reserved Words mv50cR mv500c mv7_5 mv7_5c mvX10500 mv50R NSEC PROG SCAN mvX1500 Select STRING SUB sec TABLE TRUE TypeB SUBSCAN TypeJ TypeK TypeN TypeE TypeS TypeT UINT2 TypeR usec v10 v2 Until v2c v50 v60 v20 EX1 vX15 VX2 VX1 vX105 EX2 EX3 VX3 VX4 While 7.7.3.4.3 Alias and Unit Declarations A variable can be assigned a second name, or alias, by which it can be called throughout the program.
-
Section 7. Installation CRBasic Example 13.
-
Section 7. Installation • name of the CRBasic program running in the datalogger • name of the data table (limited to 20 characters) • alphanumeric field names to attach at the head of data columns This information is referred to as "table definitions." Table Typical Data Table (p. 127) shows a data file as it appears after the associated data table has been downloaded from a CR800 programmed with the code in CRBasic example Definition and Use of a Data Table (p. 127).
-
Section 7. Installation Table 13. Typical Data Table TOA5 CR800 CR800 1048 CR800.Std.13.06 CPU:Data.cr8 TIMESTAMP RECORD BattVolt_Avg PTempC_Avg TempC_Avg(1) TempC_Avg(2) TS RN Volts Deg C Deg C Deg C Avg Avg Avg Avg 7/11/2007 16:10 0 13.18 23.5 23.54 25.12 7/11/2007 16:20 1 13.18 23.5 23.54 25.51 7/11/2007 16:30 2 13.19 23.51 23.05 25.73 7/11/2007 16:40 3 13.19 23.54 23.61 25.95 7/11/2007 16:50 4 13.19 23.55 23.09 26.05 7/11/2007 17:00 5 13.19 23.
-
Section 7.
-
Section 7. Installation • Size-Table size is the number of records to store in a table before new data begins overwriting old data. If "10" is entered, 10 records are stored in the table -- the eleventh record will overwrite the first record. If "-1" is entered, memory for the table is automatically allocated at the time the program compiles.
-
Section 7. Installation If a program is planned to experience multiple lapses, and if telecommunications bandwidth is not a consideration, the Lapses parameter should be set to 0 to ensure the CR800 allocates adequate memory for each data table. Table 14. DataInterval() Lapse Parameter Options DataInterval() Lapse Argument Effect X>0 If table record number is fixed, X data frames (1 kB per data frame) are added to data table if memory is available.
-
Section 7. Installation Consider the Average() instruction as an example of output processing instructions. Average() stores the average of a variable over the final data storage output interval. Its parameters are: • Reps — number of elements in the variable array for which to calculate averages. Reps is set to 1 to average PTemp, and set to 2 to average 2 thermocouple temperatures, both of which reside in the variable array "Temp_C". • Source — variable array to average.
-
Section 7. Installation the order calls are received. This may cause unexpected pauses in the conflicting program sequences. 7.7.3.5.3 Incidental Sequences Data table sequences are essential features of nearly all programs. Although used less frequently, subroutine sequences also have a general purpose nature. The following incidental sequences, however, are used only in applications to which they specifically apply.
-
Section 7. Installation datalogger, which is displayed by the support software. The CRBasic Editor precompiler returns a similar message. Note A program can be forced to run in sequential or pipeline modes by placing the SequentialMode or PipelineMode instruction in the declarations section of the program. Some tasks in a program may have higher priorities than other tasks. Measurement tasks generally take precedence over all others. Priority of tasks is different for pipeline mode and sequential mode.
-
Section 7. Installation 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 datalogger. All tasks are given the same general priority. However, when a conflict arises between tasks, program execution adheres to the priority schedule in table Pipeline Mode Task Priorities (p. 134). Table 16. Pipeline Mode Task Priorities 1. Measurements in main program 2. Background calibration 3. Measurements in slow sequences 4.
-
Section 7. Installation A similar concern is the reuse of the same variable in multiple tasks. Without some sort of messaging between the two tasks placed into the CRBasic program, unpredictable results are likely to occur. The SemaphoreGet() and SemaphoreRelease() instruction pair provide a tool to prevent unwanted access of an object (variable, COM port, etc.) by another task while the object is in use. Consult CRBasic Editor Help for information on using SemaphoreGet() and SemaphoreRelease(). 7.7.3.
-
Section 7. Installation CR800 clock. Scan() parameters allow modification of the period in 10- ms increments. As shown in CRBasic example BeginProg / Scan() / NextScan / EndProg Syntax (p. 136), aside from declarations, the CRBasic program may be relatively short. CRBasic Example 15. BeginProg / Scan() / NextScan / EndProg Syntax BeginProg Scan(1,Sec,3,0) PanelTemp(RefTemp, 250) TCDiff(TC(),6,mV2_5C,1,...
-
Section 7. Installation splicing, measurements in a slow sequence may span across multiple-scan intervals in the main program. When no measurements need to be spliced, the slow-sequence scan will run independent of the main scan, so slow sequences with no measurements can run at intervals ≤ main-scan interval (still in 10-ms increments) without skipping scans.
-
Section 7. Installation semaphore before measurements in a calibration or slow-sequence scan. The semaphore is taken by the main scan at its beginning if there are measurements included in the scan. The semaphore is released only after the last instruction in the main scan is executed. Slow-Sequence Scans Slow-sequence scans begin after a SlowSequence instruction. They start processing tasks prior to a measurement but stop to wait when a measurement semaphore is needed.
-
Section 7. Installation Figure 47: Sequential-mode scan priority flow diagrams 7.7.3.8 Instructions In addition to BASIC syntax, additional instructions are included in CRBasic to facilitate measurements and store data. CRBasic Programming Instructions (p. 451) contains a comprehensive list of these instructions. 7.7.3.8.1 Measurement and Data-Storage Processing CRBasic instructions have been created for making measurements and storing data.
-
Section 7. Installation PanelTemp is the keyword. Two parameters follow: Dest, a destination variable name in which the temperature value is stored; and Integ, a length of time to integrate the measurement. To place the panel temperature measurement in the variable RefTemp, using a 250-µs integration time, the syntax is as shown in CRBasic example Measurement Instruction Syntax (p. 140). CRBasic Example 17. Measurement Instruction Syntax PanelTemp(RefTemp, 250) 7.7.3.8.
-
Section 7. Installation Table 18. Rules for Names Name 1 Category Maximum Length (number of characters) Data-table name 20 Field name 39 Field-name description 64 Allowed characters and other names. 1 Variables, constants, units, aliases, station names, field names, data table names, and file names can share identical names; that is, once a name is used, it is reserved only in that category. 7.7.3.8.4 Expressions in Arguments Read More! See Expressions (p.
-
Section 7. Installation CRBasic Example 19. Use of Arrays as Multipliers and Offsets Public Pressure(3), Mult(3), Offset(3) DataTable(AvgPress,1,-1) DataInterval(0,60,Min,10) Average(3,Pressure(),IEEE4,0) EndTable BeginProg 'Calibration Factors: Mult(1)=0.123 : Offset(1)=0.23 Mult(2)=0.115 : Offset(2)=0.234 Mult(3)=0.114 : Offset(3)=0.
-
Section 7. Installation 7.7.3.9.1 Floating-Point Arithmetic Variables and calculations are performed internally in single precision IEEE fourbyte floating point with some operations calculated in double precision. Note Single-precision float has 24 bits of mantissa. Double precision has a 32-bit extension of the mantissa, resulting in 56 bits of precision.
-
Section 7. Installation CRBasic Example 20. Public Fa As Float Public Fb As Float Public L As Long Public Ba As Boolean Public Bb As Boolean Public Bc As Boolean BeginProg Fa = 0 Fb = 0.125 L = 126 Ba = Fa Bb = Fb Bc = L EndProg Conversion of FLOAT / LONG to Boolean 'This will set Ba = False (0) 'This will Set Bb = True (-1) 'This will Set Bc = True (-1) FLOAT from LONG or Boolean When a LONG or Boolean is converted to FLOAT, the integer value is loaded into the FLOAT. Booleans are converted to -1 or 0.
-
Section 7. Installation Constants Conversion Constants are not declared with a data type, so the CR800 assigns the data type as needed. If a constant (either entered as a number or declared with CONST) can be expressed correctly as an integer, the compiler will use the type that is most efficient in each expression. The integer version is used if possible, i.e., if the expression has not yet encountered a FLOAT. CRBasic example Constants to LONGs or FLOATs (p.
-
Section 7. Installation The CR800 is able to translate the conditions listed in table Binary Conditions of TRUE and FALSE (p. 146) to binary form (-1 or 0), using the listed instructions and saving the binary form in the memory location indicated. Table Logical Expression Examples (p. 147) explains some logical expressions. Non-Zero = True (Sometimes) Any argument other than 0 or -1 will be translated as TRUE in some cases and FALSE in other cases.
-
Section 7. Installation Table 20. Logical Expression Examples If X >= 5 then Y = 0 Sets the variable Y to 0 if the expression "X >= 5" is true, i.e. if X is greater than or equal to 5. The CR800 evaluates the expression (X >= 5) and registers in system memory a -1 if the expression is true, or a 0 if the expression is false. If X >= 5 OR Z = 2 then Y = 0 Sets Y = 0 if either X >= 5 or Z = 2 is true. If X >= 5 AND Z = 2 then Y = 0 Sets Y = 0 only if both X >= 5 and Z = 2 are true. If 6 then Y = 0.
-
Section 7. Installation CRBasic Example 23.
-
Section 7. Installation • Prc is the abbreviation of the name of the data process used. See table Abbreviations of Names of Data Processes (p. 149) for a complete list of these abbreviations. This is not needed for values from Status or Public tables. • Fieldname Index is the array element number in fields that are arrays (optional). • Records Back is how far back into the table to go to get the value (optional). If left blank, the most recent record is acquired. Table 21.
-
Section 7. Installation Seven special variable names are used to access information about a table: • EventCount • EventEnd • Output • Record • TableFull • TableSize • TimeStamp Consult CRBasic Editor Help index topic DataTable access for complete information. 7.7.3.11 System Signatures Signatures help assure system integrity and security. The following resources provide information on using signatures. • Signature() instruction in Diagnostics (p. 461).
-
Section 7. Installation CRBasic Example 24. Use of Variable Arrays to Conserve Code Space For I = 1 to 20 TCTemp(I) = TCTemp(I) * 1.8 + 32 Next I 7.7.4.2 Use of Move() to Conserve Code Space The Move() instruction can be used to set an array or partial array to a single value or to copy to another array or partial array as shown in CRBasic example Use of Move() to Conserve Code Space (p. 151). CRBasic Example 25.
-
Section 7. Installation calibration with new multiplier and offset factors. Only if the user creates a datastorage output table with the SampleFieldCal() instruction will a calibration history be recorded. Note CAL files created by FieldCal() and FieldCalStrain() differ from files created by the CalFile() instruction (File Management (p. 493) ). 7.8.1.
-
Section 7. Installation topics. The most comprehensive resource to date covering use of FieldCal() and FieldCalStrain() is RTDAQ software documentation. Be aware that, • the CR800 does not check for out-of-bounds values in mode variables. • valid mode variable entries are "1" or "4". 7.8.1.4.1 Single-Point Calibrations (zero, offset, or zero basis) Use this single-point calibration procedure to adjust an offset (y-intercept). See Zero (Option 0) (p. 156) and Offset (Option 1) (p.
-
Section 7. Installation 8. Set Mode = 4 to start second part of calibration. a. Mode = 5 (automatic) during second point calibration. b. Mode = 6 (automatic) when calibration is complete. 7.8.1.
-
Section 7. Installation 1. Send CRBasic example FieldCal Zeroing Demonstration Program (p. 155) to the CR800. An excitation channel has been programmed to simulate a sensor output. 2. To place the simulated RH sensor in a simulated-calibration condition (in the field it would be placed in a desiccated chamber), place a jumper wire between channels VX1/EX1 and SE6 (3L). Set variable mV to 1000. Set variable KnownRH to 0.0. 3.
-
Section 7. Installation Scan(100,mSec,0,0) 'Simulate measurement by exciting channel VX1/EX1 ExciteV(Vx1,mV,0) 'Make the calibrated measurement VoltSE(RH,1,mV2500,6,1,0,250,Multiplier,Offset) 'Perform a calibration if CalMode = 1 FieldCal(0,RH,1,Multiplier,Offset,CalMode,KnownRH,1,30) 'If there was a calibration, store it into a data table CallTable(CalHist) NextScan EndProg 7.8.1.5.2 Offset (Option 1) Case: A sensor measures the salinity of water.
-
Section 7. Installation CRBasic Example 27. FieldCal() Offset Demo Program 'Jumper VX1/EX1 to SE6(3L) to simulate a sensor Public mV Public KnownSalt Public CalMode 'Excitation mV output 'Known salt concentration 'Calibration trigger Public Multiplier 'Multiplier (starts at .
-
Section 7. Installation K = temperature correction coefficient (‐0.04 PSI / C° is typical) T0 = r temperature at the zero state T1 = temperature measurement S0 = barometric pressure at the zero state S1 = barometric pressure measurement. The following procedure determines zero offset of the pressure transducer, water temperature, and barometric pressure readings. Use the external keyboard / display or support software numeric monitor to change variable values as directed.
-
Section 7. Installation Public Offset(3) Alias Offset(1) = Digits_Offset Alias Offset(2) = Temp_Offset Alias Offset(3) = BP_Offset Public LoadResult, CalMode Public AVWRC Const GageFactor = 0.01664 Const Temp_K = -0.
-
Section 7. Installation 1. Send the program in CRBasic example FieldCal Multiplier and Offset Demonstration Program (p. 160) to the CR800. 2. To simulate the flow sensor, place a jumper wire between channels VX1/EX1 and SE6 (3L). 3. Simulate deployment-calibration conditions (output @ 30 l/s = 300 mV, output @ 10 l/s = 550 mV) in two stages. a. Set variable SignalmV to 300. Set variable KnownFlow to 30.0. b. Start the deployment calibration by setting variable CalMode = 1. c.
-
Section 7. Installation Scan(100,mSec,0,0) 'Simulate measurement by exciting channel VX1/EX1 ExciteV(Vx1,SignalmV,0) 'Make the calibrated measurement VoltSE(WaterFlow,1,mV2500,6,1,0,250,Multiplier,Offset) 'Perform a calibration if CalMode = 1 FieldCal(2,WaterFlow,1,Multiplier,Offset,CalMode,KnownFlow,1,30) 'If there was a calibration, store it into a data table CallTable(CalHist) NextScan EndProg 7.8.1.5.
-
Section 7.
-
Section 7. Installation FieldCalStrain() uses the known value of the shunt resistor to adjust the gain (multiplier / span) to compensate. The gain adjustment (S) is incorporated by FieldCalStrain() with the manufacturer's gage factor (GF), becoming the adjusted gage factor (GFadj), which is then used as the gage factor in StrainCalc(). GF is stored in the CAL file and continues to be used in subsequent calibrations.
-
Section 7. Installation Figure 49: Quarter-bridge strain-gage schematic with RC-resistor shunt CRBasic Example 31.
-
Section 7. Installation '//////////////////////////// PROGRAM //////////////////////////// BeginProg 'Set Gage Factors GF_Raw = 2.1 GF_Adj = GF_Raw 'The adj Gage factors are used in the calculation of uStrain 'If a calibration has been done, the following will load the zero or 'Adjusted GF from the Calibration file LoadFieldCal(True) Scan(100,mSec,100,0) 'Measure Bridge Resistance BrFull(Raw_mVperV,1,mV25,1,Vx1,1,2500,True ,True ,0,250,1.
-
Section 7. Installation Figure 50: Strain-gage shunt calibration started Figure 51: Strain-gage shunt calibration finished 7.8.1.6.2 Quarter-Bridge Zero (Option 10) Continuing from Quarter-Bridge Shunt (Option 13) (p. 165), keep the 249-kΩ resistor in place to simulate a strain. Using the external keyboard / display or software numeric monitor, change the value in variable Zero_Mode to 1 to start the zero calibration as shown in figure Starting Zero Procedure (p. 166).
-
Section 7. Installation Figure 53: Zero procedure finished 7.8.2 Information Services Support of information services (FTP, HTTP, XML, POP3, SMTP, Telnet, NTCIP, NTP, HTML) is extensive in the CR800, to the point of requiring another manual at least as thick as the CR800 manual so fully cover applicable topics. This section only nicks the surface. The most up-to-date information on implementing IS services is contained in CRBasic Editor Help.
-
Section 7. Installation • DHCP client to obtain an IP address • DNS client to query a DNS server to map a name into an IP address • SMTP to send email messages 7.8.2.1 PakBus Over TCP/IP and Callback Once the hardware has been configured, basic PakBus® communication over TCP/IP is possible. These functions include sending and retrieving programs, setting the CR800 clock, collecting data, and displaying at the most current record from the CR800 data tables.
-
Section 7. Installation Figure 54: Preconfigured HTML Home Page 7.8.2.3 Custom HTTP Web Server Although the default home page cannot be accessed by the user for editing, it can be replaced with the HTML code of a customized web page. To replace the default home page, save the new home page under the name default.html and copy it to the datalogger. It can be copied to a CR800 drive with File Control. Deleting default.html will cause the CR800 to use its original, default home page.
-
Section 7.
-
Section 7. Installation CRBasic Example 32. HTML 'NOTE: Lines ending with "+" are wrapped to the next line to fit on the printed page 'NOTE Continued: Do not wrap lines when entering program into CRBasic Editor. Dim Commands As String * 200 Public Time(9), RefTemp, Public Minutes As String, Seconds As String, Temperature As String DataTable(CRTemp,True,-1) DataInterval(0,1,Min,10) Sample(1,RefTemp,FP2) Average(1,RefTemp,FP2,False) EndTable 'Default HTML Page WebPageBegin("default.
-
Section 7. Installation BeginProg Scan(1,Sec,3,0) PanelTemp(RefTemp,250) RealTime(Time()) Minutes = FormatFloat(Time(5),"%02.0f") Seconds = FormatFloat(Time(6),"%02.0f") Temperature = FormatFloat(RefTemp, "%02.02f") CallTable(CRTemp) NextScan EndProg 7.8.2.4 FTP Server The CR800 automatically runs an FTP server. This allows Windows Explorer to access the CR800 file system via FTP, with drives on the CR800 being mapped into directories or folders. The root directory on the CR800 can be any drive.
-
Section 7. Installation 7.8.2.9 Micro-Serial Server The CR800 can be configured to allow serial communication over a TCP/IP port. This is useful when communicating with a serial sensor over ethernet via microserial server (third-party serial to ethernet interface) to which the serial sensor is connected. See the network-link manual and the CRBasic Editor Help for the TCPOpen() instruction for more information. Information on available network links is available in the appendix Network Links (p. 545). 7.8.
-
Section 7. Installation • Programmed mode automates much of the SDI-12 protocol and provides for data recording. 7.8.3.1 SDI-12 Transparent Mode System operators can manually interrogate and enter settings in probes using transparent mode. Transparent mode is useful in troubleshooting SDI-12 systems because it allows direct communication with probes. Transparent mode may need to wait for commands issued by the programmed mode to finish before sending responses.
-
Section 7. Installation 7.8.3.1.1 SDI-12 Transparent Mode Commands Commands have three components: Sensor address (a) – a single character, and is the first character of the command. Sensors are usually assigned a default address of zero by the manufacturer. Wildcard address (?) is used in Address Query command. Some manufacturers may allow it to be used in other commands. Command body (e.g., M1) – an upper case letter (the “command”) followed by alphanumeric qualifiers.
-
Section 7. Installation Table 25. Standard SDI-12 Command and Response Set Command Name Command Syntax 1 Response Start Concurrent Measurement aC! atttnn Additional Concurrent Measurements aC1! . . . aC9! atttnn atttnn atttnn atttnn atttnn aCC1! ... aCC9! atttnn Additional Concurrent Measurements and Request CRC Continuous Measurements Continuous Measurements and Request CRC aR0! ... aR9! aRC0! ...
-
Section 7. Installation Serial number = 101 Start Measurement Commands (aM! & aC!) A measurement is initiated with M! or C! commands. The response to each command has the form atttnn, where • a = sensor address • ttt = time, in seconds, until measurement data are available • nn = the number of values to be returned when one or more subsequent D! commands are issued. Start Measurement Command (aMv!) Qualifier v is a variable between 1 and 9.
-
Section 7. Installation Send Data Commands (aD0! to aD9!) These commands requests data from the sensor. They are normally issued automatically by the CR800 after measurement commands aMv! or aCv!. In transparent mode, the user asserts these commands in series to obtain data. If the expected number of data values are not returned in response to a aD0! command, the data logger issues aD1!, aD2!, etc., until all data are received. In transparent mode, a user does likewise.
-
Section 7. Installation instruction parameter), the CR800 issues the aM! AND aD0! commands with proper elapsed time between the two. The CR800 automatically issues retries and performs other services that make the SDI-12 measurement work as trouble free as possible. Table SDI-12Recorder() Commands (p. 179) summarizes CR800 actions triggered by some SDI12Recorder() commands. If the SDI12Recorder() instruction is not successful, NAN will be loaded into the first variable. See NAN and ±INF (p.
-
Section 7. Installation Alternate Start Measurement Command (Cv) The SDIRecorder() aCv (not C!) command facilitates using the SDI-12 standard Start Concurrent command (aCv!) without the back-to-back measurement sequence normal to the CR800 implementation of aCv!. Consider an application wherein four SDI-12 temperature sensors need to be nearsimultaneously measured at a 5 minute interval within a program that scans every 5 seconds.
-
Section 7. Installation SDI12Recorder(Temp(3),1,2,"M!",1.0,0) SDI12Recorder(Temp(4),1,3,"M!",1.0,0) NextScan EndSequence EndProg However, problems 2 and 3 still are not resolved. These can be resolved by using the concurrent measurement command, C!.
-
Section 7. Installation CRBasic Example 33.
-
Section 7.
-
Section 7. Installation SlowSequence Do 'Note SDI12SensorSetup / SDI12SensorResponse must be renewed 'after each successful SDI12Recorder() poll.
-
Section 7. Installation CRBasic Example 35. Using an SDI‐12 Extended Command 'SDI-12 extended command "XT23.61!" sent to CH200 Charging Regulator 'Correct response is "0OK", if zero (0) is the SDI-12 address. ' 'Declare Variables Public SDI12command As String Public SDI12result As String 'Main Program BeginProg Scan(20,Sec,3,0) SDI12command = "XT" & FormatFloat(PTemp,"%4.2f") & "!" SDI12Recorder(SDI12result,1,0,SDI12command,1.0,0) NextScan EndProg 7.8.3.2.
-
Section 7. Installation CRBasic Example 36. SDI‐12 Sensor Setup Public PTemp, batt_volt Public Source(10) BeginProg Scan(5,Sec,0,0) PanelTemp(PTemp,250) Battery(batt_volt) Source(1) = PTemp 'temperature, deg C Source(2) = batt_volt 'primary power, Vdc Source(3) = PTemp * 1.8 + 32 'temperature, deg F Source(4) = batt_volt 'primary power, Vdc Source(5) = PTemp 'temperature, deg C Source(6) = batt_volt * 1000 'primary power, mVdc Source(7) = PTemp * 1.
-
Section 7. Installation Example: Probe: Water Content Power Usage: • Quiescent: 0.25 mA • Measurement: 120 mA • Measurement Time: 15 s • Active: 66 mA • Timeout: 15 s Probes 1, 2, 3, and 4 are connected to SDI-12 / Control Port 1. The time line in table Example Power Usage Profile for a Network of SDI-12 Probes (p. 187) shows a 35-second power-usage profile example.
-
Section 7. Installation 7.8.4 Subroutines A subroutine is a group of programming instructions that is called by, but runs outside of, the main program. Subroutines are used for the following reasons: • To reduce program length. Subroutine code can be executed multiple times in a program scan. • To ease integration of proven code segments into new programs. • To compartmentalize programs to improve organization.
-
Section 7. Installation CRBasic Example 37. Subroutine with Global and Local Variables 'Global variables are those declared anywhere in the program as Public or Dim. 'Local variables are those declared in the Sub() instruction. 'Program Purpose: Demonstrates use of global and local variables with subroutines 'Program Function: Passes 2 variables to subroutine.
-
Section 7. Installation 7.8.5.1 OutputOpt Parameters In the CR800 WindVector() instruction, the OutputOpt parameter defines the processed data that are stored. All output options result in an array of values, the elements of which have _WVc(n) as a suffix, where n is the element number. The array uses the name of the Speed/East variable as its base. table OutputOpt Options (p. 190) lists and describes OutputOpt options. Table 29.
-
Section 7. Installation often included to zero the measurement when it equals the offset so that WindVector() can reject measurements when wind speed is zero. Standard deviation can be processed one of two ways: 1) using every sample taken during the data storage interval (enter 0 for the Subinterval parameter), or 2) by averaging standard deviations processed from shorter sub-intervals of the datastorage interval.
-
Section 7. Installation Figure 58: Mean wind-vector graph where for polar sensors: or, in the case of orthogonal sensors: Resultant mean wind direction, Θu: Standard deviation of wind direction, σ (Θu), using Campbell Scientific algorithm: The algorithm for σ (Θu) is developed by noting (FIGURE. Standard Deviation of Direction (p.
-
Section 7. Installation Standard Deviation of Direction Figure 59: Standard Deviation of Direction The Taylor Series for the Cosine function, truncated after 2 terms is: For deviations less than 40 degrees, the error in this approximation is less than 1%. At deviations of 60 degrees, the error is 10%.
-
Section 7. Installation and have never been greater than a few degrees. The final form is arrived at by converting from radians to degrees (57.296 degrees/radian). 7.8.6 Custom Menus Read More! More information concerning use of the keyboard is found in sections Using the Keyboard Display (p. 382) and Custom Keyboard and Display Menus (p. 486). Menus for the external keyboard / display can be customized to simplify routine operations.
-
Section 7. Installation SubMenu() / EndSubMenu Defines the beginning and end of a second‐level menu. Note SubMenu() label must be at least 6 characters long to mask default display clock. CRBasic example Custom Menus (p. 197) lists CRBasic programming for a custom menu that facilitates viewing data, entering notes, and controlling a device. figure Custom Menu Example — Home Screen (p. 195) through figure Custom Menu Example — Control LED Boolean Pick List (p.
-
Section 7.
-
Section 7. Installation Figure 67: Custom menu example — control-LED pick list Figure 68: Custom menu example — control-LED Boolean pick list Note See figures Custom Menu Example — Home Screen (p. 195) through Custom Menu Example — Control LED Boolean Pick List (p. 197) in reference to the following CRBasic example Custom Menus (p. 197). CRBasic Example 38.
-
Section 7.
-
Section 7. Installation 'Measure Two Thermocouples TCDiff(TCTemp(),2,mV2500C,1,TypeT,RefTemp,True,0,250,1.
-
Section 7. Installation Note Do not confuse CRBasic files with .DLD extensions with files of .DLD type used by legacy Campbell Scientific dataloggers.
-
Section 7. Installation #ElseIf LoggerType = CR800 Const SourcSerialPort = Com1 #Else Const SourcSerialPort = Com1 #EndIf 'Public Variables Public ValueRead, SelectedSpeed As String * 50 'Main Program BeginProg 'Return the selected speed and logger type for display. #If LoggerType = CR3000 SelectedSpeed = "CR3000 running at " & Speed & " intervals." #ElseIf LoggerTypes = CR1000 SelectedSpeed = "CR1000 running at " & Speed & " intervals.
-
Section 7. Installation 7.8.8.1 Introduction Serial denotes transmission of bits (1s and 0s) sequentially, or "serially." A byte is a packet of sequential bits. RS-232 and TTL standards use bytes containing eight bits each. Imagine that an instrument transmits the byte "11001010" to the CR800. The instrument does this by translating "11001010" into a series of higher and lower voltages, which it transmits to the CR800. The CR800 receives and reconstructs these voltage levels as "11001010.
-
Section 7. Installation 7.8.8.2 I/O Ports The CR800 supports two-way serial communication with other instruments through ports listed in table CR800 Serial Ports (p. 203). A serial device will often be supplied with a nine-pin D-type connector serial port. Check the manufacture's pinout for specific information. In most cases, the standard nine-pin RS-232 scheme is used. If that is the case then, • Connect sensor RX (receive, pin 2) to datalogger Tx (transmit, channel C1, C3).
-
Section 7. Installation addressing systems that allow multiplexing of several sensors on a single communications port, which makes for more efficient use of resources. 7.8.8.4 Glossary of Terms Asynchronous Indicates the sending and receiving devices are not synchronized using a clock signal. Baud rate The rate at which data are transmitted. Big Endian "Big end first." Placing the most significant integer at the beginning of a numeric word, reading left to right.
-
Section 7. Installation +3 to +25 with ‐3 to + 3 defined as the transition range that contains no information. A mark is a logic 1 and negative voltage. A space is a logic 0 and positive voltage. MSB Most significant bit (the leading bit). RS‐232C Refers to the standard used to define the hardware signals and voltage levels. The CR800 supports several options of serial logic and voltage levels including RS‐232 logic at TTL levels and TTL logic at TTL levels.
-
Section 7. Installation useful when using the CS I/O and RS-232 ports since it allows ports to be simultaneously used for sensor and PC telecommunications. • Format — Determines data type and if PakBus® communications can occur on the COM port. If the port is expected to read sensor data and support normal PakBus® telemetry operations, use an auto-baud rate argument (0 or nnnn) and ensure this option supports PakBus® in the specific application.
-
Section 7. Installation SerialOutBlock()1,3 • Binary • Can run in pipeline mode inside the digital measurement task (along with SDM instructions) if the COMPort parameter is set to a constant argument such as COM1 or COM2 , and the number of bytes is also entered as constant. SerialOut() • Handy for ASCII command and a known response, e.g., Hayes-modem commands.
-
Section 7. Installation • Will the sensor be sending multiple data strings? Multiple strings usually require filtering before parsing. • How fast will data be sent to the CR800? • Is power consumption critical? • Does the sensor compute a checksum? Which type? A checksum is useful to test for data corruption. 2. Open a serial port (SerialOpen() instruction). • Example: SerialOpen(Com1,9600,0,0,10000) • Designate the correct port in CRBasic. • Correctly wire the device to the CR800.
-
Section 7. Installation 1. Open a serial port (SerialOpen() command) to configure it for communications. • Parameters are set according to the requirements of the communications link and the serial device. • Example: SerialOpen(Com1,9600,0,0,10000) • Designate the correct port in CRBasic. • Correctly wire the device to the CR800. • Match the port's baud rate to the baud rate of the device in CRBasic. • Use a fixed baud rate (rather than auto baud) when possible. 2. Build the output string.
-
Section 7. Installation 17889 ppmV 8.1 °C" • pw=17.81 hPa pws 29.43 hPa h= 52.3 kJ/kg dT= Hex Pairs: Bytes are translated to hex pairs, consisting of digits 0 - 9 and letters a - f. Each pair describes a hexadecimal ASCII / ANSI code. Some codes translate to alpha-numeric values, others to symbols or non-printable control characters. Example (temperature sensor): SerialInString = "23 30 31 38 34 0D", which translates to: #01 84 cr • Binary: Bytes are processed on a bit-by-bit basis.
-
Section 7. Installation the sensor sends multiple strings at once, consider declaring a single string variable and read incoming strings one at a time. The CR800 adjusts the declared size of strings. One byte is always added to the declared length, which is then increased by up to another three bytes to make length divisible by four. Declared string length, not number of characters, determines the memory consumed when strings are written to memory.
-
Section 7. Installation Scan(5,Sec, 3, 0) 'Serial Out Code 'Transmits string "*27.435,56.789#" out COM1 SerialOpen(Com1,9600,0,0,10000) 'Open a serial port 'Build the output string SerialOutString = "*" & TempOut & "," & RhOut & "#" 'Output string via the serial port SerialOut(Com1,SerialOutString,"",0,100) 'Serial In Code 'Receives string "27.435,56.
-
Section 7.
-
Section 7. Installation Figure 71: HyperTerminal COM-Port Settings Tab Click File | Properties | Settings | ASCII Setup... and set as shown.
-
Section 7. Installation 7.8.8.6.2 Create Send Text File Create a file from which to send a serial string. The file shown in figure HyperTerminal Send Text-File Example (p. 215) will send the string [2008:028:10:36:22]C to the CR800. Use Notepad (Microsoft Windows utility) or some other text editor that will not place unexpected hidden characters in the file. Figure 73: HyperTerminal send text-file example To send the file, click Transfer | Send Text File | Browse for file, then click OK. 7.8.8.6.
-
Section 7. Installation programming to output and accept these same ASCII strings. A similar program can be used to emulate CR10X and CR23X dataloggers. Solution: CRBasic example Measure Sensors / Send RS-232 Data (p. 216) imports and exports serial data via the CR800 RS-232 port. Imported data are expected to have the form of the legacy Campbell Scientific time set C command. Exported data has the form of the legacy Campbell Scientific Printable ASCII format.
-
Section 7.
-
Section 7. Installation 'If it is a leap year, use this section.
-
Section 7.
-
Section 7.
-
Section 7. Installation 7.8.8.7 Q & A Q: I am writing a CR800 program to transmit a serial command that contains a null character. The string to transmit is: CHR(02)+CHR(01)+"CWGT0"+CHR(03)+CHR(00)+CHR(13)+CHR(10) How does the logger handle the null character? Is there a way that we can get the logger to send this? A: Strings created with CRBasic are NULL terminated. Adding strings together means the 2nd string will start at the first null it finds in the first string.
-
Section 7. Installation then TempData(1,1,2) = "TOP", TempData(1,1,3) = "OP", _ TempData(1,1,1) = "STOP" To handle single-character manipulations, declare the string with a size of 1. That single-character string can be used to search for specific characters. In the following example, the first character of a larger string is determined: Public TempData As String * 1 TempData = LargerString If TempData = "S" Then A single character can be retrieved from any position in a string using the third dimension.
-
Section 7. Installation A: A common caution is, “The destination variable should not be used in more than one sequence to avoid using the variable when it contains old data.” However, there are more elegant ways to handle the root problem. There is nothing unique about SerialIn() with regard to understanding how to correctly write to and read from global variables using multiple sequences. SerialIn() is writing into an array of characters.
-
Section 7. Installation Figure 75: Data from TrigVar program CRBasic Example 42. Using TrigVar to Trigger Data Storage 'In this example, the variable "counter" is incremented by 1 each scan. The data table 'is called every scan, which includes the Sample(), Average(), and Totalize() 'instructions. TrigVar is true when counter = 2 or counter = 3. Data are stored when 'TrigVar is true.
-
Section 7. Installation • Placing a time stamp in a second position in a record. • Accessing a time stamp from a data table and subsequently storing it as part of a larger data table. Maximum(), Minimum(), and FileTime() instructions produce a time stamp that may be accessed from the program after being written to a data table. The time of other events, such as alarms, can be stored using the RealTime() instruction. • Accessing and storing a time stamp from another datalogger in a PakBus network. 7.
-
Section 7. Installation 'Program BeginProg Scan(1,Sec,0,0) TimeVar = FirstTable.TimeStamp CallTable FirstTable CallTable SecondTable NextScan EndProg CRBasic Example 44. NSEC — Two Element Time Array 'TimeStamp is retrieved into variables TimeOfMaxVar(1) and TimeOfMaxVar(2). Because 'the variable is dimensioned to 2, NSEC assumes, '1) TimeOfMaxVar(1) = seconds since 00:00:00 1 January 1990, and '2) TimeOfMaxVar(2) = μsec into a second.
-
Section 7. Installation 'Declarations Public rTime(9) As Long Public rTime2(7) As Long Dim x '(or Float) '(or Float) DataTable(SecondTable,True,-1) DataInterval(0,5,Sec,10) Sample(1,rTime,NSEC) Sample(1,rTime2,NSEC) EndTable 'Program BeginProg Scan(1,Sec,0,0) RealTime(rTime) For x = 1 To 7 rTime2(x) = rTime(x) Next CallTable SecondTable NextScan EndProg CRBasic Example 46.
-
Section 7. Installation '3) sample time to three string forms using the TableName.FieldName notation. 'Form 1: "mm/dd/yyyy hr:mm:ss UTTime(1) = TimeTable.TimeLong(1,1) 'Form 2: "dd/mm/yyyy hr:mm:ss UTTime(2) = TimeTable.TimeLong(3,1) 'Form 3: "ccyy-mm-dd hr:mm:ss (ISO 8601 Int'l Date) UTTime(3) = TimeTable.TimeLong(4,1) NextScan EndProg 7.8.
-
Section 7. Installation Variable aliasing (p. 124) can be employed in the CRBasic program to make the data more understandable.
-
Section 7. Installation Figure 78: Bool8 data from bit-shift example (PC data file) CRBasic Example 47.
-
Section 7.
-
Section 7. Installation FlagsBool8(1) FlagsBool8(2) FlagsBool8(3) FlagsBool8(4) = = = = Flags AND (Flags >> (Flags >> (Flags >> &HFF 8) AND &HFF 16) AND &HFF 24) AND &HFF 'AND 'AND 'AND 'AND 1st 2nd 3rd 4th 8 8 8 8 bits bits bits bits of of of of "Flags" "Flags" "Flags" "Flags" & & & & 11111111 11111111 11111111 11111111 CallTable(Bool8Data) NextScan EndProg 7.8.
-
Section 7. Installation Table 32. TABLE. Summary of Analog Voltage Measurement Rates Maximum Rate Number of Simultaneous Channels Maximum Duty Cycle Maximum Measaurements Per Burst Description 100 Hz 600 Hz 2000 Hz Multiple channels Fewer channels One channel 100% < 100% < 100% N/A Variable 65535 Near simultaneous measurements on multiple channels Near simultaneous measurements on fewer channels Up to 8 sequential differential or 16 single-ended channels.
-
Section 7. Installation BeginProg Scan(1,Sec,0,0)'<<<
-
Section 7. Installation Many variations of this 200-Hz measurement program are possible to achieve other burst rates and duty cycles. The SubScan() / NextSubScan instruction pair introduce added complexities. The SubScan() / NextSubScan Details, introduces some of these. Caution dictates that a specific configuration be thoroughly tested before deployment. Generally, faster rates require measurement of fewer channels.
-
Section 7. Installation • One more way to view sub-scans is that they are a convenient (and only) way to put a loop around a set of measurements. SubScan() / NextSubScan specifies a timed loop for so many times around a set of measurements that can be driven by the task sequencer. 7.8.12.3 Measurement Rate: 601 to 2000 Hz To measure at rates greater than 600 Hz, VoltSE() is switched into burst mode by placing a dash (-) before the channel number and placing alternate arguments in other parameters.
-
Section 7. Installation 200 Table 37. Parameters for Analog Burst Mode (601 to 2000 Hz) CRBasic Analog Voltage Description when in Burst Mode Input Parameters A variable array dimensioned to store all measurements from a single channel. For example, the command, Destination Dim FastTemp(500) dimensions array FastTemp() to store 500 measurements (one second of data at 500 Hz, one-half second of data at 1000 Hz, etc.) The dimension can be any integer from 1 to 65535.
-
Section 7. Installation 7.8.13.1 String Operators The table String Operators (p. 238) list and describes available string operators. String operators are case sensitive. Table 38. String Operators Operator & Description Concatenates strings. Forces numeric values to strings before concatenation. Example 1 & 2 & 3 & "a" & 5 & 6 & 7 = "123a567" + Adds numeric values until a string is encountered. When a string is encountered, it is appended to the sum of the numeric values.
-
Section 7. Installation 7.8.13.2 String Concatenation Concatenation is the building of strings from other strings ("abc123"), characters ("a" or chr()), numbers, or variables. Table 39. String Concatenation Examples Expression Comments Result Str(1) = 5.4 + 3 + " Volts" Add floats, concatenate strings "8.4 Volts" Str(2) = 5.4 & 3 & " Volts" Concatenate floats and strings "5.
-
Section 7. Installation Some smart sensors send strings containing NULL characters. To manipulate a string that has NULL characters within it (in addition to being terminated with another NULL), use MoveBytes() instruction. 7.8.13.4 Inserting String Characters CRBasic Example 48.
-
Section 7. Installation 7.8.13.7 Formatting Strings Table 43. Formatting Strings Examples Expression Result Str(1)=123e4 Str(2)=FormatFloat(123e4,"%12.2f") Str(3)=FormatFloat(Values(2)," The battery is %.3g Volts ") Str(4)=Strings(3,1,InStr(1,Strings(3),"The battery is ",4)) Str(5)=Strings(3,1,InStr(1,Strings(3),"is ",2) + 3) Str(6)=Replace("The battery is 12.4 Volts"," is "," = ") Str(7)=LTrim("The battery is 12.4 Volts") Str(8)=RTrim("The battery is 12.4 Volts") Str(9)=Trim("The battery is 12.
-
Section 7. Installation 'Data Tables 'Table output on two intervals depending on condition.
-
Section 7. Installation scan times, two separate scans can be used with logic to jump between them. If a PulseCount() is used in both scans, then a PulseCountReset is used prior to entering each scan. 7.8.16 Program Signatures A program signature is a unique integer calculated from all characters in a given set of code. When a character changes, the signature changes. Incorporating signature data into a the CR800 data set allows system administrators to track program changes and assure data quality.
-
Section 7. Installation 'function Scan(1,Sec,0,0) ProgSig = Status.ProgSignature RunSig = Status.RunSignature x = 24 ExeSig(1) = Signature 'Set variable to Status table entry '"ProgSignature" 'Set variable to Status table entry '"RunSignature" 'signature includes code since initial 'Signature instruction y = 43 ExeSig(2) = Signature 'Signature includes all code since 'ExeSig(1) = Signature CallTable Signatures NextScan 7.8.17 Advanced Programming Examples 7.8.17.
-
Section 7.
-
Section 7. Installation Minimum(1,AirTemp_C,FP2,0,False) Sample(1,DeltaT_C, FP2) Sample(1,HowMany, FP2) 'Stores temperature minimum in low 'resolution format 'Stores temp difference sample in low 'resolution format 'Stores how many data events in low 'resolution format EndTable BeginProg 'A second way of naming a station is to load the name into a string variable. The is 'place here so it is executed only once, which saves a small amount of program 'execution time.
-
Section 7. Installation 'Count how many times the DataEvent “DeltaT_C>=3” has occurred. The 'TableName.EventCount syntax is used to return the number of data storage events 'that have occurred for an event driven table. This example looks in the data 'table “Event”, which is declared above, and reports the event count. The (1,1) 'after EventCount just needs to be included. HowMany = Event.EventCount(1,1) 'Call Data Tables CallTable(OneMin) CallTable(Event) NextScan EndProg 7.8.17.
-
Section 7. Installation 'Main Program BeginProg Scan(1,Sec,0,0) PanelTemp(PTemp,250) Counter1 = Counter1 + 1 NextScan 'Begin executable section of program 'Begin main scan 'End main scan SlowSequence 'Begin slow sequence 'Declare Public Variables for Secondary Scan (can be declared at head of program) Public Batt_Volt Public Counter2 'Declare Data Table DataTable(Test,1,-1) 'Data Table “Test” is event driven. 'The event is the scan.
-
Section 7.
-
Section 7. Installation '1 Minute Data Interval Scan(1,Min,0,70) Counter(4) = Counter(4) + 1 Battery(Batt_volt) PanelTemp(PTemp,250) TCDiff(Level,1,mV2_5,1,TypeT,PTemp,True ,0,250,1.0,0) If TimeIntoInterval(0,1,Min) Then TimeIntoTest = TimeIntoTest + 1 EndIf 'Call Output Tables CallTable LogTable NextScan '2 Minute Data Interval Scan(2,Min,0,200) Counter(5) = Counter(5) + 1 Battery(Batt_volt) PanelTemp(PTemp,250) TCDiff(Level,1,mV2_5,1,TypeT,PTemp,True ,0,250,1.
-
Section 7. Installation '10 Minute Data Interval Scan(10,Min,0,0) Counter(6) = Counter(6) + 1 Battery(Batt_volt) PanelTemp(PTemp,250) TCDiff(Level,1,mV2_5,1,TypeT,PTemp,True,0,250,1.0,0) If TimeIntoInterval(0,1,Min) Then TimeIntoTest = TimeIntoTest + 1 EndIf 'Call Output Tables CallTable LogTable NextScan EndIf EndProg 7.8.17.5 Scaling Array CRBasic example Scaling Array (p. 251) demonstrates programming to create and use a scaling array.
-
Section 7. Installation 'Begin Program BeginProg 'Load scaling array (multipliers and offsets) Mult(1) = 1.
-
Section 7. Installation 'Declare Units Units PTemp_C = deg C Units AirTemp_C = deg C Units DeltaT_C = deg C 'Declare Output Table -- Output Conditional on Delta T >=3 'Table stores data at the Scan rate (once per second) when condition met 'because DataInterval instruction is not included in table declaration. DataTable(DeltaT,DeltaT_C >= 3,-1) Sample(1,Status.
-
Section 7.
-
Section 7. Installation non-standard types. Measured temperatures are compared against the ITS-90 scale, a temperature instrumentation-calibration standard. PRTCalc() follows the principles and equations given in the US ASTM E1137-04 standard for conversion of resistance to temperature. For temperature range 0 to 650 °C, a direct solution to the CVD equation results in errors < ±0.0005°C (caused by rounding errors in CR800 math).
-
Section 7. Installation Table 45. PRTCalc() Type-Code-1 Sensor IEC 60751:2008 (IEC 751), alpha = 0.00385. Now internationally adopted and written into standards ASTM E1137-04, JIS 1604:1997, EN 60751 and others. This type code is also used with probes compliant with older standards DIN43760, BS1904, and others. (Reference: IEC 60751. ASTM E1137) Constant Coefficient e 1.7584810E-05 f -1.1550000E-06 g 1.7909000E+00 h -2.9236300E+00 i 9.1455000E+00 j 2.5581900E+02 Table 46.
-
Section 7. Installation Table 47. PRTCalc() Type-Code-3 Sensor US Industrial Standard, alpha = 0.00391 (Reference: OMIL R84 (2003)) Constant Coefficient i 8.8564290E+00 j 2.5190880E+02 Table 48. PRTCalc() Type-Code-4 Sensor Old Japanese Standard, alpha = 0.003916 (Reference: JIS C 1604:1981, National Instruments) Constant Coefficient a 3.9739000E-03 d -2.3480000E-06 e 1.8139880E-05 f -1.1740000E-06 g 1.7297410E+00 h -2.8905090E+00 i 8.8326690E+00 j 2.5159480E+02 Table 49.
-
Section 7. Installation Table 50. PRTCalc() Type-Code-6 Sensor Standard ITS-90 SPRT, alpha = 0.003926 (Reference: Minco / Instrunet) Constant Coefficient a 3.9848000E-03 d -2.3480000E-06 e 1.8226630E-05 f -1.1740000E-06 g 1.6319630E+00 h -2.4709290E+00 i 8.8283240E+00 j 2.5091300E+02 7.8.18.2 Measuring PT100s (100-Ohm PRTs) PT100s (100-ohm PRTs) are readily available. The CR800 can measure PT100s in several configurations, each with its own advantages. 7.8.18.2.
-
Section 7. Installation Figure PT100 in Four-Wire Half-Bridge (p. 260) shows the circuit used to measure a 100-Ω PRT. The 10-kΩ resistor allows the use of a high excitation voltage and a low input range. This ensures that noise in the excitation does not have an effect on signal noise.
-
Section 7. Installation A terminal-input module (TIM) can be used to complete the circuit shown in figure PT100 in Four-Wire Half-Bridge (p. 260). Refer to the appendix Signal Conditioners (p. 539) for information concerning available TIM modules. Figure 79: PT100 in four-wire half-bridge CRBasic EXAMPLE. PT100 in Four-Wire Half-Bridge CRBasic Example 59. PT100 in Four‐Wire Half‐Bridge 'See FIGURE. PT100 in Four-Wire Half-Bridge (p.
-
Section 7. Installation Example PRT specifications: • Alpha = 0.00385 (PRTType 1) The temperature measurement requirements in this example are the same as in PT100 in Four-Wire Half-Bridge (p. 258). In this case, a three-wire half-bridge and CRBasic instruction BRHalf3W() are used to measure the resistance of the PRT. The diagram of the PRT circuit is shown in figure PT100 in Three-Wire HalfBridge (p. 261). As in section PT100 in Four-Wire Half-Bridge (p.
-
Section 7. Installation CRBasic Example 60. PT100 in Three‐wire Half‐bridge 'See FIGURE. PT100 in Three-Wire Half-Bridge (p. 261) for wiring diagram. Public Rs_Ro Public Deg_C BeginProg Scan(1,Sec,0,0) 'BrHalf3W(Dest,Reps,Range1,SEChan,ExChan,MPE,Ex_mV,True,0,250,100.93,0) BrHalf3W(Rs_Ro,1,mV25,1,Vx1,1,2200,True,0,250,100.93,0) 'PRTCalc(Destination,Reps,Source,PRTType,Mult,Offset) PRTCalc(Deg_C,1,Rs_Ro,1,1.0,0) NextScan EndProg 7.8.18.2.
-
Section 7. Installation where X' = X / 1000 + R3/(R2+R3) Thus, to obtain the value RS/R0, (R0 = RS @ 0°C) for the temperature calculating instruction PRTCalc(), the multiplier and offset used in BRFull() are 0.001 and R3/(R2+R3), respectively. The multiplier (Rf) used in the bridge transform algorithm (X = Rf (X/(X-1)) to obtain RS/R0 is R1/R0 or (5000/100 = 50). The application requires control of the temperature bath at 50°C with as little variation as possible.
-
Section 7. Installation CRBasic Example 61. PT100 in Four‐Wire Full‐Bridge 'See FIGURE. PT100 in Four-Wire Full-Bridge (p. 263) for wiring diagram. Public BrFullOut Public Rs_Ro Public Deg_C BeginProg Scan(1,Sec,0,0) 'BrFull(Dst,Reps,Range,DfChan,Vx1,MPS,Ex,RevEx,RevDf,Settle,Integ,Mult,Offset) BrFull(BrFullOut,1,mV25,1,Vx1,1,2500,True,True,0,250,.001,.02344) 'BrTrans = Rf*(X/(1-X)) Rs_Ro = 50 * (BrFullOut/(1 - BrFullOut)) 'PRTCalc(Destination,Reps,Source,PRTType,Mult,Offset) PRTCalc(Deg_C,1,Rs_Ro,2,1.
-
Section 7. Installation Figure Running-Average Frequency Response (p. 266) is a graph of signal attenuation plotted against signal frequency normalized to 1/(running average duration). The signal is attenuated by a synchronizing filter with an order of 1 (simple averaging): Sin(πX) / (πX), where X is the ratio of the input signal frequency to the running-average frequency (running-average frequency = 1 / time length of the running average).
-
Section 7. Installation The recorded amplitude for this example should be about 1/3 of the input‐signal amplitude. A program was written with two stored variables: Accel2 and Accel2RA. The raw measurement was stored in Accel2, while Accel2RA was the result of performing a running average on the Accel2 variable. Both values were stored at a rate of 500 Hz. Figure Running‐Average Signal Attenuation (p.
-
Section 7.
-
Section 7.
-
Section 8. Operation 8.1 Measurements Several features give the CR800 the flexibility to measure many sensor types. Contact a Campbell Scientific applications engineer if assistance is required in assessing CR800 compatibility to a specific application or sensor type. Some sensors require precision excitation or a source of power. See Powering Sensors and Devices (p. 84). 8.1.1 Time Measurement of time is an essential function of the CR800.
-
Section 8. Operation basic code requirements. The DataTime() instruction is a more recent introduction that facilitates time stamping with system time. See Data Table Declarations (p. 453) and CRBasic Editor Help for more information. CRBasic Example 62.
-
Section 8. Operation instructions BrFull(), BrFull6W(), BrHalf4W(), TCDiff(), and VoltDiff () instructions perform DIFF voltage measurements. Figure 85: PGI amplifier A PGIA processes the difference between the H and L inputs, while rejecting voltages that are common to both inputs. Figure PGIA with Input Signal Decomposition (p. 271), illustrates the PGIA with the input signal decomposed into a common-mode voltage (Vcm) and a DIFF-mode voltage (Vdm).
-
Section 8. Operation is reduced to ±2.5 Vdc, whereas input limits are always ±5 Vdc. Hence for nonnegligible DIFF signals, "input limits" is more descriptive than "common-mode range." Note Two sets of numbers indicate analog channel assignments. When differential channels are identified, analog channels are numbered 1 - 3. Each differential channel has two inputs: high (H) and low (L). Single-ended channels are identified by the number set 1-6. Caution Sustained voltages in excess of ±8.
-
Section 8. Operation Sensors with a low signal-to-noise ratio, such as thermocouples, should normally be measured differentially. However, if the measurement to be made does not require high accuracy or precision, such as thermocouples measuring brush-fire temperatures, a single-ended measurement may be appropriate. If sensors require differential measurement, but adequate input channels are not available, an analog multiplexer should be acquired to expand differential input capacity.
-
Section 8. Operation Table 51. CRBasic Parameters Varying Measurement Sequence and Timing CRBasic Parameter Description MeasOfs Correct ground offset on single-ended measurements. RevDiff Reverse high and low differential inputs. SettlingTime Sensor input settling time. Integ Duration of input signal integration. RevEx Reverse polarity of excitation voltage. 8.1.2.
-
Section 8. Operation where Gain Error = ± (2500 * 0.0006) = ±1.5 mV and Offset Error = 1.5 • 667 µV + 1 µV = 1.00 mV Therefore, Error = Gain Error + Offset Error = ±1.5 mV + 1.00 µV = ±2.50 mV In contrast, the error for a 500‐mV input under the same constraints is ±1.30 mV. The figure Voltage Measurement Accuracy (p. 275) illustrates the total error with respect to voltage measurements for the ±2500‐mV range.
-
Section 8. Operation 8.1.2.5 Voltage Range In general, a voltage measurement should use the smallest fixed-input range that will accommodate the full-scale output of the sensor being measured. This results in the best measurement accuracy and resolution. The CR800 has fixed input ranges for voltage measurements and an auto range to automatically determine the appropriate input voltage range for a given measurement. The table Analog Voltage Input Ranges with CMN / OID (p.
-
Section 8. Operation 8.1.2.5.2 Fixed Voltage Ranges An approximate 9% range overhead exists on fixed input voltage ranges. For example, over-range on the ±2500 mV-input range occurs at approximately +2725 mV and -2725 mV. The CR800 indicates a measurement over-range by returning a NAN (not a number) for the measurement. 8.1.2.5.
-
Section 8. Operation 8.1.2.6 Offset Voltage Compensation Analog measurement circuitry in the CR800 may introduce a small offset voltage to a measurement. Depending on the magnitude of the signal, this offset voltage may introduce significant error. For example, an offset of 3 μV on a 2500-mV signal introduces an error of only 0.00012%; however, the same offset on a 0.25mV signal introduces an error of 1.2%.
-
Section 8. Operation When the CR800 reverses differential inputs or excitation polarity, it delays the same settling time after the reversal as it does before the first measurement. So, there are two delays per channel when either RevDiff or RevEx is used. If both RevDiff and RevEx are True, four measurements are performed; positive and negative excitations with the inputs one way and positive and negative excitations with the inputs reversed. To illustrate, 1. the CR800 switches to the channel 2.
-
Section 8. Operation duration. Consequently, noise at 1 / (integer multiples) of the integration duration is effectively rejected by an analog integrator. table CRBasic Measurement Integration Times and Codes (p. 280) lists three integration durations available in the CR800 and associated CRBasic codes. If reversing the differential inputs or reversing the excitation is specified, there are two separate integrations per measurement; if both reversals are specified, there are four separate integrations.
-
Section 8. Operation Figure 88: Ac power line noise rejection techniques ac Noise Rejection on Large Signals If rejecting ac-line noise when measuring with the 2500 mV (mV2500) and 5000 mV (mV5000) ranges, the CR800 makes two fast measurements separated in time by one-half line cycle (see figure ac Power Line Noise Rejection Techniques (p. 281) ). A 60-Hz half cycle is 8333 µs, so the second measurement must start 8333 µs after the first measurement integration began.
-
Section 8. Operation Table 56. ac Noise Rejection on Large Signals 2. During A/D, CR800 turns off excitation for ≈170 µs. 3. Excitation is switched on again for one-half cycle, then the second measurement is made. Restated, when the CR800 is programmed to use the half-cycle 50-Hz or 60-Hz rejection techniques, a sensor does not see a continuous excitation of the length entered as the settling time before the second measurement if the settling time entered is greater than one-half cycle.
-
Section 8. Operation Table 57. CRBasic Measurement Settling Times Settling Time Entry Input Voltage Range Integration Code Settling 1 Time 0 All 250 450 µs (default) 0 All _50Hz 3 ms (default) 0 All _60Hz 3 ms (default) >100 All X 2 μs entered 1 Minimum settling time required to allow the input to settle to CR800 resolution specifications. 2 X is an integer >100.
-
Section 8. Operation steady-state conditions so changes in measured voltage are attributable to settling time rather than changes in pressure. Reviewing the section Programming (p. 108) may help in understanding the CRBasic code in the example. The first six measurements are shown in table First Six Values of Settling-Time Data (p. 285). Each trace in figure Settling Time for Pressure Transducer (p.
-
Section 8. Operation Figure 90: Settling time for pressure transducer Table 58. First Six Values of Settling-Time Data TIMESTAMP REC PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) Smp Smp Smp Smp Smp Smp 1/3/2000 23:34 0 0.03638599 0.03901386 0.04022673 0.04042887 0.04103531 0.04123745 1/3/2000 23:34 1 0.03658813 0.03921601 0.04002459 0.04042887 0.04103531 0.0414396 1/3/2000 23:34 2 0.03638599 0.03941815 0.04002459 0.04063102 0.04042887 0.04123745 1/3/2000 23:34 3 0.
-
Section 8. Operation Unless a Calibrate() instruction is present in the running CRBasic program, the CR800 automatically performs self-calibration during spare time in the background as an automatic slow sequence (p. 138), with a segment of the calibration occurring every 4 seconds.
-
Section 8. Operation measurements (B) to be determined during CR800 self-calibration (maximum of 54 values). These values can be viewed in the Status table, with entries identified as listed in table Status Table Calibration Entries (p. 287). Automatic self-calibration can be overridden with the Calibrate() instruction, which forces a calibration for each execution, and does not employ any low-pass filtering on the newly determined G and B values.
-
Section 8. Operation Table 59. Status Table Calibration Entries Status Table Element Descriptions of Status Table Elements Differential (Diff) Single-Ended (SE) CalGain(18) Offset or Gain ±mV Input Range Integration Gain 2.5 50-Hz Rejection CalSeOffset(1) SE Offset 5000 250 ms CalSeOffset(2) SE Offset 2500 250 ms CalSeOffset(3) SE Offset 250 250 ms CalSeOffset(4) SE Offset 25 250 ms CalSeOffset(5) SE Offset 7.5 250 ms CalSeOffset(6) SE Offset 2.
-
Section 8. Operation Table 59. Status Table Calibration Entries Descriptions of Status Table Elements Status Table Element Differential (Diff) Single-Ended (SE) Offset or Gain ±mV Input Range Integration CalDiffOffset(16) Diff Offset 25 50-Hz Rejection CalDiffOffset(17) Diff Offset 7.5 50-Hz Rejection CalDiffOffset(18) Diff Offset 2.5 50-Hz Rejection Table 60.
-
Section 8. Operation Table 60. Calibrate() Instruction Results Array Cal() Element Descriptions of Array Elements Differential (Diff) Single-Ended (SE) 27 Typical Value Offset or Gain ±mV Input Range Integration Gain 250 60-Hz Rejection -0.067 mV/LSB 28 SE Offset 25 60-Hz Rejection ±5 LSB 29 Diff Offset 25 60-Hz Rejection ±5 LSB Gain 25 60-Hz Rejection -0.0067 mV/LSB 30 31 SE Offset 7.5 60-Hz Rejection ±10 LSB 32 Diff Offset 7.5 60-Hz Rejection ±10 LSB Gain 7.
-
Section 8. Operation 1 A/D (analog-to-digital) conversion time = 15 µs 2 Reps/No Reps -- If Reps > 1 (i.e., multiple measurements by a single instruction), no additional time is required. If Reps = 1 in consecutive voltage instructions, add 15 µs per instruction. 8.1.3 Resistance Measurements Many sensors detect phenomena by way of change in a resistive circuit. Thermistors, strain gages, and position potentiometers are examples. Resistance measurements are special-case voltage measurements.
-
Section 8. Operation Table 61.
-
Section 8. Operation Table 61. Resistive-Bridge Circuits with Voltage Excitation Resistive-Bridge Type and Circuit Diagram CRBasic Instruction and Fundamental Relationship Relationships 1 Key: Vx = excitation voltage; V1, V2 = sensor return voltages; Rf = "fixed", "bridge" or "completion" resistor; Rs = "variable" or "sensing" resistor. 2 Where X = result of the CRBasic bridge measurement instruction with a multiplier of 1 and an offset of 0. 3 See the appendix Resistive Bridge Modules (p.
-
Section 8. Operation Other sensors, e.g., LVDTs (linear variable differential transformers), require an ac excitation because they rely on inductive coupling to provide a signal. dc excitation will provide no output. CR800 bridge measurements can reverse excitation polarity to provide ac excitation and avoid ion polarization. Note Sensors requiring ac excitation require techniques to minimize or eliminate ground loops. See Ground Looping in Ionic Measurements (p. 91). 8.1.3.
-
Section 8. Operation • Effects due to the following are not included in the specification: o Bridge-resistor errors o Sensor noise o Measurement noise The ratiometric-accuracy specification is applied to a three-wire half-bridge measurement that uses the BrHalf() instruction as follows: The relationship defining the BrHalf() instruction is X = V1/Vx, where V1 is the voltage measurement and Vx is the excitation voltage. The estimated accuracy of X is designated as ∆X, where ∆X = ∆V1/Vx.
-
Section 8. Operation 8.1.3.3 Strain Calculations Read More! The FieldCalStrain() Demonstration Program (p. 154) section has more information on strain calculations. A principal use of the four-wire full bridge is the measurement of strain gages in structural stress analysis. StrainCalc() calculates microstrain, με, from an appropriate formula for the particular strain bridge configuration used. All strain gages supported by StrainCalc() use the full-bridge schematic.
-
Section 8. Operation Table 63. StrainCalc() Instruction Equations StrainCalc() BrConfig Code Configuration Full-bridge strain gage. Half the bridge has two gages parallel to + and , and the other half to and + : - 6 where: • : Poisson's Ratio (0 if not applicable) • GF: Gage Factor • Vr: 0.001 (Source-Zero) if BRConfig code is positive (+) • Vr: -0.
-
Section 8. Operation instruction. PulseCount() instruction functions include returning counts or frequency on frequency or switch-closure signals. TimerIO() instruction has additional capabilities. Its primary function is to measure the time between state transitions. Note Consult CRBasic Editor Help for more information on PulseCount() and TimerIO() instructions.
-
Section 8. Operation Table 64.
-
Section 8. Operation Figure 94: Pulse-input channels 8.1.5.1.1 High-frequency Pulse (P1 - P2) High-frequency pulse inputs are routed to an inverting CMOS input buffer with input hysteresis. The CMOS input buffer is an output zero level with its input ≥ 2.2 V, and an output one level with its input ≤ 0.9 V. When a pulse channel is configured for high-frequency pulse, an internal 100-kΩ pull-up resistor to 5 Vdc on the P1 or P2 input is automatically employed.
-
Section 8. Operation 8.1.5.2 Pulse Input on Digital I/O Channels C1 - C4 Digital I/O channels C1 – C4 can be used to measure pulse inputs between -8.0 and +16 Vdc. Low frequency mode (<1 kHz) allows for edge timing and measurement of period and frequency. High-frequency mode (up to 400 kHz) allows for edge counting only. Switch-closure mode enables measurement of drycontact switch closures up to 150 Hz. Digital I/O channels can be programmed with either PulseCount() or TimerIO() instructions.
-
Section 8. Operation 8.1.5.2.2 Low-Frequency Mode Low-frequency mode enables edge timing and measurement of period (not period averaging) and frequency. For information on period averaging, see Period Averaging (p. 307). Edge Timing (C1 - C4) Time between pulse edges can be measured. Results can be expressed in terms of microseconds or Hertz. To read more concerning edge timing, refer to CRBasic Editor Help for the TimerIO() instruction. Edge-timing resolution is approximately .
-
Section 8. Operation Figure 95: Connecting switch closures to digital I/O Using a pull-up resistor on digital I/O channels C1 - C4 8.1.5.3.
-
Section 8. Operation R = Timing resolution of the TimerIO() measurement = P = Period of input signal (seconds). For example, P = 1 / 1000 Hz = 0.001 s E = Number of rising edges per scan or 1, whichever is greater. Table 65. Example. E for a 10 Hz input signal Scan Rising Edge / Scan E 5.0 50 50 0.5 5 5 0.05 0.5 1 TimerIO() instruction measures frequencies of ≤ 1 kHz with higher frequency resolution over short (sub-second) intervals.
-
Section 8. Operation frequency is not varying over the execution interval. The calculation returns the average regardless of how the signal is changing. 8.1.5.4 Pulse Measurement Problems 8.1.5.4.1 Pay Attention to Specifications The table Example of Differing Specifications for Pulse Input Channels (p. 305) compares specifications for pulse-input channels to emphasize the need for matching the proper device to application. Take time to understand signals to be measured and compatible channels. Table 67.
-
Section 8. Operation Table 68. Time Constants (τ) Measurement τ Pulse channel, low-level ac mode See table Filter Attenuation of Frequency Signals (p. 306) footnote Digital I/O, high-frequency mode 0.025 Digital I/O, switch-closure mode 0.025 Table 69. Filter Attenuation of Frequency Signals. As shown for low-level ac inputs, increasing voltage is required at increasing frequencies to overcome filter attenuation on pulse-input channels*.
-
Section 8. Operation 8.1.5.4.3 Switch Bounce and NAN NAN will be the result of a TimerIO() measurement if one of two conditions occurs: 1. timeout expires 2. a signal on the channel is too fast (> 3 KHz) When the input channel experiences this type of signal, the CR800 operating system disables the interrupt that is capturing the precise time until the next scan is serviced. This is done so that the CR800 does not get bogged down in interrupts.
-
Section 8. Operation Figure 97: Input conditioning circuit for period averaging 8.1.7 SDI-12 Recording Read More! SDI-12 Sensor Support (p. 173) and Serial Input / Output (p. 487). SDI-12 is a communications protocol developed to transmit digital data from smart sensors to data-acquisition units. It is a simple protocol, requiring only a single communication wire. Typically, the data-acquisition unit also supplies power (12 Vdc and ground) to the SDI-12 sensor.
-
Section 8. Operation Figure 98: Circuit to limit control port input to 5 Vdc 8.1.9 Field Calibration Read More! Field Calibration of Linear Sensors (FieldCal) (p. 151) has complete information. Calibration increases accuracy of a measurement device by adjusting its output, or the measurement of its output, to match independently verified quantities. Adjusting a sensor output directly is preferred, but not always possible or practical.
-
Section 8. Operation 8.1.10.3 RS-232 Sensors RS-232 sensor cable lengths should be limited to 50 feet. 8.1.10.4 SDI-12 Sensors The SDI-12 standard allows cable lengths of up to 200 feet. Campbell Scientific does not recommend SDI-12 sensor lead lengths greater than 200 feet; however, longer lead lengths can sometimes be accommodated by increasing the wire gage or powering the sensor with a second 12-Vdc power supply placed near the sensor. 8.1.
-
Section 8. Operation which is the resolution used by PakBus clock-sync functions. In networks without routers, repeaters, or retries, the communication time will cause an additional error (typically a few 10s of milliseconds). PakBus clock commands set the time at the end of a scan to minimize the chance of skipping a record to a data table. This is not the same clock check process used by LoggerNet as it does not use average round trip calculations to try to account for network connection latency. 4.
-
Section 8. Operation 8.2.1 Analog-Input Expansion Modules Mechanical relay and solid-state relay multiplexers are available to expand the number of analog sensor inputs. Multiplexers are designed for single-ended, differential, bridge-resistance, or thermocouple inputs. 8.2.2 Pulse-Input Expansion Modules Pulse-input expansion modules are available for switch-closure, state, pulse-count and frequency measurements, and interval timing. 8.2.
-
Section 8. Operation Figure 100: Control port current sourcing 8.2.4.2 Relays and Relay Drivers Several relay drivers are manufactured by Campbell Scientific. For more information, see the appendix Relay Drivers (p. 541), contact a Campbell Scientific applications engineer, or go to www.campbellsci.com. Compatible, inexpensive, and reliable single-channel relay drivers for a wide range of loads are available from various electronic vendors such as Crydom, Newark, Mouser, etc. 8.2.4.
-
Section 8. Operation Figure 101: Relay driver circuit with relay Figure 102: Power switching without relay 8.2.5 Analog Control / Output Devices The CR800 can scale measured or processed values and transfer these values in digital form to an analog output device. The analog output device performs a digital-to-analog conversion to output an analog voltage or current. The output level is maintained until updated by the CR800. Refer to the appendix Continuous Analog Output (CAO) Modules (p.
-
Section 8. Operation 8.2.6 TIMs Terminal Input Modules (TIMs) are devices that provide simple measurementsupport circuits in a convenient package. TIMs include voltage dividers for cutting the output voltage of sensors to voltage levels compatible with the CR800, modules for completion of resistive bridges, and shunt modules for measurement of analog-current sensors. Refer to the appendix Signal Conditioners (p. 539) for information concerning available TIM modules. 8.2.
-
Section 8. Operation Table 70. CR800 Memory Allocation Memory Comments Sector Internal battery-backed See table CR800 SRAM Memory (p. 317) for detail. 1 SRAM 4 MB* Internal Flash 2 Operating system 2 MB Internal Serial Flash 3 12 kB: Device Settings 500 kB: CPU: drive External Flash (Optional) 2 GB: USB: drive Device Settings — A backup of settings such as PakBus address, station name, beacon intervals, neighbor lists, etc. Rebuilt when a setting changes.
-
Section 8. Operation Table 71. CR800 SRAM Memory Use Static Memory ---------------------------------Operating Settings and Properties ---------------------------------CRBasic Program Operating Memory ---------------------------------Variables & Constants ---------------------------------Final-Storage Data Tables Comments Operational memory used by the operating system regardless of the user program. This sector is rebuilt at power-up, program re-compile, and watchdog events. "Keep" memory.
-
Section 8. Operation 8.3.1.1 Data Storage Data-storage drives are listed in table CR800 Memory Drives (p. 318). Data-table SRAM and the CPU: drive are automatically partitioned for use in the CR800. The USR: drive can be partitioned as needed. The USB: drive is automatically partitioned when a Campbell Scientific mass-storage device is connected. Table 72. Data-Storage Drives Drive Recommended File Types 1 cr8, .CAL 2 USR: cr8, .CAL USB: .
-
Section 8. Operation size of USR: is the total RAM size less 400 kB; i.e., for a CR800 with 4-MB memory, the maximum size of USR: is about 3.6 MB. 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 changed manually using the external keyboard / display or by loading a program with a different USR: size entered in a SetStatus() instruction.
-
Section 8. Operation Instruction Data-File Formats (p. 320) lists available formats. For a format to be compatible with datalogger support software (p. 76) graphing and reporting tools, header, timestamps, and record numbers are usually required. Fully compatible formats are indicated with an asterisk. A more detailed discussion of data file formats is available in the Campbell Scientific publication LoggerNet Instruction Manual available at www.campbellsci.com. Table 73.
-
Section 8. Operation Data-File Format Examples TOB1 TOB1 files may contain an ASCII header and binary data. The last line in the example contains cryptic text which represents binary data. Example: "TOB1","11467","CR1000","11467","CR1000.Std.20","CPU:file format.CR1","61449","Test" "SECONDS","NANOSECONDS","RECORD","battfivoltfiMin","PTemp" "SECONDS","NANOSECONDS","RN","","" "","","","Min","Smp" "ULONG","ULONG","ULONG","FP2","FP2" }Ÿp' E1HŒŸp' E1H›Ÿp' E1HªŸp' E1H¹Ÿp' E1H TOA5 TOA5 files contain ASCII (p.
-
Section 8. Operation CSIJSON CSIJSON files contain header information and data in a JSON format. Example: "signature": 38611,"environment": {"stationfiname": "11467","tablefiname": "Test","model": "CR1000","serialfino": "11467", "osfiversion": "CR1000.Std.21.03","progfiname": "CPU:file format.CR1"},"fields": [{"name": "battfivoltfiMin","type": "xsd:float", "process": "Min"},{"name": "PTemp","type": "xsd:float","process": "Smp"}]}, "data": [{"time": "2011-01-06T15:04:15","no": 0,"vals": [13.28,21.
-
Section 8. Operation empty string. There will be one descriptor for each field name given on Header Line 2. Record Element 1 – Timestamp Data without timestamps are usually meaningless. Nevertheless, the TableFile() instruction optionally includes timestamps in some formats. Record Element 2 – Record Number Record numbers are optionally provided in some formats as a means to ensure data integrity and provide an up‐count data field for graphing operations.
-
Section 8. Operation • Restores settings to default. • Initializes system variables. • Clears communications memory. Operating systems can also be sent using the program Send feature in datalogger support software (p. 76). Beginning with CR800 operating system v.16, settings and status are preserved when sending a subsequent operating system by this method; data tables are erased. Rely on this feature with caution, however, when sending an OS to CR800s in remote and difficult-to-access locations. 8.
-
Section 8. Operation Table 74. File-Control Functions File-Control Functions Accessed Through 2 Setting program file attributes. See File Attributes (p. 326) File Control , power-up with Campbell 5 Scientific mass-storage media (USB: drive) , 6 FileManage() instruction , web API FileControl Sending an OS to the CR800. Reset CR800 settings DevConfig , automatic with Campbell 5 Scientific mass-storage media (USB: drive) Sending an OS to the CR800.
-
Section 8. Operation 8.3.4.1 File Attributes A feature of program files is the file attribute. Table CR800 File Attributes (p. 326) lists available file attributes, their functions, and when attributes are typically used. For example, a program file sent via the support software Program Send command, runs a) immediately ("run now"), and b) when power is cycled on the CR800 ("run on power-up'). This functionality is invoked because Program Send sets two CR800 file attributes on the program file, i.e.
-
Section 8. Operation Table 76. Data-Preserve Options if "Preserve data if no table changed" if current program = overwritten program keep CPU data keep cache data else erase CPU data erase cache data end if end if if "erase data" erase CPU data erase cache data end if 8.3.4.3 External Memory Power-up Uploading a CR800 operating system (OS) file or user-program file in the field can be challenging, particularly during weather extremes.
-
Section 8. Operation • Formatting memory drives. • Deleting data files associated with the previously running program. Note Back in the old days of volatile RAM, life was frustrating, but simple. Lost power meant lost programs, variables, and data – a clean slate. The advent of nonvolatile memory has saved a lot of frustration in the field, but it requires thought in some applications.
-
Section 8. Operation • File = accompanying operating system or user program file. Name can be up to 22 characters long. • Device: the CR800 memory drive to which the accompanying operating system or user program file is copied (usually CPU:). If left blank or with an invalid option, default device will be CPU:. Use the same drive designation as the transporting external device if the preference is to not copy the file. Table 77. Powerup.
-
Section 8. Operation Example Power-up.ini Files Powerup.ini Example 'Code format and syntax 'Command = numeric power-up command 'File = file associated with the action 'Device = device to which File is copied. Defaults to CPU: 'Command,File,Device 13,Write2CRD_2.cr1,cpu: Powerup.ini Example 'Copy program file pwrup.cr1 from the external drive to CPU: 'File will run only when CR800 powered-up later. 2,pwrup.cr1,cpu: Powerup.ini Example 'Format the USR: drive 5,,usr: ' Powerup.
-
Section 8. Operation 8.3.5 File Names The maximum size of the file name that can be stored, run as a program, or FTP transferred in the CR800 is 59 characters. If the name is longer than 59 characters, an Invalid Filename error is displayed. If several files are stored, each with a long filename, memory allocated to the root directory can be exceeded before the actual memory of storing files is exceeded. When this occurs, an "insufficient resources or memory full" error is displayed. 8.3.
-
Section 8. Operation Table 78.
-
Section 8. Operation 8.4.1 Hardware and Carrier Signal Campbell Scientific supplies or recommends a wide range of telecommunications hardware. Table CR800 Telecommunications Options (p. 333) lists telecommunications destination, device, path, and carrier options which imply certain types of hardware for use with the CR800 datalogger. Information in table CR800 Telecommunications Options (p. 333) is conceptual.
-
Section 8. Operation allows multiple PCs to communicate with the CR800 simultaneously when proper telecommunications networks are installed. Typically, the PC initiates telecommunications with the CR800 via datalogger support software (p. 547). However, some applications require the CR800 to call back the PC (initiate telecommunications). This feature is called Callback. Special features exclusive to LoggerNet (p. 547) enable the PC to receive calls from the CR800.
-
Section 8. Operation 8.5.1 PakBus Addresses CR800s are assigned PakBus® address 1 as a factory default. Networks with more than a few stations should be organized with an addressing scheme that guarantees unique addresses for all nodes. One approach, demonstrated in figure PakBus Network Addressing (p. 336) , is to assign single-digit addresses to the first tier of nodes, double-digit to the second tier, triple-digit to the third, etc. Note that each node on a branch starts with the same digit.
-
Section 8. Operation Figure 103: PakBus network addressing LoggerNet is configured by default as a router and can route datalogger- todatalogger communications. Table 80.
-
Section 8. Operation Table 80. PakBus Leaf-Node and Router Device Configuration Network Device Description PakBus Leaf Node PakBus Router PakBus Aware SC932A Serial interface • COM220 Telephone modem • COM310 Telephone modem • SRM-5A Short-haul modem • Transparent 1 This network link is not compatible with CR800 datalogger. 8.5.3 Linking PakBus Nodes: Neighbor Discovery New terms (see Nodes: Leaf Nodes and Routers (p.
-
Section 8. Operation 8.5.3.3 Hello-request (one-way broadcast) All nodes hearing a hello-request broadcast (existing and potential neighbors) will issue a hello-message to negotiate or re-negotiate a neighbor relationship with the broadcasting node. 8.5.3.4 Neighbor Lists PakBus® devices in a network can be configured with a neighbor list. The CR800 sends out a hello-message to each node in the list whose CVI has expired at a random interval1.
-
Section 8. Operation 8.5.4 PakBus Troubleshooting Various tools and methods have been developed to assist in troubleshooting PakBus® networks. 8.5.4.1 Link Integrity With beaconing or neighbor-filter discovery, links are established and verified using relatively small data packets (hello-messages). When links are used for regular telecommunications, however, longer messages are used.
-
Section 8. Operation than one hop away. Table PakBus Link-Performance Gage (p. 340) provides a linkperformance gage. Table 81. PakBus Link-Performance Gage 500 byte Pings Sent Successes Link Status 10 10 excellent 10 9 good 10 7-8 adequate 10 <7 marginal 8.5.4.3 Traffic Flow Keep beacon intervals as long as possible with higher traffic (large numbers of nodes and / or frequent data collection). Long beacon intervals minimize collisions with other packets and resulting retries.
-
Section 8. Operation 8.5.6 PakBus LAN Example To demonstrate PakBus® networking, a small LAN (Local Area Network) of CR800s can be configured as shown in figure Configuration and Wiring of PakBus LAN (p. 341). A PC running LoggerNet uses the RS-232 port of the first CR800 to communicate with all CR800s. All LoggerNet functions, such as send programs, monitor measurements and collect data, are available to each CR800.
-
Section 8. Operation 8.5.6.2 LAN Setup Configure CR800s before connecting them to the LAN: 1. Start Device Configuration Utility (DevConfig). Click on Device Type: CR800. Follow on-screen instructions to power CR800s and connect them to the PC. Close other programs that may be using the PC COM port, such as LoggerNet, PC400, PC200W, HotSync, etc. 2. Click on the Connect button at the lower left. 3.
-
Section 8.
-
Section 8. Operation Table 82. PakBus-LAN Example Datalogger-Communications Settings Software→ Device Configuration Utility (DevConfig) Tab→ Deployment Sub-Tab→ Datalogger Setting→ PakBus Adr Sub-Setting→ Advanced ComPort Settings COM1 Is Router COM2 Baud Rate Neighbors Datalogger ↓ 1 Baud Rate Begin: End: CR800_1 1 115.2K Fixed 2 2 115.2K Fixed CR800_2 2 115.2K Fixed 1 1 Disabled CR800_3 3 115.2K Fixed 1 1 115.2K Fixed CR800_4 4 115.
-
Section 8. Operation Figure 111: LoggerNet Network-Map Setup: PakBusPort As shown in figure LoggerNet Device Map Setup: PakBusPort (p. 345), set the PakBusPort maximum baud rate to 115200. Leave other settings at the defaults.
-
Section 8. Operation As shown in figure LoggerNet Device-Map Setup: Dataloggers (p. 345), set the PakBus® address for each CR800 as listed in table PakBus-LAN Example Datalogger-Communications Settings (p. 344). 8.5.7 PakBus Encryption PakBus encryption allows two end devices to exchange encrypted commands and data. Routers and other leaf nodes do not need to be set for encryption. The CR800 has a setting accessed through DevConfig that sets it to send / receive only encrypted commands and data.
-
Section 8. Operation Note Setting the encryption key for a PakBus port device will force all messages it sends to use encryption. 8.6 Alternate Telecommunications The CR800 communicates with datalogger support software (p. 76) and other Campbell Scientific dataloggers (p. 541) using the PakBus (p. 438) protocol (PakBus Overview (p. 334) ). Modbus, DNP3, and Web API are also supported. CAN bus is supported when using the Campbell Scientific SDM-CAN communications module. 8.6.1 DNP3 8.6.1.
-
Section 8. Operation Table 83. DNP3 Implementation — Data Types Required to Store Data in Public Tables for Object Groups Data Type Group Description Boolean 1 Binary input 2 Binary input change 10 Binary output 12 Control block 30 Analog input 32 Analog change event 40 Analog output status 41 Analog output block 50 Time and date 51 Time and date CTO Long 8.6.1.2.2 CRBasic Instructions Complete descriptions and options of commands are available in CRBasic Editor Help.
-
Section 8. Operation Syntax DNPUpdate (DNPSlaveAddr,DNPMasterAddr) 8.6.1.2.3 Programming for Data-Acquisition As shown in CRBasic example Implementation of DNP3 (p. 349), program the CR800 to return data when polled by the DNP3 master using the following three actions: 1. Place DNP() at the beginning of the program between BeginProg and Scan(). Set COM port, baud rate, and DNP3 address. 2. Setup the variables to be sent to the master using DNPVariable().
-
Section 8. Operation 'Object group 30, variation 2 is used to return analog data when the CR800 'is polled. Flag is set to an empty 8 bit number(all zeros), DNPEvent is a 'reserved parameter and is currently always set to zero. Number of events is 'only used for event data.
-
Section 8. Operation 8.6.2.2 Terminology Table Modbus to Campbell Scientific Equivalents (p. 351) lists terminology equivalents to aid in understanding how CR800s fit into a SCADA system. Table 84.
-
Section 8. Operation RTU / PLC Remote Telemetry Units (RTUs) and Programmable Logic Controllers (PLCs) were at one time used in exclusive applications. As technology increases, however, the distinction between RTUs and PLCs becomes more blurred. A CR800 fits both RTU and PLC definitions. 8.6.2.3 Programming for Modbus 8.6.2.3.1 Declarations Table CRBasic Ports, Flags, Variables, and Modbus Registers (p. 352) shows the linkage between CR800 ports, flags and Boolean variables and Modbus registers.
-
Section 8. Operation Syntax MoveBytes(Dest, DestOffset, Source, SourceOffset, NumBytes) 8.6.2.3.3 Addressing (ModbusAddr) Modbus devices have a unique address in each network. Addresses range from 1 to 247. Address 0 is reserved for universal broadcasts. When using the NL100, use the same number as the Modbus and PakBus® address. 8.6.2.3.4 Supported Function Codes (Function) Modbus protocol has many function codes. CR800 commands support the following. Table 86.
-
Section 8. Operation 8.6.2.5 Modbus over IP Modbus over IP functionality is an option with the CR800. Contact Campbell Scientific for details. 8.6.2.6 Modbus tidBytes Q: Can Modbus be used over an RS‐232 link, 7 data bits, even parity, one stop bit? A: Yes. Precede ModBusMaster() / ModBusSlave() with SerialOpen() and set the numeric format of the COM port with any of the available formats, including the option of 7 data bits, even parity.
-
Section 8. Operation Scan(1,Sec,0,0) 'In the case of the CR800 being the ModBus master then the 'ModbusMaster instruction would be used (instead of fixing 'the variables as shown between the BeginProg and SCAN instructions). ModbusMaster(Result,COMRS232,-115200,5,3,Register(),-1,2,3,100) 'MoveBytes(DestVariable,DestOffset,SourceVariable,SourceOffSet, 'NumberOfBytes) MoveBytes(Combo,2, Register_LSW,2,2) MoveBytes(Combo,0, Register_MSW,2,2) NextScan EndProg 8.6.
-
Section 8. Operation Four levels of access are available through Basic Access Authentication: • all access denied (Level 0) • all access allowed (Level 1) • set variables allowed (Level 2) • read-only access (Level 3) Multiple user accounts and security levels can be defined. .csipasswd is created and edited in the Device Configuration Utility (DevConfig) (p. 92) software Net Services tab, Edit .csipasswd File button. When in Datalogger .
-
Section 8. Operation and arguments and the commands wherein they are used. Parameters and arguments for specific commands are listed in the following sections. Table 87.
-
Section 8. Operation p2 DataQuery Specifies ending date and/or time when using date-range argument. time expressed in defined format (see Time Syntax (p. 358) section) value SetValueEx Specifies the new value. numeric or string time ClockSet Specifies set time. time in defined format action FileControl Specifies FileControl action. 1 through 20 file FileControl Specifies first argument of FileControl action.
-
Section 8. Operation Table 88. BrowseSymbols API Command Parameters uri Optional. Specifies the URI (p. 447) for the data source. When querying a CR800, uri source, tablename and fieldname are optional. If source is not specified, dl (CR800) is assumed. A field name is always specified in association with a table name. If the field name is not specified, all fields are output. If fieldname refers to an array without a subscript, all fields associated with that array will be output.
-
Section 8. Operation is_read_only Boolean value that is set to true if the symbol is considered to be read-only. A value of false would indicate an expectation that the symbol value can be changed using the SetValueEx command. can_expand Boolean value that is set to true if the symbol has child values that can be listed using the BrowseSymbols command. If the client specifies the URI for a symbol that does not exist, the server will respond with an empty symbols set.
-
Section 8. Operation
BallastLine | dl:BallastLine | 6 | true | false | true | Public | dl:Public | 6 | true | fals e | true |