CR1000 Measurement and Control System 1/08 C o p y r i g h t © 2 0 0 0 - 2 0 0 8 C a m p b e l l S c i e n t i f i c , I n c .
Warranty and Assistance The CR1000 MEASUREMENT AND CONTROL SYSTEM is warranted by CAMPBELL SCIENTIFIC, INC. to be free from defects in materials and workmanship under normal use and service for thirty-six (36) months from date of shipment unless specified otherwise. Batteries have no warranty. CAMPBELL SCIENTIFIC, INC.'s obligation under this warranty is limited to repairing or replacing (at CAMPBELL SCIENTIFIC, INC.'s option) defective products.
CR1000 Table of Contents PDF viewers note: These page numbers refer to the printed version of this document. Use the Adobe Acrobat® bookmarks tab for links to specific sections. 1. Introduction ...............................................................1-1 2. Quickstart Tutorial ....................................................2-1 2.1 Primer - CR1000 Data Acquisition ...................................................... 2-1 2.1.1 Components of a Data Acquisition System .............................
CR1000 Table of Contents 3.1.7 Security...................................................................................... 3-10 3.1.8 Care and Maintenance ............................................................... 3-10 3.1.8.1 Protection from Water ..................................................... 3-10 3.1.8.2 Protection from Voltage Transients................................. 3-11 3.1.8.3 Calibration....................................................................... 3-11 3.1.8.
CR1000 Table of Contents 5. Measurement and Control Peripherals ...................5-1 5.1 5.2 5.3 5.4 Analog Input Expansion ....................................................................... 5-1 Pulse Input Expansion Modules ........................................................... 5-1 Serial Input Expansion Modules........................................................... 5-1 Control Output...................................................................................... 5-1 5.4.
CR1000 Table of Contents 9.3 Writing CR1000 Programs ................................................................... 9-1 9.3.1 Short Cut Editor and Program Generator.................................... 9-2 9.3.2 CRBASIC Editor......................................................................... 9-2 9.3.3 Transformer ................................................................................. 9-3 9.4 Numerical Formats ..............................................................................
CR1000 Table of Contents 10.4 Program Control Instructions ........................................................... 10-7 10.4.1 Common Controls ................................................................... 10-7 10.4.2 Advanced Controls.................................................................. 10-9 10.5 Measurement Instructions .............................................................. 10-10 10.5.1 Diagnostics............................................................................
CR1000 Table of Contents 11.1.5 FieldCal() Demonstration Programs........................................ 11-3 11.1.5.1 Zero (Option 0) .............................................................. 11-3 11.1.5.2 Offset (Option 1)............................................................ 11-5 11.1.5.3 Two Point Slope and Offset (Option 2) ......................... 11-6 11.1.5.4 Two Point Slope Only (Option 3).................................. 11-8 11.1.6 FieldCalStrain() Demonstration Program.............
CR1000 Table of Contents 12. Memory and Data Storage ....................................12-1 12.1 Internal SRAM ................................................................................. 12-4 12.2 CompactFlash® (CF) ........................................................................ 12-4 12.3 Memory Drives................................................................................. 12-5 12.3.1 CPU: .......................................................................................
CR1000 Table of Contents 15.2.4 Troubleshooting....................................................................... 15-6 15.2.5 Modbus over IP with NL115................................................... 15-6 15.2.6 Modbus Slave over IP with NL100 ......................................... 15-6 15.2.6.1 Configuring the NL100.................................................. 15-6 15.2.6.2 Configuring the CR1000.............................................. 15-10 Section 16. Support Software..............
CR1000 Table of Contents 19.4.3 Diagnosis and Fix Procedures ................................................. 19-7 19.4.3.1 Battery Voltage Test ..................................................... 19-7 19.4.3.2 Charging Circuit Test — Solar Panel............................ 19-8 19.4.3.3 Charging Circuit Test — Transformer .......................... 19-9 19.4.3.4 Adjusting Charging Circuit Voltage ........................... 19-10 962H 396H 963H Appendices A. Glossary..................................
CR1000 Table of Contents 4.5-1. Schematic of a Pulse Sensor on a CR1000 ..................................... 4-30 4.5-2. Pulse Input Types ........................................................................... 4-31 4.5-3. Amplitude reduction of pulse-count waveform before and after 1 μs time constant filter........................................................... 4-31 4.6-1. Input conditioning circuit for low-level and high level period averaging. ....................................................
CR1000 Table of Contents Tables 4.1-1. Current Sourcing Limits ................................................................... 4-2 4.2-1. CRBASIC Parameters Varying Measurement Sequence and Timing....................................................................................... 4-3 4.2-2. Analog Voltage Input Ranges with Options for Open Input Detect (OID) and Pull into Common Mode (PCM). ................. 4-4 4.2-3. Analog Measurement Offset Voltage Compensation ....................... 4-6 4.2-4.
CR1000 Table of Contents 16.5-2. LoggerNet Clients (require, but do not include, the LoggerNet Server)................................................................... 16-2 18.4-1. CR1000 Lithium Battery Specifications ....................................... 18-2 19.1-1. Math Expressions and CRBASIC Results .................................... 19-4 19.1-2. Variable and FS Data Types with NAN and ±INF ....................... 19-4 B-1. Common Uses of the Status Table ........................................
CR1000 Table of Contents 12.6-5. 12.6-6. 12.6-7. 15.1-1. 15.2-1. 19.1-1. Run Program from CRD: drive................................................... 12-12 Run Program Always, Erase CF data. ........................................ 12-12 Run Program Now, Erase CF data.............................................. 12-12 CRBASIC Code. Implementation of DNP3. ............................... 15-1 CRBASIC Code Example: Modbus Slave.................................. 15-10 Using NAN in an Expressions...........
CR1000 Table of Contents xiv
Section 1. Introduction 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 CR1000 are defined by our customers.
Section 1. Introduction This is a blank page.
Section 2. Quickstart Tutorial Quickstart tutorial gives a cursory look at CR1000 data acquisition. 2.1 Primer - CR1000 Data Acquisition Data acquisition with the CR1000 is the result of a step wise procedure involving the use of electronic sensor technology, the CR1000, a telecommunications link, and PC datalogger support software. 2.1.1 Components of a Data Acquisition System CR1000s are only one part of a data acquisition system.
Section 2. Quickstart Tutorial On-site serial communications are preferred if the datalogger is near the PC, and the PC can dedicate a serial (COM) port for the datalogger. On-site methods such as direct serial connection or infrared link are also used when the user visits a remote site with a laptop or PDA. In contrast, telecommunications provide remote access and the ability to discover problems early with minimum data loss.
Section 2.
Section 2. Quickstart Tutorial 2.1.6 Analog Sensors Analog sensors output continuous voltages that vary with the phenomena measured. Analog sensors connect to analog terminals. Analog terminals are configured as single-ended (measured with respect to ground) or differential (high input measured with respect to the low input of a channel pair (FIGURE 2.1-3)). Analog channels are configured individually as 8 differential or 16 single ended Channels (FIGURE 2.1-2).
Section 2. Quickstart Tutorial 3 H 2 L 4 Sensor Wired to Single-Ended Channel #2 Sensor H 1 1 L 2 + DIFF SE - L H 3 2 4 Sensor Wired to Differential Channel #1 L Sensor H 1 1 2 - DIFF SE + FIGURE 2.1-3.
Section 2. Quickstart Tutorial 2.1.7 Bridge Sensors Bridge sensors change resistance with respect to environmental change. Resistance is determined by measuring the difference between the excitation voltage supplied to the bridge by the CR1000 and the voltage detected by the CR1000 returning from the bridge. The CR1000 supplies a precise excitation voltage via excitation terminals. Return voltage is measured on analog terminals (FIGURE 2.1-4).
Section 2. Quickstart Tutorial 2.1.8 Pulse Sensors The CR1000 can measure switch closures, low-lever AC signals (waveform breaks zero volts), or voltage pulses (±20 VDC) on pulse channels (FIGURE 2.1-5 and FIGURE 2.1-6). Period averaging sensors are connected to single-ended analog channels. P1 P2 FIGURE 2.1-5. Pulse Input Types EX1 Sensor FIGURE 2.1-6. Anemometer Wired to Pulse Channel #1 2.1.
Section 2. Quickstart Tutorial Digital I/O Ports Used to Control/Monitor Pump 110 VAC CR10 C1 G ACL1 Line Monitor Pump C2 G C1 - Used as input to monitor pump status. C2 - Used as output to switch power to a pump via a solid state relay. FIGURE 2.1-7. Control and Monitoring of a Device using Digital I/O Ports 2.1.10 RS-232 Sensors RS-232 sensors can be connected to either the 9-pin RS-232 port or digital I/O port pairs.. FIGURE 2.1-8 illustrates use of RS-232 or digital I/O ports. FIGURE 2.1-8.
Section 2. Quickstart Tutorial 2.2 Hands-on Exercise – Measuring a Thermocouple This tutorial is a stepwise procedure for configuring a CR1000 to make a simple thermocouple measurement and send the resulting data to a PC. Discussions include programming, real-time data monitoring, collecting data, and viewing data. Principles discussed are applicable to all CR1000 applications. 2.2.1 Connections to the CR1000 Connect power and RS-232 cables to the CR1000 as illustrated in FIGURE 2.2-1.
Section 2. Quickstart Tutorial 2.2.2 PC200W Software Obtain and install PC200W. PC200W is available on the Campbell Scientific Resource CD or at www.campbellsci.com. When PC200W is first opened, the EZSetup Wizard is launched. Click the Next button and follow the prompts to select the CR1000, the COM port on the computer that will be used for communications, 115200 baud, and PakBus Address 1. When prompted with the option to Test Communications, click the Finish button.
Section 2. Quickstart Tutorial Historical Note: In the space race era, a field thermocouple measurement was a complicated and cumbersome process incorporating thermocouple wire with three junctions, a micro-volt meter, a vacuum flask filled with an ice slurry, and a thick reference book. One thermocouple junction connected to the μV meter, another sat in the vacuum flask, and the third was inserted into the location of the temperature of interest.
Section 2. Quickstart Tutorial Use the Help in conjunction with the steps outlined below: Step 1: Open a new or existing file. NOTE The first time Short Cut is run, a prompt asks for a choice of “AC Noise Rejection.” If the CR1000 will be used in the United States, choose “60 Hz”; many other countries use “50 Hz” power mains systems. A second prompt asks for a choice of “Sensor Support.” Choose “Campbell Scientific, Inc.” On the “1. New/Open” page, click [New Program].
Section 2. Quickstart Tutorial FIGURE 2.2-4. Short Cut Sensors Page Click on Wiring Diagram to view the sensor wiring diagram, as shown in FIGURE 2.2-5. Wire the Type T Thermocouple (provided) to the CR1000 as shown on the diagram. Click on 3. Outputs to continue with Step 3. FIGURE 2.2-5.
Section 2. Quickstart Tutorial Step 3: Data Storage Output Processing. The Outputs page has a list of Selected Sensors to the left, and data storage Tables to the right as shown in FIGURE 2.2-6. Two Tables, Table1 and Table2, are available by default. Both Tables have a Store Every field and a list box to select time units. These are used to set the interval at which data will be stored. FIGURE 2.2-6.
Section 2. Quickstart Tutorial Click the Summary tab and / or Print buttons to view and print the summaries. Click the X button to exit the Short Cut window. FIGURE 2.2-7. Short Cut Finish Page 2.2.2.2 Connecting to the Datalogger From the PC200W Clock / Program tab, click on the Connect button to establish communications with the CR1000 (FIGURE 2.2-8). When communications have been established, the text on the button will change to Disconnect. Connect Button FIGURE 2.2-8.
Section 2. Quickstart Tutorial 2.2.2.3 Synchronizing the Clocks Click the Set Clock button to synchronize the datalogger’s clock with the computer’s clock. 2.2.2.4 Sending the Program Click the Send Program button. Navigate to the C:\CampbellSci\SCWin folder and select the file QED.CR1 and click the Open button. A progress bar is displayed, followed by a message that the program was successfully sent. 2.2.2.5 Monitoring Data Tables The Monitor Data window (FIGURE 2.
Section 2. Quickstart Tutorial FIGURE 2.2-10. PC200W Collect Data Tab 2.2.2.7 Viewing Data To view the collected data, click on the View button (located in the upper right-central portion of the main screen). Options are accessed by using the menus or by selecting the toolbar icons. Move and hold the mouse over a toolbar icon for a few seconds for a brief description of that icon's function. To open a data file, click the Open file icon (FIGURE 2.2-11), and double click on the file CR1000_OneMin.
Section 2. Quickstart Tutorial Open file Expand tabs FIGURE 2.2-11. PC200W View Data Utility Close the graph and view screens, and close PC200W.
Section 3. Overview 3.1 CR1000 Overview The CR1000 Datalogger is a precision instrument designed for demanding low-power measurement applications. CPU, analog and digital inputs, analog and digital outputs, and memory are controlled by the operating system in conjunction with the user program. The user program is written with CRBASIC, a programming language that includes data processing and analysis routines as well as a standard BASIC instruction set.
Section 3. Overview The CR1000 measures analog voltage and pulse signals, representing the magnitudes numerically. Numeric values are scaled to the unit of measure such as millivolts and pulses, or in user specified engineering units such as wind direction and wind speed. Measurements can be processed through calculations or statistical operations and stored in memory awaiting transfer to a PC via external storage or telecommunications.
Section 3. Overview Period Average: 16 channels (SE 1 -16) • Input voltage range: -2500 mV to +2500 mV. • Maximum frequency: 200 kHz Technical Note -- Pulse Count vs. Period Average Pulse count and period average measurements can both be used to measure sensors that output frequency. Yet pulse count and period average measurement methods are quite different, resulting in different characteristics for each type.
Section 3. Overview The CR1000 can be used as a PLC (programmable logic controller). Utilizing peripheral relays and analog output devices, the CR1000 can manage binary and variable control devices through the following output channels: Read more! See Section 5.4 Control Output. Continuous Analog Voltage Output: available by adding a peripheral analog output device available from Campbell Scientific.. Digital I/O: 8 channels (C1 - C8) configurable for pulse output duration.
Section 3. Overview Power Out Peripheral 12 V Power Source: 2 terminals (12V) and associated grounds (G) supply power to sensors and peripheral devices requiring nominal 12 VDC. This supply may drop as low as 9.6 VDC before datalogger operation stops. Precautions should be taken to minimize the occurrence of data from underpowered sensors. Peripheral 5 V Power Source: 1 terminal (5V) and associated ground (G) supply power to sensors and peripheral devices requiring regulated 5 VDC. 3.1.2.
Section 3. Overview 3.1.3 Power Requirements Read more! See Section 6 Power Supply. The CR1000 operates from a DC power supply with voltage ranging from 9.6 to 16 V, and is internally protected against accidental polarity reversal. The CR1000 has modest input power requirements. In low power applications, it can operate for several months on non-rechargeable batteries. Power systems for longer-term remote applications typically consist of a charging source, a charge controller, and a rechargeable battery.
Section 3. Overview Keyboard Display), or through datalogger support software (see Section 13 Support Software).. OS files are sent to the CR1000 with DevConfig, through the program Send button in datalogger support software, or with a CF card. When the OS is sent via DevConfig, most settings are cleared, whereas, when sent via datalogger support software, most settings are retained. 3.1.4.
Section 3. Overview 3.1.6 Communications Read more! See Section 13 Telecommunications and Data Retrieval. The CR1000 communicates with external devices to receive programs, send data, or act in concert with a network. The primary communication protocol is PakBus. Modbus and DNP3 communication protocols are also supported. 3.1.6.1 PakBus Read more! See Section 14 PakBus Overview.
Section 3. Overview 3.1.6.3 DNP3 Communication Read more! See Section 15.1 DNP3. The CR1000 supports DNP3 Slave communication for inclusion in DNP3 SCADA networks. 3.1.6.4 Keyboard Display Read more! See Section 17 CR1000KD: Using the Keyboard Display. The CR1000KD Keyboard Display is a powerful tool for field use.
Section 3. Overview 3.1.7 Security CR1000 applications may include collection of sensitive data, operation of critical systems, or networks accessible by many individuals. CR1000 security provides means by which partial or complete lock-out can be accomplished in the CRBASIC program code. Up to three levels of security can be set in the datalogger. Level 1 must be set before Level 2. Level 2 must be set before Level 3. If a level is set to 0, any level greater than it will also be set to 0 (e.g.
Section 3. Overview present; hydrogen gas generated by the batteries may build up to an explosive concentration. 3.1.8.2 Protection from Voltage Transients Read more! See Section 7 Grounding. The CR1000 must be grounded to minimize the risk of damage by voltage transients associated with power surges and lightning induced transients. Earth grounding is required to form a complete circuit for voltage clamping devices internal to the CR1000. 3.1.8.3 Calibration Read more! See Section 0 Self-Calibration.
Section 3. Overview 3-12 2. PC400 supports a variety of telecommunication options, manual data collection, and data monitoring displays. Short Cut, CRBASIC Editor, and Transformer Utility are included for creating CR1000 programs. PC400 does not support complex communication options, such as phoneto-RF, PakBus® routing, or scheduled data collection. 3. LoggerNet supports combined telecommunication options, customized data monitoring displays, and scheduled data collection.
Section 3. Overview 3.
Section 3.
Section 4. Sensor Support Several features give the CR1000 the flexibility to measure many sensor types. Contact a Campbell Scientific applications engineer if assistance is required to assess sensor compatibility. 4.1 Powering Sensors Read more! See Section 6 Power Supply. The CR1000 is a convenient source of power for sensors and peripherals requiring a 5 or 12 VDC source.
Section 4. Sensor Support 4.1.3 Continuous Unregulated (Nominal 12 Volt) Voltage on the 12 V terminals will change with CR1000 supply voltage. 4.1.4 Switched Unregulated (Nominal 12 Volt) Voltage on the SW-12 terminal will change with CR1000 supply voltage. Two CRBASIC instructions, SW12() and PortSet(), control the SW-12 terminal. Each is handled differently by the CR1000. SW12() is a processing task instruction.
Section 4. Sensor Support within the ±5000 mV common-mode input range of the amplifier. The amplifier cannot properly reject common-mode signals that fall outside of the ±5000 mV common-mode input range. See Section 16.2 for more information on common-mode range. NOTE Two sets of numbers are assigned to analog channels. For differential measurements, analog channels are numbered 1 - 8. Each differential channel as two inputs: high (H) and low (L).
Section 4. Sensor Support 4.2.2 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 CR1000 has six fixed input ranges for voltage measurements, along with an autorange option that enables the CR1000 to automatically determine the appropriate input voltage range for a given measurement. TABLE 4.
Section 4. Sensor Support AutoRange is recommended for a signal that occasionally exceeds a particular range, for example, a Type J thermocouple measuring a temperature usually less than 476 °C (±25 mV range) but occasionally as high as 500 °C (±250 mV range). AutoRange should not be used for rapidly fluctuating signals, particularly signals traversing several voltage ranges rapidly. The possibility exists that the signal can change ranges between the range check and the actual measurement.
Section 4. Sensor Support CR1000 measurement instructions incorporate techniques to cancel these unwanted offsets. TABLE 4.2-3 lists measurement instructions and offset voltage compensation options available to each. TABLE 4.2-3.
Section 4. Sensor Support There are four delays per channel measured. The CR1000 processes the four sub-measurements into a single reported value. In cases of excitation reversal, excitation "on time" for each polarity is exactly the same to ensure that ionic sensors do not polarize with repetitive measurements. Read more! A white paper entitled “The Benefits of Input Reversal and Excitation Reversal for Voltage Measurements” is available at www.campbellsci.com. 4.2.3.
Section 4. Sensor Support 4.2.5 Integration Read more! See a white paper entitled “Preventing and Attacking Measurement Noise Problems” available at www.campbellsci.com. The CR1000 incorporates circuitry to perform an analog integration on voltages to be measured prior to the A/D conversion. The magnitude of the frequency response of an analog integrator is a SIN(x) / x shape, which has notches (transmission zeros) occurring at 1 / (integer multiples) of the integration duration.
Section 4. Sensor Support FIGURE 4.2-1. Full and ½ Cycle Integration Methods for AC Power Line Noise Rejection 4.2.5.1.2 AC Noise Rejection on Large Analog Signals When rejecting AC noise on the 2500 mV and 5000 mV ranges, the CR1000 makes two fast measurements separated in time by ½ line cycle, as illustrated in FIGURE 4.2-1. For 60 Hz rejection , ½ line cycle = 8333 μs, meaning that the 2nd measurement must start 8333 μs after the integration for the first measurement was started.
Section 4. Sensor Support TABLE 4.2-6. AC Noise Rejection Integration on Voltage Ranges mV5000 and mV2500 AC Power Line Frequency Measurement Integration Time 60 Hz 250 μs x 2 _60Hz 3000 μs 8330 μs 50 Hz 250 μs x 2 _50Hz 3000 μs 10000 μs CRBASIC Integration Code Default Settling Time Maximum Recommended Settling Time* *Excitation time equals settling time in measurements requiring excitation. The CR1000 cannot excite channels Vx/EX1, Vx/EX2, and Vx/EX3 during A/D conversion.
Section 4. Sensor Support TABLE 4.2-7. CRBASIC Measurement Settling Times Settling Time Entry Input Voltage Range Integration Code Settling Time* 0 All 250 ms 450 ms (default) 0 All _50Hz 3 ms (default) 0 All _60Hz 3 ms (default) >100 All All μs entered *Minimum settling time required to allow the input to settle to CR1000 resolution specifications. A finite settling time is required for CR1000 voltage measurements for the following reasons: 1.
Section 4. Sensor Support Reviewing Section 9 CR1000 Programming may help in understanding the CRBASIC code in the example. EXAMPLE 4.2-1. CRBASIC Code: Measuring Settling Time 'CR1000 Series Datalogger 'Program to measure the settling time of a sensor 'measured with a differential voltage measurement Public PT(20) 'Variable to hold the measurements DataTable (Settle,True,100) Sample (20,PT(),IEEE4) EndTable BeginProg Scan (1,Sec,3,0) BrFull (PT(1),1,mV7_5,1,Vx1,1,2500,True ,True ,100,250,1.
Section 4. Sensor Support Settling Time 0.044 99 0.043 97 0.042 95 Series1 Series2 Series3 Series4 Series5 Average % 0.04 0.039 93 91 % of Final Value mV/Volt 0.041 89 0.038 87 0.037 0.036 85 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time (x100 us) FIGURE 4.2-2. Settling Time for Pressure Transducer TABLE 4.2-8. First Six Values of Settling Time Data TIMESTAMP RECORD PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) Smp Smp Smp Smp Smp Smp 0.
Section 4. Sensor Support The composite transfer function of the instrumentation amplifier, integrator, and analog-to-digital converter of the CR1000 is described by the following equation: COUNTS = G * Vin + B where COUNTS is the result from an analog-to-digital conversion, G is the voltage gain for a given input range, and B is the internally measured offset voltage.
Section 4. Sensor Support TABLE 4.2-9. Values Generated by the Calibrate() Instruction Array Element Description Typical Value 1 SE offset for ±5000 mV input range with 250 ms integration. ±5 LSB 2 Differential offset for ±5000 mV input range with 250 ms integration. ±5 LSB 3 Gain for ±5000 mV input range with 250 ms integration. -1.34 mV/LSB 4 SE offset for ±2500 mV input range with 250 ms integration. ±5 LSB 5 Differential offset for ±2500 mV input range with 250 ms integration.
Section 4. Sensor Support 31 SE offset for ±7.5 mV input range with 60 Hz integration. ±10 LSB 32 Differential offset for ±7.5 mV input range with 60 Hz integration. ±10 LSB 33 Gain for ±7.5 mV input range with 60 Hz integration. -0.002 mV/LSB 34 SE offset for ±2.5 mV input range with 60 Hz integration. ±20 LSB 35 Differential offset for ±2.5 mV input range with 60 Hz integration. ±20 LSB 36 Gain for ±2.5 mV input range with 60 Hz integration. -0.
Section 4. Sensor Support measurements are appropriate. Program Code EXAMPLE 4.3-1 shows CR1000 code for measuring and processing four wire full bridge circuits. All bridge measurements have the option (RevEx) to make one set of measurements with the excitation as programmed and another set of measurements with the excitation polarity reversed. The offset error in the two measurements due to thermal EMFs can then be accounted for in the processing of the measurement instruction.
Section 4.
Section 4. Sensor Support EXAMPLE 4.3-1. CRBASIC Code: 4 Wire Full Bridge Measurement and Processing 'Declare Variables Public X Public X1 Public R1 Public R2 Public R3 Public R4 'Main Program BeginProg R2 = 1000 'Resistance of R2 R3 = 1000 'Resistance of R3 R4 = 1000 'Resistance of R4 Scan(500,mSec,1,0) 'Full Bridge measurement: BrFull(X,1,mV2500,1,1,1,2500,True,True,0,_60Hz,1.0,0.0) X1 = ((-1 * X) / 1000) + (R3 / (R3 + R4)) R1 = (R2 * (1 - X1)) / X1 NextScan EndProg 4.3.
Section 4. Sensor Support TABLE 4.3-1.
Section 4. Sensor Support 4.4 Thermocouple Measurements NOTE Thermocouples are easy to use with the CR1000. They are also inexpensive. However, they pose several challenges to the acquisition of accurate temperature data, particularly when using external reference junctions. Campbell Scientific strongly encourages any user of thermocouples to carefully evaluate Section 4.4.1 Error Analysis of Thermocouple Measurements.
Section 4. Sensor Support measurement and does not include errors in installation or matching the sensor and thermocouple type to the environment being measured. 4.4.1.1 Panel Temperature The panel temperature thermistor (Betatherm 10K3A1A) is just under the panel in the center of the two rows of analog input terminals. It has an interchangeability specification of 0.1 °C for temperatures between 0 and 70 °C. Below freezing and at higher temperatures, this specification is degraded.
Section 4. Sensor Support each analog terminal strip measured the temperature of an insulated aluminum bar outside the chamber. The temperature of this bar was also measured by another datalogger. Differences between the temperature measured by one of the thermocouples and the actual temperature of the bar are due to the temperature difference between the terminals the thermocouple is connected to and the thermistor reference (the figures have been corrected for thermistor errors). FIGURE 4.
Section 4. Sensor Support Reference Temperature Errors Due to Panel Gradient Chamber Changed from 85 to 25 degrees C 2 90 1 Chamber and Reference Temperatures deg. C 80 0 Measured - Actual degrees C 70 -1 Channel 1 Channel 3 60 Channel 4 -2 Channel 6 Channel 8 50 RefTemp_Avg -3 Chamber Temp 40 -4 30 -5 -6 20 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 Time Minutes FIGURE 4.4-3. Panel Temperature Gradients during 80 to 25 °C Change 4.4.1.
Section 4. Sensor Support When both junctions of a thermocouple are at the same temperature there is no voltage produced (law of intermediate metals). A consequence of this is that a thermocouple cannot have an offset error; any deviation from a standard (assuming the wires are each homogeneous and no secondary junctions exist) is due to a deviation in slope. In light of this, the fixed temperature limits of error (e.g., ±1.0 °C for type T as opposed to the slope error of 0.
Section 4. Sensor Support 0.0012 * 52 mV = 62 µV or 1.78 oC (62 / 34.9). The basic resolution on the 250 mV range is 66.7 µV or 1.91 oC. Thus, the possible error due to the voltage measurement is 4.38 oC when reversing differential inputs, or 7.28 oC when not reversing differential inputs. TABLE 4.4-2. Voltage Range for Maximum Thermocouple Resolution (with reference temperature at 20oC) TC Type and temp. range oC Temp. range for ±2.5 mV range Temp. range for ±7.5 mV range Temp.
Section 4. Sensor Support TABLE 4.4-3. Limits of Error on CR1000 Thermocouple Polynomials (Relative to NIST Standards) TC Type T J E K Range oC -270 to 400 -270 to -200 -200 to -100 -100 to 100 100 to 400 -150 to 760 -100 to 300 -240 to 1000 -240 to -130 -130 to 200 200 to 1000 -50 to 1372 -50 to 950 950 to 1372 Limits of Error oC + 18 @ -270 ± 0.08 ± 0.001 ± 0.015 ± 0.008 ± 0.002 ± 0.4 ± 0.005 ± 0.02 ± 0.01 ± 0.04 4.4.1.
Section 4. Sensor Support 4.4.1.7 Error Summary The magnitude of the errors described in Section 4.4.1 illustrate that the greatest sources of error in a thermocouple temperature measurement are likely due to the limits of error on the thermocouple wire and in the reference temperature. Errors in the thermocouple and reference temperature linearizations are extremely small, and error in the voltage measurement is negligible. TABLE 4.
Section 4. Sensor Support K thermocouples, since the upper limit of the reference compensation polynomial fit range is 100 oC and the upper limit of the extension grade wire is 200 oC. With the other types of thermocouples the reference compensation polynomial fit range equals or is greater than the extension wire range. In any case, errors can arise if temperature gradients exist within the junction box. FIGURE 4.4-4 illustrates a typical junction box wherein the reference junction is the CR1000.
Section 4. Sensor Support Pulse Channel Sensor Ground FIGURE 4.5-1. Schematic of a Pulse Sensor on a CR1000 NOTE The PulseCount() instruction cannot be used in a Slow Sequence scan. Execution of PulseCount() within a scan involves determining the accumulated counts in each dedicated 24-bit counter since execution of the last PulseCount(). PulseCount() parameter (POption) determines if the output will be in counts (POption = 0) or frequency (POption = 1).
Section 4. Sensor Support FIGURE 4.5-2. Pulse Input Types CAUTION Maximum input voltage on pulse channels P1 and P2 is ±20 V. If pulse inputs of higher than ±20 V need to be measured, third party external signal conditioners should be employed. Contact a Campbell Scientific applications engineer if assistance is needed. Under no circumstances should voltages greater than ±50 V be measured. 4.5.1.
Section 4. Sensor Support When a pulse channel is configured for high-frequency pulse, an internal 100 kΩ pull-up resistor to +5 V on the P1 or P2 input is employed. This pull-up resistor accommodates open-collector (open-drain) output devices for highfrequency input. 4.5.1.2 Low-Level AC Rotating magnetic pickup sensors commonly generate AC output voltages ranging from millivolts at low rotational speeds to several volts at high rotational speeds.
Section 4. Sensor Support levels. Software switch debouncing of switch closure is incorporated in the switch-closure mode for digital I/O parts C1 – C8. CAUTION Minimum and maximum input voltages on digital I/O channels C1 – C8 is –8.0 V and +16 V, respectively. If pulse inputs < -8.0 V or > +16 V are to be measured by C1 – C8, then external signal conditioning should be employed. Contact a Campbell Scientific applications engineer if assistance is needed.
Section 4. Sensor Support CAUTION Noisy signals with slow transitions through the voltage threshold have the potential for extra counts around the comparator switch point. A voltage comparator with 20 mV of hysteresis follows the voltage gain stages. The effective input referred hysteresis equals 20 mV divided by the selected voltage gain. The effective input referred hysteresis on the ± 25 mV range is 2 mV; consequently, 2 mV of noise on the input signal could cause extraneous counts.
Section 5. Measurement and Control Peripherals Peripheral devices are available for expanding the CR1000’s on-board input / output capabilities. Classes of peripherals are discussed below according to use. Some peripherals are designed as SDM (Synchronous Devices for Measurement) devices. SDM devices are intelligent peripherals that receive instruction from and send data to the CR1000 over a proprietary 3-wire serial communications link utilizing channels C1, C2, and C3.
Section 5. Measurement and Control Peripherals 5.4.1 Binary Control 5.4.1.1 Digital I/O Ports Each of eight digital I/O ports (C1 - C8) can be configured as an output port and set low (0 V) or high (5 V) using the PortSet() or WriteIO() instructions. A digital output port is normally used to operate an external relay driver circuit because the port itself has very limited drive capability (2.0 mA minimum at 3.5 V). 5.4.1.
Section 5. Measurement and Control Peripherals FIGURE 5.4-1. Relay Driver Circuit with Relay FIGURE 5.4-2. Power Switching without Relay 5.5 Analog Control / Output Devices The CR1000 can scale measured or processed values and transfer these values in digital form to a CSI analog output device. The analog output device then performs a digital-to-analog conversion and outputs an analog voltage or current signal. The output signal is maintained until updated by the datalogger. 5.6 Other Peripherals 5.6.
Section 5. Measurement and Control Peripherals 5.6.2 Vibrating Wire Vibrating wire modules interface vibrating wire transducers to the CR1000. 5.6.3 Low-level AC Low-level AC input modules increase the number of low-level AC signals a CR1000 can monitor by converting low-level AC to high-frequency pulse.
Section 6. CR1000 Power Supply Reliable power is the foundation of a reliable data acquisition system. When designing a power supply, consideration should be made regarding worst-case power requirements and environmental extremes. Excessive switching noise or AC ripple present on a DC power supply can increase measurement noise. Noise sources include power transformers, regulators, and grid or mains power inclusively. Using high quality power regulators reduces noise due to power regulation.
Section 6. CR1000 Power Supply (ground). The CR1000 is internally protected against, but will not function with, reversed external power polarity. 6.5 Vehicle Power Connections If a CR1000 is powered by a motor vehicle supply, a second supply may be needed. When starting the motor of the vehicle, the battery voltage may drop below 9.6 V. This causes the CR1000 to stop measurements until the voltage again equals or exceeds 9.6 V.
Section 7. Grounding Grounding the CR1000 and its peripheral devices and sensors is critical in all applications. Proper grounding will ensure the maximum ESD (electrostatic discharge) protection and higher measurement accuracy. 7.1 ESD Protection ESD (electrostatic discharge) can originate from several sources. The most common, and most destructive, are primary and secondary lightning strikes. Primary lightning strikes hit the datalogger or sensors directly.
Section 7. Grounding Tie analog signal shields and returns to grounds ( ) located in analog input terminal strips. Tie pulse-counter returns into grounds ( ) in pulse-counter terminal strip. Large excitation return currents may also be tied into this ground in order to minimize induced single-ended offset voltages in half bridge measurements. Tie 5 V, SW-12, 12 V and C1-C8 returns into power grounds (G). External Power Input Star Ground at Ground Lug FIGURE 7.1-1.
Section 7. Grounding provide an adequate earth ground. For these situations, consult the literature on lightning protection or contact a qualified lightning protection consultant. In vehicle applications, the earth ground lug should be firmly attached to the vehicle chassis with 12 AWG wire or larger. In laboratory applications, locating a stable earth ground is challenging, but still necessary.
Section 7. Grounding 7.3 Single-Ended Measurement Reference Low-level single-ended voltage measurements are sensitive to ground potential fluctuations. The grounding scheme in the CR1000 has been designed to eliminate ground potential fluctuations due to changing return currents from 12 V, SW-12, 5 V, and the control ports. This is accomplished by utilizing separate signal grounds ( ) and power grounds (G).
Section 7. Grounding 7.4.2 External Signal Conditioner External signal conditioners, e.g. an infrared gas analyzer (IRGA), are frequently used to make measurements and send analog information to the CR1000. These instruments are often powered by the same AC line source as the CR1000. Despite being tied to the same ground, differences in current drain and lead resistance result in different ground potential at the two instruments.
Section 7. Grounding sensor deterioration, the capacitors block any DC component from affecting the measurement.
Section 8. CR1000 Configuration The CR1000 may require changes to factory default settings depending on the application. Most settings concern telecommunications between the CR1000 and a network or PC. Good News! The CR1000 is shipped factory ready with all settings and firmware necessary to communicate with a PC via RS-232 and to accept and execute user application programs. OS upgrades are occasionally made available at www.campbellsci.com. 8.
Section 8. CR1000 Configuration FIGURE 8.1-1. DevConfig CR1000 Facility When the Connect button is pressed, the device type, serial port, and baud rate selector controls become disabled and, if DevConfig is able to connect to the CR1000, the button will change from "Connect" to "Disconnect". 8.2 Sending the Operating System 8.2.1 Sending OS with DevConfig The CR1000 is shipped with the operating system pre-loaded. However, OS updates are made available at www.campbellsci.com and can be sent to the CR1000.
Section 8. CR1000 Configuration FIGURE 8.2-1. DevConfig OS download window for CR1000. The text at right gives the instructions for sending the OS. Follow these instructions. When the Start button is clicked, DevConfig offers a file open dialog box that prompts for the operating system file (*.obj file). When the CR1000 is then powered-up, DevConfig starts to send the operating system. When the operating system has been sent, a message dialog will appear similar to the one shown in FIGURE 8.2-2. FIGURE 8.
Section 8. CR1000 Configuration The information in the dialog helps to corroborate the signature of the operating system sent. 8.2.2 Sending OS to Remote CR1000 Operating systems can be sent remotely using the Program Send feature in LoggerNet, PC400, and PC200W. Sending an OS via Program Send retains settings unless changes in the new OS prevent it. To ensure a remote OS download does not alter telecommunications settings, a program named default.cr1 can be sent prior to the OS being sent.
Section 8. CR1000 Configuration FIGURE 8.3-1. DevConfig Settings Editor As shown in FIGURE 8.3-1, the top of the Settings Editor is a grid that allows the user to view and edit the settings for the device. The grid is divided into two columns with the setting name appearing in the left hand column and the setting value appearing in the right hand column. Change the currently selected cell with the mouse or by using up-arrow and down-arrow keys as well as the Page-Up and Page-Down keys.
Section 8. CR1000 Configuration FIGURE 8.3-2. Summary of CR1000 Configuration 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. Clicking Save on the summary screen will save the configuration to an XML file.
Section 8. CR1000 Configuration 8.3.1 Deployment Tab FIGURE 8.3-3. DevConfig Deployment Tab As shown in FIGURE 8.3-3, 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. 8.3.1.1 Datalogger Sub-Tab Serial Number displays the CR1000 serial number. This setting is set at the factory and cannot be edited. OS Version displays the operating system version that is in the CR1000.
Section 8. CR1000 Configuration 8.3.1.2 Ports Settings Sub-Tab As shown in FIGURE 8.3-4, the port settings tab has the following settings. FIGURE 8.3-4. DevConfig Deployment | Ports Settings Tab Read more! PakBus Networking Guide available at www.campbellsci.com. Selected Port specifies the datalogger serial port to which the beacon interval and hello setting values will be applied.
Section 8. CR1000 Configuration ranges already set up. These controls will be disabled if the Verify Interval value is set to zero. Add Range will cause the range specified in the Begin and End range to be added to the list of neighbors to the datalogger on the port specified by Selected Port. This control will be disabled if the value of the Verify Interval is zero or if the end range value is less than the begin range value.
Section 8. CR1000 Configuration 8.3.2 Logger Control Tab FIGURE 8.3-6. DevConfig Logger Control Tab The clock in the PC and the datalogger will be checked every second and the difference displayed. The System Clock Setting allows entering what offset, if any, to use with respect to standard time (Local Daylight Time or UTC, Greenwich mean time). The value selected for this control will be remembered between sessions.
Section 8. CR1000 Configuration 8.4 Settings via Terminal Emulator CR1000 Terminal Mode is designed to aid Campbell Scientific engineers in operating system development. It has some features useful to users. However, it is frequently modified and cannot be relied upon to have the same features or formats from version to version of the OS. DevConfig Terminal tab offers a terminal emulator that can be used to access the CR1000 Terminal Mode.
Section 8.
Section 9. CR1000 Programming 9.1 Inserting Comments into Program Comments are non-functioning text placed within the body of a program to document or clarify program algorithms. As shown in EXAMPLE 9.1-1, comments are inserted into a program by preceding the comment with a single quote ('). Comments can be entered either as independent lines or following CR1000 code. When the CR1000 compiler sees a single quote ('), it ignores the rest of the line. EXAMPLE 9.1-1.
Section 9. CR1000 Programming 9.3.1 Short Cut Editor and Program Generator Short Cut is easy-to-use menu-driven software that presents the user with lists of predefined measurement, processing, and control algorithms from which to choose. The user makes choices and Short Cut writes the CRBASIC code required to perform the tasks. Short Cut creates a wiring diagram to simplify connection of sensors and external devices. Section 2, Quickstart Tutorial, works through a measurement example using Short Cut.
Section 9. CR1000 Programming 9.3.3 Transformer This section is not yet available. 9.4 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 9.4-1. Only standard base 10 notation is supported by Campbell Scientific hardware and software displays. TABLE 9.4-1. Formats for Entering Numbers in CRBASIC Format Example Value Standard 6.832 6.
Section 9. CR1000 Programming 9.5 Structure TABLE 9.5-1 delineates CRBASIC program structure: TABLE 9.5-1. CRBASIC Program Structure Declarations Declare constants List fixed constants Declare Public variables List / dimension variables viewable during program execution Dimension variables List / dimension variables not viewable during program execution. Define Aliases Assign aliases to variables. Define Units Assign engineering units to variable (optional). Units are strictly for documentation.
Section 9. CR1000 Programming EXAMPLE 9.5-1 demonstrates the proper structure of a CRBASIC program. EXAMPLE 9.5-1.
Section 9. CR1000 Programming 9.6 Declarations Constants (and pre-defined constants), Public variables, Dim variables, Aliases, Units, Data Tables, Subroutines are declared at the beginning of a CRBASIC program. 9.6.1 Variables A variable is a packet of memory, given an alphanumeric name, through which pass measurements and processing results during program execution. Variables are declared either as Public or Dim at the discretion of the programmer.
Section 9. CR1000 Programming 9.6.1.2 Dimensions Occasionally, a multi-dimensioned array is required by an application. Dimensioned arrays can be thought of just as distance, area, and volume measurements are thought of. A single dimensioned array, declared as VariableName(x), can be thought of as x number of variables is a series. A two-dimensional array, declared as: Public (or Dim) VariableName(x,y), can be thought of as (x) * (y) number of variables in a square x-by-y matrix.
Section 9. CR1000 Programming 'UINT2 Data Storage Example Sample (1,PosCounter,UINT2) 'LONG Data Storage Example Sample (1,PosNegCounter,Long) 'STRING Data Storage Example Sample (1,FirstName,String) 'BOOLEAN Data Storage Example Sample (8,Switches(),Boolean) 'BOOL8 Data Storage Example Sample (16,FLAGS(),Bool8) 'NSEC Data Storage Example Sample (1,CR1000Time,Nsec) EndTable TABLE 9.6-1 lists details of available data types. TABLE 9.6-1.
Section 9. CR1000 Programming 9.6.1.4 Data Type Operational Detail FP2 Default CR1000 data type for stored data. While IEEE 4 byte floating point is used for variables and internal calculations, FP2 is adequate for most stored data. FP2 provides 3 or 4 significant digits of resolution, and requires half the memory as IEEE 4. TABLE 9.6-2. Resolution and Range Limits of FP2 Data Zero 0.000 Minimum Magnitude ±0.001 Maximum Magnitude ±7999.
Section 9. CR1000 Programming Boolean Boolean variables are typically used for flags and to represent conditions or hardware that have only two states such as flags and control ports. A Boolean variable uses the same 4-byte integer format as a LONG but can be set to only one of two values. To save memory space, consider using BOOL8 format instead. BOOL8 BOOL8 is used to store variables that hold bits (0 or 1) of information. This data type uses less space than normal 32-bit values.
Section 9. CR1000 Programming EXAMPLE 9.6-3. CRBASIC Code: 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 9.6.3 Flags Flags are a useful program control tool. While any variable of any data type can be used as a flag, using Boolean variables, especially variables named “Flag”, works best. EXAMPLE 9.
Section 9. CR1000 Programming A data table is essentially a file that resides in CR1000 memory. The file is written to each time data are directed to that file. The trigger that initiates data storage is tripped either by the CR1000’s clock, or by an event, such as a high temperature. Up to 30 data tables can be created and written to by the program. The program may store individual measurements, individual calculated values, or summary data such as averages, maxima, or minima to data tables.
Section 9. CR1000 Programming EXAMPLE 9.7-1.
Section 9. CR1000 Programming 9.7.1.1 DataTable() and EndTable() The DataTable instruction has three parameters: a user-specified alphanumeric name for the table (e.g., “OneMin”), a trigger condition (e.g., “True”), and the size to make the table in RAM (e.g., auto allocated). NOTE • Name -- The table name can be any combination of numbers and letters up to 20 characters in length. The first character must be a letter. • TrigVar -- The trigger condition may be a variable, expression, or constant.
Section 9. CR1000 Programming 9.7.1.3 Output Processing Instructions Data storage processing (“output processing”) instructions determine what data are stored in the data table. When a data table is called in the CRBASIC program, data storage processing instructions process variables holding current inputs or calculations. If trigger conditions are true, e.g. the required interval has expired, processed values are stored (“output”) in the data table. In EXAMPLE, three averages are stored.
Section 9. CR1000 Programming 'Process and Control If Oscillator = 1 If Flag(1) = True DisableVar = True End If Else DisableVar = False EndIf 'Call Data Tables and Store Data CallTable(OscAvgData) NextScan EndProg Read more! For a complete list of output processing instructions, see Section 10.2.3 Data Storage Output Processing. 9.8 Subroutines Read more! See Section 11.4 Subroutines for more information on programming with subroutines.
Section 9. CR1000 Programming Scan determines how frequently instructions in the program are executed: EXAMPLE 9.9-2. CRBASIC Code: Scan Syntax 'Scan(Interval, Units, BufferSize, Count) Scan(1,Sec,3,0) · · · ExitScan Scan has four parameters: Interval is the interval between scans. Units is the time unit for the interval. Interval is 10 ms < = Interval < = 1 day. BufferSize is the size (number of scans) of a buffer in RAM that holds the raw results of measurements.
Section 9. CR1000 Programming 9.11 Program Execution and Task Priority Execution of program instructions is prioritized among three tasks: measurement / control, SDM, and processing. Processes of each task are listed in TABLE 9.11-1. The measurement / control task is a rigidly timed sequence that measures sensors and outputs control signals for other devices. The SDM task manages measurement and control of SDM devices (Campbell Scientific’s Synchronous Devices for Measurement).
Section 9. CR1000 Programming measurements are not allowed in pipeline mode. Because of the precise execution of measurement instructions, processing in the current scan (including update of public variables and data storage) is delayed until all measurements are complete. Some processing, such as transferring variables to control instructions, e.g. PortSet() and ExciteV(), may not be completed until the next scan. When a condition is true for a task to start, it is put in a queue.
Section 9. CR1000 Programming other sequences have access to measurement hardware with the order of priority being the background calibration sequence followed by the slow sequences in the order they are declared in the program. NOTE Measurement tasks have priority over other tasks such as processing and communication to allow accurate timing needed within most measurement instructions. 9.
Section 9. CR1000 Programming 9.12.3 Names in Parameters TABLE 9.12-1 lists the maximum length and allowed characters for the names for Variables, Arrays, Constants, etc. The CRBASIC Editor pre-compiler will identify names that are too long or improperly formatted. TABLE 9.12-1. Rules for Names Name for Maximum Length (number of characters) Allowed characters Variable or Array 39 Letters A-Z, upper or lower. Constant 38 case, underscore “_”, and Alias 39 numbers 0-9.
Section 9. CR1000 Programming EXAMPLE 9.12-3. CRBASIC Code: 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 9. CR1000 Programming 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. Instructions that use double precision are AddPrecise, Average, AvgRun, AvgSpa, CovSpa, MovePrecise, RMSSpa, StdDev, StdDevSpa, and Totalize. Floating point arithmetic is common in many electronic computational systems, but it has pitfalls high-level programmers should be aware of.
Section 9. CR1000 Programming EXAMPLE 9.13-2. CRBASIC Code: Conversion of FLOAT / LONG to Boolean 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 ‘This will set Ba = False (0) ‘This will Set Bb = True (-1) ‘This will Set Bc = True (-1) 9.13.3.2 FLOAT from LONG or Boolean When a LONG or Boolean is converted to FLOAT, the integer value is loaded into the FLOAT.
Section 9. CR1000 Programming 9.13.3.5 Constants Conversion 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 will be used if possible, i.e., if the expression has not yet encountered a float. This is illustrated in EXAMPLE 9.13-4. EXAMPLE 9.13-4.
Section 9. CR1000 Programming TABLE 9.13-1.
Section 9. CR1000 Programming EXAMPLE 9.13-5. Logical Expression Examples a. 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 CR1000 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. b. If X >= 5 AND Z = 2 then Y = 0 Sets Y = 0 only if both X >= 5 and Z = 2 are true. c. If X >= 5 OR Z = 2 then Y = 0 Sets Y = 0 if either X >= 5 or Z = 2 is true.
Section 9.
Section 9. CR1000 Programming TABLE 9.14-1.
Section 9.
Section 10. CRBASIC Programming Instructions Read more! Parameter listings, application information, and code examples are available in CRBASIC Editor Help. CRBASIC Editor is part of PC400, LoggerNet, and RTDAQ. Select instructions are explained more fully, some with example code, in Section 11 Programming Resource Library. Example code is throughout the CR1000 manual. Refer to the table of contents Example index. 10.1 Program Declarations Alias Assigns a second name to a variable.
Section 10. CRBASIC Programming Instructions ESSVariables Automatically declares all the variables required for the datalogger when used in an Environmental Sensor Station application. Used in conjunction with ESSInitialize. Syntax ESSVariables PipelineMode Configures datalogger to perform measurement tasks separate from, but concurrent with, processing tasks. Syntax PipelineMode PreserveVariables Retains in memory the values for variables declared by the Dim or Public statements.
Section 10. CRBASIC Programming Instructions WebPageBegin / WebPageEnd See Section 11.2 Information Services. 10.2 Data Table Declarations DataTable … EndTable Mark the beginning and end of a data table. Syntax DataTable(Name, TrigVar, Size) [data table modifiers] [on-line storage destinations] [output processing instructions] EndTable 10.2.1 Data Table Modifiers DataEvent Sets triggers to start and stop storing records within a table. One application is with WorstCase.
Section 10. CRBASIC Programming Instructions TableFile Writes a file from a data table to the datalogger CPU, user drive, or a compact flash card. Syntax TableFile ("FileName", Options, MaxFiles, NumRecs / TimeIntoInterval, Interval, Units, OutStat, LastFileName) 10.2.3 Data Storage Output Processing FieldNames Immediately follows an output processing instruction to change default field names. Syntax FieldNames ("Fieldname1 : Description1, Fieldname2 : Description2…") 10.2.3.
Section 10. CRBASIC Programming Instructions PeakValley Detects maxima and minima in a signal. Syntax PeakValley (DestPV, DestChange, Reps, Source, Hysteresis) Sample Stores the current value at the time of output. Syntax Sample (Reps, Source, DataType) SampleFieldCal Writes field calibration data to a table. See Section 6.19 Calibration Functions. SampleMaxMin Samples a variable when another variable reaches its maximum or minimum for the defined output period.
Section 10. CRBASIC Programming Instructions 10.2.4 Histograms Histogram Processes input data as either a standard histogram (frequency distribution) or a weighted value histogram. Syntax Histogram (BinSelect, DataType, DisableVar, Bins, Form, WtVal, LoLim, UpLim) Histogram4D Processes input data as either a standard histogram (frequency distribution) or a weighted value histogram of up to 4 dimensions.
Section 10. CRBASIC Programming Instructions 10.4 Program Control Instructions 10.4.1 Common Controls BeginProg … EndProg Mark the beginning and end of a program. Syntax BeginProg Program Code EndProg Call Transfers program control from the main program to a subroutine. Syntax Call [subroutine name] (list of variables) CallTable Calls a data table, typically for output processing. Syntax CallTable [TableName] Delay Delays the program.
Section 10. CRBASIC Programming Instructions For ... Next Repeats a group of instructions a specified number of times. Syntax For counter = start To end [ Step increment ] [statementblock] [ExitFor] [statementblock] Next [counter [, counter][, ...]] If ... Then ... Else … ElseIf ... EndIf NOTE EndSelect and EndIf call the same CR1000 function Allows conditional execution, based on the evaluation of an expression. Else is optional. ElseIf is optional.
Section 10. CRBASIC Programming Instructions Slow Sequence Marks the beginning of a section of code that will run concurrently with the main program. Syntax SlowSequence SubScan … NextSubScan Controls a multiplexer or measures some analog inputs at a faster rate than the program scan. Syntax SubScan (SubInterval, Units, Count) Measurements and processing NextSubScan WaitDigTrig Triggers a measurement scan from an external digital trigger.
Section 10. CRBASIC Programming Instructions Restore Resets the location of the Read pointer back to the first value in the list defined by Data or DataLong. 10.5 Measurement Instructions 10.5.1 Diagnostics Battery Measures input voltage. Syntax Battery (Dest) ComPortIsActive Returns a Boolean value, based on whether or not activity is detected on the specified COM port. Syntax variable = ComPortIsActive (ComPort) InstructionTimes Returns the execution time of each instruction in the program.
Section 10. CRBASIC Programming Instructions VoltSe Measures the voltage at a single-ended input with respect to ground. Syntax VoltSe (Dest, Reps, Range, SEChan, MeasOfs, SettlingTime, Integ, Mult, Offset) 10.5.3 Thermocouples Read more! See Section 4.34 Thermocouple Measurements. TCDiff Measures a differential thermocouple. Syntax TCDiff (Dest, Reps, Range, DiffChan, TCType, TRef, RevDiff, SettlingTime, Integ, Mult, Offset) TCSe Measures a single-ended thermocouple.
Section 10. CRBASIC Programming Instructions BrFull6W Measures ratio of Vdiff2 / Vdiff1 of a 6 wire full bridge. Reports 1000 * (Vdiff2 / Vdiff1). Syntax BrFull6W (Dest, Reps, Range1, Range2, DiffChan, Vx/ExChan, MeasPEx, ExmV, RevEx, RevDiff, SettlingTime, Integ, Mult, Offset) 10.5.5 Excitation ExciteV This instruction sets the specified switched voltage excitation channel to the voltage specified. Syntax ExciteV (Vx/ExChan, ExmV, XDelay) SW12 Sets a switched 12-volt supply high or low.
Section 10. CRBASIC Programming Instructions PulsePort Toggles the state of a control port, delays the specified amount of time, toggles the port, and delays a second time. Syntax PulsePort (Port, Delay) ReadIO Reads the status of selected control I/O ports. Syntax ReadIO (Dest, Mask) TimerIO Measures interval or frequency on a digital I/O port.
Section 10. CRBASIC Programming Instructions 10.5.9 Specific Sensors CS110 Measures electric field by means of a CS110 electric field meter. Syntax CS110 (Dest, Leakage, Status, Integ, Mult, Offset) CS110Shutter Controls the shutter of a CS110 electric field meter. Syntax CS110Shutter (Status, Move) CS616 Enables and measures a CS616 water content reflectometer. Syntax CS616 (Dest, Reps, SEChan, Port, MeasPerPort, Mult, Offset) TGA Measures a TGA100A trace gas analyzer system.
Section 10. CRBASIC Programming Instructions 10.5.10 Peripheral Device Support Multiple SDM instructions can be used within a program. AM25T Controls the AM25T Multiplexer. Syntax AM25T (Dest, Reps, Range, AM25TChan, DiffChan, TCType, Tref, ClkPort, ResPort, VxChan, RevDiff, SettlingTime, Integ, Mult, Offset) SDMAO4 Sets output voltage levels in an SDM-AO4 analog output device. Syntax SDMAO4 (Source, Reps, SDMAdress) SDMCAN Reads and controls an SDM-CAN interface.
Section 10. CRBASIC Programming Instructions SDMSW8A Controls and reads an SDM-SW8A. Syntax SDMSW8A (Dest, Reps, SDMAddress, FunctOp, SW8AStartChan, Mult, Offset) SDMTrigger Synchronize when SDM measurements on all SDM devices are made. Syntax SDMX50 Allows individual multiplexer switches to be activated independently of the TDR100 instruction. Syntax SDMX50 (SDMAddress, Channel) TDR100 Directly measures TDR probes connected to the TDR100 or via an SDMX50.
Section 10. CRBASIC Programming Instructions > < >= <= Greater Than Less Than Greater Than or Equal Less Than or Equal Bit Shift Operators Bit shift operators (<< and >>) allow the program to manipulate the positions of patterns of bits within an integer (CRBASIC Long type).
Section 10. CRBASIC Programming Instructions << Bit shift left Syntax Variable = Numeric Expression >> Amount >> Bit shift right Syntax Variable = Numeric Expression >> Amount 10.6.2 Logical Operators AND Used to perform a logical conjunction on two expressions. Syntax result = expr1 And expr2 NOT Performs a logical negation on an expression. Syntax result = NOT expression OR Used to perform a logical disjunction on two expressions.
Section 10. CRBASIC Programming Instructions TABLE 10.6-1. Derived Trigonometric Functions Function CRBASIC Equivalent Secant Sec = 1 / Cos(X) Cosecant Cosec = 1 / Sin(X) Cotangent Cotan = 1 / Tan(X) Inverse Secant Arcsec = Atn(X/Sqr(X*X-1))+Sgn(Sgn(X)1)*1.5708 Inverse Cosecant Arccosec = Atn(X/Sqr(X*X-1))+(Sgn(X)1)*1.5708 Inverse Cotangent Arccotan = Atn(X) + 1.
Section 10. CRBASIC Programming Instructions COSH Returns the hyperbolic cosine of an expression or value. Syntax x = COSH (source) SIN Returns the sine of an angle. Syntax x = SIN (source) SINH Returns the hyperbolic sine of an expression or value. Syntax x = SINH(Expr) TAN Returns the tangent of an angle. Syntax x = TAN (source) TANH Returns the hyperbolic tangent of an expression or value. Syntax x = TANH (Source) 10.6.4 Arithmetic Functions ABS Returns the absolute value of a number.
Section 10. CRBASIC Programming Instructions INT or FIX Return the integer portion of a number. Syntax x = INT (source) x = Fix (source) INTDV Performs an integer division of two numbers. Syntax X INTDV Y LN or LOG Returns the natural logarithm of a number. Ln and Log perform the same function. Syntax x = LOG (source) x = LN (source) NOTE LOGN = LOG(X) / LOG(N) LOG10 The LOG10 function returns the base 10 logarithm of a number.
Section 10. CRBASIC Programming Instructions RectPolar Converts from rectangular to polar coordinates. Syntax RectPolar (Dest, Source) 10.6.5 Integrated Processing PRT Calculates temperature from the resistance of an RTD. Syntax PRT (Dest, Reps, Source, Mult, Offset) DewPoint Calculates dew point temperature from dry bulb and relative humidity. Syntax DewPoint (Dest, Temp, RH) VaporPressure Calculates vapor pressure from temperature and relative.
Section 10. CRBASIC Programming Instructions StdDevSpa Used to find the standard deviation of an array. Syntax StdDevSpa(Dest, Swath, Source) SortSpa Sorts the elements of an array in ascending order. Syntax SortSpa (Dest, Swath, Source) MaxSpa Finds the maximum value in an array. Syntax MaxSpa(Dest, Swath, Source) MinSpa Finds the minimum value in an array. Syntax MinSpa (Dest, Swath, Source) RMSSpa Computes the RMS (root mean square) value of an array. Syntax RMSSpa (Dest, Swath, Source) 10.6.
Section 10. CRBASIC Programming Instructions 10.7 String Functions & + Concatenates string variables Concatenates string and numeric variables 10.7.1 String Operations String Constants Constant strings can be used in expressions using quotation marks, i.e. FirstName = “Mike” String Addition Strings can be concatenated using the ‘+’ operator, i.e FullName = FirstName + “ “ + MiddleName + “ “ + LastName String Subtraction String1-String2 results in an integer in the range of -255..+255.
Section 10. CRBASIC Programming Instructions HEX Returns a hexadecimal string representation of an expression. Syntax Variable = HEX (Expression) HexToDec Converts a hexadecimal string to a float or integer. Syntax Variable = HexToDec (Expression) InStr Find the location of a string within a string. Syntax Variable = InStr (Start, SearchString, FilterString, SearchOption) LTrim Returns a copy of a string with no leading spaces.
Section 10. CRBASIC Programming Instructions Replace Searches a string for a substring, and replace that substring with a different string. Syntax variable = Replace (SearchString, SubString, ReplaceString) StrComp Compares two strings by subtracting the characters in one string from the characters in another Syntax Variable = StrComp (String1, String2) SplitStr Splits out one or more strings or numeric variables from an existing string.
Section 10. CRBASIC Programming Instructions DaylightSavingUS Determine if US daylight saving time has begun or ended. Optionally advance or turn-back the datalogger clock one hour. Syntax variable = DaylightSavingUS (DSTSet) IfTime Returns a number indicating True (-1) or False (0) based on the datalogger's real-time clock. Syntax IfTime (TintoInt, Interval, Units) PakBusClock Sets the datalogger clock to the clock of the specified PakBus device.
Section 10. CRBASIC Programming Instructions VoiceHangup Hangs up the voice modem. Syntax VoiceHangup VoiceKey Recognizes the return of characters 1 - 9, *, or #. VoiceKey is often used to add a delay, which provides time for the message to be spoken, in a VoiceBegin/EndVoice sequence. Syntax VoiceKey (TimeOut*IDH_Popup_VoiceKey_Timeout) VoiceNumber Returns one or more numbers (1 - 9) terminated by the # or * key.
Section 10. CRBASIC Programming Instructions DisplayMenu … EndMenu Marks the beginning and ending of a custom menu. Syntax DisplayMenu ("MenuName", AddToSystem) menu definition EndMenu MenuItem Defines the name and associated measurement value for an item in a custom menu. Syntax MenuItem ("MenuItemName", Variable) MenuPick Creates a list of selectable options that can be used when editing a MenuItem value. Syntax MenuPick (Item1, Item2, Item3...
Section 10. CRBASIC Programming Instructions SerialIn Sets up a communications port for receiving incoming serial data. Syntax SerialIn (Dest, ComPort, TimeOut, TerminationChar, MaxNumChars) SerialInBlock Stores incoming serial data. This function returns the number of bytes received. Syntax SerialInBlock (ComPort, Dest, MaxNumberBytes) SerialInChk Returns the number of characters available in the datalogger serial buffer.
Section 10. CRBASIC Programming Instructions The ComPort parameter sets a default communications port when a route to the remote node is not known. Enter one of the following commands: ComRS-232 ComME Com310 ComSDC7 ComSDC8 ComSDC10 ComSDC11 Com1 (C1,C2) Com2 (C3,C4) Com3 (C5,C6) Com4 (C7,C8) Baud rate on asynchronous ports (ComRS-232, ComME, Com1, Com2, Com3, and Com4) will default to 9600 unless set otherwise by SerialOpen(), or if the port is opened by an incoming PakBus packet at some other baud rate.
Section 10. CRBASIC Programming Instructions ClockReport Sends the datalogger clock value to a remote datalogger in the PakBus network. Syntax ClockReport (ComPort, RouterAddr, PakBusAddr) DataGram Initializes a SerialServer / DataGram / PakBus application in the datalogger when a program is compiled. Syntax DataGram (ComPort, BaudRate, PakBusAddr, DestAppID, SrcAppID) DialSequence … EndDialSequence Defines the code necessary to route packets to a PakBus device.
Section 10. CRBASIC Programming Instructions Routes Returns a list of known dynamic routes for a PakBus datalogger that has been configured as a router in a PakBus network. Syntax Routes (Dest) SendData Sends the most recent record from a data table to a remote PakBus device. Syntax SendData (ComPort, RouterAddr, PakBusAddr, DataTable) SendFile Sends a file to another PakBus datalogger.
Section 10. CRBASIC Programming Instructions 10.13 Variable Management FindSpa Searches a source array for a value and returns the value’s position in the array. Syntax FindSpa (SoughtLow, SoughtHigh, Step, Source) Move Moves the values in a range of variables into difference variables or fills a range of variables with a constant. Syntax Move (Dest, DestReps, Source, SourceReps) 10.14 File Management Commands to access and manage files stored in CR1000 memory.
Section 10. CRBASIC Programming Instructions FileRename Changes the name of file on the CR1000’s CPU:, USR:, or CRD: drives. Syntax FileRename(drive:OldFileName, drive:NewFileName) FileSize Returns the size of the file in the previously opened file referenced by the FileHandle parameter. Syntax FileSize(FileHandle) FileTime Returns the time the file specified by the FileHandle was created.
Section 10. CRBASIC Programming Instructions ResetTable Used to reset a data table under program control. Syntax ResetTable (TableName) SetStatus ("FieldName", Value) Changes the value for a setting in the datalogger Status table. Syntax SetStatus ("FieldName", Value) TableName.FieldName Accesses a specific field from a record in a table Syntax TableName.FieldName (FieldNameIndex, RecordsBack) TableName.Output Determine if data was written to a specific DataTable the last time the DataTable was called.
Section 10. CRBASIC Programming Instructions 10.16 Information Services Email, IP SMS, and Web Page Services. Read more! See Section 11.2 Information Services. EMailRecv Polls an SMTP server for email messages and store the message portion of the email in a string variable. Syntax variable = EMailRecv ("ServerAddr", "ToAddr", "FromAddr", "Subject", Message, "Authen", "UserName", "PassWord", Result) EMailSend Sends an email message to one or more email addresses via an SMTP server.
Section 10. CRBASIC Programming Instructions TCPOpen Sets up a TCP/IP socket for communication. Syntax TCPOpen (IPAddr, TCPPort, TCPBuffer) TCPClose Closes a TCPIP socket that has been set up for communication. Syntax TCPClose (TCPSocket) UDPOpen Opens a port for transferring UDP packets. Syntax UDPOpen(IPAddr, UDPPort, UDPBuffsize) UDPDataGram Sends packets of information via the UDP communications protocol.
Section 10. CRBASIC Programming Instructions 10.18 SCADA Read more! See Sections 15.1 DNP3 and 15.2 Modbus. ModBusMaster Sets up a datalogger as a ModBus master to send or retrieve data from a ModBus slave. Syntax ModBusMaster (ResultCode, ComPort, BaudRate, ModBusAddr, Function, Variable, Start, Length, Tries, TimeOut) ModBusSlave Sets up a datalogger as a ModBus slave device.
Section 10. CRBASIC Programming Instructions NewFieldCal Triggers storage of FieldCal values when a new FieldCal file has been written. Syntax DataTable (TableName, NewFieldCal, Size) SampleFieldCal EndTable LoadFieldCal Loads values from the FieldCal file into variables in the datalogger. Syntax LoadFieldCal (CheckSig) FieldCalStrain Sets up the datalogger to perform a zero or shunt calibration for a strain measurement.
Section 10. CRBASIC Programming Instructions 10.20.2 GOES GOESData Sends data to a CSI GOES satellite data transmitter. Syntax GOESData (Dest, Table, TableOption, BufferControl, DataFormat) GOESGPS Stores GPS data from the satellite into two variable arrays. Syntax GOESGPS (GoesArray1(6), GoesArray2(7)) GOESSetup Programs the GOES transmitter for communication with the satellite.
Section 10. CRBASIC Programming Instructions 10.20.4 INMARSAT-C INSATSetup Configures the OMNISAT-I transmitter for sending data over the INSAT-1 satellite. Syntax INSATSetup (ResultCode, PlatformID, RFPower) INSATData Sends a table of data to the OMNISAT-I transmitter for transmission via the INSAT-1 satellite. Syntax INSATData (ResultCode, TableName, TX_Window, TX_Channel) INSATStatus Queries the transmitter for status information. Syntax INSATStatus (ResultCode) This is a blank page.
Section 11. Programming Resource Library 11.1 Field Calibration of Linear Sensors (FieldCal) 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 11. Programming Resource Library 11.1.2 CRBASIC Programming Field calibration functionality is utilized through either: FieldCal() -- the principal instruction used for non-strain gage type sensors. One instruction is entered for each sensor to be calibrated. or FieldCalStrain() -- the principal instruction used for strain gages measuring microstrain. One instruction is entered for each gage to be calibrated.
Section 11. Programming Resource Library 11.1.4.1 Single-point Calibrations (zero or offset) Use the following general procedure to adjust offsets (y-intercepts) with singlepoint calibrations: 1) Ensure mode variable = 0 or 6 before starting. 2) Place the sensor into zeroing or offset condition 3) Set mode variable = 1 to start calibration Mode Variable > 0 and ≠ 6 <0 2 6 Interpretation calibration in progress calibration encountered an error calibration in process calibration complete. 11.1.4.
Section 11. Programming Resource Library chamber. The following procedure zeros the RH sensor to obtain the calibration report shown. Calibration Report for Air RH Sensor Initial Calibration 1 Month Calibration mV Output 1000 1050 Desiccated Chamber 0% 0% Multiplier .05 % / mV .05 % / mV Offset -50 % -52.5 % Reading % 0% Send the program in EXAMPLE 11.1-1 to the CR1000. To simulate the RH sensor, place a jumper wire between channels EX1 and SE8 (4L).
Section 11. Programming Resource Library BeginProg Multiplier = .05 Offset = 0 KnownRH = 0 LoadFieldCal(true) 'Load the CAL File, if possible Scan(100,mSec,0,0) 'Simulate measurement by exciting channel Vx/EX1 ExciteV(Vx1,mV,0) 'Make the calibrated measurement VoltSE(RH,1,mV2500,8,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 11.1.5.
Section 11. Programming Resource Library EXAMPLE 11.1-2. FieldCal offset demonstration program. 'Jumper EX1 to SE8(4L) to simulate a sensor Public mV Public KnownSalt Public CalMode 'Excitation mV Output 'Known Salt Concentration 'Calibration Trigger Public Multiplier Public Offset Public SaltContent 'Multiplier (Starts at .
Section 11. Programming Resource Library Calibration Report for Y Flow Meter Initial Calibration 1 Week Calibration (5% Drift) Output @ 30 l/s 300 mV 285 mV Output @ 10 l/s 550 mV 522 mV Multiplier -0.0799 l/s/mV -.0841 l/s/mV Offset 53.90 l 53.92 l Send the program in EXAMPLE 11.1-3 to the CR1000. Put a jumper wire between channels Vx/EX1 and SE8 (4L).
Section 11. Programming Resource Library EXAMPLE 11.1-3. FieldCal multiplier and offset demonstration program.
Section 11. Programming Resource Library Send the program in EXAMPLE 11.1-4. Start the first step of the simulated calibration by entering: mV = 175 mV KnownWC = 10 CalibMode = 1 The first step is complete when CalibMode increments to 3. Calibration continues when starting the second step by entering: mV = 700 KnownWC = 35 CalibMode = 4 Sensitivity calibration is complete when CalibMode increments automatically to 6. EXAMPLE 11.1-4. FieldCal multiplier only demonstration program.
Section 11.
Section 11. Programming Resource Library 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 11. Programming Resource Library EXAMPLE 11.1-5. FieldCalStrain() calibration demonstration.
Section 11. Programming Resource Library 11.1.6.1 Quarter bridge Shunt (Option 13) With EXAMPLE 11.1-5 sent to CR1000, and with strain gage stable, use the CR1000KD keyboard or software numeric monitor to change the value in variable KnownRes to the nominal resistance of the gage, 1000 Ω. Set Shunt_Mode to 1 to start the two-point shunt calibration. When Shunt_Mode increments to 3, the first step is complete. To complete the calibration, shunt R1 with the 249 kΩ resistor. Set variable KnownRes to 249,000.
Section 11. Programming Resource Library FIGURE 11.1-4. Starting zero procedure. FIGURE 11.1-5. Zero procedure finished. 11.2 Information Services When used in conjunction with an NL115 network link interface, or a cell modem with the PPP/IP key enabled, the CR1000 has TCP/IP functionality. This provides the following capabilities: 11-14 • PakBus communication over TCP/IP with LoggerNet or PC400 software. • Callback (datalogger initiated communication) using the CRBASIC TCPOpen() function.
Section 11. Programming Resource Library • Modbus/TCP/IP, Master and Slave. • 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. For additional information, see the NL115 manual and CRBASIC Editor Help. 11.2.1 PakBus Over TCP/IP and Callback Once the hardware has been configured, basic PakBus communication over TCP/IP is possible.
Section 11. Programming Resource Library Links will also be created automatically for any HTML, XML, and JPEG files found on the datalogger in the CPU:, USR:, and CRD: drives. To copy files to these drives, choose File Control from the Tools menu found in PC400 or in the Connect screen of LoggerNet. Although the default home page cannot be accessed by the user for editing, it can be replaced with HTML code to customize the look of the home page.
Section 11. Programming Resource Library HTTPOut("
Current Record from Public Table
") HTTPOut("Current Record from Status Table
") HTTPOut("
Section 11. Programming Resource Library FIGURE 11.2-3. Monitor Web Page Generated By Datalogger Program 11.2.3 FTP Server The CR1000 automatically runs an FTP server. This allows Windows Explorer to access the CR1000 file system via FTP, with the “drives” on the CR1000 being mapped into directories or folders. The “root directory” on the CR1000 can include CPU, USR or CRD. USR is a user defined directory that is created by allocating memory for it in the USRDriveSize field of the Status table.
Section 11. Programming Resource Library 11.2.5 Telnet Telnet can be used to access the same commands as the Terminal Emulator in the LoggerNet Connect screen’s Tools menu and the PC400. Start a Telnet session by opening a command prompt and type in: Telnet xxx.xxx.xxx.xxx where xxx.xxx.xxx.xxx is the IP address of the network device connected to the CR1000. 11.2.6 SNMP Simple Network Management Protocol (SNMP) is a part of the IP suite used by NTCIP and RWIS for monitoring road conditions.
Section 11. Programming Resource Library has, then the hostname can be used interchangeably with the IP address in some datalogger instructions. 11.2.12 SMTP Simple Mail Transfer Protocol (SMTP) is the standard for e-mail transmissions. The CR1000 can be programmed to send e-mail messages on a regular schedule or based on the occurrence of an event. 11.3 SDI-12 Sensor Support 11.3.
Section 11. Programming Resource Library FIGURE 11.3-1. Entering SDI-12 Transparent Mode through LoggerNet Terminal Emulator 11.3.2 SDI-12 Command Basics All commands can be issued through SDI-12 transparent mode. All commands have three components: sensor address, command body, and command termination. Sensor address is a single character, and is always the first character of the command or the subsequent response from the sensor.
Section 11. Programming Resource Library 11.3.3.1 Address Query Command If the address of a particular sensor is unknown, use the Address Query command to request the sensor identify itself. Get Unknown Address syntax is “?!” (without the quotation marks), where the question mark is used as a wildcard for the address, followed by the command terminator. The sensor replies to the query with the address, “a”.
Section 11. Programming Resource Library nn = the number of values will be returned in one or more subsequent D commands The difference between the two commands is with what happens after the response is returned to the logger. When running CRBASIC code, with the standard M[v] command, the datalogger pauses its operations until the time “ttt” expires, after which it immediately polls the sensor for those values, and then continues with the remainder of its program.
Section 11. Programming Resource Library every scan, i.e., it will pick up the data from the measurement command issued during the previous scan and, when the timeout has expired, issue the measurement command whose data will be retrieved on the subsequent scan. 11.3.4.
Section 11. Programming Resource Library TABLE 11.3-1. The SDI-12 basic command / response set. Courtesy SDI-12 Support Group.
Section 11. Programming Resource Library 11.3.6 SDI-12 Power Considerations When a command is sent by the datalogger to an SDI-12 probe, all probes on the same SDI-12 port will wake up. Only the probe addressed by the datalogger will respond, however, all other probes will remain active until the timeout period expires. Example Probe: Water Content Power Usage: Quiescent: 0.
Section 11. Programming Resource Library For most applications, total power usage of 318 mA for 15 seconds is not excessive, but if 16 probes were wired to the same SDI-12 port, the resulting power draw would be excessive. Spreading sensors over several SDI-12 terminals will help reduce power consumption. 11.4 Subroutines This section is not yet available. 11.5 Wind Vector 11.5.
Section 11. Programming Resource Library 11.5.2 Wind Vector Processing CR1000 WindVector instruction processes wind speed and direction from either polar (wind speed and direction) or orthogonal (fixed East and North propellers) sensors. It uses raw data to generate mean wind speed, mean wind vector magnitude, and mean wind vector direction over a data storage interval.
Section 11. Programming Resource Library 11.5.2.1 Measured Raw Data Si = horizontal wind speed Θi = horizontal wind direction Uei = east-west component of wind Uni = north-south component of wind N = number of samples 11.5.2.2 Calculations North sn U Θu s1 s4 s2 s3 East FIGURE 11.5-1. Input Sample Vectors In FIGURE 11.
Section 11. Programming Resource Library or, in the case of orthogonal sensors Ux=(Σ(Uei/Ui))/N Uy=(Σ(Uni/Ui))/N where Ui=(Uei2+Uni2)1/2 Standard deviation of wind direction, σ(Θ1), using Yamartino algorithm: σ(Θ1)=arc sin(ε)[1+0.1547 ε3] where, ε=[1-((Ux)2+(Uy)2)]1/2 and Ux and Uy are as defined above. Resultant mean horizontal wind speed, U : U =(Ue2+Un2)1/2 Un U Ue FIGURE 11.5-2.
Section 11. Programming Resource Library The algorithm for σ(θu) is developed by noting (FIGURE 11.5-2) that Cos (Θ i ' ) = U i /s i ; where Θ i ' = Θ i − Θu U Ui Θu Θ'i si FIGURE 11.5-3. Standard Deviation of Direction The Taylor Series for the Cosine function, truncated after 2 terms is: Cos (Θi ' ) ≅ 1 − (Θ i ' ) 2 / 2 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 11. Programming Resource Library have never been greater than a few degrees. The final form is arrived at by converting from radians to degrees (57.296 degrees/radian). σ(Θu ) = (2(1 − U / S))1/ 2 = 81(1 − U / S)1/ 2 11.6 CR1000KD Custom Menus This section is not yet available. 11.7 Conditional Compilation CRBASIC allows definition of conditional code that the compiler interprets and includes at compile time.
Section 11. Programming Resource Library EXAMPLE 11.7-1. Use of Conditional Compile Instructions #If, #ElseIf, #Else and #EndIf 'Conditional Compilation Example for CR3000 / CR1000 / CR800 Series Dataloggers 'Here we choose to set program options based on the 'setting of a constant in the program.
Section 11. Programming Resource Library 'Main Scan. Scan (ScanRate,Sec,0,0) 'Here we make a measurement using different parameters and a different 'SE channel depending on the logger type the program is running in. #If LoggerType = CR3000 VoltSe(ValueRead,1,mV1000,22,0,0,_50Hz,0.1,-30) 'This instruction is used if the logger is a CR3000 #ElseIf LoggerType = CR1000 VoltSe(ValueRead,1,mV2500,12,0,0,_50Hz,0.
Section 11. Programming Resource Library EXAMPLE 11.10-1 lists CRBASIC code that uses TrigVar() rather than DataInterval() to trigger data storage. TABLE 11.10-1 shows data produced by the example code. EXAMPLE 11.10-1. 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.
Section 11. Programming Resource Library 11.11 Programming for Control This section is not yet available. 11.12 NSEC Data Type 11.12.1 NSEC Application NSEC data type consists of 8 bytes divided up as 4 bytes of seconds since 1990 and 4 bytes of nanoseconds into the second. NSEC is used when a LONG variable being sampled is the result of the RealTime() instruction, or when the sampled variable is a LONG storing time since 1990, such as results when time-of-maximum or time-of-minimum is requested.
Section 11. Programming Resource Library 11.12.3 Example NSEC Programming EXAMPLE 11.12-1. CRBASIC Code: Using NSEC data type on a 1 element array. A timestamp is retrieved into variable TimeVar(1) as seconds since 00:00:00 1 January 1990. Because the variable is dimensioned to 1, NSEC assumes the value = seconds since 00:00:00 1 January 1990.
Section 11. Programming Resource Library BeginProg Scan (1,Sec,0,0) PanelTemp (PTempC,250) MaxVar = FirstTable.PTempC_Max TimeOfMaxVar = FirstTable.PTempC_TMx CallTable FirstTable CallTable SecondTable NextScan EndProg EXAMPLE 11.12-3. CRBASIC Code: Using NSEC data type with a 7 element time array. A timestamp is retrieved into variable rTime(1) through rTime(9) as year, month, day, hour, minutes, seconds, and microseconds using the RealTime() instruction.
Section 12. Memory and Data Storage CR1000 memory consists of four storage media: 1. 2. 3. 4. Internal Flash EEPROM Internal Serial Flash Internal SRAM External Compact Flash (CF) (optional) Table 10-1 illustrates the structure of CR1000 memory. The CR1000 utilizes many memory features automatically. However, users control, and should monitor, those areas of memory wherein data tables, CRBASIC program files, and image files reside.
Section 12. Memory and Data Storage TABLE 10-1. CR1000 Memory Allocation NOTE: As of September 2007, all new CR1000s have 4 MB SRAM. Internal Flash EEPROM SRAM 2 or 4 MB Notes See Table 10-2. Internal Serial Flash 128K or 512K Device Configuration Settings Backup ~ 1K “CPU” Drive for files ~ 98K External Compact Flash (Variable size) “CRD” Drive for files 12-2 A backup of all the Device Configuration Settings, such as PakBus Address, Station Name, Beacon Intervals, Neighbor lists, etc.
Section 12. Memory and Data Storage TABLE 10-2. CR1000 SRAM Memory SRAM 2 or 4 MB “Static” Memory used by the operating system regardless of the user’s program. --------------------------Operating Settings and Properties --------------------------User’s Program operating memory --------------------------Variables Constants --------------------------Auto-allocated final storage tables Notes The operating system requires some memory in which to operate.
Section 12. Memory and Data Storage 12.1 Internal SRAM SRAM (2 or 4 Mbytes) is powered by the internal CR1000 battery when main power is disconnected so data remain in memory. SRAM data are erased when a program is sent to the CR1000. Some SRAM is used by the operating system. The CR1000 can be programmed to store each measurement or, more commonly, to store processed values such as averages, maxima, minima, histograms, FFTs, etc. Storage can be programmed to occur periodically or conditionally.
Section 12. Memory and Data Storage If the card has adequate space, the tables will be allocated and the CR1000 will start storing data to them. If there is no card or if there is not enough space, the CR1000 will warn that the card is not being used and will run the program, storing the data in SRAM only. When a card with enough available memory is inserted the CR1000 will create the data tables on the card and store the data that is accumulated in SRAM.
Section 12. Memory and Data Storage Filemanage() command is used within the CRBASIC program to remove files from the USR: drive. Files are managed manually using the File Control tool in LoggerNet. Files are collected by remote ftp connections (where there is a TCP/IP connection to the logger), manually using the file control tool in LoggerNet, or automatically using the LNCMD program supplied with LoggerNet. Two status table registers are used to monitor use and size of the USR: drive.
Section 12. Memory and Data Storage TABLE 12.6-1. File Control Functions File Control Functions Accessed Through Sending programs to the CR1000. Send 1, LN file control2, DevConfig3, CF manual4, CF power-up5 Setting file attributes. See TABLE 12.6-2. LN file control2, CF power-up5, FileManage()6. Sending an OS to the CR1000. Reset settings. LN file control2, DevConfig3, CF automatic5 Sending an OS to the CR1000. Preserve settings. Send 1, LN file control with default.
Section 12. Memory and Data Storage 12.6.1 File Attributes A feature of program files is the file attribute. TABLE 12.6-2 lists available file attributes, their functions, and when attributes are typically used. For example, a program file sent via the Send option in LoggerNet, PC400, or PC200W, runs a) immediately and b) when power is cycled on the CR1000. This functionality is invoked because Send sets two CR1000 file attributes on the program file.
Section 12. Memory and Data Storage if “keep CF data” keep CF data from overwritten program if current program = overwritten program keep CPU data keep cache data else erase CPU data erase cache data end if end if if “erase CF data” erase CF data from overwritten program erase CPU data erase cache data end if FIGURE 12.6-1. Summary of the Effect of CF Data Options on CR1000 Data. 12.6.
Section 12. Memory and Data Storage “Oh, what a tangled web we weave...” - Sir Walter Scott. Back in the old days of volatile RAM, life was simple. Nasty at times, but simple. You lose power, you lose program, variables, and data. Simple. You re-start from scratch. The advent of non-volatile memory has saved a lot of frustration in the field, but it requires thought in some applications.
Section 12. Memory and Data Storage TABLE 12.6-3. Powerup.ini Commands Command Description 1 Run always, preserve CF data files 2 Run on power-up 5 Format 6 Run now, preserve CF data files 9 Load OS (File = .obj) 13 Run always, erase CF data files now 14 Run now, erase CF data files now By using PreserveVariables() instruction in the CR1000 CRBASIC program, with options 1 & 6, data and variables can be preserved. EXAMPLE 12.6-1. Powerup.ini code.
Section 12. Memory and Data Storage Program Execution After File is processed, the following rules determine what CR1000 program to run: 1) If the Run Now program is changed then it will be the program that runs. 2) If no change is made to Run Now program, but Run on Power-up program is changed, the new Run on Power-up program runs. 3) If neither Run on Power-up nor Run Now programs are changed, the previous Run on Power-up program runs. Example Power-up.ini Files EXAMPLE 12.6-2 through EXAMPLE 12.
Section 13. Telecommunications and Data Retrieval Telecommunications, in the context of CR1000 operation, is the movement of information between the CR1000 and another computing device, usually a PC. The information can be programs, data, files, or control commands. Telecommunications systems require three principal components: hardware, carrier signal, and protocol. For example, a common way to communicate with the CR1000 is with PC200W software by way of a PC COM port.
Section 13. Telecommunications and Data Retrieval 13.2 Protocols The primary telecommunication protocol for the CR1000 is PakBus (Section 14 PakBus Overview). ModBus and DNP3 are also supported on board (Section 15). CANBUS is also supported when using the Campbell Scientific CANBUS communications module. 13.3 Initiating Telecommunications Telecommunications sessions are usually initiated by the user or PC.
Section 13. Telecommunications and Data Retrieval 13.4 Data Retrieval Data tables are transferred to PC files through a telecommunications link (Section 13 Telecommunications and Data Retrieval) or by transporting the CF card to the PC. 13.4.1 Via Telecommunications Data are usually transferred through a telecommunications link to an ASCII file on the supporting PC using Campbell Scientific datalogger support software (Section 16 Support Software).
Section 13. Telecommunications and Data Retrieval This is a blank page.
Section 14. PakBus Overview Read more! This section is provided as a primer to PakBus communications. Complete information is available in Campbell Scientific’s “PakBus Networking Guide.” The CR1000 communicates with computers or other dataloggers via PakBus. PakBus is a proprietary telecommunications protocol similar in concept to IP (Internet protocol). PakBus allows compatible Campbell Scientific dataloggers and telecommunications hardware to seamlessly link to a PakBus network. 14.
Section 14. PakBus Overview o Routers can be central routers. Central routers know the entire network. A PC running LoggerNet is typically a central router. o Routers can be router-capable dataloggers or communications devices. The CR1000 is a leaf node by factory default. It can be configured as a router by setting “IsRouter” in its status table to “1” or “True”. The network shown in FIGURE 14.2-1 contains 6 routers and 8 leaf nodes. FIGURE 14.2-1. PakBus Network Addressing.
Section 14. PakBus Overview 14.4 Linking Nodes: Neighbor Discovery To form a network, nodes must establish links with neighbors (adjacent nodes). Links are established through a process called discovery. Discovery occurs when nodes exchange hellos. A hello exchange occurs during a hello-message between two nodes. 14.4.1 Hello-message (two-way exchange) A hello-message is an interchange between two nodes that negotiates a neighbor link.
Section 14. PakBus Overview 14.4.6 Maintaining Links Links are maintained by means of the CVI (communications verification interval). The CVI can be specified in each node with DevConfig. The following rules* apply: If Verify Interval = 0, then CVI = 2.5 x beacon interval* If Verify Interval = 60, then CVI = 60 seconds* If Beacon Interval = 0 and Verify Interval = 0, then CVI = 300 seconds* *During the hello-message, a CVI must be negotiated between two neighbors.
Section 14. PakBus Overview Hence, the size of the responses to the file receive commands that the CR1000 sends will be governed by the maxPacketSize setting for the datalogger as well as that of any of its parents in LoggerNet's network map. Note that this calculation also takes into account the error rate for devices in the link. BMP5 data collection transaction does not provide any way for the client to specify a cap on the size of the response message.
Section 14. PakBus Overview 14.6 LoggerNet Device Map Configuration As shown in FIGURE 14.6-1 and FIGURE 14.6-2, the essential element of a PakBus network device map in LoggerNet is the PakBusPort. After adding the root port (COM, IP, etc), add a PakBusPort and the dataloggers. FIGURE 14.6-1. Flat Map FIGURE 14.6-2. Tree Map Use the ‘tree’ configuration of FIGURE 14.6-2 when communications requires routers.
Section 15. Alternate Telecoms Resource Library 15.1 DNP3 The CR1000 is DNP3 SCADA compatible. DNP3 is a SCADA protocol used primarily by utilities, power generation and distribution networks, and the water and wastewater treatment industry. Distributed Network Protocol (DNP) is an open protocol used in applications to ensure data integrity using minimal data bandwidth. DNP implementation in the CR1000 is DNP3 level 2 Slave compliant with some of the operations found in a level 3 implementation.
Section 15. Alternate Telecoms Resource Library 'Main Program BeginProg 'DNP communication over the RS-232 port at 115.2kbps.
Section 15. Alternate Telecoms Resource Library serial sensors. Because Modbus uses a common bus and addresses each node, serial sensors are essentially multiplexed to a CR1000 datalogger. By default, a CSI datalogger goes into sleep mode after 40 seconds of communications inactivity. Once asleep, two packets are required before the datalogger will respond. The first packet wakes the logger up and the second packet is received as data.
Section 15. Alternate Telecoms Resource Library Holding Registers 40001 - 49999 Hold values resulting from a programming action. Holding registers in the Modbus domain are read / write. In the CSI domain, the leading digit in Modbus digital, input and holding registers is ignored, and so digital, input, and holding registers are assigned together to a single variable array. Thus, in the CSI domain, holding registers are declared as Dim or Public variables and are read / write.
Section 15. Alternate Telecoms Resource Library ModbusSlave Sets up a datalogger as a Modbus slave device. Syntax ModbusSlave (ComPort, BaudRate, ModbusAddr, DataVariable, BooleanVariable) MoveBytes Moves binary bytes of data into a different memory location when translating big endian to little endian data. Syntax MoveBytes | Dest | DestOffset | Source | SourceOffset | NumBytes 15.2.3.3 Addressing (ModbusAddr) Modbus devices have a unique address in each network. Addresses range from 1 to 247.
Section 15. Alternate Telecoms Resource Library 15.2.4 Troubleshooting Test the Modbus functions on the datalogger with third party software Modbus software. Further information is available at the following links: http://ecatalog.campbellsci.com/kbase/knowbase.cfm http://www.simplyModbus.ca/FAQ.htm http://www.Modbus.org/tech.php http://www.lammertbies.nl/comm/info/Modbus.html http://www.telemecanique.com/85256D9800508A3B/all/ 852566B70073220C85256752006EA537?OpenDocument&L=EN 15.2.
Section 15. Alternate Telecoms Resource Library FIGURE 15.2-1. NL100/NL105 Settings. Verify the correct OS version and enter IP address, net mask, and default gateway. FIGURE 15.2-2. PakBus Settings. The PakBus address must be unique to the network. PakBus / TCP Server must be enabled. Pick a PakBus / TCP Server port number or use the default. PakBus / TCP Client should be disabled. Modbus / TCP - PakBus Gateway should be enabled.
Section 15. Alternate Telecoms Resource Library FIGURE 15.2-3. RS-485 Settings. This port should be disabled, unless an RS485 connection is being used. FIGURE 15.2-4. RS-232 Settings. This port should be set to Configuration Monitor.
Section 15. Alternate Telecoms Resource Library FIGURE 15.2-5. CS I/O Settings. The CS I/O Configuration should be set to PakBus. The SDC Address/Me Baud Rate should be set to SDC7 or SDC8. The Serial Server Port will not be active. PakBus Beacon Interval will probably be ok at 60 sec. As a result the PakBus verify Interval will be 0. FIGURE 15.2-6. Tlink Settings. This option is disabled.
Section 15. Alternate Telecoms Resource Library 15.2.6.2 Configuring the CR1000 The CRBASIC program has to include the instruction ModbusSlave, which defines what variables are accessible and the Modbus address of the devise. The ModbusSlave instruction does not need to be executed every time the program runs but it must at least be placed between the 'Begin Program' and 'Scan' instructions (see program example below). The Modbus address and the datalogger PakBus address must be identical.
Section 16. Support Software PC / Windows(R) compatible software products are available from Campbell Scientific to facilitate CR1000 programming, maintenance, data retrieval, and data presentation. Short Cut, PC200W, and Visual Weather are designed for novice integrators, but have features useful in advanced applications. PC400 and LoggerNet provide increasing levels of power required for advanced integration, programming and networking applications.
Section 16. Support Software the LoggerNet server. TABLE 16.5-2 lists features of LoggerNet products that require the LoggerNet server as an additional purchase. TABLE 16.5-1. LoggerNet Products that Include the LoggerNet Server LoggerNet Datalogger management, programming, data collection, scheduled data collection, network monitoring and troubleshooting, graphical data displays, automated tasks, data viewing and post-processing.
Section 16. Support Software 16.6 PDA Software PConnect Software supports PDAs with Palm Operating Systems. PConnectCE supports Windows Mobile and Pocket PC PDAs. Both support direct RS-232 connection to the CR1000 for sending programs, collecting data, and digital real-time monitoring.
Section 16. Support Software This is a blank page.
Section 17. CR1000KD: Using the Keyboard Display Read more! See Section 11.6 CR1000KD Custom Menus. The CR1000 has an optional keyboard display, the CR1000KD. This section illustrates the use of the CR1000KD using its default menus. The CR1000KD has a few keys that have special functions which are listed below.
Section 17. CR1000KD: Using the Keyboard Display Power Up Screen CAMPBELL SCIENTIFIC CR1000 Datalogger 06/18/2000, 18:24:35 CPU: TRIG.CR1 Running.
Section 17. CR1000KD: Using the Keyboard Display 17.1 Data Display Data Run/Stop Program File PCCard Ports and Status Configure, Settings Move the cursor to Data and press Enter Real Time Tables Real Time Custom Final Storage Data Reset Data Tables Graph Setup List of Data Tables created by active program List of User-Selected Variables (blank if not set up) List of Data Tables created by active program All Tables List of Data Tables created by active program Graph Type Roll Scaler Manual Upper: 0.
Section 17. CR1000KD: Using the Keyboard Display 17.1.1 Real Time Tables List of Data Tables created by active program. For Example, Public Table1 Temps Move the cursor to desired table and press Enter Tref TCTemp(1) TCTemp(2) TCTemp(3) Flag(1) Flag(2) Flag(3) Flag(4) : 23.0234 : 19.6243 : 19.3429 : 21.2003 : -1.0000 : 0.00000 : 0.00000 : 0.00000 Public Table values can be changed. Move the cursor to value and press Enter to edit value.
Section 17. CR1000KD: Using the Keyboard Display 17.1.2 Real Time Custom The CR1000KD can be configured with a user defined real-time display. The CR1000 will keep the setup as long as the same program is running, or it is changed by the user. Read more! Custom menus can also be programmed. See Section 11.6 CR1000KD Custom Menus for more information. List of UserSelected Variables List of Data Tables created by active program.
Section 17. CR1000KD: Using the Keyboard Display 17.1.3 Final Storage Tables List of Data Tables created by active program.
Section 17. CR1000KD: Using the Keyboard Display 17.2 Run/Stop Program Data Run/Stop Program File PCCard Ports and Status Configure, Settings Move the cursor to run/stop program and press Enter. If program is running CPU: ProgramName.CR1 Is Running >* Run on Power Up Stop, Retain Data Stop, Delete Data Restart, Retain Data Restart, Delete Data Execute } Select 1 (press Enter) and move the cursor to Execute. Press Enter to execute. Press escape to cancel or get list of available programs.
Section 17. CR1000KD: Using the Keyboard Display 17.3 File Display Data Run/Stop Program File PCCard Ports and Status Configure, Settings New File Name: CPU: .CR1 CRD: .CR1 Move the cursor to File and press Enter New Edit Copy Delete Run Options Directory Format CPU: CRD: Copy From To Execute List of files on CPU or Card.
Section 17. CR1000KD: Using the Keyboard Display 17.3.1 File: Edit The CRBASIC Editor is recommended for writing and editing datalogger programs. Changes in the field can be made with the keyboard display. List of Program files on CPU: or CRD: For Example: CPU: TCTEMP.CR1 RACE.CR1 0 0 Save Changes? Yes No ESC Move the cursor to desired Program and press Enter CR1000 ' TCTemp.
Section 17. CR1000KD: Using the Keyboard Display 17.4 PCCard Display Data Run/Stop Program File PCCard Ports and Status Configure, Settings Move the cursor to PCCard and press Enter PCCard is only in menu if a CF card module is attached and a CF card is inserted.
Section 17. CR1000KD: Using the Keyboard Display 17.5 Ports and Status Read more! See Appendix A Status Table Ports Status Table PortStatus (1): PortStatus (2): PortStatus (3): PortStatus (4): PortStatus (5): PortStatus (6): PortStatus (7): PortStatus (8): OFF OFF OFF OFF OFF OFF OFF OFF Move the cursor to the desired port and press Enter to toggle OFF/ON. The port must be configured as an output to be toggled.
Section 17. CR1000KD: Using the Keyboard Display 17.
Section 17. CR1000KD: Using the Keyboard Display 17.6.1 Set Time / Date Move the cursor to time element and press Enter to change it. Then move the cursor to Set and press Enter to apply the change. 17.6.2 PakBus Settings In the Settings menu, move the cursor to the PakBus element and press Enter to change it. After modifying, press Enter to apply the change. 17.6.
Section 17. CR1000KD: Using the Keyboard Display This is a blank page.
Section 18. Care and Maintenance Temperature and humidity can affect the performance of the CR1000. The internal lithium battery must be replaced periodically. 18.1 Temperature Range The standard CR1000 is designed to operate reliably from -25 to +50°C (-40°C to +85°C, optional) in non-condensing humidity. 18.2 Moisture Protection When humidity tolerances are exceeded and condensation occurs, damage to CR1000 electronics can result. Effective humidity control is the responsibility of the user.
Section 18. Care and Maintenance 18.4 Replacing the Internal Battery CAUTION Misuse of the lithium battery or installing it improperly can cause severe injury. Fire, explosion, and severe burn hazard! Do not recharge, disassemble, heat above 100°C (212°F), solder directly to the cell, incinerate, nor expose contents to water. Dispose of spent lithium batteries properly. The CR1000 contains a lithium battery that operates the clock and SRAM when the CR1000 is not powered.
Section 18. Care and Maintenance Logan, Utah FIGURE 18.4-1. CR1000 with wiring panel. FIGURE 18.4-2. Loosen thumbscrew to remove CR1000 canister from wiring panel.
Section 18. Care and Maintenance FIGURE 18.4-3. Pull edge with thumbscrew away from wiring panel. FIGURE 18.4-4. Remove nuts to disassemble canister.
BATT ERY Section 18. Care and Maintenance K DESI PA DESI PAK FIGURE 18.4-5. Remove and replace battery.
Section 18. Care and Maintenance This is a blank page.
Section 19. Troubleshooting NOTE If any component needs to be returned to the factory for repair or recalibration, remember that an RMA number is required. Contact a Campbell Scientific applications engineer to receive the RMA number. 19.1 Programming 19.1.1 Debugging Resources A properly deployed CR1000 measures sensors accurately and stores all data as requested by the program.
Section 19. Troubleshooting SkippedRecord - Increments normally caused by skipped scans, which occur when a table called by the skipped scan is supposed to store data. These counters are not incremented by all events that leave gaps in data, including the CR1000 powering down or the CR1000 clock being changed. ProgErrors -- If not zero, investigate Memoryfree -- Too small a number leads to problems.
Section 19. Troubleshooting experimenting with the InstructionTimes() instruction in the program. Analyzing InstructionTimes() results can be difficult due to the multitasking nature of the logger, but it can be a powerful way to fine tune a program. 19.1.4 NAN and ±INF NAN (not-a-number) and ±INF (infinite) are data words indicating an exceptional occurrence in datalogger function or processing. NAN is a constant that can be used in expressions such as in EXAMPLE 19.
Section 19. Troubleshooting TABLE 19.1-1. Math Expressions and CRBASIC Results Expression 0/0 ∞-∞ (-1) ∞ 0 * -∞ ±∞ / ±∞ 1∞ 0*∞ x / 0 x / -0 -x / 0 -x / -0 ∞0 0∞ 00 CRBASIC Expression 0/0 (1 / 0) - (1 / 0) -1 ^ (1 / 0) 0 * (-1 * (1 / 0)) (1 / 0) / (1 / 0) 1 ^ (1 / 0) 0 * (1 / 0) 1/0 1 / -0 -1 / 0 -1 / -0 (1 / 0) ^ 0 0 ^ (1 / 0) 0^0 Result NAN NAN NAN NAN NAN NAN NAN INF INF -INF -INF INF 0 1 19.1.4.
Section 19. Troubleshooting 19.2 Communications 19.2.1 RS-232 Baud rate mis-match between the CR1000 and LoggerNet is often the root of communication problems through the RS-232 port. By default, the CR1000 attempts to adjust its baud rate to that of LoggerNet. However, settings changed in the CR1000 to accommodate a specific RS-232 device, such as a smart sensor, display or modem, may confine the RS-232 port to a single baud rate.
Section 19. Troubleshooting 19.4 Power Supply 19.4.1 Overview Power supply systems may include batteries, charger/regulators, and charging sources such as solar panels or transformers. All of these components may need to be checked if the power supply is not functioning properly. Section 17.4.
Section 19. Troubleshooting 19.4.3 Diagnosis and Fix Procedures 19.4.3.1 Battery Voltage Test If using a rechargeable power supply, disconnect the charging source (e.g., Solar Panel, Transformer connected to 120 Vac) from the battery pack and wait for 20 minutes before proceeding with the test. Set the voltmeter to read dc voltages as high as 15 Vdc. Use the voltmeter to measure the voltage between the +12 V and Ground terminals on the datalogger. Is the voltage > 10.
Section 19. Troubleshooting 19.4.3.2 Charging Circuit Test — Solar Panel Disconnect any wires attached to the 12 V and ground terminals on the charging regulator (e.g., PS100, CH100, PS12LA). Disconnect the battery from the charging circuit. Only the solar panel should be connected. This test assumes the solar panel has an unregulated output. Set the voltmeter to measure dc voltages. Use the voltmeter to measure the voltage output of the solar panel at the “CHG” inputs on the regulator.
Section 19. Troubleshooting 19.4.3.3 Charging Circuit Test — Transformer Disconnect any wires attached to the 12 V and ground terminals on the charging regulator (e.g., PS100, CH100, PS12LA). Disconnect the battery from the charging circuit. Only the trans-former should be connected. The transformer should be connected to 120 Vac. Determine whether the transformer output is an ac or dc voltage and set the voltmeter to read that type of voltage.
Section 19. Troubleshooting 19.4.3.4 Adjusting Charging Circuit Voltage Campbell Scientific recommends that only a qualified electronic technician perform the following procedure. Place a 5 kohm resistor between the charging regulator’s 12 V output and ground terminals. Use a voltmeter to measure the voltage across the 5 kohm resistor. Connect a charger that provides a voltage greater than 17 V to the input of the charge circuit.
Appendix A. Glossary A.1 Terms AC see VAC. A/D analog-to-digital conversion. The process that translates analog voltage levels to digital values. accuracy a measure of the correctness of a measurement. See also Section A.2.1 Accuracy, Precision, and Resolution. Amperes (Amps) base unit for electric current. Used to quantify the capacity of a power source or the requirements of a power consuming device. analog data presented as continuously variable electrical signals.
Appendix A. Glossary control I/O Terminals C1 - C8 or processes utilizing these terminals. CVI Communications Verification Interval. The interval at which a PakBus device verifies the accessibility of neighbors in its neighbor list. If a neighbor does not communicate for a period of time equal to 2.5 x the CVI, the device will send up to 4 Hellos. If no response is received, the neighbor is removed from the neighbor list. CPU central processing unit. The brains of the CR1000.
Appendix A. Glossary DTE data terminal equipment. While the term has much wider meaning, in the limited context of practical use with the CR1000, it denotes the pin configuration, gender and function of an RS-232 port. The RS-232 port on the CR1000 and on many 3rd party telecommunications devices, such as a digital cellular modems, are DCE. Attachment of a null-modem cable to a DCE device effectively converts it to a DTE device.
Appendix A. Glossary high resolution a high resolution data value has 5 significant digits and may range in magnitude from +.00001 to +99999. A high resolution data value requires 2 Final Storage locations (4 bytes). All Input and Intermediate Storage locations are high resolution. Output to Final Storage defaults to low resolution; high resolution output must be specified by Instruction 78. HTML Hypertext Markup Language. A programming language used for the creation of web pages.
Appendix A. Glossary modem/terminal any device which: 1) has the ability to raise the CR23X's ring line or be used with the SC32A to raise the ring line and put the CR23X in the Telecommunications Command State and 2) has an asynchronous serial communication port which can be configured to communicate with the CR23X. multi-meter an inexpensive and readily available device useful in troubleshooting data acquisition system faults. mV the SI abbreviation for milliVolts. NAN not a number.
Appendix A. Glossary output processing instructions process data values and generate Output Arrays. Examples of Output Processing Instructions include Totalize, Maximize, Minimize, Average, etc. The data sources for these Instructions are values in Input Storage. The results of intermediate calculations are stored in Intermediate Storage. The ultimate destination of data generated by Output Processing Instructions is usually Final Storage but may be Input Storage for further processing.
Appendix A. Glossary Poisson Ratio a ratio used in strain measurements equal to transverse strain divided by extension strain. v = -(εtrans / εaxial). Public a CRBASIC command for declaring and dimensioning variables. Variables declared with PUBLIC can be monitored during datalogger operation. pulse an electrical signal characterized by a sudden increase in voltage follow by a short plateau and a sudden voltage decrease. regulator a device for conditioning an electrical power source.
Appendix A. Glossary Seebeck Effect induces microvolt level thermal electromotive forces (EMF) across junctions of dissimilar metals in the presence of temperature gradients. This is the principle behind thermocouple temperature measurement. It also causes small correctable voltage offsets in CR1000 measurement circuitry. Send denotes the program send button in LoggerNet, PC400, and PC200W datalogger support software.
Appendix A. Glossary normal operation, all processing called for by an instruction must be completed before moving on the next instruction. The maximum throughput rate for a fast single-ended measurement is approximately 192 measurements per second (12 measurements, repeated 16 times per second).
Appendix A. Glossary weather tight describes an instrumentation enclosure impenetrable by common environmental conditions. During extraordinary weather events, however, seals on the enclosure may be breached. XML Extensible Markup Language. A.2 Concepts A.2.1 Accuracy, Precision, and Resolution Three terms often confused are accuracy, precision, and resolution. Accuracy is a measure of the correctness of a single measurement, or the group of measurements in the aggregate.
Appendix B. Status Table The CR1000 status table contains system operating status information accessible via CR1000KD keypad or PC software DevConfig, LoggerNet, or PC400. TABLE B-1 lists some of the more common uses of status table information. TABLE B-2 is a comprehensive list of status table variables with brief descriptions. Status Table information is easily viewed by going to LoggerNet | Connect | Datalogger | View Station Status.
Appendix B. Status Table TABLE B-2. Status Fields and Descriptions Status Fieldname RecNum TimeStamp OSVersion OSDate OSSignature SerialNumber RevBoard StationName1 PakBusAddress2 ProgName StartTime RunSignature ProgSignature Battery PanelTemp WatchdogErrors3 LithiumBattery4 Low12VCount5 Low5VCount CompileResults B-2 Description Variable Default Type Record number for this set of data _ Time the record was generated Time _ Version of the Operating System String _ Date OS was released.
Appendix B. Status Table Status Fieldname Variable Default Normal Type Range A code variable that indicates how the String 0 0 system woke up from power off. The number of compile or runtime Integer _ 0 errors for the current program. Number of times an array was accessed Integer 0 0 out of bounds. Number of skipped scans that have Integer 0 _ occurred while running the current scan. The number of scans skipped in the Integer 0 _ background calibration.
Appendix B. Status Table Status Fieldname Description FullMemReset A value of 98765 written to this location will initiate a full memory reset. Full memory reset will reinitialize RAM disk, final storage, PakBus memory, and return parameters to defaults. Programmed name of data table(s). String Each table has its own entry. array of number of data tables Variable array that posts how many Integer records have been skipped for a given array table. Each table has its own entry.
Appendix B. Status Table Status Fieldname Description BuffDepth Shows the current Pipeline Mode processing buffer depth., which indicates how far processing is currently behind measurement. Gives the maximum number of buffers processing lagged measurement. The last time the background calibration executed. The last time SlowSequence scan(s) executed. The time (μs) required to process the background calibration. The time (μs) required to process SlowSequence scan(s).
Appendix B. Status Table Status Fieldname CommActive15 CommConfig Baudrate16 IsRouter PakBusNodes CentralRouters(1) - (8)17 B-6 Description Variable Default Normal Type Range Array of Boolean values telling if Boolean False, True or communications is currently active on array of except False the corresponding port.
Appendix B. Status Table Status Fieldname Beacon Verify MaxPacketSize USRDriveSize IPInfo pppInterface pppIPAddr pppUsername pppPassword Description Variable Default Type Array of Beacon intervals (in seconds) Integer 0 for comms ports. Aliased to BeaconRS- array of 232, 9 BeaconME, BeaconSDC7, BeaconSDC8, BeaconSDC10, BeaconSDC11, BeaconCOM1, BeaconCOM2, BeaconCOM3, BeaconCOM4 Array of verify intervals (in seconds) Integer 0 for com ports.
Appendix B. Status Table Status Fieldname Description pppDial Specifies the dial string that follows ATD (e.g., #777 for Redwing CDMA) or a list of AT commands separated by ';' (e.g., ATV1; AT+CGATT=0;ATD*99***1#), that will be used to initialise and dial through a modem before a PPP connection is attempted. A blank string means that dialling is not necessary before a PPP connection is established. Specifies the response expected after String dialing a modem before a PPP connection can be established.
Appendix B. Status Table 7 The Variable out of Bounds error occurs when a program tries to write to an array variable outside of its declared size. It is a programming error that causes this, and should not be ignored. When the datalogger detects that a write outside of an array is being attempted it does not perform the write and increments the VOOB in the status table. The compiler and precompiler can only catch things like reps too large for an array etc.
Appendix B. Status Table (14) 2500 mV range 1/50 Hz integration, (15) 250 mV range 1/50 Hz integration, (16) 25 mV range 1/50 Hz integration, (17) 7.5 mV range 1/50 Hz integration, (18) 2.5 mV range 1/50 Hz integration This is a blank page.
Appendix C. Serial Port Pin Outs C.1 CS I/O Communications Port Pin configuration for the CR1000 CS I/O port is listed in TABLE C-1. TABLE C-1. CS I/O Pin Description ABR PIN O I = = = = Abbreviation for the function name. Pin number. Signal Out of the CR1000 to a peripheral. Signal Into the CR1000 from a peripheral. PIN ABR I/O Description 1 5V O 5V: Sources 5 VDC, used to power peripherals. 2 SG 3 RING I Ring: Raised by a peripheral to put the CR1000 in the telecommunications mode.
Appendix C. Serial Port Pin Outs C.2 RS-232 Communications Port Pin configuration for the CR1000 RS-232 9-pin port is listed in TABLE C-2. Information for using a null modem with the RS-232 9-pin port is given in TABLE C-3. The Datalogger RS-232 port can function as either a DCE (Data Communication Equipment) or DTE (Data Terminal Equipment) device. For the Datalogger RS-232 port to function as a DTE device, a null modem cable is required.
Appendix C. Serial Port Pin Outs TABLE C-3.
Appendix C.
Appendix D. ASCII Table American Standard Code for Information Interchange Decimal Values and Characters Dec. Char. Dec. Char. Dec. Char. Dec. Char.
Appendix D. ASCII Table This is a blank page.
Index to Sections The index lists page numbers to headings of sections containing desired information. Consequently, sought after information may be on pages subsequent to those listed in the index.
Index to Sections Calibration - Error, B-1 Calibration – Field Calibration Example Programs, 11-3 Calibration – Field Calibration Offset, 11-5 Calibration – Field Calibration Slope / Offset, 11-6 Calibration – Field Calibration Slope Only, 11-8 Calibration – Field Calibration Zero, 11-3 Calibration - Manual Field Calibration, 11-2 Calibration - Single-point Field Calibration, 11-3 Calibration - Two-point Field Calibration, 11-3 Calibration Functions, 10-39 Calibration Gain, B-1 Calibration, Self-, 4-13 Call
Index to Sections Data Fill Days, B-1 Data Format, 13-3 Data Point, A-2 Data Record Size, B-1 Data Retrieval, 2-1, 13-1, 13-3 Data Storage, 3-7, 10-3, 10-4, 12-1 Data Storage - Trigger, 11-35 Data Table, 9-12 Data Table Names, B-1 Data Tables, 2-16, 9-11, 9-28, 10-3, 10-35, 17-6 Data Type, 9-7, 9-24 Data Types, 9-7, 9-8, 9-23 DataEvent, 10-3 DataGram, 10-32 DataInterval, 10-3 DataInterval() Instruction, 9-14 Datalogger, 2-1 Datalogger Support Software, 3-11, A-2 DataLong … Read … Restore, 10-9 DataTable … E
Index to Sections File Attributes, 12-8 File Control, 12-6 File Display, 17-8 File Management, 10-34 FileClose, 10-34 FileList, 10-34 FileManage, 10-34 FileMark, 10-35 FileOpen, 10-34 FileRead, 10-34 FileReadLine, 10-34 FileRename, 10-35 FileSize, 10-35 FileTime, 10-35 FileWrite, 10-35 Fill-and-Stop, 12-4 FillStop, 10-3 Final Storage, A-3 Final Storage Tables, 17-6 FindSpa, 10-34 Firmware, 3-6 Fixed Voltage Range, 4-4 Flags, 9-11, 15-4 Flat Map, 14-6 FLOAT, 9-7, 9-23, 9-24, 9-25, 19-4 Floating Point, 9-22 F
Index to Sections IP - Modbus, 15-6 IP Address, A-4 IP Information, B-1 IPTrace, 10-37 Junction Box, 4-29 Keyboard, 3-9 Keyboard Display, 3-9, 10-28, 11-32, 17-1 Leads, 4-10 Leaf Node, 14-2 Leaf Nodes, 14-1 Left, 10-25 Len, 10-25 LevelCrossing, 10-6 Lightning, 2-2, 3-11, 7-1, A-3 Linear Sensors, 4-34 Link Performance, 14-5 Lithium Battery, 18-2, B-1 LN or LOG, 10-21 LoadFieldCal, 10-40 LOG10, 10-21 Logger Control, 8-10 LoggerNet, 16-1, 16-2 Logic, 9-27 Logical Expressions, 9-25 Logical Operators, 10-18 Long
Index to Sections Numerical Formats, 9-3 Offset, 4-7, 9-21, 9-22 Ohm, A-5 Ohms Law, A-5 OID, 4-4 OMNISAT, 10-41 OmniSatData, 10-41 OmniSatRandomSetup, 10-41 OmniSatStatus, 10-41 OmniSatSTSetup, 10-41 On-line Data Transfer, A-5 Opcodes, B-1 Open Input Detect, 4-4 Open Inputs, 4-5 OpenInterval, 10-3 Operating System, 8-2, 8-3 Operating Temperature Range, 18-1 Operators, 10-16, 10-18 OR, 10-18 OR Diode Circuit, 6-2 OS, 8-2, 8-3 OS Date, B-1 OS Signature, B-1 OS Version, B-1 Output, A-5 Output Array, A-5 Output
Index to Sections Program - Declarations, 9-6, 10-1 Program - Dimensions, 9-7 Program - Documenting, 9-1 Program - Expressions, 9-21, 9-22 Program – Field Calibration, 11-2 Program - Flags, 9-11 Program - Floating Point Arithmetic, 9-22 Program - Instructions, 9-20 Program - Mathematical Operations, 9-23 Program - Measurement Instructions, 9-20 Program - Modbus, 15-4 Program - Multiplier, 9-21 Program - Names in Parameters, 9-21 Program - Offsets, 9-21 Program - Output Processing, 9-15 Program - Overrun, 19
Index to Sections RX, C-1 Sample, 10-5 Sample Rate, A-7 SampleFieldCal, 10-5, 10-39 SampleMaxMin, 10-5 Satellite, 10-40 SatVP, 10-22 Saving Memory, 9-23 SCADA, 3-8, 3-9, 10-39, 15-1, 15-2 Scan, 9-16, 9-17 Scan (execution interval), A-7 Scan … ExitScan … NextScan, 10-8 Scan Interval, 9-16, 9-17 Scientific Notation, 9-3 SDE, C-1 SDI-12, 11-21, 11-25, 11-26, A-7 SDI-12 Measurements, 4-34, 19-3 SDI-12 Recorder, 10-13 SDI-12 Sensor, 10-13 SDI-12 Support, 10-13, 11-20 SDI12Recorder, 10-13 SDI12SensorResponse, 10-
Index to Sections SMTP, 11-20, A-8 SNMP, 11-19 SNP, A-8 Software, 3-11 Software - Beginner, 2-10 Solar Panel, 19-8 SortSpa, 10-23 Span, 9-21, 9-22 Spark Gap, 7-1 Specifications, 3-13 SplitStr, 10-26 Sqr, 10-21 Square Wave, 2-7, 4-31 SRAM, 12-4 Standard Deviation, 11-31 Start Time, B-1 Start Up Code, B-1 Starter Software, 2-10 State, 2-7, 2-8, A-8 StaticRoute, 10-33 Station Name, 8-4, 10-2, B-1 Status, 17-11 Status Table, B-1, B-2 StdDev, 10-5 StdDevSpa, 10-23 Storage, 10-3 Strain, 4-19, 4-20 Strain Calculat
Index to Sections Tutorial, 2-1 Tutorial Exercise, 2-9 TVS, 6-1 TX, C-1 UDP, 10-37 UDPDataGram, 10-38 UDPOpen, 10-38 UINT2, 9-7, 9-9 Units, 10-2 UpperCase, 10-26 UPS, 3-6, 6-1, A-9 User Program, 9-1 USR Drive, B-1 USR Drive Free, B-1 USR:, A-9 VAC, A-9 VaporPressure, 10-22 Variable, A-9 Variable Array, 9-6 Variable Out of Bounds, B-1 Variables, 9-6, 9-23, 10-34 VDC, A-9 Vector, 11-29, 11-30 Vector Processing, 11-28 Vehicle Power, 6-2 Vehicle Power Connection, 6-2 Verify Interval, B-1 Vibrating Wire, 5-4 Vib
This is a blank page.
Campbell Scientific Companies Campbell Scientific, Inc. (CSI) 815 West 1800 North Logan, Utah 84321 UNITED STATES www.campbellsci.com info@campbellsci.com Campbell Scientific Africa Pty. Ltd. (CSAf) PO Box 2450 Somerset West 7129 SOUTH AFRICA www.csafrica.co.za cleroux@csafrica.co.za Campbell Scientific Australia Pty. Ltd. (CSA) PO Box 444 Thuringowa Central QLD 4812 AUSTRALIA www.campbellsci.com.au info@campbellsci.com.au Campbell Scientific do Brazil Ltda.