Campbell Scientific CR510 User Manual

Page 1
CR510 DATALOGGER
OPERATOR'S MANUAL
REVISION: 2/03
COPYRIGHT (c) 1986-2003 CAMPBELL SCIENTIFIC, INC.
Page 2
This is a blank page.
Page 3

WARRANTY AND ASSISTANCE

The
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. The customer shall assume all costs of removing, reinstalling, and shipping defective products to CAMPBELL SCIENTIFIC, INC. CAMPBELL SCIENTIFIC, INC. will return such products by surface carrier prepaid. This warranty shall not apply to any CAMPBELL SCIENTIFIC, INC. products which have been subjected to modification, misuse, neglect, accidents of nature, or shipping damage. This warranty is in lieu of all other warranties, expressed or implied, including warranties of merchantability or fitness for a particular purpose. CAMPBELL SCIENTIFIC, INC. is not liable for special, indirect, incidental, or consequential damages.
Products may not be returned without prior authorization. To obtain a Returned Materials Authorization (RMA), contact CAMPBELL SCIENTIFIC, INC., phone (435) 753-2342. After an applications engineer determines the nature of the problem, an RMA number will be issued. Please write this number clearly on the outside of the shipping container. CAMPBELL SCIENTIFIC's shipping address is:
CAMPBELL SCIENTIFIC, INC.
RMA#_____ 815 West 1800 North Logan, Utah 84321-1784
is warranted by CAMPBELL SCIENTIFIC, INC. to be free from defects in
CAMPBELL SCIENTIFIC, INC. does not accept collect calls. Non-warranty products returned for repair should be accompanied by a purchase order to cover the repair.
815 W. 1800 N. Logan, UT 84321-1784 USA Phone (435) 753-2342 FAX (435) 750-9540 www.campbellsci.com
Campbell Scientific Canada Corp. 11564 -149th Street Edmonton, Alberta T5M 1W7 CANADA Phone (780) 454-2505 FAX (780) 454-2655
Campbell Scientific Ltd. Campbell Park 80 Hathern Road Shepshed, Loughborough LE12 9GX, U.K. Phone +44 (0) 1509 601141 FAX +44 (0) 1509 601091
Page 4
This is a blank page.
Page 5
CR510 MEASUREMENT AND CONTROL MODULE

TABLE OF CONTENTS

PAGE
OV1. PHYSICAL DESCRIPTION
OV1.1 Analog Inputs ......................................................................................................................OV-1
OV1.2 Excitation Outputs............................................................................................................... OV-2
OV1.3 Pulse Inputs ........................................................................................................................ OV-2
OV1.4 Digital I/O Ports................................................................................................................... OV-2
OV1.5 Analog Ground (AG) ........................................................................................................... OV-2
OV1.6 12 V, Power Ground (G), and Earth Terminals................................................................... OV-2
OV1.7 5 V Output........................................................................................................................... OV-2
OV1.8 Serial I/O .............................................................................................................................OV-2
OV1.9 Connecting Power to the CR510......................................................................................... OV-2
OV2. MEMORY AND PROGRAMMING CONCEPTS
OV2.1 Internal Memory..................................................................................................................OV-3
OV2.2 Program Tables, Execution Interval and Output Intervals .................................................. OV-5
OV2.3 CR510 Instruction Types..................................................................................................... OV-6
OV3. COMMUNICATING WITH CR510
OV3.1 Keyboard/Display................................................................................................................OV-8
OV3.2 Using Computer with Datalogger Support Software ........................................................... OV-9
OV3.3 ASCII Terminal or Computer with Terminal Emulator......................................................... OV-9
OV4. PROGRAMMING THE CR510
OV4.1 Programming Sequence ................................................................................................... OV-10
OV4.2 Instruction Format............................................................................................................. OV-10
OV4.3 Entering a Program...........................................................................................................OV-11
OV5. PROGRAMMING EXAMPLES
OV5.1 Sample Program 1............................................................................................................ OV-12
OV5.2 Editing an Existing Program.............................................................................................. OV-14
OV5.3 Setting the Datalogger Time ............................................................................................. OV-15
OV6. DATA RETRIEVAL OPTIONS.................................................................................... OV-16
OV7. SPECIFICATIONS.......................................................................................................... OV-18
PROGRAMMING
1. FUNCTIONAL MODES
1.1 Datalogger Programs - ∗1, ∗2, ∗3, and 4 Modes...................................................................1-1
1.2 Setting and Displaying the Clock - ∗5 Mode............................................................................1-4
1.3 Displaying/Altering Input Memory, Flags, and Ports - ∗6 Mode ..............................................1-4
1.4 Compiling and Logging Data - ∗0 Mode..................................................................................1-5
1.5 Memory Allocation - ∗A ...........................................................................................................1-5
1.6 Memory Testing and System Status - ∗B................................................................................1-9
1.7 C Mode -- Security...............................................................................................................1-11
1.8 D Mode -- Save or Load Program .......................................................................................1-11
i
Page 6
CR510 TABLE OF CONTENTS
2. INTERNAL DATA STORAGE
2.1 Final Storage Areas, Output Arrays, and Memory Pointers................................................... 2-1
2.2 Data Output Format and Range Limits .................................................................................. 2-3
2.3 Displaying Stored Data on Keyboard/Display - 7 Mode........................................................ 2-3
3. INSTRUCTION SET BASICS
3.1 Parameter Data Types........................................................................................................... 3-1
3.2 Repetitions ............................................................................................................................. 3-1
3.3 Entering Negative Numbers................................................................................................... 3-1
3.4 Indexing Input Locations ........................................................................................................ 3-1
3.5 Voltage Range and Overrange Detection .............................................................................. 3-2
3.6 Output Processing.................................................................................................................. 3-2
3.7 Use of Flags: Output and Program Control........................................................................... 3-3
3.8 Program Control Logical Constructions ................................................................................. 3-4
3.9 Instruction Memory and Execution Time................................................................................ 3-7
3.10 Error Codes.......................................................................................................................... 3-11
DATA RETRIEVAL/COMMUNICATION
4. EXTERNAL STORAGE PERIPHERALS
4.1 On-Line Data Transfer - Instruction 96 .................................................................................. 4-1
4.2 Manually Initiated Data Output - ∗8 Mode.............................................................................. 4-3
4.3 Printer Output Formats........................................................................................................... 4-3
4.4 Storage Module...................................................................................................................... 4-4
4.5 9 Mode -- SM192/716 Storage Module Commands............................................................. 4-5
5. TELECOMMUNICATIONS
5.1 Telecommunications Commands .......................................................................................... 5-1
5.2 Remote Programming of the CR510...................................................................................... 5-4
6. 9-PIN SERIAL INPUT/OUTPUT
6.1 Pin Description....................................................................................................................... 6-1
6.2 Enabling and Addressing Peripherals.................................................................................... 6-2
6.3 Ring Interrupts........................................................................................................................ 6-3
6.4 Interrupts During Data Transfer ............................................................................................. 6-3
6.5 Modem/Terminal Peripherals................................................................................................. 6-4
6.6 Synchronous Device Communication .................................................................................... 6-4
6.7 Modem/Terminal and Computer Requirements..................................................................... 6-5
PROGRAM EXAMPLES
7. MEASUREMENT PROGRAMMING EXAMPLES
7.1 Single-Ended Voltage 107 Temperature Probe ..................................................................... 7-1
7.2 Differential Voltage Measurement.......................................................................................... 7-1
7.3 HMP35C Temperature and RH Probe ................................................................................... 7-2
7.4 Anemometer with Photochopper Output................................................................................ 7-3
7.5 Tipping Bucket Rain Gage with Long Leads.......................................................................... 7-4
7.6 100 ohm PRT in 4 Wire Half Bridge....................................................................................... 7-4
7.7 100 ohm PRT in 3 Wire Half Bridge....................................................................................... 7-6
ii
Page 7
CR510 TABLE OF CONTENTS
7.8 100 ohm PRT in 4 Wire Full Bridge ........................................................................................7-7
7.9 Pressure Transducer - 4 Wire Full Bridge ..............................................................................7-8
7.10 Lysimeter - 6 Wire Full Bridge.................................................................................................7-9
7.11 227 Gypsum Soil Moisture Block ..........................................................................................7-11
7.12 Nonlinear Thermistor in Half Bridge......................................................................................7-12
7.13 Water Level - Geokon's Vibrating Wire Pressure Sensor.....................................................7-13
7.14 4 to 20 mA Sensor Using CURS100 Terminal Input Module................................................7-17
8. PROCESSING AND PROGRAM CONTROL EXAMPLES
8.1 Computation of Running Average...........................................................................................8-1
8.2 Rainfall Intensity......................................................................................................................8-2
8.3 Sub 1 Minute Output Interval Synched to Real Time..............................................................8-3
8.4 Switch Closures on Control Port (Rain Gage).........................................................................8-3
8.5 Converting 0-360 Wind Direction Output to 0-540 for Strip Chart...........................................8-4
8.6 Use of 2 Final Storage Areas - Saving Data Prior to Event ....................................................8-5
8.7 Logarithmic Sampling Using Loops.........................................................................................8-6
INSTRUCTIONS
9. INPUT/OUTPUT INSTRUCTIONS.....................................................................................9-1
10. PROCESSING INSTRUCTIONS......................................................................................10-1
11. OUTPUT PROCESSING INSTRUCTIONS...................................................................11-1
12. PROGRAM CONTROL INSTRUCTIONS......................................................................12-1
MEASUREMENTS
13. CR510 MEASUREMENTS
13.1 Fast and Slow Measurement Sequence ...............................................................................13-1
13.2 Single-Ended and Differential Voltage Measurements .........................................................13-2
13.3 The Effect of Sensor Lead Length on the Signal Settling Time ............................................13-3
13.4 Bridge Resistance Measurements ......................................................................................13-12
13.5 Resistance Measurements Requiring AC Excitation ..........................................................13-16
13.6 Calibration Process.............................................................................................................13-17
INSTALLATION
14. INSTALLATION AND MAINTENANCE
14.1 Protection from the Environment ..........................................................................................14-1
14.2 Power Requirements.............................................................................................................14-1
14.3 Campbell Scientific Power Supplies......................................................................................14-2
14.4 Solar Panels..........................................................................................................................14-5
14.5 Direct Battery Connection to the CR510 Terminal Strip........................................................14-5
14.6 Vehicle Power Supply Connections ......................................................................................14-5
14.7 Grounding .............................................................................................................................14-6
14.8 Terminal Strip........................................................................................................................14-7
14.9 Use of Digital I/O Ports for Switching Relays........................................................................14-7
14.10 Maintenance..........................................................................................................................14-9
iii
Page 8
CR510 TABLE OF CONTENTS
APPENDICES
A. GLOSSARY..............................................................................................................................A-1
B. ADDITIONAL TELECOMMUNICATIONS INFORMATION
B.1 Telecommunications Command with Binary Responses.......................................................B-1
B.2 Final Storage Format .............................................................................................................B-3
B.3 Generation of Signature.........................................................................................................B-5
B.4 D Commands to Transfer Program with Computer..............................................................B-5
C. ASCII TABLE...........................................................................................................................C-1
D. DATALOGGER INITIATED COMMUNICATIONS
D.1 Introduction.............................................................................................................................D-1
D.2 Example Phone Callback Program Based On A Condition ...................................................D-1
D.3 PC208 DOS Computer Software and It’s Computer Setup ...................................................D-2
E. CALL ANOTHER DATALOGGER VIA PHONE OR RF
E.1 Introduction.............................................................................................................................E-1
E.2 Programming..........................................................................................................................E-1
E.3 Programming for the Calling CR510 ...................................................................................... E-1
E.4 Remote Datalogger Programming......................................................................................... E-3
F. MODBUS ON THE CR10 AND CR510
F.1 Terminology............................................................................................................................F-1
F.2 Communications and Compatibility........................................................................................ F-1
F.3 More on Modbus .................................................................................................................... F-2
G. TD OPERATING SYSTEM ADDENDUM FOR CR510, CR10X, AND
CR23X MANUALS
LIST OF TABLES..........................................................................................................................LT-1
LIST OF FIGURES........................................................................................................................ LF-1
iv
Page 9

FEATURES OF CR510

The CR510 is programmed in the same way as the CR500 and executes existing CR500 programs. The CR510 has a clock and memory backed by an internal battery. This keeps the time and data while the CR510 is not connected to external power.
GENERAL
POWER UP
When primary power is applied to the CR510, it tests the FLASH memory and loads the current program to RAM. After the program compiles successfully, the CR510 begins executing the program. If the ring line on the 9 pin connector is raised while the CR510 is testing memory, there will be a 128 second delay before compiling and running the program. This can be used to edit or change the program before it starts running. To raise the ring line, press any key on the CR10KD keyboard display or call the CR510 with the computer during the power up sequence (i.e., while “HELLO” is displayed on the CR10KD).
LITHIUM BATTERY
A lithium battery powers the clock and RAM when the primary 12 VDC is not connected. The clock is more accurate when connected to the primary 12 VDC power supply. The lithium battery has an expected life of four years of continuous use. That is, the primary 12 VDC can be disconnected for four years before the clock stops and data are lost. The voltage of the lithium battery is found in the 8th window of the B mode. The voltage of a new battery is approximately 3 volts. The lithium battery must be replaced when its voltage falls below 2.4 VDC. (Section 14.11)
INTERNAL FLASH PROGRAM STORAGE
Several programs can be stored in the CR510 Flash Memory and later recalled and run using the D Mode. (Section 1.8)
LOW VOLTAGE INDICATOR
When primary power falls below 9.6 VDC, the CR510 stops executing its programs. The Low Voltage Counter (B window 9) is incremented by one each time the primary power drops below 9.6 VDC and E10 is displayed on the CR10KD. A double dash (--) in the 9th window of the B mode indicates that the CR510 is currently in a low primary power mode. (Section 1.6)
CONTROL PORT COUNTERS AND INTERRUPTS
Control port 2 can be used to measure switch closures up to 40 Hz. Control port 2 can also be used to activate interrupt driven subroutine
98. (Sections 1.1.2, 9, Instruction 3)
TAPE
Cassette tape is not supported as a data retrieval method with the CR510.
NEW INSTRUCTIONS
P69 Wind Vector P75 Histogram P98 Send Character
TWO FINAL STORAGE AREAS
Final Storage can be divided into two parts: Final Storage Area 1 and Final Storage Area 2. Final Storage Area 1 is the default storage area and the only one used if the operator does not specifically allocate memory to Area 2. Each Final Storage Area can be represented as ring memory, where the newest data writes over the oldest data.
v
Page 10
This is a blank page.
Page 11

SELECTED OPERATING DETAILS

1. Storing Data - Data are stored in Final Storage only by Output Processing Instructions and only when the Output Flag (Flag 0) is set. (Sections OV4.1.1 and
3.7.1)
2. Storing Date and Time - Date and time are stored with the data in Final Storage ONLY if the Real Time Instruction 77 is used. (Section 11)
3. Data Transfer - On-line data transfer from Final Storage to peripherals (printer, Storage Module, etc.) occurs only if enabled with Instruction 96 in the datalogger program. (Sections 4 and 12)
4. Final Storage Resolution - All Input Storage values are displayed (6 mode) as high resolution with a maximum value of
99999. However, the default resolution for data stored in Final Storage is low resolution, maximum value of 6999. Results exceeding 6999 are stored as 6999 unless Instruction 78 is used to store the values in Final Storage as high resolution values. (Sections 2.2.1 and 11)
5. Floating Point Format - The computations performed in the CR510 use floating point arithmetic. CSI's 4 byte floating point numbers contain a 23 bit binary mantissa and a 6 bit binary exponent. The largest and smallest numbers that can be stored and processed are 9 x 10
18
and 1 x 10
-19
,
respectively. (Section 2.2.2)
6. Erasing Final Storage - Data in Final Storage can be erased without altering the program by using the A Mode to repartition memory. (Section 1.5.2)
7. ALL memory can be erased and the CR510 completely reset by entering 98765 for the number of bytes allocated to Program Memory. (A Window 5, Section
1.5.2)
vii
Page 12

CAUTIONARY NOTES

1. Damage will occur to the analog input circuitry if voltages in excess of ±16 V are applied for a sustained period. Voltages in excess of ±5 V will cause errors and possible overranging on other analog input channels.
2. When using the CR510 with the PS12LA, remember that the sealed lead acid batteries are permanently damaged if deep discharged. The cells are rated at a 7 Ahr capacity but experience a slow discharge even in storage. It is advisable to maintain a continuous charge on the PS12LA battery pack, whether in operation or storage (Section 14).
3. When connecting power to the CR510, first connect the positive lead from the power source to the 12 V terminal. Then connect the negative lead to G. Connecting these leads in the reverse order makes it easier for the positive wire to accidentally touch a grounded component and short out the power supply (Section 14).
4. Voltages in excess of 5.6 volts applied to a control port can cause the CR510 to malfunction and damage the datalogger.
5. Voltage pulses can be counted by CR510 Pulse Counters configured for High Frequency Pulses. However, when the pulse is actually a low frequency signal (below about 10 Hz) AND the positive voltage excursion exceeds 5.6 VDC, the 5 VDC supply will start to rise, upsetting all analog measurements.
Pulses whose positive voltage portion exceed 5.6 VDC with a duration longer than 100 milliseconds need external conditioning. See the description of the Pulse count instruction in Section 9 for details on the external conditioning.
6. The CR510 board is coated with a conformal coating to protect against excess humidity and corrosion. To protect the datalogger from corrosion, additional desiccant must be placed inside the enclosure. To reduce vapor transfer into the enclosure, plug the cable entry conduit with Duct Seal, a putty-type sealant shipped with Campbell Scientific enclosures and available at most electrical supply houses. DO NOT totally seal enclosures equipped with lead acid batteries. Hydrogen concentration may build up to explosive levels.
viii
Page 13

CR510 DATALOGGER OVERVIEW

The CR510 is a fully programmable datalogger/controller with non-volatile memory and a battery backed clock in a small, rugged module. The combination of reliability, versatility, and telecommunications support make it a favorite choice for networks and single logger applications.
Campbell Scientific Inc. provides four aids to operating the CR510:
1. This Overview
2. The CR510 Operator's Manual
3. The CR510 Prompt Sheet
4. Short Cut
This Overview introduces the concepts required to take advantage of the CR510's capabilities. Hands­on programming examples start in Section OV5. Working with a CR510 will help the learning process, so don't just read the examples, do them. If you want to start this minute, go ahead and try the examples, then come back and read the rest of the Overview.
The sections of the Operator's Manual which should be read to complete a basic understanding of the CR510 operation are the Programming Sections 1-3, the portions of the data retrieval Sections 4 and 5 appropriate to the method(s) you are using (see OV6), and Section 14 which covers installation and maintenance.
Section 6 covers details of serial communications. Sections 7 and 8 contain programming examples. Sections 9-12 have detailed descriptions of each programming instruction, and Section 13 goes into detail on the CR510 measurement procedures.
The Prompt Sheet is an abbreviated description of the programming instructions. Once familiar with the CR510, it is possible to program it using only the Prompt Sheet as a reference, consulting the manual if further detail is needed.
Short Cut is an easy-to-use DOS-based software program. It features point-and-click menus to guide you through the process of creating simple CR510 programs. In addition to the downloadable program file, Short Cut creates a table to simplify wiring sensors to the CR510.
Read the Selected Operating Details and Cautionary Notes at the front of the Manual before using the CR510.

OV1. PHYSICAL DESCRIPTION

The CR510 was designed to provide a rugged datalogger with a low per unit cost. Some of its distinguishing physical features are:
The CR510 does not have an integral keyboard/display. The user accesses the CR510 with the portable CR10KD Keyboard Display or with a computer or terminal (Section OV2).
The power supply is external to the CR510. This gives the user a wide range of options (Section 14) for powering the CR510.

OV1.1 ANALOG INPUTS

The terminals labeled 1H to 4L are analog inputs. These numbers refer to the high and low inputs to the differential channels 1 and 2. In a differential measurement, the voltage on the H input is measured with respect to the voltage on the L input. When making single­ended measurements, either the H or L input may be used as an independent channel to measure voltage with respect to the CR510 analog ground (AG). The single-ended channels are numbered sequentially starting with 1H; e.g., the H and L sides of differential channel 1 are single-ended channels 1 and 2; the H and L sides of differential channel 2 are single-ended channels 3 and 4, etc.
OV-1
Page 14
CR510 OVERVIEW

OV1.2 EXCITATION OUTPUTS

The terminals labeled E1, and E2 are precision, switched excitation outputs used to supply programmable excitation voltages for resistive bridge measurements. DC or AC excitation voltages between -2500 mV and +2500 mV are user programmable (Section 9).

OV1.3 PULSE INPUTS

The terminals labeled P1, P2, and P3 are the pulse counter inputs for the CR510. P1 and P2 are programmable for high frequency pulse, low level AC, or switch closure (Section 9, Instruction 3). C2/P3 can be configured to count switch closures up to 40 Hz.

OV1.4 DIGITAL I/O PORTS

Terminal C1 is a digital Input/Output port. On power-up it is configured as an input port, commonly used for reading the status of an external signal. High and low conditions are: 3V < high < 5.5V; -0.5V < low < 0.8V.
Configured as output the port allows on/off control of external devices. A port can be set high (5V ± 0.1V), set low (<0.1V), toggled or pulsed (Sections 3, 8.3, and 12).
Port C2/P3 can be configured as pulse counters for switch closures (Section 9, Instruction 3) or used to trigger subroutine execution (Section
1.1.2), or serial SDI-12 communication.

OV1.5 ANALOG GROUND (AG)

OV1.7 5V OUTPUT

The 5V (±0.2%) output is commonly used to power peripherals such as the QD1 Incremental Encoder Interface and AVW1 Vibrating Wire Interface.
The 5V output is common with pin 1 on the 9 pin serial connector; 200 mA is the maximum combined current output.

OV1.8 SERIAL I/O

The 9 pin serial I/O port contains lines for serial communication between the CR510 and external devices such as computers, printers, Storage Modules, etc. This port does NOT have the
same configuration as the 9 pin serial ports currently used on many personal computers.
It has a 5VDC power line which is used to power peripherals such as the Storage Modules. The same 5VDC supply is used for the 5V output on the terminal strip. It also has a continuous 12 V power supply on pin 8 for external communication devices such as the COM200 and COM300. Section 6 contains technical details on serial communication.

OV1.9 CONNECTING POWER TO THE CR510

The CR510 can be powered by any 12VDC source. The green power connector is a plug in connector that allows the power supply to be easily disconnected without unscrewing the terminals. The Terminal Strip power connection is reverse polarity protected. See Section 14 for details on power supply connections.
The AG terminals are analog grounds, used as the reference for single-ended measurements and excitation return.
OV1.6 12V, POWER GROUND (G), AND EARTH
TERMINALS
The 12V and power ground (G) terminals are used to supply 12V DC power to the datalogger. The extra 12V and G terminals can be used to connect other devices requiring 12V power.
The G terminals are also used to tie cable shields to ground, and to provide a ground reference for pulse counters and binary inputs. The G terminals are directly connected to the Earth terminal. For protection against transient voltage spikes, Earth Ground should be connected to a good earth ground (Section
14.7.1).
OV-2
CAUTION: The metal surfaces of the
CR510 Terminal Strip, and CR10KD Keyboard Display are at the same potential as power ground. To avoid shorting 12 volts to ground, connect the 12 volt lead first, then connect the ground lead.
When primary power falls below 9.6 VDC, the CR510 stops executing its programs. The Low Voltage Counter (B window 9) is incremented by one each time the primary power falls below
9.6 VDC and E10 is displayed on the CR10KD. A double dash (--) in the 9th window of the ∗B mode indicates that the CR510 is currently in a low primary power mode. (Section 1.6)
The datalogger program and stored data remain in memory, and the clock continues to keep
Page 15
CR510 OVERVIEW
time when power is disconnected. The clock and Static Random Access Memory (SRAM) are powered by an internal lithium battery.
OV2. MEMORY AND PROGRAMMING
CONCEPTS

OV2.1 INTERNAL MEMORY

The standard CR510 has 128 K of Flash Electrically Erasable Programmable Read Only Memory (EEPROM) and 128 K Static Random Access Memory (SRAM). The Flash EEPROM stores the operating system and user programs. RAM is used for data and running the program. Data Storage can be expanded with an optional Flash EEPROM (Figure OV2.1-1). The use of the Input, Intermediate, and Final Storage in the measurement and data processing sequence is shown in Figure OV2.1-2. The five areas of SRAM are:
1. System Memory - used for overhead tasks such as compiling programs, transferring data, etc. The user cannot access this memory.
2. Progr am Memory - available for user entered programs.
3. Input Storage - Input Storage holds the results of measurements or calculations. The 6 Mode is used to view Input Storage locations for checking current sensor
readings or calculated values. Input Storage defaults to 28 locations. Additional locations can be assigned using the ∗A Mode.
4. Intermediate Storage - Certain Processing Instructions and most of the Output Processing Instructions maintain intermediate results in Intermediate Storage. Intermediate storage is automatically accessed by the instructions and cannot be accessed by the user. The default allocation is 64 locations. The number of locations can be changed using the A Mode.
5. Final Storage - Final processed values are stored here for transfer to printer, solid state Storage Module or for retrieval via telecommunication links. Values are stored in Final Storage only by the Output Processing Instructions and only when the Output Flag is set in the user’s program. Approximately 62,000 locations are allocated to Final Storage on power up. This number is reduced if Input or Intermediate Storage is increased.
While the total size of these areas remains constant, memory may be reallocated between the areas to accommodate different measurement and processing needs (A Mode, Section 1.5).
OV-3
Page 16
CR510 OVERVIEW
Flash Memory
(EEPROM)
Total 128 Kbytes
Operating System
(96 Kbytes)
Active Program
(16 Kbytes)
Stored Programs
(16 Kbytes)
How it works:
The Operating System is loaded into Flash Memory at the factory. System Memory is used while the CR510 is running calculations, buffering data and for general operating tasks.
Any time a user loads a program into the CR510, the program is compiled in SRAM and stored in the Active Program areas. If the CR510 is powered off and then on, the Active Program is loaded from Flash and run.
The Active Program is run in SRAM to maximize speed. The program accesses Input Storage and Intermediate Storage and stores data into Final Storage for later retrieval by the user.
The Active Program can be copied into the Stored Programs area. While 98 program "names" are available, the number of programs stored is limited by the available memory. Stored programs can be retrieved to become the active program. While programs are stored one at a time, all stored programs must be erased at once. That is because the flash memory can only be written to once before it must be erased and can only be erased in 16 Kbytes blocks.
SRAM
Total 128 Kbytes
System Memory
(4096 Bytes)
Active Program
(default 2048 Bytes)
Input Storage
(default 28 locations, 112 bytes)
Intermediate Storage
(default 64 locations, 256 bytes)
Final Storage Area 1
(default 62,280 locations, 124,560 bytes)
Final Storage Area 2
(default 0 locations, 0 bytes)
Optional
Flash EEPROM
OV-4
With the Optional Flash Memory, up to 2 Mbytes of additional memory can be added to increase Final Storage by another 524,288 data values per Mbyte. The user can allocate this extra memory to any combination of Area 1 or Area 2.
(Memory Areas separated by dashed lines: can be re-sized by the user.)
FIGURE OV2.1-1. CR510 Memory
Final Storage Area 1
and/or
Final Storage Area 2
(Additional 524,288 locations per Mbyte)
Page 17
CR510 OVERVIEW
OV2.2 PROGRAM TABLES, EXECUTION
INTERVAL AND OUTPUT INTERVALS
The CR510 must be programmed before it will make any measurements. A program consists of a group of instructions entered into a
program table. The program table is given an execution interval which determines how
frequently that table is executed. When the table is executed, the instructions are executed in sequence from beginning to end. After executing the table, the CR510 waits the remainder of the execution interval and then executes the table again starting at the beginning.
The interval at which the table is executed generally determines the interval at which the sensors are measured. The interval at which data are stored is separate from how often the table is executed, and may range from samples every execution interval to processed summaries output hourly, daily, or on longer or irregular intervals.
Table 1. Execute every x sec.
0.125 < x < 8191
Instructions are executed sequentially in the order they are entered in the table. One complete pass through the table is made each execution interval unless program control instructions are used to loop or branch execution.
Normal Order: MEASURE PROCESS CHECK OUTPUT COND. OUTPUT PROCESSING
Table 2. Execute every y sec.
0.125 < y < 8191
Table 2 is used if there is a need to measure and process data on a separate interval from that in Table 1.
Programs are entered in Tables 1 and 2. Subroutines, called from Tables 1 and 2, are entered in Subroutine Table 3. The size of program memory can be fixed or automatically allocated by the CR510 (Section 1.5).
Table 1 and Table 2 have independent execution intervals, entered in units of seconds with an allowable range of 1/8 to 8191 seconds. Subroutine Table 3 has no execution interval; subroutines are only executed when called from Table 1 or 2.
OV2.2.1 THE EXECUTION INTERVAL
The execution interval specifies how often the program in the table is executed, which is usually determined by how often the sensors are to be measured. Unless two different
measurement rates are needed, use only one table. A program table is executed sequentially
starting with the first instruction in the table and proceeding to the end of the table.
Table 3. Subroutines
A subroutine is executed only when called from Table 1 or 2.
Subroutine Label Instructions End Subroutine Label Instructions End Subroutine Label Instructions End
FIGURE OV2.2-1. Program and Subroutine Tables
OV-5
Page 18
CR510 OVERVIEW
Each instruction in the table requires a finite time to execute. If the execution interval is less than the time required to process the table, an execution interval overrun occurs; the CR510 finishes processing the table and waits for the next execution interval before initiating the table. When an overrun occurs, decimal points are shown on either side of the G on the display in the LOG mode (0). Overruns and table priority are discussed in Section 1.1.
OV2.2.2. THE OUTPUT INTERVAL
The interval at which output occurs must be an integer multiple of the execution interval (e.g., a table cannot have a 10 minute execution interval and output every 15 minutes).
A single program table can have many different output intervals and conditions, each with a unique data set (Output Array). Program Control Instructions are used to set the Output Flag. The Output Processing Instructions which follow the instruction setting the Output Flag determine the data output and its sequence. Each additional Output Array is created by another Program Control Instruction checking a output condition, followed by Output Processing Instructions defining the data set to output.

OV2.3 CR510 INSTRUCTION TYPES

Figure OV2.3-1 illustrates the use of three different instruction types which act on data. The fourth type, Program Control, is used to control output times and vary program execution. Instructions are identified by numbers.
1. INPUT/OUTPUT INSTRUCTIONS (1-12, 16-29, 105-106, 114, 117, 130, 131, Section
9) control the terminal strip inputs and outputs (Figure OV1.1-2), storing the results in Input Storage (destination). Multiplier and offset parameters allow conversion of linear signals into engineering units. The Digital I/O Ports are also addressed with I/O Instructions.
2. PROCESSING INSTRUCTIONS (30-68, Section 10) perform numerical operations on values located in Input Storage and store the results back in Input Storage. These instructions can be used to develop high level algorithms to process measurements prior to Output Processing.
3. OUTPUT PROCESSING INSTRUCTIONS (69-82, Section 11) are the only instructions which store data in Final Storage. Input Storage values are processed over time to obtain averages, maxima, minima, etc. There are two types of processing done by Output Instructions:
Intermediate and Final. Intermediate processing normally takes
place each time the instruction is executed. For example, when the Average Instruction is executed, it adds the values from the input locations being averaged to running totals in Intermediate Storage. It also keeps track of the number of samples.
Final processing occurs only when the Output Flag is high (Section 3.7.1). The Output Processing Instructions check the Output Flag. If the flag is high, final values are calculated and output. With the Average, the totals are divided by the number of samples and the resulting averages sent to Final Storage. Intermediate locations are zeroed and the process starts over. The Output Flag, Flag
0, is set high by a Program Control Instruction which must precede the Output Processing Instructions in the user entered program.
4. PROGRAM CONTROL INSTRUCTIONS (83-98, 111, 120-121, Section 12) are used for logic decisions, conditional statements, and to send data to peripherals. They can set flags and ports, compare values or times, execute loops, call subroutines, conditionally execute portions of the program, etc.
OV-6
Page 19
INPUT/OUTPUT INSTRUCTIONS
Specify the conversion of a sensor signal to a data value and store it in Input Storage. Programmable entries specify: (1) the measurement type (2) the number of channels to measure (3) the input voltage range (4) the Input Storage Location (5) the sensor calibration constants used to convert the sensor output to engineering units
I/O Instructions also control analog outputs and digital control ports.
INPUT STORAGE
Holds the results of measurements or calculations in user specified locations. The value in a location is written over each time a new measurement or calculation stores data to the locations.
CR510 OVERVIEW
PROCESSING INSTRUCTIONS
Perform calculations with values in Input Storage. Results are returned to Input Storage. Arithmetic, transcendental and polynomial functions are included.
OUTPUT PROCESSING INSTRUCTIONS
Perform calculations over time on the values updated in Input Storage. Summaries for Final Storage are generated when a Program Control Instruction sets the Output Flag in response to time or events. Results may be redirected to Input Storage for further processing. Examples include sums, averages, max/min, standard deviation, histograms, etc.
Output Flag set high
FINAL STORAGE
Final results from OUTPUT PROCESSING INSTRUCTIONS are stored here for on-line or interrogated transfer to external devices (Figure OV5.1-1). When memory is full, new data overwrites the oldest data.
FIGURE OV2.3-1. Instruction Types and Storage Areas
INTERMEDIATE STORAGE
Provides temporary storage for intermediate calculations required by the OUTPUT PROCESSING INSTRUCTIONS; for example, sums, cross products, comparative values, etc.
OV-7
Page 20
CR510 OVERVIEW

OV3. COMMUNICATING WITH CR510

An external device must be connected to the CR510's Serial I/O port to communicate with the CR510. This may be either Campbell Scientific's CR10KD Keyboard Display or a computer/terminal.
The CR10KD is powered by the CR510 and connects directly to the serial port via the SC12 cable (supplied with the CR10KD). No interfacing software is required.
Computer communication and program editing is accomplished using Campbell Scientific's datalogger support software. This package contains a program editor (EDLOG), datalogger communications, automated telecommunications data retrieval, a data reduction program, and programs to retrieve data from Campbell Scientific Storage Modules.
To participate in the programming examples (Section OV5) you must communicate with the CR510. Read Section OV3.1 if the CR10KD is being used or Section OV3.2 if datalogger support software is being used.

OV3.1 KEYBOARD/DISPLAY

The SC12 cable (supplied with the CR10KD) is used to connect the Keyboard/Display to the 9 pin Serial I/O port on the CR510.
OV3.1.1 FUNCTIONAL MODES
CR510/User interaction is broken into different functional MODES (e.g., programming the measurements and output, setting time, manually initiating a block data transfer to Storage Module, etc.). The modes are referred to as Star () Modes since they are accessed by first keying , then the mode number or letter. Table OV3.1-1 lists the CR510 Modes.
TABLE OV3.1-1. ∗∗∗ Mode Summary
Key Mode
0
∗ ∗ ∗ ∗ ∗ ∗ ∗
LOG data and indicate active Tables
1
Program Table 1
2
Program Table 2
3
Program Table 3, subroutines only
4
Parameter Entry Table
5
Display/set real time clock
6
Display/alter Input Storage data, toggle flags or control ports.
7
∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
Display Final Storage data
8
Final Storage data transfer to peripheral
9
Storage Module commands
A
Memory allocation/reset
B
Signature/status
C
Security
D
Save/load Program
#
Used with TGT1 satellite transmitter
If the Keyboard/Display is connected to the CR510 prior to being powered up, the "HELLO" message is displayed while the CR510 checks memory. The total size of memory is then displayed (256 for 256 K bytes of memory). When the CR10KD is plugged in after the CR510 has powered up, the display is meaningless until "" is pressed to enter a mode.
This manual describes direct interaction with the CR510. If you have a CR10KD, work through the direct programming examples in this overview in addition to using EDLOG and you will have the basics of CR510 operation as well as an appreciation for the help provided by the software.
OV-8
OV3.1.2 KEY DEFINITION
Keys and key sequences have specific functions when using the CR10KD keyboard or a computer/terminal in the remote keyboard state (Section 5). Table OV3.1-2 lists these functions. In some cases, the exact action of a key depends on the mode the CR510 is in and is described with the mode in the manual.
Page 21
CR510 OVERVIEW
TABLE OV3.1-2 Key Description/Editing
Functions
Key Action
0
9
-
Key numeric entries into display Enter Mode (followed by Mode
Number)
A B C
Enter/Advance Back up Change the sign of a number or index
an input location to loop counter
D #
Enter the decimal point Clear the rightmost digit keyed into
the display
# A
Advance to next instruction in program table (∗1, ∗2, ∗3) or to next Output Array in Final Storage (∗7)
# B
Back up to previous instruction in program table or to previous Output Array in Final Storage
# D # 0
Delete entire instruction (then A) Back up to the start of the
current array.
When using a computer/terminal to communicate with the CR510 (Telecommunications remote keyboard state) there are some keys available in addition to those found on the CR10KD. Table OV3.1-3 lists these keys.
TABLE OV3.1-3. Additional Keys Allowed in
Telecommunications
Key Action
- Change Sign, Index (same as C) CR Enter/advance (same as A) : Colon (used in setting time) S or ^S Stops transmission of data (10
second time-out; any character restarts)
C or ^C Aborts transmission of Data
When using the support software, the computer’s baud rate, port, and modem types are specified and stored in a file for future use.
The simplest and most common interface is the SC32A Optically Isolated RS232 Interface. The SC32A converts and optically isolates the voltages passing between the CR510 and the external terminal device.
The SC12 Two Peripheral cable which comes with the SC32A is used to connect the serial I/O port of the CR510 to the 9 pin port of the SC32A labeled "Datalogger". Connect the "Terminal/Printer" port of the SC32A to the serial port of the computer with a straight 25 pin cable or, if the computer has a 9 pin serial port, a standard 9 to 25 pin adapter cable.
OV3.3 ASCII TERMINAL OR COMPUTER WITH
TERMINAL EMULATOR
Devices which can be used to communicate with the CR510 include standard ASCII terminals and computers programmed to function as a terminal emulator. See Section
6.7 for details. To communicate with any device other than the
CR10KD, the CR510 enters its Telecom­munications Mode and responds only to valid telecommunications commands. Within the Telecommunications Mode, there are 2 "states"; the Telecommunications Command state and the Remote Keyboard state. Communication is established in the Telecommunications command state. One of the commands is to enter the Remote Keyboard state (Section 5).
The Remote Keyboard state allows the keyboard of the computer/terminal to act like the CR10KD keyboard. Various datalogger modes may be entered, including the mode in which programs may be keyed in to the CR510 from the computer/terminal.
OV3.2 USING COMPUTER WITH DATALOGGER
SUPPORT SOFTWARE
Direct datalogger communication programs in the datalogger support software provide menu selection of tools to perform the datalogger functions (e.g., set clock, send program, monitor measurements, and collect data). The user also has the option of directly entering keyboard commands via a built-in terminal emulator (Section OV3.3).

OV4. PROGRAMMING THE CR510

A datalogger program is created on a computer using EDLOG or one of the programming aids such as Short Cut. A program can also be entered directly into the datalogger. Section OV4.3 describes options for loading the program into the CR510.
OV-9
Page 22
CR510 OVERVIEW

OV4.1 PROGRAMMING SEQUENCE

In routine applications, the CR510 measures sensor output signals, processes the measurements over some time interval and stores the processed results. A generalized programming sequence is:
1. Enter the execution interval. In most cases, the execution interval is determined by the desired sensor scan rate.
2. Enter the Input/Output instructions required to measure the sensors.
3. If processing in addition to that provided by the Output Processing Instructions (step 5) is required, enter the appropriate Processing Instructions.
4. Enter the Program Control Instruction to test the output condition and set the Output Flag when the condition is met. For example, use
Instruction 92 to output based on time. Instruction 86 to output every execution
interval. Instruction 88 or 89 to output based on a
comparison of values in input locations. This instruction must precede the Output
Processing Instructions which store data in Final Storage. Instructions are described in Sections 9 through 12.
Execution intervals and output intervals set with Instruction 92 are synchronized with datalogger time starting at midnight.

OV4.2 INSTRUCTION FORMAT

Instructions are identified by an instruction number. Each instruction has a number of parameters that give the CR510 the information it needs to execute the instruction.
The CR510 Prompt Sheet has the instruction numbers in red, with the parameters briefly listed in columns following the description. Some parameters are footnoted with further description under the "Instruction Option Codes" heading.
For example, Instruction 73 stores the maximum value that occurred in an Input Storage location over the output interval.
P73 Maximum
1: Reps 2: TimeOption 3: Loc
The instruction has three parameters (1) REPetitionS, the number of sequential Input Storage locations on which to find maxima, (2) TIME, an option of storing the time of occurrence with the maximum value, and (3) LOC the first Input Storage location operated on by the Maximum Instruction. The codes for the TIME parameter are listed in the "Instruction Option Codes".
5. Enter the Output Processing Instructions to store processed data in Final Storage. The order in which data are stored is determined by the order of the Output Processing Instructions in the table.
6. Repeat steps 4 and 5 for additional outputs on different intervals or conditions.
NOTE: The program must be executed for output to occur. Therefore, the interval at which the Output Flag is set must be evenly divisible by the execution interval. For example, with a 2 minute execution interval and a 5 minute output interval, the program will only be executed on the even multiples of the 5 minute intervals, not on the odd. Data will be output every 10 minutes instead of every 5 minutes.
OV-10
The repetitions parameter specifies how many times an instruction's function is to be repeated. For example, four 107 thermistor probes may be measured with a single Instruction 11, Temp­107, with four repetitions. Parameter 2 specifies the input channel of the first thermistor (the probes must be connected to sequential channels). Parameter 4 specifies the Input Storage location in which to store measurements from the first thermistor. If location 5 were used and the first probe was on channel 1, the temperature of the thermistor on channel 1 would be stored in input location 5, the temperature from channel 2 in input location 6, etc.
Detailed descriptions of the instructions are given in Sections 9-12. Entering an instruction into a program table is described in OV5.
Page 23
CR510 OVERVIEW

OV4.3 ENTERING A PROGRAM

Programs are entered into the CR510 in one of three ways:
1. Keyed in using the CR10KD keyboard.
2. Loaded from a pre-recorded listing using the D Mode. There are 2 types of storage/input: a. Stored on disk/sent from computer. b. Stored/loaded from Storage Module.
3. Loaded from internal Flash Memory or Storage Module upon power-up.
A program is created by keying it directly into the datalogger as described in Section OV5, or on a PC using EDLOG or a programming aid such as Short Cut.
Program files (.DLD) can be downloaded directly to the CR510 using Campbell’s datalogger support software. Communication via direct wire, telephone, or Radio Frequency (RF) is supported.
Programs can be copied to a Storage Module with the appropriate software. Using the ∗D Mode to save or load a program from a Storage Module is described in Section 1.8.
Once a program is loaded in the CR510, the program will be stored in flash memory and will automatically be loaded and run when the datalogger is powered-up.

OV5. PROGRAMMING EXAMPLES

The following examples stress direct interaction with the CR510 using the CR10KD. At the beginning of each example is an EDLOG listing of the program. You can also participate in the example by entering the program in EDLOG and sending it to the CR510 and viewing measurements with Campbell’s datalogger support software. If you have the CR10KD, work through the examples as well as using EDLOG. You will learn the basics of CR510 operation as well as an appreciation for the help provided by the software.
We will start with a simple programming example. There is a brief explanation of each step to help you follow the logic. When the example uses an instruction, find it on the Prompt Sheet and follow through the description of the parameters. Using the Prompt Sheet while going through these examples will help you become familiar with its format. Sections 9­12 have more detailed descriptions of the instructions.
Connect the CR510 to the CR10KD Keyboard/Display or a terminal (Section OV3). Hook up the power leads as described in Section OV1.2. The programming steps in the following examples use the keystrokes possible on the keyboard/display. With a terminal, some responses will be slightly different.
The program on power up function can also be achieved by using a Storage Module. Up to 8 programs can be stored in the Storage Module, the programs may be assigned any of the numbers 1-8. If the Storage Module is connected when the CR510 is powered-up the CR510 will automatically load program number 8, provided that a program 8 is loaded in the Storage Module (Section 1.8). The program from the Storage Module will replace the active program in flash memory.
If the CR10KD is connected to the CR510 when it is powered up, the display will show:
Display Explanation HELLO On power-up, the CR510
displays "HELLO" while it checks the memory (this display occurs only with the CR10KD).
after a few seconds delay
:0256 The size of the machine's total
memory, 256 K (1280 if 1 meg option).
When primary power is applied to the CR510, it tests the FLASH memory and loads the current program to RAM. After the program compiles successfully, the CR510 begins executing the program. If the ring line on the 9 pin connector is raised while the CR510 is testing memory,
OV-11
Page 24
CR510 OVERVIEW
there will be a 128 second delay before compiling and running the program. This can be used to edit or change the program before it starts running. To raise the ring line, press any key on the CR10KD keyboard display or call the CR510 with the computer during the power up sequence (i.e., while “HELLO” is displayed on the CR10KD).
In order to ensure that there is no active program in the CR510, we will load an empty program using the *D Mode:
Display Will Show:
Key (ID:Data) Explanation
00:00 Enter mode
D
13:00 Enter *D Mode
7
13:7 7 is command to load
program from flash
A
07:00 Execute command 7,
CR510 is ready for program number
0
07:0 Load Program 0 (empty
program)
A
Execute program load, after a short wait, the display will show
13:0000 Indicating that the
command is complete.

OV5.1 SAMPLE PROGRAM 1

EDLOG Listing Program 1: *Table 1 Program
01: 5.0 Execution Interval (seconds) 1: Internal Temperature (P17)
1: 1 Loc [ CR510Temp ]
2: Do (P86)
1: 10 Set Output Flag High
3: Sample (P70)
1: 1 Reps 2: 1 Loc [ CR510Temp ]
In this example the CR510 is programmed to read its own internal temperature (using a built in thermistor) every 5 seconds and to send the results to Final Storage.
Display Will Show:
Key (ID:Data) Explanation
00:00 Enter mode.
1
01:0000 Enter Program Table 1.
A
01:0.0000 Advance to execution
interval (In seconds)
5
01:5 Key in an execution
interval of 5 seconds.
A
01:P00 Enter the 5 second
execution interval and advance to the first program instruction location.
1 7
01:P17 Key in Instruction 17
which directs the CR510 to measure the internal temperature in degrees C. This is an Input/Output Instruction.
A
01:0000 Enter Instruction 17 and
advance to the first parameter.
1
01:1 The input location to
store the measurement, location 1.
A
02:P00 Enter the location # and
advance to the second program instruction.
The CR510 is now programmed to read the internal temperature every 5 seconds and place the reading in Input Storage Location 1. The program can be compiled and the temperature displayed.
Display Will Show:
Key (
ID:Data) Explanation
0LOG 1 Exit Table 1, enter ∗0
Mode, compile table and begin logging.
606:0000 Enter 6 Mode (to view
Input Storage).
A
01:21.234 Advance to first storage
location. Internal datalogger temp. is
o
21.234
C (display shows actual temperature so exact value will vary).
OV-12
Page 25
CR510 OVERVIEW
Wait a few seconds:
01:21.423 The CR510 has read the
sensor and stored the result again. The internal temp is now 21.423 The value is updated every 5 seconds when the table is executed. At this point the CR510 is measuring the temperature every 5 seconds and sending the value to Input Storage. No data are being saved. The next step is to have the CR510 send each reading to Final Storage. (Remember, the Output Flag must be set first.)
101:0000 Exit 6 Mode. Enter
program table 1.
2 A
02:P00 Advance to 2nd
instruction location (this is where we left off).
8 6
02:P86 This is the DO instruction
(a Program Control Instruction).
A
01:00 Enter 86 and advance to
the first parameter (which will specify the command to execute).
1 0
01:10 This command sets the
Output Flag. (Flag 0)
A
03:P00 Enter 10 and advance to
third program instruction.
7 0
03:P70 The SAMPLE instruction.
It directs the CR510 to take a reading from an Input Storage location and send it to Final Storage (an Output Processing Instruction).
A
01:0000 Enter 70 and advance to
the first parameter (repetitions).
1
01:1 There is only one input
location to sample; repetitions = 1.
A
02:0000 Enter 1 and advance to
second parameter (Input
Storage location to sample).
1
02:1 Input Storage Location 1,
o
C.
A
04:P00 Enter 1 and advance to
where the temperature is stored.
fourth program instruction.
00:00 Exit Table 1.
0
LOG 1 Enter 0 Mode, compile
program, log data.
The CR510 is now programmed to measure the internal temperature every 5 seconds and send each reading to Final Storage. Values in Final
Storage can be viewed using the
7 Mode.
Display Will Show:
Key (
ID:Data) Explanation
707: 13.000 Enter 7 Mode. The
Data Storage Pointer (DSP) is at Location 13 (in this example).
A
01: 0102 Advance to the first
value, the Output Array ID. 102 indicates the Output Flag was set by the second instruction in Program Table 1.
A
02: 21.23 Advance to the first
stored temperature.
A
01: 0102 Advance to the next
output array. Same Output Array ID.
A
02: 21.42 Advance to 2nd stored
temp, 21.42 deg. C.
There are no date and time tags on the data. They must be put there with Output Instruction
77. Instruction 77 is used in the next example. If a terminal is used to communicate with the
CR510, Telecommunications Commands (Section 5) can be used to view entire Output Arrays (in this case the ID and temperature) at the same time.
OV-13
Page 26
CR510 OVERVIEW

OV5.2 EDITING AN EXISTING PROGRAM

When editing an existing program in the CR510, entering a new instruction inserts the instruction; entering a new parameter replaces the previous value.
To insert an instruction, enter the program table and advance to the position where the instruction is to be inserted (i.e., P in the data portion of the display) key in the instruction number, and then key A. The new instruction will be inserted at that point in the table,
Instruction # Parameter (Loc:Entry) (
Par#:Entry) Description 1 Enter Program Table 1 01:60 60 second (1 minute) execution interval
# D
Key
until 01:P00 Erase previous Program before
is displayed continuing. 01:P11 Measure reference temperature
01:1 Store temp in Location 1 02:5 03:3 04:1 05:1.0 06:0.0
advance through and enter the parameters. The instruction that was at that point and all instructions following it will be pushed down to follow the inserted instruction.
An instruction is deleted by advancing to the instruction number (P in display) and keying #D (Table 4.2-1).
To change the value entered for a parameter, advance to the parameter and key in the correct value then press A. Note that the new value is not entered until A is keyed.
SAMPLE PROGRAM 2
02:P92 If Time instruction
01:0 0 minutes into the interval 02:60 60 minute interval 03:10 Set Output Flag 0
The CR510 is programmed to measure the datalogger internal temperature every sixty seconds. The If Time instruction sets the Output Flag high at the beginning of every hour. Next, the Output Instructions for time and average are added.
03:P77 Output Time instruction
01:110 Store Julian day, hour, and minute
04:P71 Average instruction
01:1 one repetition 02:1 Location 1 - source of temps. to be averaged
05:P92 If Time instruction
01:0 0 minutes into the interval 02:1440 1440 minute interval (24 hrs.) 03:10 Set Output Flag 0
06: P77 Output Time instruction
01:100 Store Julian day
OV-14
Page 27
Instruction # Parameter (Loc.:Entry) (
Par.#:Entry) Description
07: P73 Maximize instruction
01:1 One repetition 02:10 Output time of daily maximum in hours and minutes 03:2 Data source is Input Storage Location 1.
08: P74 Minimize instruction
01:1 One repetition 02:10 Output the time of the daily minimum in hours
03:1 Data source is Input Storage Location 1.
The program to make the measurements and to send the desired data to Final Storage has been entered. At this point, Instruction 96 is entered to enable data transfer from Final Storage to Storage Module.
09:P96 Activate Serial Data Output.
1:71 Output Final Storage data to Storage Module.

OV5.3 SETTING THE DATALOGGER TIME

CR510 OVERVIEW
and minutes
The next example shows how to set the datalogger date and time using the CR10KD. Here the example reverts back to the key-by-key format.
Key Display
5
A 1 9 9 A 1 9 7 A 1 3 2 4 A
0
00:21:32 Enter 5 Mode. Clock running but perhaps not set correctly. 05:0000 Advance to location for year.
8
05:1998 Key in year (1998). 05:0000 Enter and advance to location for Julian day. 05:197 Key in Julian day. 05:0021 Enter and advance to location for hours and minutes (24 hr. time). 05:1324 Key in hrs.:min. (1:24 PM in this example). :13:24:01 Clock set and running. LOG 1 Exit 5, compile Table 1, commence logging data.
Explanation
OV-15
Page 28
CR510 OVERVIEW

OV6. DATA RETRIEVAL OPTIONS

There are several options for data storage and retrieval. These options are covered in detail in Sections 2, 4, and 5. Figure OV6.1-1 summarizes the various possible methods.
Regardless of the method used, there are three general approaches to retrieving data from a datalogger.
1) On-line output of Final Storage data to a peripheral storage device. On a regular schedule, that storage device is either "milked" of its data or is brought back to the office/lab where the data is transferred to the computer. In the latter case, a "fresh" storage device is usually left in the field when the full one is taken so that data collection can continue uninterrupted.
2) Bring a storage device to the datalogger and milk all the data that has accumulated in Final Storage since the last visit.
3) Retrieve the data over some form of telecommunications link, whether it be RF, telephone, short haul modem, or satellite. This can be performed under program control or by regularly scheduled polling of the dataloggers. Campbell Scientific's Datalogger Support Software automates this process.
Regardless of which method is used, the retrieval of data from the datalogger does NOT erase those data from Final Storage. The data remain in the ring memory until:
They are written over by new data (Section 2.1) Memory is reallocated or the CR510 is reset
(Section 1.5) Table OV6.1-1 lists the instructions used with
the various methods of data retrieval.
TABLE OV6.1-1. Data Retrieval Methods and Related Instructions
Method Instruction/Mode Section in Manual
Storage Module Instruction 96 4.1, 12
89
Telecommunications Telecommunications
Commands 5
Instruction 97 12 Printer or other Instruction 96 4.1, 12 Serial device
8
4.2
4.5
4.2
OV-16
Page 29
S
DATALOGGER
SC12 CABLES
CR510 OVERVIEW
DSP4
HEADS UP
DISPLAY
SM192/716 STORAGE MODULE
STORAGE MODULE OR CARD BROUGHT FROM THE FIELD TO THE COMPUTER
SM192/716
STORAGE MODULES
CSM1
CSM1
MD9 MULTIDROP INTERFACE
COAXIAL CABLE
MD9 MULTIDROP INTERFACE
SC12 CABLE
SC532
RS-232
INTERFACE
COMPUTER
ASYNCHRONOUS SERIAL COMMUNICATIONS PO RT
RF95 RF
RF
MODEM
MODEM
RF
RF100/RF200
TRANSCEIVER
TRANSCEIVER
W/ANTENNA
W/ ANTENNA
& CABLE
& CABLE
RF
RF100/RF200
TRANSCEIVER
TRANSCEIVER
W/ANTENNA
W/ ANTENNA &
& CABLE
CABLE
SC12 CABLE
RF232 RF
RF
BASE
BASE
STATION
STATION
SC32A
RS-232
INTERFACE
INTERFACE
SRM-5A RAD
SRM-6A RAD
SHORTHAUL
SHORTHAUL
MODEM
MODEM
2 TWISTED
PAIR WIRES
UP TO 5 MI.
SRM-5A RAD
SRM-6A RAD
SHORTHAUL
SHORTHAUL
MODEM
MODEM
RS-232
RS-232
CABLE
CABLE
SC932
COM200
DC112
PHONE
PHONE
MODEM
MODEM
PHONE LINE
HAYES
COMPATIBLE
PHONE
MODEM
COM100
DC1765
CELLULAR
CELLULAR
PHONE
PHONE
NOTES: 1. ADDITIONAL METHODS OF DATA RETRIEVAL ARE:
A. SATELLITE TRANSMISSION B. DIRECT DUMP TO PRINTER C. VOICE PHONE MODEM TO VOICE PHONE OR PC WITH HAYES COMPATIBLE
PHONE MODEM
2. THE DSP4 HEADS UP DISPLAY ALLOWS THE USER TO VIEW DATA IN INPUT STORAGE. ALSO BUFFERS FINAL STORAGE DATA AND WRITES IT TO PRINTER OR STORAGE MODULE.
3. ALL CAMPBELL SCIENTIFIC RS-232 INTERFACES HAVE A FEMALE 25 PIN RS-232 CONNECTOR.
FIGURE OV6.1-1. Data Retrieval Hardware Options
OV-17
Page 30
CR510 OVERVIEW

OV7. SPECIFICATIONS

Electrical specifications are valid over a -25° to +50°C range unless otherwise specified; non-condensing environment required. To maintain electrical specifications, yearly calibrations are recommended.
PROGRAM EXECUTION RATE
System tasks initiated in sync with real-time up to 64 Hz. One measurement with data transfer is possible at this rate without interruption.
ANALOG INPUTS
NUMBER OF CHANNELS: 2 differential or 4
single-ended, individually configured.
RANGE AND RESOLUTION:
Full Scale Resolution (µV)
Input Range (mV) Diff
±2500 333 666
±250 33.3 66.6
±25 3.33 6.66 ±7.5 1.00 2.00 ±2.5 0.33 0.66
INPUT SAMPLE RATES: Includes the measurement
time and conversion to engineering units. The fast and slow measurements integrate the signal for 0.25 and 2.72 ms, respectively. Differential measurements incorporate two integrations with reversed input polarities to reduce thermal offset and common mode errors.
Fast differential voltage: 4.2 ms Slow differential voltage: 9.2 ms Differential with 60 Hz rejection: 25.9 ms
ACCURACY: ±0.1% of FSR (-25° to 50°C);
INPUT NOISE VOLTAGE (for ±2.5 mV range):
COMMON MODE RANGE: ±2.5 V DC COMMON MODE REJECTION: > 140 dB NORMAL MODE REJECTION: 70 dB (60 Hz with
INPUT CURRENT: ±9 nA maximum INPUT RESISTANCE: 20 Gohms typical
±0.05% of FSR (0° to 40°C); e.g., ±0.1% FSR = ±5.0 mV for ±2500 mV range
Fast differential: 0.82 µV rms Slow differential: 0.25 µV rms Differential with
60 Hz rejection: 0.18 µV rms
slow differential measurement)
erential Single-Ended
ANALOG OUTPUTS
DESCRIPTION: 2 switched excitations, active only
during measurement, one at a time. RANGE: ±2.5 V RESOLUTION: 0.67 mV ACCURACY: ±2.5 mV (0° to 40°C);
CURRENT SOURCING: 25 mA CURRENT SINKING: 25 mA FREQUENCY SWEEP FUNCTION: The switched
±5 mV (-25° to 50°C)
outputs provide a programmable swept frequency,
0 to 2.5 V square wave for exciting vibrating wire
transducers.
RESISTANCE MEASUREMENTS
MEASUREMENT TYPES: The CR510 provides
ratiometric bridge measurements of 4- and 6-wire
full bridge, and 2-, 3-, and 4-wire half bridges.
Precise dual polarity excitation using any of the
switched outputs eliminates dc errors.
Conductivity measurements use a dual polarity
0.75 ms excitation to minimize polarization errors.
ACCURACY: ±0.02% of FSR plus bridge errors.
PERIOD AVERAGING MEASUREMENTS
DEFINITION: The average period for a single cycle is
determined by measuring the duration of a speci­fied number of cycles. Any of the 4 single-ended analog input channels can be used. Signal atten­tuation and ac coupling is typically required.
INPUT FREQUENCY RANGE:
Signal peak-to-peak
Min. Max. Pulse w. Freq.
500 mV 5.0 V 2.5 µs 200 kHz
10 mV 2.0 V 10 µs 50 kHz
5 mV 2.0 V 62 µs 8 kHz 2 mV 2.0 V 100 µs 5 kHz
RESOLUTION: 35 ns divided by the number of
cycles measured ACCURACY: ±0.03% of reading TIME REQUIRED FOR MEASUREMENT: Signal
period multiplied by the number of cycles
measured plus 1.5 cycles + 2 ms.
1
Min. Max
2
PULSE COUNTERS
NUMBER OF CHANNELS: 2 eight-bit or 1 sixteen-
bit; software selectable as switch closure, high
frequency pulse, or low-level ac modes. An addi-
tional channel (C2/P3) can be software configured
to read switch closures at rates up to 40 Hz. MAXIMUM COUNT RATE: 16 kHz, eight-bit counter;
400 kHz, sixteen-bit counter. Channels are
scanned at 8 or 64 Hz (software selectable). SWITCH CLOSURE MODE:
Minimum Switch Closed Time: 5 ms
Minimum Switch Open Time: 6 ms
Maximum Bounce Time: 1 ms open
without being counted
HIGH FREQUENCY PULSE MODE:
Minimum Pulse Width: 1.2 µs
Maximum Input Frequency: 400 kHz
Maximum Input Voltage: ±20 V
Voltage Thresholds: Count upon transition
from below 1.5 V to above 3.5 V at low frequen-
cies. Larger input transitions are required at high
frequencies because of input filter with 1.2 µs time
constant. Signals up to 400 kHz will be counted if
centered around +2.5 V with deviations ‡ – 2.5 V
for ‡ 1.2 µs. LOW LEVEL AC MODE:
(Typical of magnetic pulse flow transducers or
other low voltage, sine wave outputs.)
Input Hysteresis: 14 mV
Maximum ac Input Voltage: ±20 V
Minimum ac Input Voltage:
(Sine wave mV rms)* Range (Hz)
20 1 to 1000
200 0.5 to 10,000
*16-bit config. or 64 Hz scan req’d for freq. > 2048 Hz
1000 0.3 to 16,000
DIGITAL I/O PORTS
DESCRIPTION: Port C1 is software selectable as a
binary input, control output, or as an SDI-12 port.
Port C2/P3 is input only and can be software con-
figured as an SDI-12 port, a binary input, or as a
switch closure counter (40 Hz max). OUTPUT VOLTAGES (no load): high 5.0 V ±0.1 V;
low < 0.1 V OUTPUT RESISTANCE: 500 ohms INPUT STATE: high 3.0 to 5.5 V; low -0.5 to 0.8 V
INPUT RESISTANCE: 100 kohms
SDI-12 INTERFACE STANDARD
DESCRIPTION: Digital I/O Ports C1-C2 support
SDI-12 asynchronous communication; up to ten SDI-12 sensors can be connected to each port. Meets SDI-12 standard Version 1.2 for datalogger and sensor modes.
EMI and ESD PROTECTION
The CR510 is encased in metal and incorporates EMI filtering on all inputs and outputs. Gas discharge tubes provide robust ESD protection on all terminal block inputs and outputs. The following European standards apply.
EMC tested and conforms to BS EN61326:1998. Details of performance criteria applied are available
upon request.
CPU AND INTERFACE
PROCESSOR: Hitachi 6303. PROGRAM STORAGE: Up to 16 kbytes for active
program; additional 16 kbytes for alternate programs. Operating system stored in 128 kbytes Flash memory.
DATA STORAGE: 128 kbytes SRAM standard
(approximately 62,000 values). Additional 2 Mbytes Flash available as an option.
OPTIONAL KEYBOARD DISPLAY: 8 digit LCD
(0.5" digits).
PERIPHERAL INTERFACE: 9 pin D-type
connector for keyboard display, storage module, modem, printer, card storage module, and RS-232 adapter.
BAUD RATES: Selectable at 300, 1200, and 9600,
76,800 for certain synchronous devices. ASCII communication protocol is one start bit, one stop bit, eight data bits (no parity).
CLOCK ACCURACY: ±1 minute per month
SYSTEM POWER REQUIREMENTS
VOLTAGE: 9.6 to 16 Vdc TYPICAL CURRENT DRAIN: 1.3 mA quiescent,
13 mA during processing, and 46 mA during analog measurement.
BATTERIES: Any 12 V battery can be connected as
a primary power source. Several power supply options are available from Campbell Scientific. The model CR2430 lithium battery for clock and SRAM backup has a capacity of 270 mAhr.
PHYSICAL SPECIFICATIONS
SIZE: 8.4" x 1.5" x 3.9" (21.3 cm x 3.8 cm x 9.9 cm).
Additional clearance required for serial cable and sensor leads.
WEIGHT: 15 oz. (425 g)
WARRANTY
Three years against defects in materials and workmanship.
We recommend that you confirm system
configuration and critical specifications with
Campbell Scientific before purchase.
OV-18
Copyright © 1999, 2001 Campbell Scientific, Inc. Printed September 2001
Page 31

SECTION 1. FUNCTIONAL MODES

1.1 DATALOGGER PROGRAMS ­3, AND
∗∗∗∗
Data acquisition and processing functions are controlled by user-entered instructions contained in program tables. Programming can be separated into 2 tables, each having its own user-entered execution interval. A third table is available for programming subroutines which may be called by instructions in Tables 1 or 2 or by a special interrupt. The 1 and 2 Modes are used to access Tables 1 and 2. The ∗3 Mode is used to access Subroutine Table 3.
The 4 Mode Table is a table of values used in the program that someone can change while the rest of the program is protected. These values may be used for sensor calibrations or to select optional sensors. The 4 Table is only available when a special program created by EDLOG is loaded in the CR510.
When a program table is first entered, the display shows the table number in the ID field and 00 in the data field. Keying an "A" will advance the editor to the execution interval. If there is an existing program in the table, keying an instruction location number prior to "A" will advance directly to the instruction (e.g., 5 will advance to the fifth instruction in the table).
1.1.1 EXECUTION INTERVAL
The execution interval is entered in units of seconds as follows:
4 MODES
∗∗∗∗
1,
2,
∗∗∗∗
∗∗∗∗
offset, and the result placed in Input Storage). Additional processing requires extra time. The throughput rate is the rate at which a measurement can be made and the resulting value stored in Final Storage. The maximum throughput rate for fast single-ended measurements with standard software is 192 measurements per second (12 measurements repeated 16 times per second).
If the specified execution interval for a table is less than the time required to process that table, the CR510 finishes processing the table and waits for the next occurrence of the execution interval before again initiating the table (i.e., when the execution interval has elapsed and the table is still executing, that execution is skipped). Since no advantage is gained in the rate of execution with this situation, it should be avoided by specifying an execution interval adequate for the table processing time.
NOTE: Whenever the processing time of the user's program exceeds a table's execution interval, an error is logged in memory. The number of overrun errors can be displayed and reset in the B mode (Section 1.6) or using the Telecommunica­tions A command (Section 5.1). An overrun will also cause decimal points to appear on both sides of the sixth digit of the CR10KD. The decimal points will not appear around the G in LOG if the 0 Mode is entered
before the overrun occurs.
1/8 ....31.875 seconds, in multiples of 1/8 (0.125)
32 .....8191 seconds, in multiples of 1 second
Execution of the table is repeated at the rate determined by this entry. The table will not be executed if 0 is entered. Entries less than 32 seconds will be rounded to a valid interval if they are within 1/512 (0.00195) second of a valid interval, otherwise error E41 will be displayed. Entries greater than 32 seconds are rounded to the nearest second.
The sample rate for a CR510 measurement is the rate at which the measurement instruction can be executed (i.e., the measurement made, scaled with the instruction's multiplier and
In some cases, the processing time may exceed the execution interval only when the Output Flag is set and extra time is consumed by final Output Processing. This may be acceptable. For example, suppose it is desired to sample some phenomena every 0.125 seconds and output processed data every 10 minutes. The processing time of the table which does this is less than 0.125 seconds except when output occurs (every 10 minutes). With final output the processing time is 1 second. With the execution interval set at 0.125 seconds, and a one second lag between samples once every 10 minutes, 8 measurements out of 4800 (.17%) are missed: an acceptable statistical error for most populations.
1-1
Page 32
SECTION 1. FUNCTIONAL MODES
1.1.2 SUBROUTINES
Table 3 is used to enter subroutines which may be called with Program Control Instructions in Tables 1 and 2 or other subroutines. The group of instructions which form a subroutine starts with Instruction 85, Label Subroutine, and ends with Instruction 95, End (Section 12).
Subroutine 98 has the unique capability of being executed when port 2 goes high. This subroutine will interrupt Tables 1 and 2 (Section
1.1.3) when port 2 goes high. When the port goes high, the processor awakes within a few microseconds. The port triggers on the rising edge (i.e., when it goes from low to high). If the port stays high, the subroutine is not called again.
1.1.3 TABLE PRIORITY/INTERRUPTS
Table 1 execution has priority over Table 2. If Table 2 is being executed when it is time to execute Table 1, Table 2 will be interrupted. After Table 1 processing is completed, Table 2 processing resumes at the interruption point. If the execution interval of Table 2 coincides with Table 1, Table 1 is executed first, then Table 2.
Interrupts by Table 1 are not allowed in the middle of an instruction or while output to Final Storage is in process (flag 0 is set high). The interrupt occurs as soon as the instruction is completed or flag 0 is set low.
Subroutine 98 can be initiated by port 2 going high (Section 1.1.2), can interrupt either Table 1 or 2 or can occur when neither is being executed. This subroutine can interrupt a table while the Output Flag is set. When the port goes high during the execution of a table, the instruction being executed is completed before the subroutine is run (i.e., as if the subroutine was called by the next instruction).
The priority is Subroutine 98, Table 1, Table 2. If the interrupt subroutine started when neither table was running, then neither table can interrupt it.
While subroutine 98 is being executed as a result of port 2 going high, that port interrupt is disabled (i.e., the subroutine must be completed before the port going high will have any effect).
1.1.4 ∗∗∗4 PARAMETER ENTRY TABLE
The 4 mode is a table with up to one hundred values. Each value corresponds to an instruction parameter in the datalogger program. When the datalogger compiles the program, values in the 4 table are transferred to the corresponding instruction parameter. The datalogger program must be created using EDLOG which allows instruction parameters to be assigned to the 4 table.
In a network of datalogger stations, the 4 table can be used to simplify site customization and the procedure of information entry. Once a generalized program is developed, application specific details, e.g., sensor calibration, can be entered without accessing the 1 and ∗2 program tables or the 3 subroutine table.
ASSIGNING PARAMETERS TO ∗∗∗4 - EDLOG
The only way to implement the 4 mode is through EDLOG. The datalogger program is generated in EDLOG in the normal way.
To assign a parameter to a 4 location, position the cursor on the desired parameter and press the "@" key. EDLOG then prompts for the location number in the 4 table to be assigned to the associated parameter. After a valid number is entered, EDLOG marks the parameter with "@@nn" to the right of the parameter description, where "nn" is the ∗4 location number.
Older versions of EDLOG (prior to DOS Version
6.0) may not support the 4 mode or may require that the support be enabled. To enable the 4 mode press the F5 key followed by the "@" key while in EDLOG's edit mode. "F5=∗4 List" is displayed at the top of the screen indicating that EDLOG's 4 feature is active. Subsequent use of the F5 key displays a list indicating which 4 locations are in use. If your copy of EDLOG is earlier than 6.0 and it does not display "F5=4 List", it is likely that that version of EDLOG does not support the ∗4 mode. Please contact Campbell Scientific for details of an upgrade.
Any program parameter or execution interval can be marked for inclusion in the table, as illustrated below.
1-2
Page 33
SECTION 1. FUNCTIONAL MODES
PROGRAM
* Table 1 Program
01: 0.0 Execution Interval
(seconds) @@0
01: Volts (SE) (P1)
1: 1 Reps 2: 1 ±2.5 mV Slow Range 3: 1 SE Channel 4: 1 Loc [ _________ ] 5: 1 Mult @@1 6: 0 Offset @@2
In the above example, 4 location 0 is assigned to the program table execution interval, and locations 1 and 2 to the multiplier and offset of the measurement instruction. Note that a default execution interval of zero means the program will not execute until an alternative interval is entered in location 00 of the 4 mode. A default multiplier and offset of 1 and 0 means that the measurement value is in units of millivolts. A different multiplier and offset can be entered in 4 locations 1 and 2, respectively.
A 4 location can be used in only one program parameter. For example, 4 locations 0, 1, and 2 used in the example cannot be reused in another instruction in the same program.
If the 4 feature is enabled in EDLOG when printing a program to a printer or disk file, the ∗4 list is printed at the end of the file.
To enter a value in a 4 location, advance to the desired location, key in the number and enter it by pressing the "A" key. The value is not entered if the "A" key is not pressed.
Entering a new value causes the datalogger to stop logging. Logging resumes when the program is compiled. Upon compiling, all current 4 values are incorporated into the program. For this reason, whenever changes are made in the 4 mode, make sure that all ∗4 values are correct before exiting the 4 mode.
Removing or adding an instruction to a program residing in the datalogger disables the 4 mode. An instruction parameter may be edited without any adverse affect. If the 4 mode is disabled, it may be reactivated by downloading the program to the datalogger or, if the program was saved to Flash storage, retrieving the program from the stored program area.
The C mode (Section 1.7) may be used to secure the datalogger program and the ∗4 mode entries. The lowest level of security prevents access to the ∗1, ∗2, and 3 modes. Higher levels of security block ∗4.
The CR510 will not respond to the 4 command if any of the following conditions exist.
the program that was downloaded does not contain any 4 assignments.
Once the EDLOG created program has been sent to the CR510, it can be saved in the Flash memory program storage area using the ∗D Mode (Section 1.8).
CHANGING VALUES IN ∗∗∗4 TABLE
Enter the 4 Mode by keying "4"; "04:00" is then displayed. At this point it is possible to jump to any valid 4 location by keying the desired location number and pressing the A key. For example, when the display shows 04:00 and the desired location is 80, key in the number 80, press the A key and the display will show "80:XXXXX." where XXXXX. is the value stored in location 80. Pressing the "A" key advances to the next 4 location, and the "B" key backs up to the previous location. If a ∗4 location is not assigned in the datalogger program, it can not be displayed in the 4 mode.
a program that was downloaded has since been hand edited.
Security is blocking access to 4.
1.1.5 COMPILING A PROGRAM
When a program is first loaded, or if any changes are made in the ∗1, ∗2, ∗3, ∗4, ∗A, or C Modes, the program must be compiled before it starts running. The compile function checks for programming errors and optimizes program information for use during program execution. If errors are detected, the appropriate error codes are indicated on the display (Section 3.10). The compile function is executed when the 0 , 6, or B Modes are entered and prior to saving a program listing in the D Mode. The compile function is only executed after a program change has been made and any subsequent use of any of these
1-3
Page 34
SECTION 1. FUNCTIONAL MODES
modes will return to the mode without recompiling.
When the 0 or B Mode is used to compile, all output ports and flags are set low, the timer is reset, and data values contained in Input and Intermediate Storage are reset to zero.
When the 6 Mode is used to compile data values contained in Input Storage, the state of flags, control ports, and the timer (Instruction
26) are unaltered. Compiling always zeros Intermediate Storage.
1.2 SETTING AND DISPLAYING THE CLOCK -
The 5 Mode is used to display or set time. When "5" is entered, time is displayed. It is updated approximately once a second or longer depending on the rate and degree of data collection and processing taking place. The sequence of time parameters displayed in the 5 Mode is given in Table 1.2-1.
To set the year, day, or hours and minutes, enter the 5 Mode and advance to display the appropriate value. Key in the desired number and enter the value by keying "A". When a new value for hours and minutes is entered, the seconds are set to zero and current time is again displayed. To exit the 5 Mode, key "∗" and the mode you wish to enter.
When the time is changed, a partial recompile is done automatically to synchronize the program with real time.
Changing time affects the output and execution intervals in which time is changed. Because time can only be set with a 1 second resolution, execution intervals of 1 second or less remain constant. Averaged values will still be accurate, though the interval may have a different number of samples than normal. Totalized values will reflect the different number of samples. The pulse count instruction will use the previous interval's value if an option has been selected to discard odd intervals, otherwise it will use the count accumulated in the interval.
5 MODE
∗∗∗∗
TABLE 1.2-1. Sequence of Time
Parameters in ∗∗∗5 Mode
Display
Key ID:DATA
5
:HH:MM:SS Display current time
A A
05:XXXX Display/enter year 05:XXXX Display/enter day of year
Description
1-365(366)
A
05:HH:MM: Display/enter
hours:minutes
1.3 DISPLAYING/ALTERING INPUT MEMORY, FLAGS, AND PORTS ­MODE
The 6 Mode is used to display and/or change Input Storage values and to toggle and display user flags and ports. If the 6 Mode is entered immediately following any changes in program tables, the program will be compiled and run.
NOTE: Input Storage data and the state of flags, control ports, and the timer (Instruction 26) are UNALTERED whenever program tables are altered and recompiled with the 6 Mode. Compiling always zeros Intermediate Storage.
TABLE 1.3-1. ∗∗∗6 Mode Commands
Key Action
A
B
C
D 0 #
1.3.1 DISPLAYING AND ALTERING INPUT STORAGE WITH THE KEYBOARD DISPLAY
When "6" is entered, the keyboard/display will read "06:0000". One can advance to view the value stored in input location 1 by keying "A". To go directly to a specific location, key in the location number before keying "A". For example, to view the value contained in Input
Advance to next input location or enter new value
Back-up to previous location Change value in input location
(followed by keyed in value, then "A") Display/alter user flags Display/alter ports Display current location and allow a
location number to be keyed in, followed by "A" to jump to that location
6
∗∗∗∗
1-4
Page 35
SECTION 1. FUNCTIONAL MODES
Storage location 20, key in "*6 20 A". The ID portion of the display shows the last 2 digits of the location number. If the value stored in the location being monitored is the result of a program instruction, the value on the keyboard/display will be the result of the most recent scan and will be updated each time the instruction is executed. When using the ∗6 Mode from a remote terminal, a number (any number) must be sent before the value shown will be updated.
Input locations can be used to store parameters for use in computations. To store a value in a location, or change the current value, key "C" while monitoring the location, followed by the desired number and "A". This number will be saved once the program is recompiled.
If an algorithm requires parameters to be manually modified during execution of the Program without interruption of the Table execution process, the 6 Mode can be used. (If parameters will not need modification, it is better to load them from the program using Instruction
30.) If initial parameter values are required to be in place before program execution commences, use Instruction 91 at the beginning of the program table to prevent the execution until a flag is set (see the next section). Initial parameter values can be entered into input locations using the 6 Mode C command. The flag can then be set to enable the table(s).
If the program is altered and compiled with ∗0 Mode, all values previously entered via 6C will be set to zero. To preserve 6C entered values, compile in the 6 Mode after changing the program.
1.3.2 DISPLAYING AND TOGGLING USE R FLAGS
If D is keyed while the CR510 is displaying a location value, the current status of the user flags will be displayed in the following format: "00:010010". The characters represent the flags, the left-most digit is Flag 1 and right most is Flag
8. A "0" indicates the flag is clear or “low” and a "1" indicates the flag is set or “high”. In the above example, Flags 4 and 7 are set. To toggle a flag, simply press the corresponding number. To return to displaying the input location, press "A".
Entering appropriate flag tests into the program allows manual control of program execution.
For example, to manually start the execution of Table 2: enter Instruction 91 as the first instruction in Table 2. The first parameter is 25 (do if Flag 5 is low), the second parameter is 0, go to end of program table. If Flag 5 is low, all subsequent instructions in Table 2 will be skipped. Flag 5 can be toggled from the ∗6 Mode, effectively starting and stopping the execution of Table 2.
1.3.3 DISPLAYING AND TOGGLING PORTS
The status of the CR510 ports can be displayed by hitting "0" while looking at an input location (e.g., 6 A0). Ports are displayed left to right as 0, 0, 0, 0, 0, 0, C2, C1 (exactly opposite to the flags). A port configured as output can be toggled by hitting its number while in the port display mode. There is no effect on C2 because it is configured as an input only, or on C1 when it is configured as input only.
On power up all ports are configured as inputs. Instruction 20 is used to configure C1 as an output. Port C1 can also be configured as an output by any program control commands which uses the port as an output (pulse, set high, set low, toggle).
1.4 COMPILING AND LOGGING DATA ­0 MODE
∗∗∗∗
When the 0 Mode is entered after programming the CR510, the program is compiled and the display shows "LOG" followed by the active program table numbers. The display is not updated after entering ∗0.
NOTE: All output ports are set low, the timer is reset, and data values in Input and Intermediate Storage are RESET TO ZERO whenever the program tables are altered and the Program is recompiled with the ∗0 Mode. The same is true when the programs are compiled with B or ∗D.
To minimize current drain, the CR510 should be left in the 0 Mode when logging data.
1.5 MEMORY ALLOCATION -
1.5.1 INTERNAL MEMORY
When powered up with the keyboard display attached, the CR10KD displays HELLO while performing a self check. The total system
A
∗∗∗∗
1-5
Page 36
SECTION 1. FUNCTIONAL MODES
memory is then displayed in K bytes. The size of memory can be displayed in the B mode.
Input Storage is used to store the results of Input/Output and Processing Instructions. The values stored in input locations may be displayed using the 6 Mode (Section 1.3).
Final Storage holds stored data for a permanent record. Output Instructions store data in Final Storage when the Output Flag is set (Section 3.7). The data in Final Storage can be monitored using the 7 Mode (Section 2.3).
Intermediate Storage is a scratch pad for Output Processing Instructions. It is used to store the results of intermediate calculations necessary for averages, standard deviations,
histograms, etc. Intermediate Storage is not accessible by the user.
Each Input or Intermediate Storage location requires 4 bytes of memory. Each Final Storage location requires 2 bytes of memory. Low resolution data points require 1 Final Storage location, and high resolution data points require 2. Section 2 describes Final Storage and data retrieval in detail.
Figure 1.5-1 lists the basic memory functions and the amount of memory allotted to them.
1-6
Page 37
SECTION 1. FUNCTIONAL MODES
Flash Memory
(EEPROM)
Total 128 Kbytes
Operating System
(96 Kbytes)
Active Program
(16 Kbytes)
Stored Programs
(16 Kbytes)
How it works:
The Operating System is loaded into Flash Memory at the factory. System Memory is used while the CR510 is running for calculations, buffering data and general operating tasks.
Any time a user loads a program into the CR510, the program is compiled in SRAM and stored in the Active Program areas. If the CR510 is powered off and then on, the Active Program is loaded from Flash and run.
The Active Program is run in SRAM to maximize speed. The program accesses Input Storage and Intermediate Storage and stores data into Final Storage for later retrieval by the user.
The Active Program can be copied into the Stored Programs area. While 98 program "names" are available, the number of programs stored is limited by the available memory. Stored programs can be retrieved to become the active program. While programs are stored one at a time, all stored programs must be erased at once. That is because the flash memory can only be written to once before it must be erased and can only be erased in 16 Kbytes blocks.
SRAM
Total 128 Kbytes
System Memory
(4096 Bytes)
Active Program
(default 2048 Bytes)
Input Storage
(default 28 locations, 112 bytes)
Intermediate Storage
(default 64 locations, 256 bytes)
Final Storage Area 1
(default 62,280 locations, 124,560 bytes)
Final Storage Area 2
(default 0 locations, 0 bytes)
Optional
Flash EEPROM
With the Optional Flash Memory, up to 2 Mbytes of additional memory can be added to increase Final Storage by another 524,288 data values per Mbyte. The user can allocate this extra memory to any combination of Area 1 or Area 2.
(Memory Areas separated by dashed lines: can be re-sized by the user.)
FIGURE 1.5-1. CR510 Memory
Final Storage Area 1
and/or
Final Storage Area 2
(
Additional
524,288
locations per Mbyte)
1-7
Page 38
SECTION 1. FUNCTIONAL MODES
1.5.2 ∗∗∗A MODE
The A Mode is used to 1) determine the number of locations allocated to Input Storage, Intermediate Storage, Final Storage Area 2, Final Storage Area 1, and Program Memory; 2) repartition this memory;
3) check the number of bytes remaining in Program memory; 4) erase Final Storage; and 5) to completely reset the datalogger.
A second Final Storage area (Storage Area 2) can be allocated in the A Mode. On power up, the number of locations allocated for Storage Area 2 defaults to 0. Final Storage Area 1 is the source from which memory is taken when Input, Intermediate, Final Storage Area 2, or program memories are increased. When they are reduced, Final Storage Area 1 memory is increased. Allocation of Input and Intermediate Storage locations does NOT change Final Storage Area 2.
With the Flash EEPROM 1 or 2 meg. expanded memory options, the boundary between Area 1 and Area 2 must lie between 32 K location sectors. Entries for Area 2 greater than 32,769 locations will be rounded up to the next boundary.
When A is entered, the first number displayed is the number of memory locations allocated to Input Storage. The "A" key is used to advance through the next 6 windows. Table 1.5-2 describes what the values in the A Mode represent.
At the reset, the memory allocation defaults to the values in Figure 1.5-1. The size of Final Storage is determined by the size of memory installed.
The sizes of Input, Intermediate, Final Storage Area 2, and Program Memory may be altered by keying in the desired value and entering it by keying "A". One Input or Intermediate Storage location can be exchanged for two Final Storage locations. The size of Final Storage Area 1 will be adjusted automatically.
The maximum size of Input and Intermediate Storage and the minimum size of Final Storage are determined by the memory installed (Figure
1.5-1). A minimum 28 Input location and one Final Storage Area 1 location will ALWAYS be retained. The size of Intermediate Storage may be reduced to 0.
Keyboard Display Entry ID: Data
A
A
A
A
A
A
01: XXXX Input Storage Locations (minimum of 28, maximum limited by
02: XXXX Intermediate Storage Locations (maximum limited by available
03: XXXXX Final Storage Area 2 Locations (minimum of 0, maximum
04: XXXXX Final Storage Area 1 Locations (minimum of 1). This number is
05: Bytes allocated for user program. The number of bytes to
06: Bytes free in program memory. The user cannot change this
TABLE 1.5-2. Description of ∗∗∗A Mode Data
Description of Data
available memory and constraints on Final Storage). This value can be changed by keying in the desired number.
memory and constraints on Input and Final Storage). This value can be changed by keying in the desired number. Enter 0 and the CR510 will assign the exact number needed. Entering 0 will also result in the CR510 erasing all data whenever the program is changed and compiled.
limited by available memory). Changing this number automatically reallocates Final Storage Area 1.
automatically altered when the memory allocation for Program, Input, Intermediate, or Final Storage Area 2 is changed.
assign to program memory can be keyed in to change the size of program memory. Changing the size of program memory results in all data being erased. Enter 0 and the CR510 will assign the exact number needed. Entering 0 will also result in the CR510 erasing all data whenever the program is changed and compiled.
Key in 98765 to completely reset datalogger.
window. It is a function of window 5 and the program.
1-8
Page 39
SECTION 1. FUNCTIONAL MODES
After repartitioning memory, the program must be recompiled. Compiling erases Intermediate Storage. Compiling with 0 erases Input Storage; compiling with 6 leaves Input Storage unaltered.
If Intermediate Storage size is too small to accommodate the programs or instructions entered, the "E:04" ERROR CODE will be displayed in the ∗0, ∗6, and B Modes. The user may remove this error code by entering a larger value for Intermediate Storage size. Intermediate Storage and Program Memory can be automatically allocated by entering 0 for their size. When automatic allocation is used, all data are erased any time the program is exchanged and recompiled. Final Storage size is maximized by limiting Intermediate Storage and Program Memory to the minimum necessary. The size of Final Storage and the rate at which data are stored determines how long it will take for Final Storage to fill, at which point new data will write over old.
Intermediate Storage and Final Storage are erased when memory is repartitioned. This feature may be used to clear memory without altering programming. The number of locations (Windows 1-4) does not actually need to be changed; the same value can be keyed in and entered.
ENTERING 98765 for the number of bytes to allocate for program memory (5th Window) COMPLETELY RESETS THE CR510. All
memory is erased including any stored programs and memory is checked. Memory allocation returns to the default. The reset operation requires approximately 1 minute for a CR510, 5 minutes for a CR510-1M, and 10 minutes for a CR510-2M. Please be patient while the reset
takes place; if the CR510 is turned off in the middle of a reset, it will perform the reset the next time it is powered up.
1.6 MEMORY TESTING AND SYSTEM
STATUS -
The B Mode is used to check the status of the program’s operating system and lithium battery. Table 1.6-1 describes what the values seen in the B Mode represent.
A signature is a number which is a function of the data and the sequence of data in memory. It is derived using an algorithm which assures a
99.998% probability that if either the data or its sequence changes, the signature changes. The signature of the program memory is used to determine if the program tables have been altered. During the self check on reset, the signature computed for the Operating Sytem (OS) is compared with a stored signature to determine if a failure has occurred. The algorithm used to calculate the signature is described in Appendix C.
NOTE: Instruction 19 calculates one signature for the program System. Because this is a combined signature, it is not the same as the signatures in Windows 1 or 2.
The contents of windows 6 and 7, Operating System (OS) version and version revision, are helpful in determining what OS is in the datalogger. As different versions are released, there may be operational differences. When calling Campbell
Scientific for datalogger assistance, please have these numbers available.
B
∗∗∗∗
the Operating
and
1-9
Page 40
SECTION 1. FUNCTIONAL MODES
TABLE 1.6-1. Description of ∗∗∗B Mode Data
Keyboard Display Entry ID: Data
B
A A A A A A A A A A
01: XXXXX Program memory Signature. The value is dependent upon the
02: XXXXX Operating System (OS) Signature 03: XXXXX Memory Size, Kbytes (Flash + SRAM) 04: XX Number of E08 occurrences (Key in 88 to reset) 05: XX Number of overrun occurrences (Key in 88 to reset) 06: X.XXXX Operating System version number 07: XXXX. Version revision number
08: X.XXXX Lithium battery voltage (measured daily)
09: XX Low 12 V battery detect counter (Key in 88 to reset) 10: XX Extended memory error counter (Key in 88 to reset) 11: X.XXXX Extended Memory time of erase, seconds
Description of Data
programming entered and memory allotment. If the program has not been previously compiled, it will be compiled and run.
TABLE 1.7-1. ∗∗∗C Mode Entries
Keyboard Display Entry ID: Data
C
A A
01:XXXX Non-zero password blocks entry to ∗1, ∗2, ∗3, ∗A, and ∗D
02:XXXX Non-zero password blocks ∗4, ∗5, and 6 except for display. 03:XXXX Non-zero password blocks ∗5, ∗6, ∗7, ∗8, ∗9, ∗B, and all
Keyboard Display Entry ID: Data
C
A
12:0000 Enter password. If correct, security is temporarily unlocked
01:XX Level to which security has been disabled.
SECURITY DISABLED
Description
Modes.
telecommunications commands except A, L, N, and E.
SECURITY ENABLED
Description
through that level.
0 -- Password 1 entered (everything unlocked) 1 -- Password 2 entered 2 -- Password 3 entered
1-10
Page 41
SECTION 1. FUNCTIONAL MODES
1.7
C MODE -- SECURITY
∗∗∗∗
The C Mode is used to block access to the user's program information and certain CR510 functions. There are 3 levels of security, each with its own 4 digit password. Setting a password to a non-zero value "locks" the functions secured at that level. The password must subsequently be entered to temporarily unlock security through that level. Passwords are part of the program. If security is enabled in the active program, it is enabled as soon as the program is run when the CR510 is powered up.
When security is disabled, C will advance directly to the window containing the first password. A non-zero password must be entered in order to advance to the next window. Leaving a password 0, or entering 0 for the password disables that and subsequent levels of security.
Security may be temporarily disabled by entering a password in the C Mode or using the telecommunications L command (Section
5.1). The password entered determines what operations are unlocked (e.g., entering password 2 unlocks the functions secured by passwords 2 and 3). Password 1 (everything unlocked) must be entered before any passwords can be altered.
When security is temporarily disabled in the ∗C Mode, entering 0 will automatically re-enable security to the level determined by the passwords entered.
The telecommunications L command temporarily changes the security level. After hanging up, security is reset.
1.8
D MODE -- SAVE OR LOAD
∗∗∗∗
PROGRAM
The D Mode is used to save or load CR510 programs, to set the degree to which memory is cleared on powerup, to set the datalogger ID, and to set communication to full or half duplex.
Programs (∗1, ∗2, ∗3, ∗4, ∗A, ∗C, and D Mode data) may be stored to and from computers, internal flash memory, and Storage Modules. Several programs can be stored in the CR510 Flash Memory and later recalled and run using the D Mode or Instruction 111.
Campbell Scientific’s datalogger support software automatically makes use of the D Mode to upload and download programs from a computer. Appendix C gives some additional information on Commands 1 and 2 that are used for these operations.
When "D" is keyed in, the CR510 will display "13:00". A command (Table 1.8-1) is entered by keying the command number and "A".
TABLE 1.8-1. ∗∗∗D Mode Commands
Command Description
1 Send (Print) ASCII Program 2 Load ASCII Program, 0 Compile 2-- Load ASCII Program, 6 Compile 6 Store Program in Flash 7 Load Program from Flash 7N Save/Load/Clear Program from
Storage Module N 8 Set Datalogger ID 9 Set Full/Half Duplex 10 Set Powerup Options
If the CR510 program has not been compiled when the command to save a program is entered, it will be compiled before the program is saved. When a program is loaded, it is immediately compiled and run. When a command is complete, "13:0000" is displayed; D must be entered again before another command can be given.
TABLE 1.8-2. Progr am Load Error Codes
E 94 Program Storage Area full E 95 Program does not exist in flash E 96 Storage Module not connected or
wrong address E 97 Data not encountered within 30 sec. E 98 Uncorrectable errors detected E 99 Wrong type of file or Editor Error
1.8.1 INTERNAL FLASH PROGRAM STORAGE
Several programs can be stored in the CR510 Flash Memory and later recalled and run using the D Mode. The Flash Electrically Erasable Programmable Read Only Memory is non­volatile memory that can only be erased in 16K blocks. The CR510 has 128K of Flash EEPROM memory, one 16K block is reserved for storing extra programs.
When a program is loaded and compiled, it is saved as the active program. The active
1-11
Page 42
SECTION 1. FUNCTIONAL MODES
program will be automatically loaded and run when the CR510 is powered up. (If a Storage Module with a program 8 is connected when the CR510 powers-up, the Storage Module program 8 will be loaded into the CR510 and become the active program.)
The active program can be stored in internal flash memory program storage with ∗D command 6 (Table 1.8-3). Programs can be retrieved with D command 7 (Table 1.8-4).
TABLE 1.8-3 Storing Program in
Internal Flash
Key entry Display
D 13:00 6A 06:00
You may now enter one of the following options:
xxA Save active program as
number xx, xx may be 1-98. A Scroll forward and B backward through saved
program numbers. The
numbers are displayed in the
order saved. 99A99A Clear all saved programs. 0A Display number of bytes free in
saved program area.
TABLE 1.8-4 Retrieving a Program from
Internal Flash
Key entry Display
D 13:00 7A 07:00
You may now enter one of the following options:
xxA Retrieve program number xx
(the most recent xx saved). To
have the program compile like
6 (no resetting of input
locations, flags, or ports) press
C (xx--) before A. 0A Erase active program (i.e., load a
blank program; memory allocation
and Final Storage are reset). A Scroll forward and B backward through saved
program numbers.
Scrolling through the program names begins with the oldest program. "A" advances to the next newer program, "B" backs up to the next older program. While scrolling, at any time typing in a number (xxA) will cause a save or a retrieve operation.
Each program saved takes up the memory required for the program + 6 bytes.
Flash memory can only be written to once before being erased. Because it can only be erased in 16K blocks, if one stored program is to be erased, all must be erased. To allow revising a program and storing it with the same number (name) as an earlier version, the same number can be used by more than one saved program. When retrieving a program, the programs are searched beginning with the last program saved; the most recently saved version will be retrieved. An older program with a duplicate name cannot be retrieved. When the flash program memory is full, all programs must be erased before any more can be added (error 94 will be displayed).
1.8.2 PROGRAM TRANSFER WITH STORAGE MODULE
Storage Modules can store up to eight separate programs. The Storage Module and Keyboard/Display or Modem/Terminal must both be connected to the CR510. After keying ∗D, the command 7N, is entered (N is the Storage Module address 1-8, Section 4.4.1). Address 1 will work with any Storage Module address; the CR510 will search for the lowest address Storage Module that is connected. The command to save, load, or clear a program and the program number (Table 1.8-5) is entered. After the operation is finished "13:0000" is displayed. Error 96 indicates that the Storage Module is not connected or the wrong address was given.
1-12
Page 43
SECTION 1. FUNCTIONAL MODES
TABLE 1.8-5 Transferring a Program using a
Storage Module
Key entry Display
D 13:00 7NA 7N:00 (N is Storage Module
address 1-8)
You may now enter one of the following options:
1x Save Program x to Storage
Module (x = 1-8)
2x Load Program x from Storage
Module (x = 1-8)
3x Erase Program x in Storage
Module (x = 1-8)
The datalogger can be programmed on power­up using a Storage Module. If a program is stored as program number 8, and the Storage Module is connected to the datalogger I/O at power-up, program number 8 is automatically loaded into the active program area of the datalogger and run.
1.8.3 FULL/HALF DUPLE X
The *D Mode can also be used to set communications to full or half duplex. The default is full duplex, which works best in most situations.
1.8.4 SET DATALOGGER ID
Command 8 is used to set the datalogger ID. The ID can be moved to an input location with Instruction 117 and can then be sampled as part of the data.
TABLE 1.8-7 Setting Datalogger ID
Key Entry Display
D 13:00 8A 08:0XXX
Where XXX are 0s or the current ID. You may now key in the ID (1-254, excluding 13).
1.8.5 SETTING POWERUP OPTIONS
Setting options for the Program on Powerup allows the user to specify what information to retain from when the datalogger was last on. This allows Flag/Port status, the User Timer, and the Input/Intermediate Storage to be cleared or not cleared.
Table 1.8-8. Setting Powerup Options
Key entry Display
D 13:00 10A 10:0X
TABLE 1.8-6. Setting Duplex
Key entry Display
D 13:00 9A 09:0x
If x=0 the CR510 is set for full duplex. If x=1 the CR510 is set for half duplex.
You may now change the option:
0A Set full duplex 1A Set half duplex
Where X is the powerup option currently selected. You may now change the option:
0A Clears input locations, ports, flags, user
timer, and intermediate storage locations.
1A Clears intermediate storage only (leaves
Input Storage, Flags/Ports, and User Timer
as is). 2A Doesn’t clear anything. 3A Do not change power-up settings.
1-13
Page 44
SECTION 1. FUNCTIONAL MODES
This is a blank page.
1-14
Page 45

SECTION 2. INTERNAL DATA STORAGE

2.1 FINAL STORAGE AREAS, OUTPUT ARRAYS, AND MEMORY POINTERS

Final Storage is the memory where final processed data are stored. Final Storage data are transferred to your computer or external storage peripheral.
The size of Final Storage is expressed in terms of memory locations; one memory location is two bytes. A low resolution data point (4 decimal characters) occupies one memory location (2 bytes), whereas a high resolution data point (5 decimal characters) requires two memory locations (4 bytes). Table 1.5-1 shows the default allocation of memory locations to Program, Input, Intermediate, and the two Final Storage areas. The A Mode is used to reallocate memory or erase Final Storage (Section 1.5).
The default size of Final Storage with standard memory is 62280 low resolution memory locations.
Final Storage can be divided into two parts: Final Storage Area 1 and Final Storage Area 2.
Final Storage Area 1 is the default storage area and the only one used if the operator does not specifically allocate memory to Area 2.
Two Final Storage Areas may be used to:
1. Output different data to different devices.
2. Separate archive data from real time display data. In other words, you can record a short time history of real time data and separately record long term, archive data.
3. Record both high speed data (fast recording interval) and slow data without having the high speed data write over the slow data.
Each Final Storage Area can be represented as ring memory (Figure 2.1-1) on which the newest data are written over the oldest data.
The Data Storage Pointer (DSP) is used to determine where to store each new data point in the Final Storage area. The DSP advances to the next available memory location after each new data point is stored.
FIGURE 2.1-1. Ring Memory Representation of Final Data Storage
2-1
Page 46
SECTION 2. I NTERNAL DATA STORAGE
Output Processing Instructions store data into Final Storage only when the Output Flag is set. The string of data stored each time the Output Flag is set is called an OUTPUT ARRAY. The first data point in the output array is a 3 digit OUTPUT ARRAY ID. This ID number is set in one of two ways:
1. In the default condition, the ID consists of the program table number and the Instruction Location Number of the instruction which set the Output Flag for that particular array of data. For example, the ID of 118 in Figure 2.1-2 indicates that the 18th instruction in Table 1 set the Output Flag.
2. The output array ID can be set by the user with the second parameter of Instruction 80 (Section 11). The ID can be set to any positive integer up to 511. This option allows the user to make the output array ID independent of the programming. The program can be changed (instructions added or deleted) without changing the output array ID. This avoids confusion during data reduction, especially on long term projects where program changes or updates are likely.
Data are stored in Final Storage before being transmitted to an external device. There are 4 pointers for each Final Storage Area which are used to keep track of data transmission. These pointers are:
1. Display Pointer (DPTR)
2. Printer Pointer (PPTR)
3. Telecommunications (Modem) Pointer (MPTR)
4. Storage Module Pointer (SPTR) The DPTR is used to recall data to the keyboard/
display. The positioning of this pointer and data recall are controlled from the keyboard (7 Mode).
The PPTR is used to control data transmission to a printer or other serial device. Whenever on-line printer transfer is activated (Instruction
96), data between the PPTR and DSP are transmitted. The PPTR may also be positioned via the keyboard for manually initiated data transmission (8 Mode).
The MPTR is used in transmitting data over a telecommunications interface. When telecommunications is first entered, the MPTR is set to the same location as the DSP. Positioning of the MPTR is then controlled by commands from the external calling device (Section 5.1).
FIGURE 2.1-2. Output Array ID
NOTE: If Instruction 80 is used to
designate the active Final Storage Area and parameter 2 is 0, the output array ID is determined by the position of Instruction 80 or by the position of the instruction setting the Output Flag, whichever occurs last.
A start-of-array marker ($ in Figure 2.1-1) is written into Final Storage with the Output Array ID. This marker is used as a reference point from which to number the data points of the output array. The start of array marker occupies the same Final Storage location as the Array ID and is transparent for all user operations.
The SPTR is used to control data transmission to a Storage Module. When on-line transfer is activated by Instruction 96, data is transmitted each time an output array is stored in Final Storage IF THE STORAGE MODULE IS CONNECTED TO THE CR510. If the Storage Module is not connected, the CR510 does not transmit the data nor does it advance the SPTR to the new DSP location. It saves the data until the Storage Module is connected. Then, during the next execution of Instruction 96, the CR510 outputs all of the data between the SPTR and the DSP and updates the SPTR to the DSP location (Section 4.1)
The SPTR may also be positioned via the keyboard for manually initiated data transfer to the Storage Module (8 Mode, Section 4.2).
CAUTION: All memory pointers are set to the DSP location when the datalogger compiles a program. ALWAYS RETRIEVE UNCOLLECTED DATA BEFORE MAKING PROGRAM CHANGES.
2-2
Page 47
SECTION 2. I NTERNAL DATA STORAGE
2.2 DATA OUTPUT FORMAT AND
RANGE LIMITS
Data are stored internally in Campbell Scientific's Binary Final Storage Format (Appendix B.2). Data may be sent to Final Storage in either LOW RESOLUTION or HIGH RESOLUTION format.
2.2.1 RESOLUTION AND RANGE LIMITS
Low resolution data is a 2 byte format with 4 significant digits and a maximum magnitude of +6999. High resolution data is a 4 byte format with 5 significant digits and a maximum possible output value of +99999 (see Table 2.2-1 below).
TABLE 2.2-1. Resolution Range Limits of
CR510 Data
Minimum Maximum
Resolution Zero
Low 0.000 +0.001 +6999. High 0.0000 + .00001 +99999.
The resolution of the low resolution format is reduced to 3 significant digits when the first (left most) digit is 7 or greater. Thus, it may be necessary to use high resolution output or an offset to maintain the desired resolution of a measurement. For example, if water level is to be measured and output to the nearest 0.01 ft., the level must be less than 70 ft. for low resolution output to display the
0.01 ft. increment. If the water level was expected to range from 50 to 80 ft. the data could either be output in high resolution or could be offset by 20 ft. (transforming the range to 30 to 50 ft.).
Magnitude Magnitude
seventh digit. For example, the resolution of 97,386,924 is better than 10. The resolution of
0.0086731924 is better than 0.000000001. A precise calculation of the resolution of a
number may be determined by representing the number as a mantissa between .5 and 1 multiplied by 2 raised to some integer power. The resolution is the product of that power of 2 and
-24
. For example, representing 478 as .9336
2
9
, the resolution is 29 2
2 A description of Campbell Scientific's floating point format may be found in the description of the J and K Telecommunications Commands in Appendix B.
-24
= 2
-15
= 0.0000305.
2.3 DISPLAYING STORED DATA ON KEYBOARD/DISPLAY -
(Computer/terminal users refer to Section 5 for instructions on entering the Remote Keyboard State.)
Final Storage may be displayed by using the ∗7 Mode. Key ∗7.
If you have allocated memory to Final Storage Area 2, the display will show:
07:00
Select which Storage Area you wish to view:
00 or 01 = Final Storage Area 1
02 = Final Storage Area 2
7 MODE
∗∗∗∗
The default for Final Storage is low resolution. Program instruction 78 can be used to change this to high resolution.
2.2.2 INPUT AND INTERMEDIATE STORAGE DATA FORMAT
While output data have the limits described above, the computations performed in the CR510 are done in floating point arithmetic. In Input and Intermediate Storage, the numbers are stored and processed in a binary format with a 23 bit binary mantissa and a 6 bit binary exponent. The largest and smallest numbers that can be stored and processed are 9 x 10 and 1 x 10 number determines the resolution of the arithmetic. A rough approximation of the resolution is that it is better than 1 in the
-19
, respectively. The size of the
18
If no memory has been allocated to Final Storage Area 2, this first window will be skipped.
The next window displays the current DSP location. Pressing A advances you to the Output array ID of the oldest Array in the Storage Area. To locate a specific Output Array, enter a location number that positions the Display Pointer (DPTR) behind the desired data and press the "A" key. If the location number entered is in the middle of an Output Array, the DPTR is automatically advanced to the first data point of the next Output Array. Repeated use of the "A" key advances through the Output Array, while use of the "B" key backs the DPTR through memory.
The memory location of the data point is displayed by pressing the "#" key. At this point,
2-3
Page 48
SECTION 2. I NTERNAL DATA STORAGE
another memory location may be entered, followed by the "A" key to jump to the start of the Output Array equal to or just ahead of the location entered. Whenever a location number is displayed by using the "#" key, the corresponding data point can be displayed by pressing the "C" key.
The same element in the next Output Array with the same ID can be displayed by hitting #A. The same element in the previous array can be displayed by hitting #B. If the element is 1 (Array ID), then #A advances to the next array and #B backs up to the previous array. #0A backs up to the start of the current array.
The keyboard commands used in the 7 Mode are summarized in Table 2.3-1.
Advancing the DPTR past the Data Storage Pointer (DSP) displays the oldest data point. Upon entering the 7 Mode, the oldest Output Array can be accessed by pressing the "A" key.
TABLE 2.3-1. ∗∗∗7 Mode Command Summary
Key Action
A B #
Advance to next data point Back-up to previous data point Display location number of currently
displayed data point value
C # A
Display value of current location Advance to same element in next
Output Array with same ID
# B
Back-up to same element in previous Output Array with same ID
# 0 A
Back-up to the start of the current Final Data Storage Array
Exit 7 Mode
2-4
Page 49

SECTION 3. INSTRUCTION SET BASICS

The instructions used to program the CR510 are divided into four types: Input/Output (I/O), Processing, Output Processing, and Program Control. I/O Instructions are used to make measurements and store the readings in input locations or to initiate analog or digital port output. Processing Instructions perform mathematical operations using data from Input Storage locations and place the results back into specified Input Storage locations. Output Processing Instructions provide a method for generating time or event dependent data summaries from processed sensor readings residing in specified Input Storage locations. Program Control Instructions are used to direct program execution based on time and or conditional tests on input data and to direct output to external devices.
Instructions are identified by a number. There are a fixed number of parameters associated with each instruction to give the CR510 the information required to execute the instruction. The set of instructions available in the CR510 is determined by the CR510 Operating System.

3.1 PARAMETER DATA TYPES

There are 3 different data types used for Instruction parameters: Floating Point (FP), 4 digit integers (4), and 2 digit integers (2). The parameter data type is identified in the listings of the instruction parameters in Sections 9-12. Different data types are used to allow the CR510 to make the most efficient use of its memory.
Floating Point parameters are used to enter numeric constants for calibrations or mathematical operations. While it is only possible to enter 5 digits (magnitude +.00001 to +99999.), the internal format has a much greater range (1x10
2.2.1). Instruction 30 can be used to enter a number in scientific notation into an input location.
-19
to 9x1018, Section

3.2 REPETITIONS

The repetitions parameter on many of the I/O, Processing, and Output Processing Instructions is used to repeat the instruction on a number of sequential Input Channels or Input Storage locations. For example, if you are making 2 differential voltage measurements on the same voltage range, wire the inputs to sequential channels and enter the Differential Voltage Measurement Instruction once with 2 repetitions, rather than entering 2 separate measurement instructions. The instruction will make 2 measurements starting on the specified channel number and continuing through the other differential channel. The results will be stored in the specified input location and the next succeeding input location. Averages for both
measurements can be calculated by entering the Average Instruction with 2 repetitions.
When several of the same type of measurements will be made, but the calibrations of the sensors are different, it requires less time to make the measurements using one measurement with repetitions and then apply the calibrations with a scaling array (Inst. 53) than it does to enter the instruction several times in order to use a different multiplier and offset. This is due to set up and calibration time for each measurement instruction. However, if time is not a constraint, separate instructions may make the program easier to follow.

3.3 ENTERING NEGATIVE NUMBERS

After keying in a number, press C or "-" to change the number's sign. On floating point numbers a minus sign (-) will appear to the left of the number. Excitation voltages in millivolts for I/O Instructions are 4 digit integers; when C is keyed 2 minus signs (--) will appear to the right of the number indicating a negative excitation. Even though this display is the same as that indicating an indexed input location, (Section 3.4) there is no indexing effect on excitation voltage.

3.4 INDEXING INPUT LOCATIONS

When used within a loop, the parameters for input locations can be Indexed to the loop counter. The loop counter is added to the indexed value to determine the actual Input Location the instruction acts on. Normally the loop counter is incremented by 1 after each pass through the loop. Instruction 90, Step
3-1
Page 50
SECTION 3. INSTRUCTION SET BASICS
Loop Index, allows the increment step to be changed. See Instructions 87 and 90, Section 12, for more details.
To index an input location (4 digit integer), C or "-" is pressed after keying the value but before entering the parameter. Two minus signs (--) will be displayed to the right of the parameter.

3.5 VOLTAGE RANGE AND OVERRANGE DETECTION

The voltage RANGE code parameter on Input/Output Instructions is used to specify the full scale range of the measurement and the integration period for the measurement (Table
3.5-1). The full scale range selected should be the
smallest that will accommodate the full scale output of the sensor being measured. Using the smallest possible range will result in the best resolution for the measurement.
Four different integration sequences are possible. The relative immunity of the integration sequences to random noise is: 60 Hz rej. = 50 Hz rej. > 2.72ms integ. > 272 µs integ. The 60 Hz rejection integration rejects noise from 60 Hz AC line power. The 50 Hz rejection is for countries whose electric utilities operate at 50 Hz (Section 13.1).
When a voltage input exceeds the range programmed, the value which is stored is set to the maximum negative number and displayed as -99999 in high resolution or -6999 in low resolution.
Voltages greater than 16 volts may permanently damage the CR510.
NOTE: Voltages in excess of 5.5 volts applied to a control port can cause the CR510 to malfunction.

3.6 OUTPUT PROCESSING

Most Output Processing Instructions have both an Intermediate Data Processing operation and a Final Data Processing operation. For example, when the Average Instruction, 71, is initiated, the intermediate processing operation increments a sample count and adds each new Input Storage value to a cumulative total residing in Intermediate Storage. When the Output Flag is set, the final processing operation divides the cumulative total by the number of samples to find the average. The average is then stored in final storage and the cumulative total and number of samples are set to zero in Intermediate Storage.
Final Storage Area 1 (Sections 1.5, 2.1) is the default destination of data output by Output Processing Instructions. Instruction 80 may be used to direct output to either Final Storage Area 2 or to Input Storage.
Output Processing Instructions requiring intermediate processing sample the specified input location(s) each time the Output Instruction is executed, NOT each time the location value is updated by an I/O Instruction. For example: Suppose a temperature measurement is initiated by Table 1 which has an execution interval of 1 second.
An input voltage greater than +5 volts on one of the analog inputs will result in errors and possible overranging on the other analog inputs.
TABLE 3.5-1. Input Voltage Ranges and Codes
Range Code Full Scale Range Resolution*
Slow Fast
2.72ms 250 us 60 Hz 50 Hz Integ. Integ. Reject. Reject.
1112131 ±2.5 mV 0.33 µV 2122232 ±7.5 mV 1.0 µV 3132333 ±25 mV 3.33 µV 4142434 ±250 mV 33.3 µV 5152535±2500 mV 333. µV
* Differential measurement, resolution for single-ended measurement is twice value shown.
3-2
Page 51
SECTION 3. INSTRUCTION SET BASICS
The instructions to output the average temperature every 10 minutes are in Table 2 which has an execution interval of 10 seconds. The temperature will be measured 600 times in the 10 minute period, but the average will be the result of only 60 of those measurements because the instruction to average is executed only one tenth as often as the instruction to make the measurement.
Intermediate Processing can be disabled by setting Flag 9 which prevents Intermediate Processing without actually skipping over the Output Instruction.
All of the Output Processing Instructions store processed data values when and only when the Output Flag is set high (Section 3.7.1). The Output Flag (Flag 0) is set high at desired intervals or in response to certain conditions by using an appropriate Program Control Instruction (Section 12).

3.7 USE OF FLAGS: OUTPUT AND PROGRAM CONTROL

There are 10 flags which may be used in CR510 programs. Two of the flags are dedicated to specific functions: Flag 0 causes Output Processing Instructions to write to Final Storage, and Flag 9 disables intermediate processing. Flags 1-8 may be used as desired in programming the CR510. Flags 0 and 9 are automatically set low at the beginning of each execution of the program table. Flags 1-8 start out low when a program is compiled with 0 and remain unchanged until acted on by a Program Control Instruction or until manually toggled from the 6 Mode.
TABLE 3.7-1. Flag Description
Flag 0 - Output Flag Flag 1 to 8 - User Flags Flag 9 - Intermediate Processing
Disable Flag
Flags are set with Program Control Instructions. The Output Flag (Flag 0) and the intermediate programming disable flag (Flag 9) will always be set low if the set high condition fails. The status of flags 1-8 does not change when a conditional test is false.
3.7.1 THE OUTPUT FLAG
A group of processed data values is placed in Final Data Storage by Output Processing Instructions when the Output Flag (Flag 0) is set high. This group of data is called an Output Array. The Output Flag is set using Program Control Instructions according to time or event dependent intervals specified by the user. The Output Flag is set low at the beginning of each execution of the program table.
Output is most often desired at fixed intervals; this is accomplished with Instruction 92, If Time. Output is usually desired on the even interval, so Parameter 1, time into the interval, is 0. The time interval (Parameter 2), in minutes, is how often output will occur; i.e., the Output Interval. The command code (Parameter 3) is 10, causing Flag 0 to be set high. The time interval is synchronized to 24 hour time; output will occur on each integer multiple of the Output Interval starting from midnight (0 minutes). If the Output Interval is not an even divisor of 1440 minutes (24 hours), the last output interval of the day will be less than the specified time interval. Output will occur at midnight and will resume synchronized to the new day. Instruction 92 is followed in the program table by the Output Instructions which define the Output Array desired.
Each group of Output Processing Instructions creating an Output Array is preceded by a Program Control Instruction that sets the Output Flag high.
NOTE: If the Output Flag is already set high and the test condition of a subsequent Program Control Instruction acting on Flag 0 fails, the flag is set low. This eliminates entering another instruction to specifically reset the Output Flag before proceeding to another group of Output Instructions with a different output interval.
3.7.2 THE INTERMEDIATE PROCESSING DISABLE FLAG
The Intermediate Processing Disable Flag (Flag
9) suspends intermediate processing when it is set high. This flag is used to restrict sampling for averages, totals, maxima, minima, etc., to times when certain criteria are met. The flag is automatically set low at the beginning of each execution of the program table.
3-3
Page 52
SECTION 3. INSTRUCTION SET BASICS
TABLE 3.7-2. Example of the Use of Flag 9
1: If time is (P92)
1: 0 Minutes (Seconds --) into a 2: 10 Interval (same units as above) 3: 10 Set Ouptut Flag High (Flag 0)
2: If (X!F) (P89)
1: 14 X Loc [ Wind_spd ] 2: 4 < 3: 4.5 F
4: 19 Set Intermed. Proc. Disable Flag High (Flag 9) 3: Histogram (P75) ; See Section 11 for details of this intruction. 4: Do (P86) ; Required when additional output processing follows
1: 29 Set Intermed. Proc. Disable Flag Low (Flag 9) 5: Maximum (P73)
1: 1 Reps
2: 00 Time Option
3: 14 Loc [ Wind_spd ]
As an example, suppose it is desired to obtain a wind speed rose incorporating only wind speeds greater than or equal to 4.5 m/s. The wind speed rose is computed using the Histogram Instruction 75, and wind speed is stored in input location 14, in m/s. Instruction 89 is placed just before Instruction 75 and is used to set Flag 9 high if the wind speed is less than 4.5 m/s:
NOTE: Flag 9 is automatically reset the same as Flag 0. If the intermediate processing disable flag is already set high and the test condition of a subsequent Program Control Instruction acting on Flag 9 fails, the flag is set low. This feature eliminates having to enter another instruction to specifically reset Flag 9 low before proceeding to another group of test conditions.
3.7.3 USER FLAGS
Flags 1-8 are not dedicated to a specific purpose and are available to the user for general programming needs. The user flags can be manually toggled from the keyboard in the 6 Mode (Section 1.3). By inserting the flag test (Instruction 91) at appropriate points in the program, the user can use the 6 Mode to manually direct program execution.

3.8 PROGRAM CONTROL LOGICAL CONSTRUCTIONS

Most of the Program Control Instructions have a command code parameter which is used to specify the action to be taken if the condition tested in the instruction is true. Table 3.8-1 lists these codes.
TABLE 3.8-1. Command Codes
0 Go to end of program table 1-9, 79-99 Call Subroutine 1-9, 79-99 10-19 Set Flag 0-9 high 20-29 Set Flag 0-9 low 30 Then Do 31 Exit loop if true 32 Exit loop if false 41 Set Port 1 high 51 Set Port 1 low 61 Toggle Port 1 71 Pulse Port 1
1
98 is a special subroutine which can be called by Control port 2 going high; see Instruction 85 for details (Section 12).
2
If this command is executed while in a subroutine, execution jumps directly to the end of the table that called the subroutine.
1
2
3-4
Page 53
3.8.1 IF THEN/ELSE COMPARISONS
Program Control Instructions can be used for If then/else comparisons. When Command 30 (Then do) is used with Instructions 83 or 88-92, the If Instruction is followed immediately by instructions to execute if the comparison is true. The Else Instruction (94) is optional and is followed by the instructions to execute if the comparison is false. The End Instruction (95) ends the If then/else comparison and marks the beginning of the instructions that are executed regardless of the outcome of the comparison (see Figure 3.8-1).
SECTION 3. INSTRUCTION SET BASICS
FIGURE 3.8-2. Logical AND Construction
;Logical AND construction example: ;Check first condition
6: If (X!F) (P89)
1: 1 X Loc [ DO_ppm ] 2: 4 < 3: 3.5 F 4: 30 Then Do
FIGURE 3.8-1. If Then/Else
Execution Sequence
;Logical ELSE construction example: ;Check condition
1: If (X!F) (P89)
1: 1 X Loc [ DO_ppm ] 2: 4 < 3: 3.5 F 4 30 Then Do
;Instruction(s) to execute if above condition is true 2: Do (P86)
1: 41 Set Port 1 High 3: Else (P94) ;Instruction(s) to execute if above condition is false
4: Do (P86)
1: 51 Set Port 1 Low
;AND check second condition 7: If (X!F) (P89)
1: 2 X Loc [ Counter ] 2: 3 >= 3: 10 F 4: 30 Then Do
;Instruction(s) to execute if both conditions are true 8: Do (P86)
1: 41 Set Port 1 High 9: End (P95) 10: End (P95) If Then/Else comparisons may be nested to
form logical AND or OR branching. Figure 3.8­2 illustrates an AND construction. If conditions A and B are true, the instructions included between IF B and the first End Instruction will be executed.
If either of the conditions is false, execution will jump to the corresponding End Instruction, skipping the instructions between.
5: End (P95)
A logical OR construction is also possible. Figure 3.8-3 illustrates the instruction sequence that will result in subroutine X being executed if either A or B is true.
3-5
Page 54
SECTION 3. INSTRUCTION SET BASICS
;Logical OR construction example: 11: If (X!F) (P89)
1: 1 X Loc [ DO_ppm ] 2: 4 < 3: 3.5 F 4: 30 Then Do
12: Do (P86)
1: 41 Set Port 1 High 13: Else (P94) 14: If (X!F) (P89)
1: 2 X Loc [ counter ]
2: 3 >=
3: 10 F
4: 30 Then Do 15: Do (P86)
1: 41 Set Port 1 High 16: End (P95) 17: End (P95) A logical OR can also be constructed by setting
a flag high if a comparison is true. (The flag is cleared or set low before making comparisons.) After all comparisons have been made, execute the desired instructions if the flag is set high.
;CASE Logic construction example: 18: CASE (P93)
1: 3 Case Loc [ Reading ]
19: If Case Location < F (P83)
1: 1.8 F 2: 30 Then Do
;See Section 9 for details of this Instruction 20: AC Half Bridge (P5)
21: End (P95) 22: If Case Location < F (P83)
1: 9.25 F 2: 30 Then do
;See Section 9 for details of this Instruction 23: Full Bridge (P6)
24: End (P95) 25: If Case Location < F (P83)
1: 280 F 2: 30 Then do
;See Section 9 for details of this Instruction 26: Full Bridge (P6)
27: End (P95)
The Begin Case Instruction 93 and If Case Instruction 83 allow a series of tests on the value in an input location. The case test is started with Instruction 93 which specifies the location to test. A series of Instruction 83s are then used to compare the value in the location with fixed values. When the value in the input location is less than the fixed value specified in Instruction 83, the command in that Instruction 83 is executed, and execution branches to the END Instruction 95 which closes the case test (see Instruction 93, Section 12).
28: End (P95)
3.8.2 NESTING
A branching or loop instruction which occurs before a previous branch or loop has been closed is nested. The maximum nesting level is 11 deep. Loop Instruction 87 and Begin Case Instruction 93 both count as 1 level. Instructions 83, 86, 88, 89, 91, and 92 each count as one level when used with the Command "30" which is the "Then Do" command. Use of Else, Instruction 94, also counts as one nesting level each time it is used. For example, the AND construction above is nested 2 deep while the OR construction is nested 3 deep.
Subroutine calls do not count as nesting with the above instructions, though they have their own nesting limit (maximum of 6, see Instruction 85, Section 12). Branching and loop nesting start at zero in each subroutine.
3-6
Page 55
Any number of groups of nested instructions may be used in any of the three Programming Tables. The number of groups is only restricted by the program memory available.

3.9 INSTRUCTION MEMORY AND EXECUTION TIME

Each instruction requires program memory and uses varying numbers of Input, Intermediate, and Final Storage locations. Tables 3.9-1 to
3.9-4 list the memory used by each instruction and the approximate time required to execute it.
When attempting to make a series of measurements and calculations at a fast rate, it is important to examine the time required for the automatic calibration sequence and possibly make use of the program controlled calibration, Instruction 24. Section 13.7 describes the calibration process.
NOTE: EDLOG generates a “trace” file with the extension .PTI which shows the estimated program execution time.
SECTION 3. INSTRUCTION SET BASICS
3-7
Page 56
SECTION 3. INSTRUCTION SET BASICS
3-8
Page 57
SECTION 3. INSTRUCTION SET BASICS
TABLE 3.9-2. Processing Instruction Memory and Execution Times R = No. of Reps.
INPUT MEMORY PROG.
INSTRUCTION LOC.
INTER. LOC. BYTES EXECUTION TIME (ms)
30 Z=F 1 0 9 1.0 + 0.2 exponent 31 Z=X 1 0 6 0.7 32 Z=Z+1 1 0 4 0.8 33 Z=X+Y 1 0 8 1.2 34 Z=X+F 1 0 10 1.1 35 Z=X-Y 1 0 8 1.2 36 Z=X∗Y1081.5 37 Z=X∗F10101.2 38 Z=X/Y 1 0 8 3.0 39 Z=SQRT(X) 1 0 6 9.0 40 Z=LN(X) 1 0 6 8.4 41 Z=EXP(X) 1 0 6 6.6 42 Z=1/X 1 0 6 2.9 43 Z=ABS(X) 1 0 6 1.0 44 Z=FRAC(X) 1 0 6 1.1 45 Z=INT(X) 1 0 6 1.4 46 Z=X MOD F 1 0 10 3.5 47 Z=X
Y
1 0 8 14.9 48 Z=SIN(X) 1 0 6 7.3 49 SPA. MAX 1 or 2 0 8 2.7 + 0.6 * swath 50 SPA. MIN 1 or 2 0 8 2.3 + 0.6 * swath 51 SPA. AVG 1 0 8 3.0 + 0.6 * swath 52 RUNNING AVG 1 (R par 4) + R + 1 11 2.1 + 3.7R 53 A∗X+B 4 0 36 3.5 54 BLOCK MOVE R 0 10 0.3 + 0.2R 55 POLYNOMIAL R 0 31 1.2 + (2.0 + 0.4 order)R 56 SAT. VP 1 0 6 4.5 58 LP FILTER R R + 1 13 1.0 + 2.2R 59 X/(1-X) 1 0 9 0.4 + 1.2R 61 INDIR. MOVE 1 0 6 0.6 63 PARA.EXTN. 0 0 10 0.2 65 BULK LOAD 8 0 36 4.5 66 ARC TAN 1 0 8 8.7 68 4 DIG PARA. EXTN. 0 0 8 0.7
3-9
Page 58
SECTION 3. INSTRUCTION SET BASICS
TABLE 3.9-3. Output Instruction Memory and Execution Times R = No. of Reps.
INTER. MEM. FINAL PROG. EXECUTION TIME (ms)
INSTRUCTION LOC.
VALUES
1
BYTES FLAG 0 LOW FLAG 0 HIGH
69 WIND VECTOR 2+9R (2, 3, or 4)R 12
Options 00, 01, 02 4.0 + 17.4R 3.3 + 70.7R Options 10, 11, 12 3.0 + 16.3R 4.0 + 75R
70 SAMPLE 0 R 6 0.2 0.5+ 0.4R 71 AVERAGE 1+R R 7 0.6+ 1.1R 1.5+ 4.4R 72 TOTALIZE R R 7 0.6+ 1.0R 1.0+ 1.7R 73 MAXIMIZE (1 or 2)R (1,2, or 3)R 8 1.0+ 1.2R 5.0+ 3.0R 74 MINIMIZE (1 or 2)R (1,2, or 3)R 8 0.8+ 1.2R 5.0+ 3.0R 75 HISTOGRAM 1+bins∗Rbins∗R 24 0.8+ 3.4R 1.6+ 5.2 + (1.4 ∗ bins)R 77 REAL TIME 0 1 to 4 4 0.2 3.8 78 RESOLUTION 0 0 3 0.4 0.4 79 SMPL ON MM R R 7 0.4 1.7 + 1.1R
1
80 STORE AREA
00 70.3 0.3
82 STD. DEV. 1+3R R 7 1.5+ 2.0R 2.9+ 2.1R
1
Output values may be sent to either Final Storage area or Input Storage with Instruction 80.
TABLE 3.9-4. Program Control Instruction Memory and Execution Times
MEMORY
INTER. PROG.
INSTRUCTION LOC. BYTES EXECUTION TIME (ms)
83 IF CASE <F 0 10 0.5 85 LABEL SUBR. 0 3 0 86 DO 0 6 0.3 87 LOOP 1 10 0.3 88 IF X<=>Y 0 11 0.8 89 IF X<=>F 0 13 0.6 90 LOOP INDEX 0 3 0.7 91 IF FLAG/PORT 0 7 0.4 92 IF TIME 1 12 0.4 93 BEGIN CASE 1 8 0.3 94 ELSE 0 4 0.2 95 END 0 4 0.2 96 SERIAL OUT 0 3 Option: 0x 1x 2x 3x
Time: 0.4 1.8 2.1 0.9 Option: 4x 5x 6x 7x
Time: 1.7 1.9 0.7 0.5 97 INIT.TELE. 7 17 2.3 120 GOES SAT 0 or 2 5 8000 121 ARGOS SAT 0 8 250
3-10
Page 59
SECTION 3. INSTRUCTION SET BASICS

3.10 ERROR CODES

There are four types of errors flagged by the CR510: Compile, Run Time, Editor, and D Mode. Compile errors are errors in programming which are detected once the program is entered and compiled for the first time (∗0, ∗6, or B Mode entered). If a programming error is detected during compilation, an E is displayed with the 2 digit error code. The Instruction Location Number of the Instruction which caused the error is displayed to the right of the error code (e.g., E23 105; 105 indicates that the fifth instruction in Table 1 caused error 23). Error 22, missing END, will indicate the location of the instruction which the compiler cannot match with an END instruction.
Run time errors are detected while the program is running. The number of the instruction being executed at the time the error is detected is displayed to the right of the error code (e.g., E09 06 indicates that an Instruction 6 in the program is attempting to store data in input locations beyond those allocated). Run time errors 9 and 31 are the result of programming errors. While E08 will display the number of the instruction that was being executed when the error occurred, it is unlikely that the instruction has anything to do with the error.
transients. Frequent repetitions of E08 are indicative of a hardware problem or a software bug and should be reported to Campbell Scientific. The CR510 keeps track of the number of times (up to 99) that E08 has occurred. The number can be displayed and reset in the B Mode (Section 1.6) or with the Telecommunications A command (Section 5.1).
Error 10 is displayed if the primary power drops below 9.6 volts. When this happens, the CR510 stops executing programs. The low voltage counter (B Window 9, Section 1.6) counts the number of times the voltage drops below 9.6 volts and displays a double dash (--) if the CR510 is currently in a low voltage shut down. Below approximately 8.5 volts the CR510 will not communicate with the CR10KD or modem, although there may be enough power to display characters on the CR10KD.
Editor errors are detected as soon as an incorrect value is entered and are displayed immediately. Only the error code is displayed. D Mode errors indicate problems with saving or loading a program. Only the error code is displayed.
TABLE 3.10-1. Error Codes
If there is a run time error in a table with a fast execution interval, the error may be written to the display so frequently that it seems the CR510 is not responding to the keyboard. Once the program is stopped, normal function will return. To stop the program some entry must be changed which requires recompiling (Section 1.1.4). For example, enter 0 for the execution interval of Table 1 (i.e., enter ∗1A0A as fast as possible). The program can easily be stopped by pressing any key while the CR10KD is displaying “HELLO” after applying power (turn the CR510 off and then on again). This delays program execution for about two minutes, allowing the program to be changed.
Error 8 is the result of a hardware and software "watchdog" that checks the processor state, software timers, and program related counters. The watchdog will attempt to reset the processor and program execution if it finds that the processor has bombed or is neglecting standard system updates, or if the counters are out of allowable limits. Error code 08 is flagged when the watchdog performs this reset. E08 is occasionally caused by voltage surges or
Code Type Description
03 Editor Program table full 04 Compile Intermediate Storage full 05 Compile Storage Area #2 not
allocated
08 Run Time CR510 reset by
watchdog timer 09 Run Time Insufficient Input Storage 10 Run Time Low battery voltage 11 Editor Attempt to allocate more
Input or Intermediate
Storage than is available 12 Compile Duplicate 4 ID 20 Compile SUBROUTINE encountered
before END of previous
subroutine 21 Compile END without IF, LOOP or
SUBROUTINE 22 Compile Missing END 23 Compile Nonexistent
SUBROUTINE 24 Compile ELSE in SUBROUTINE
without IF 25 Compile ELSE without IF
3-11
Page 60
SECTION 3. INSTRUCTION SET BASICS
26 Compile EXIT LOOP without
LOOP
27 Compile IF CASE without BEGIN
CASE
30 Compile IF and/or LOOP nested
too deep
31 Run Time SUBROUTINES nested
too deep
32 Compile Instruction 3 and interrupt
subroutine use same port 40 Editor Instruction does not exist 41 Editor Incorrect execution
interval 60 Compile Insufficient Input Storage 92 Compile Instruction 92, intervals in
seconds: Time into Interval
> 59 or Interval > 60 94 D MODE Program Storage Area
full 95 D MODE Program does not exist in
Flash memory 96 D MODE Addressed device not
connected or wrong
address (see Table 1.8-2) 97 D MODE Data not received within
30 seconds 98 D MODE Uncorrectable errors
detected 99 D MODE Wrong file type or editor
error
3-12
Page 61

SECTION 4. EXTERNAL STORAGE PERIPHERALS

External data storage devices are used to provide a data transfer medium that the user can carry from the test site to the lab and to supplement the internal storage capacity of the CR510, allowing longer periods between visits to the site. The standard data storage peripheral for the CR510 is the Storage Module (Section 4.4). Output to a printer or related device is also possible (Section 4.3).
Data output to a peripheral device can take place ON-LINE (automatically, as part of the CR510's routine operation) or it can be MANUALLY INITIATED. On-line data transfer is
accomplished with Instruction 96 (Section 4.1). Manual initiation is done in the (Section 4.2).
The CR510 can output data to multiple peripherals. The CR510 activates the peripheral it sends data to in one of two ways (Section 6.2):
1. A specific pin in the 9-pin connector is dedicated to that peripheral; when that pin goes high, the peripheral is enabled. This is referred to as "PIN-ENABLED" or simply "ENABLED".
2. The peripheral is synchronously addressed by the CR510. This is referred to as "ADDRESSED".
Modems are pin-enabled. Only one modem device may be connected to the CR510 at any one time. The CR510 considers the following devices to be pin-enabled modems: SC32A, SC932, short-haul, MD9, radio modems, and telephone modems except for voice modems.
8 Mode
The SM192, SM716, and CSM1 Storage Modules are addressed. The CR510 can tell when the addressed device is present. The CR510 will not send data meant for the Storage module if the Storage Module is not present (Section 4.4.2). Other addressed devices include the CR10KD and voice modems.
9 Mode (Section 4.5) allows the user to communicate directly with the Storage Module and
The to perform several functions, including review of data, battery test, review of Storage Module status, etc.
Cassette tape data storage is not supported by the CR510.
4.1 ON-LINE DATA TRANSFER ­INSTRUCTION 96
All on-line data output to a peripheral device is accomplished with Instruction 96. (Instruction 96 can also be used to transfer data from one Final Storage Area to the other, Section 8.8,
12). This instruction must be included in the datalogger program for on-line data transfer to take place. Instruction 96 should follow the Output Processing Instructions, but only needs to be included once in the program table unless both Final Storage areas are in use. The suggested programming sequence is:
1. Set the Output Flag.
2. If both Final Storage Areas are in use or if you wish to set the Output Array ID, enter Instruction 80 (Section 11).
3. Enter the appropriate Output Processing Instructions.
4. Enter Instruction 96 to enable the on-line transfer of Final Storage data to the specified device. If outputting to more than one device, Instruction 96 must be entered separately for each device.
5. Repeat steps 2 through 4 if you wish to output data to the other Final Storage Area and the peripheral.
4-1
Page 62
SECTION 4. EXTERNAL STORAGE PERIPHERALS
Instruction 96 has a single parameter which specifies the peripheral to send output to. Table
4.1-1 lists the output device codes.
TABLE 4.1-1. Output Device Codes for
Instruction 96 and ∗∗∗8 Mode
Code Device
ADDRESSED PRINTER 1y Printable ASCII 2y Comma separated ASCII 3y Binary
PIN ENABLED PRINTER 4y Printable ASCII 5y Comma separated ASCII 6y Binary
y = BAUD RATE CODES
0 300 1 1200 2 9600 3 76,800
7N Storage Module N (N=address, 1...8) 7N-- Output File Mark to Storage Module N 80 To the other Final Storage Area [Inst.
96 only], new data since last output 81 To the other Final Storage Area
[Inst. 96 only], entire active Final
Storage Area The source of data for Instruction 96 is the
currently active Final Storage Area as set by Instruction 80 (the default is Final Storage Area 1 at the beginning of each program table execution).
If the CR510 is using the 9-pin connector for other I/O tasks when Instruction 96 is executed, the output request is put in a queue and program execution continues. As the 9-pin
connector becomes available, each device in the queue gets its turn.
An output request is not put in the queue if the same device is already in the queue. The data contained in the queue (and which determine a unique entry) are the device, baud rate (if applicable), and the Final Storage Area.
When an entry reaches the top of the queue, the CR510 sends all data accumulated since the last transfer to the device up to the location of the DSP at the time the device became active.
Printer output can be either pin-enabled or addressed. However, there is not a pin specifically dedicated to print enable. When a pin-enabled print output is specified, the SDE line, which is normally used in the addressing sequence, is used as a print enable. This allows some compatibility with the CR21, 21X, and CR7 dataloggers which have a Print Enable line. The pin-enabled print option will result in garbage being sent to the print peripheral if an addressed device is also connected to the CR510 (i.e., CR10KD, SM192 or SM716 etc.). The SDC99 Synchronous Device Interface can convert a print device to an Addressed peripheral (Section 6.2).
The STORAGE MODULE address is important only when using more than one Storage Module. One is a universal address which will find the Storage Module with lowest number address that is connected. If a Storage Module is not connected, the CR510 will not advance the SPTR (Section 2.1) and the Storage Module drops out of the queue until the next time Instruction 96 is executed. Section 4.4 contains specifics on the Storage Modules.
Display
Key ID:DATA
8
A A
A
A
08:00 Key 1 or 2 for Storage Area. (This window is skipped if no memory has
01:XX Key in Output Device Option. See Table 4.1-1. 02:XXXXX Start of dump location. Ini tially the SPTR or PPTR location; a different
03:XXXXX End of dump location. Initially the DSP location; a different location may
04:00 Ready to dump. To initiate dump, key any number, then A. While
4-2
TABLE 4.2-1. ∗∗∗8 Mode Entries
Description
been allocated to Final Storage Area 2.)
location may be entered if desired.
be keyed in if desired.
dumping, "04" will be displayed in the ID field and the location number in the Data field. The location number will stop incrementing when the dump is complete. (Any key aborts transmission after completion of the current data block.)
Page 63
SECTION 4. EXTERNAL STORAGE PERIPHERALS
4.2 MANUALLY INITIATED DATA OUTPUT -
Data transfer to a peripheral device can be manually initiated in the 8 Mode. This process requires that the user have access to the CR510 through a terminal or the CR10KD. The 8 Mode allows the user to retrieve a specific block of data, on demand, regardless of whether or not the CR510 is programmed for on-line data output.
If external storage peripherals are not left on­line, the maximum time between collecting data must be calculated to ensure that data in Final Storage are not lost due to write-over. To calculate this time it is necessary to know: (1) the size of Final Storage, (2) the number of Output Arrays being generated, (3) the number of low and/or high resolution data points per Output Array, and (4) the rate at which Output Arrays are placed into Final Storage. When calculating the number of data points per Output Array, remember to add 1 data point per array for the Output Array ID.
For example, assume that 62,280 locations are assigned to Final Storage (A Mode), and that 1 Output Array, containing the Array ID (1 memory location), 9 low resolution data points (9 memory locations) and 5 high resolution data points (10 memory locations), is stored each hour. In addition, an Output Array with the Array ID and 5 high resolution data points (11 memory locations) is stored daily. This is a total of 491 memory locations per day ((20 x 24) + 11). 62,280 divided by 491 = 126.8 days. Therefore, the CR510 would have to be visited every 126 days to retrieve data, because write-over would begin on the 127th day. The site should be visited more frequently than this for routine maintenance. Thus data storage capacity would not be a factor in determining how frequently to visit the site.
8 MODE
∗∗∗∗
The output device codes used with the 8 Mode are the same as those used with Instruction 96 (Table 4.1-1), with the exception of the option to transfer data from one Final Storage area to the other (80, 81). Table 4.2-1 lists the keystrokes required to initiate a 8 data dump.

4.3 PRINTER OUTPUT FORMATS

Printer output can be sent in binary Final Storage Format (Appendix C.2), Printable ASCII, or Comma Separated ASCII. These ASCII formats may also be used when data from the Storage Modules or Telecommunications are stored on disk with Campbell Scientific's datalogger support software.
4.3.1 PRINTABLE ASCII FORMAT
In the Printable ASCII format each data point is preceded by a 2 digit data point ID and a (+) or () sign. The ID and fixed spacing of the data points make particular points easy to find on a printed output. This format requires 10 bytes per data point to store on disk.
Figure 4.3-1 shows both high and low resolution data points in a 12 data point Output Array. The example data contains Day, Hour-Minute, and Seconds in the 2nd - 4th data points. REMEMBER! You must specifically program the CR510 to output the date and time values. The Output Array ID, Day, and Time are always 4 character numbers, even when high resolution output is specified. The seconds resolution is .125 seconds.
Each full line of data contains 8 data points (79 characters including spaces), plus a carriage return (CR) and line feed (LF). If the last data point in a full line is high resolution, it is followed immediately with a CR and LF. If it is low resolution, the line is terminated with a space, CR and LF. Lines of data containing less than 8 data points are terminated similarly after the last data point.
4-3
Page 64
SECTION 4. EXTERNAL STORAGE PERIPHERALS
FIGURE 4.3-1. Example of CR510 Printable ASCII Output Format
4.3.2 COMMA SEPARATED ASCII
Comma Separated ASCII strips all IDs, leading zeros, unnecessary decimal points and trailing zeros, and plus signs. Data points are separated by commas. Arrays are separated by Carriage Return Line Feed. Comma Separated ASCII requires approximately 6 bytes per data point. Example:
1,234,1145,23.65,-12.26,625.9 1,234,1200,24.1,-10.98,650.3

4.4 STORAGE MODULE

The Storage Module stores data in battery backed RAM. Backup is provided by an internal lithium battery. The RAM is internal on the SM192/716 and on a PCMCIA card in the CSM1. Operating power is supplied by the CR510 over pin 1 of the 9-pin connector. Whenever power is applied to the 9-pin connector (after having been off), the Storage Module places a File Mark in the data (if a File Mark is not the last data point already in storage).
The File Mark separates data. For example, if you retrieve data from one CR510, disconnect the Storage Module and connect it to a second CR510, a File Mark is automatically placed in the data. This mark follows the data from the first CR510 but precedes the data from the second.
The SM192 has 192K bytes of RAM storage; the SM716 has 716K bytes. Both can be configured as either ring or fill and stop memory. The size of memory in the CSM1 depends on the PC Card used. The CSM1 is always fill and stop.
4.4.1 STORAGE MODULE ADDRESSING
The CSM1 does not support individual addresses. Use address 1 when sending data to the CSM1.
The SM192/716 Storage Modules can have individual addresses. Different addresses allow 1) up to 8 Storage Modules to be connected to the CR510 during on-line output, 2) different data to be output to different Modules, and 3) transfer of data from a Module that is left with the CR510 to a Module that is hand carried to the site for data transfer (9 Mode).
Storage Modules are assigned addresses (1-8) either through the 9 Mode or with the SMCOM or SMS software. 1 is the default address when the Storage Module is reset. Unless you are using one of the features which require different addresses, you need not assign any other address.
Address 1 is also a universal address when sending data or commands to a storage module with Instruction 96, 8, or 9. When address 1 is entered in the 9 Mode (default) or in the device code (71, Table 4.2-1) for Instruction 96 or the 8 Mode, The CR510 searches for the
4-4
Page 65
SECTION 4. EXTERNAL STORAGE PERIPHERALS
Storage Module with the lowest address that is not full (fill and stop configuration only) and addresses it. In other words, if a single Storage Module is connected, and it is not full, address 1 will address that Storage Module regardless of the address that is assigned to the Module.
Address 1 would be used with Instruction 96 if several Storage Modules with different addresses were connected to the CR510 and were to be filled sequentially. The Storage modules would be configured as fill and stop. When the lowest addressed Module was full data would be written to the next lowest addressed Module, etc.
4.4.2 STORAGE MODULE USE WITH INSTRUCTION 96
When output to the Storage Module is enabled with Instruction 96, the Storage Module(s) may be either left with the CR510 for on-line data transfer and periodically exchanged, or brought to the site for data transfer.
USE OF STORAGE MODULE TO PICK UP DATA
The CR510 is capable of recognizing whether or not the Storage Module is connected. Each time Instruction 96 is executed and there is data to output, the CR510 checks for the presence of a Storage Module. If one is not present, the CR510 does not attempt to output data. Instead, the CR510 saves the data and continues its other operations without advancing the Storage Module Pointer (SPTR, Section 2.1).
When the user finally does connect the Storage Module to the CR510, two things happen:
1. Immediately upon connection, a File Mark is
placed in the Storage Module Memory following the last data stored (if a File Mark wasn't the last data point already in storage).
2. During the next execution of Instruction 96,
the CR510 recognizes that the Storage Module (SM) is present and outputs all data between the SPTR and the DSP location.
The File Mark allows the operator to distinguish blocks of data from different dataloggers or from different visits to the field.
To be certain that the Storage Module has been connected to the CR510 during an execution of P96, the user can:
Leave the Storage Module connected for a time
period longer than an execution interval or
Use the SC90 9-Pin Serial Line Monitor. The SC90 contains an LED which lights up during data transmission. The user connects the SM to the CR510 with the SC90 on the line and waits for the LED to light. When the light goes off, data transfer is complete and the SM can be disconnected from the CR510.
4.4.3 ∗∗∗8 DUMP TO STORAGE MODULE
In addition to the on-line data output procedures described above, output to the Storage Module can be manually initiated in the 8 Mode. The procedure for setting up and transferring data is as follows:
1. Connect both the CR10KD Keyboard/Display (or terminal) and the Storage Module to the CR510 using the SC12 cable. (For terminals, an SC32A is needed. See Section 5 for interfacing details.)
2. Key in the appropriate commands as listed in Table 4.2-1.
4.5
9 MODE -- SM192/716 STORAGE
∗∗∗∗
MODULE COMMANDS
The CSM1 does not support the 9 Mode Commands. The 9 Mode is used to issue commands to the
SM192/716 Storage Module, through the CR510, using the CR10KD or a terminal/computer. These commands are like Modes for the Storage Module and in some cases are directly analogous to the CR510 Modes. Command 7 enters a mode used to review stored data, and 8 is used to transfer data between two Storage Modules connected to the CR510. The operations with the Storage Module are not directly analogous as may be seen in Table 4.5-1 which lists the commands (e.g., when reviewing data, #A advances to the start of the next Output Array rather than to the same element in the next array with the same ID).
When 9 is keyed, the CR510 responds: 09:01. 1 is the default address for the Storage Module (Section 4.4.1). If you have more than 1 Storage Module connected, enter the address of the desired Storage Module. Address 1 will always work if only one Module is connected. Key A and the CR510 responds: 9N:00 Where N is the address which was entered.
You may now enter any of the commands in Table 4.5-1 (key in the command number and enter with A). Most commands have at least one response. Advance through the responses and return to the *9 command state by keying A.
4-5
Page 66
SECTION 4. EXTERNAL STORAGE PERIPHERALS
TABLE 4.5-1. ∗∗∗9 Commands for Storage Module
COMMAND DISPLAY DESCRIPTION
1 01: 0000 RESET, enter 248 to erase all data and programs. While erasing,
the SM checks memory. The number of good chips is then
01: XX displayed (6 for SM192, 22 SM716).
3 03: 01 INSERT FILE MARK, 1 indicates that the mark was inserted, 0
that it was not.
4 04: XX DISPLAY/SET MEMORY CONFIGURATION enter the
appropriate code to change configuration 0=ring, 1=fill & stop
5 DISPLAY STATUS (A to advance to each window)
01: ABCD Window 1:
AB Storage pointer location (chip no.)
CD Total good RAM chips (1-22)
02: ABCD Window 2:
AB Display pointer location (chip no.)
C Unloaded Batt. Chk. 0=low, 1=OK
D No. of Programs stored (Max=8)
03: A0CD Window 3:
A Errors logged (up to 9)
0 Not Used
C Memory Config. (0=ring, 1=fill&stop)
D Memory Status (0=not full, 1=full)
04: XXXXX PROM signature (0 if bad PROM) 6 06: 0X BATTERY CHECK UNDER LOAD (0=low, 1=OK) 7 07: 00 DISPLAY DATA, Select the Storage Module Area with these codes:
0 Dump pointer to SRP 1 File 1, current file 2 File 2, previous to file 1 3 File 3, previous to file 2 4 File 4, previous to file 3 5 File 5, previous to file 4 7 Display pointer to SRP 9 Oldest data to SRP
1-5 will loop within file boundaries, 0,7,9 allow display to
cross boundaries
07:XXXXXX SM location at end of area selected. Key A to advance to first
data. If another location is keyed in SM will jump to 1st start of array following that location. Review data with:
A Advance and display next data point B Back-up one data point # Display location, C to return to data #A Advance to next start of Array #B Back-up to start of Array #D Return to 9 command mode
8 DUMP TO ANOTHER STORAGE MODULE
08:00 Select Area as in 7 above
01:XXXXXX First Loc. in area selected/Enter Loc. to start dump
02:XXXXXX Final Loc. in area selected/Enter Loc. to end dump
03:XX Enter destination SM address 9 DISPLAY ADDRESSES OF CONNECTED SM
XXXXXXXX 1 = occupied, 0 = unoccupied
87654321 (Addresses 8-1 from left to right) 10 CHANGE ADDRESS
10:0X X is current address, enter address to change to (1-8)
4-6
Page 67

SECTION 5. TELECOMMUNICATIONS

Telecommunications is used to retrieve data from Final Storage directly to a computer/terminal and to program the CR510. Any user communication with the CR510 that makes use of a computer or terminal instead of the CR10KD is through Telecommunications.
Telecommunications can take place over a variety of links including:
Telephone
Cellular phone
Radio frequency
Short haul modem and twisted pair wire
SC32A and ribbon cable
Multi-drop interface and coax cable
This section does not cover the technical interface details for any of these links. Those details are covered in Section 6 and in the individual manuals for the devices.
Data retrieval can take place in either ASCII or BINARY. The BINARY format is 5 times more compact than ASCII. The shorter transmission times for binary result in lower long distance costs if the link is telephone and lower power consumption with an RF link. On "noisy" links shorter blocks of data are more likely to get through without interruption.
For more efficient data transfer, binary data retrieval makes use of a signature for error detection. The signature algorithm assures a 99.998% probability that if either the data or its sequence changes, the signature changes.
Campbell Scientific has developed a software package which automates data retrieval and facilitates the programming of Campbell Scientific dataloggers and the handling of data files. This package has been designed to meet the most common needs in datalogger support and telecommunications. Therefore, this section does not furnish sufficient detail to write telecommunications software. Appendix B contains some details of binary data transfer and Campbell Scientific's binary data format.
The emphasis of this section is on the commands that a person would use when manually (i.e., keyed in by hand) interrogating or programming the CR510 via a computer/terminal. These commands and the responses to them are sent in the American Standard Code for Information Interchange (ASCII).
The telecommunications commands allow the user to perform several operations including:
monitor data in Input Storage and review data in Final Storage
retrieve Final Storage data in either ASCII or BINARY
open communications with the Storage Module
remote keyboard programming
The Remote Keyboard State (Section 5.2) allows the user with a computer/terminal to use the same commands as the CR10KD.

5.1 TELECOMMUNICATIONS COMMANDS

When a modem/terminal rings the CR510, the CR510 should answer almost immediately. Several carriage returns (CR) must be sent to the CR510 to allow it to set its baud rate to that of the modem/terminal (300, 1200, or 9600). Once the baud rate is set, the CR510 will send back the prompt, "∗∗∗", signaling that it is ready to receive a command.
GENERAL RULES governing the telecommunications commands are as follows:
1. ∗∗∗ from datalogger means "ready for command".
2. All commands are of the form: [no.]letter, where the number may or may not be optional.
3. Valid characters are the numbers 0-9, the capital letters A-M, the colon (:), and the carriage return (CR).
5-1
Page 68
SECTION 5. TELECOMMUNICATIONS
4. An illegal character increments a counter and zeros the command buffer, returning a ∗∗∗∗.
5. CR to datalogger means "execute".
6. CRLF from datalogger means "executing command".
7. ANY character besides a CR sent to the datalogger with a legal command in its buffer causes the datalogger to abort the command sequence with CRLF∗∗∗ and to zero the command buffer.
8. All commands return a response code, usually at least a checksum.
9. The checksum includes all characters sent by the datalogger since the last ∗∗∗, including the echoed command sequence, excluding only the checksum itself. The checksum is formed by summing the ASCII values, without parity, of the transmitted characters. The largest possible checksum value is 8191. Each time 8191 is exceeded, the CR510 starts the count over; e.g., if the sum of the ASCII values is 8192, the checksum is 0.
10. Commands that return Campbell Scientific binary format data (i.e., F and K commands) return a signature (see Appendix B.3).
The CR510 sends ASCII data with 8 bits, no parity, one start bit, and one stop bit.
After the CR510 answers a ring, or completes a command, it waits about 40 seconds (127 seconds in the Remote Keyboard State) for a valid character to arrive. It "hangs up" if it does not receive a valid character in this time interval. Some modems are quite noisy when not on line; it is possible for valid characters to appear in the noise pattern. To insure that this situation does not keep the CR510 in telecommunications, the CR510 counts all the invalid characters it receives from the time it answers a ring, and terminates communication after receiving 150 invalid characters.
The CR510 continues to execute its measurement and processing tasks while servicing the telecommunication requests. If the processing overhead is large (short Execution Interval), the processing tasks will slow the telecommunication functions. In a worst case situation, the CR510 interrupts the processing tasks to transmit a data point every
0.125 second. The best way to become familiar with the
Telecommunication Commands is to try them from a terminal connected to the CR510 via the SC32A (Section 6.7.1) or other interface. Commands used to interrogate the CR510 in the Telecommunications Mode are described in the following Table.
5-2
Page 69
SECTION 5. TELECOMMUNICATIONS
TABLE 5.1-1. Telecommunications Commands
Command Description
[F.S. Area]A SELECT AREA/STATUS - If 1 or 2 does not precede the A to select the
Final Storage Area, the CR510 will default to Area 1. All subsequent commands other than A will address the area selected. Datalogger returns Reference, the DSP location; the number of filled Final Storage locations; Version of datalogger; Final Storage Area; Location of MPTR (the location number may be 1 to 7 characters long); Errors #1, #2, and #3 where #1 is the number of E08's, #2 is the number of overrun errors, and #3 is the number of times the program stopped due to low voltage (all are cleared by entering 8888A; #2 is also cleared at time of program compilation); size of total Memory in CR510; the lithium Battery voltage; and Checksum. All in the following format:
R+xxxxx F+xxxxx Vxx Axx L+xxxxxxx Exx xx xx Mxxxx B+xxxxx Cxxxx If data is stored while in telecommunications, the A command must be
issued to update the Reference to the new DSP.
[no. of arrays]B BACK-UP - MPTR is backed-up the specified number of Output Arrays
(no number defaults to 1) and advanced to the nearest start of array. CR510 sends the Area, MPTR Location, and Checksum:
Ax Lxxxxxxx Cxxxx
[YR:DAY:HR:MM:SS]C RESET/SEND TIME - If time is entered the time is reset. If only 2
colons are in the time string, HR:MM:SS is assumed; 3 colons means DAY:HR:MM:SS. If only the C is entered, time is unaltered. CR510 returns year, Julian day, hr:min:sec, and Checksum:
Y:xx Dxxxx Txx:xx:xx Cxxxx
[no. of arrays]D ASCII DUMP - If necessary, the MPTR is advanced to start of scan.
CR510 sends the number of arrays specified (no number defaults to 1) or the number of arrays between MPTR and Reference, whichever is smaller, CRLF, Location, Checksum.
E End call. Datalogger sends CRLF only.
[no. of loc.]F BINARY DUMP - Used by CSI software for data retrieval. See
Appendix C.
[F.S. loc. no.]G MOVE MPTR - MPTR is moved to specified Final Storage location.
The location number must be entered. CR510 sends Area, Location, and Checksum: Ax Lxxxxxxx Cxxxx
7H or 2718H REMOTE KEYBOARD - CR510 sends the prompt ">" and is ready to
execute standard keyboard commands (Section OV3).
[loc. no.]I Display/change value at Input Storage location. CR510 sends the value
stored at the location. A new value and CR may then be sent. CR510 sends checksum. If no new value is sent (CR only), the location value will remain the same.
5-3
Page 70
SECTION 5. TELECOMMUNICATIONS
3142J TOGGLE FLAGS AND SET UP FOR K COMMAND - Used in the
Monitor Mode and with the Heads Up Display. See Appendix C for details.
K CURRENT INFORMATION - In response to the K command, the
CR510 sends datalogger time, user flag status, the data at the input locations requested in the J command, and Final Storage Data if requested by the J command. Used in the Monitor Mode and with Heads Up Display. See Appendix B.
[Password]L Unlocks security (if enabled) to the level determined by the password
entered (See C Mode, Section 1.7). CR510 sends security level (0-3) and checksum: Sxx Cxxxx
[X]M Connect to Storage Module with address 'X' and enter the Storage
Module's Telecommunications Mode (see Storage Module manual). The Storage Module can also be accessed through the 9 Commands while in the Remote Keyboard (Section 4.5 and the Storage Module manual).
1N Connect phone modem to RF modem at phone to RF base station
(requires 1200 baud communication).

5.2 REMOTE PROGRAMMING OF THE CR510

Remote programming of the CR510 can be accomplished with the datalogger support software or directly through the Remote Keyboard State.
The datalogger support software was developed by Campbell Scientific for use with IBM or compatible PC's. Datalogger programs are developed on the computer using the program editor and downloaded to the datalogger with the terminal emulator program.
The CR510 is placed in the Remote Keyboard State by sending either "7H" or "2718H" and a carriage return (CR). The CR510 responds by sending a CR, line feed (LF), and the prompt '>'. The CR510 is then ready to receive the standard keyboard commands; it recognizes all the standard CR510 keyboard characters plus several additional characters, including the decimal point, the minus sign, and Enter (CR) (Section OV3.2). ENTERING 0 RETURNS THE CR510 TO THE TELECOMMUNICATIONS COMMAND STATE.
Remember that entering 0 will compile and run the CR510 program if program changes have been made. If the CR10KD is connected it will just display "LOG" when 0 is executed via telecommunications. It will not indicate active tables (keying "0" on the Keyboard/Display will show the tables).
The 7H Command is generally used with a terminal for direct entry since H makes use of a destructive backspace and does not send control Q between each entry. The 2718H Command functions the same as it does for other Campbell Scientific dataloggers (deleting an entry causes the entire entry to be sent, "control Q" is sent after each user entry).
It is important to remember that the Remote Keyboard State is still within Telecommunications. Entering 0 exits the Remote Keyboard State and returns the datalogger to the Telecommunications Command State, awaiting another command. So, the user can step back and forth between the Telecommunications Command State and the Remote Keyboard State.
5-4
7H (or 2718H)
Telecommunications Remote
Command Keyboard
State State
0
Page 71

SECTION 6. 9-PIN SERIAL INPUT/OUTPUT

6.1 PIN DESCRIPTION

All external communication peripherals connect to the CR510 through the 9-pin subminiature D­type socket connector located on the front of the Terminal Strip (Figure 6.1-1). Table 6.1-1 shows the I/O pin configuration, and gives a brief description of the function of each pin.
TABLE 6.1-1. Pin Description
FIGURE 6.1-1. 9-pin Female Connector
ABR = Abbreviation for the function name. PIN = Pin number. O = Signal Out of the CR510 to a peripheral. I = Signal Into the CR510 from a peripheral.
PIN ABR
1 5 V O 5V: Sources 5 VDC, used
2 SG Signal Ground: Provides
3 RING I Ring: Raised by a
4 RXD I Receive Data: Serial
5 ME O Modem Enable: Raised
I/O Description
to power peripherals.
a power return for pin 1 (5V), and is used as a reference for voltage levels.
peripheral to put the CR510 in the telecommunications mode.
data transmitted by a peripheral are received on pin 4.
when the CR510 determines that a modem raised the ring line.
PIN ABR
6 SDE O Synchronous Device
7 CLK/HS I/O Clock/Handshake: Used
8 12 V: Sources
9 TXD O Transmit Data: Serial
I/O Description
Enable: Used to address Synchronous Devices (SDs), and can be used as an enable line for printers.
with the SDE and TXD lines to address and transfer data to SDs. When not used as a clock, pin 7 can be used as a handshake line (during printer output, high enables, low disables).
continuous 12 V, used to power telephone modems.
data are transmitted from the CR510 to peripherals on pin 9; logic low marking (0V) logic high spacing (5V) standard asynchronous ASCII, 8 data bits, no parity, 1 start bit, 1 stop bit, 300, 1200, 9600, 76,800 baud (user selectable).
6-1
Page 72
SECTION 6. 9-PIN SERIAL INPUT/OUTPUT
(ME)
MODEM
(COM200
RF95
SC32A)
FIGURE 6.2-1. Hardware Enabled and Synchronously Addressed Peripherals

6.2 ENABLING AND ADDRESSING PERIPHERALS

While several peripherals may be connected in parallel to the 9-pin port, the CR510 has only one transmit line (pin 9) and one receive line (pin 4, Table 6.1-1). The CR510 selects a peripheral in one of two ways: 1) A specific pin is dedicated to that peripheral and the peripheral is enabled when the pin goes high; we will call this pin­enabled or simply enabled. 2) The peripheral is addressed; the address is sent on pin 9, each bit being synchronously clocked using pin 7. Pin 6 is set high while addressing.
6.2.1 PIN-ENABLED PERIPHERALS
Modem Enable (pin 5) is dedicated to a specific device. Synchronous Device Enable (pin 6) can either be used as a Print Enable or it can be used to address Synchronous Devices (Section
6.6). Modem Enable (ME), pin 5, is raised to enable
a modem that has raised the ring line. Modem/terminal peripherals include Campbell Scientific phone modems and computers or terminals using the SC32A RS232 interface. The CR510 interprets a ring interrupt (Section
6.3) to come from a modem if the device raises the CR510's Ring line, and holds it high until the CR510 raises the ME line. Only one modem/ terminal may be connected to the CR510.
Print Peripherals are defined as peripherals which have an asynchronous serial communications port used to RECEIVE data transferred by the CR510. In most cases the
print peripheral is a printer, but could also be an on-line computer or other device.
Synchronous Device Enable (SDE), pin 6, may be used to enable a print peripheral only when no other addressable peripherals are connected to the 9-pin connector. Use of the SDE line as an enable line maintains CR510 compatibility with printer-type peripherals which require a line to be held high (Data Terminal Ready) in order to receive data.
If output to both a print peripheral and an addressable peripheral is necessary the SDC99 Synchronous Device Interface is required. With the SDC99 the print peripheral functions as an addressable peripheral. If the SDC99 is not used, the print peripheral receives the address and data sent to the addressed peripheral. Synchronous addressing appears as garbage characters on a print peripheral.
6.2.2 ADDRESSED PERIPHERALS
The CR510 has the ability to address Synchronous Devices (SDs). SDs differ from enabled peripherals in that they are not enabled solely by a hardware line (Section 6.2.1); an SD is enabled by an address synchronously clocked from the CR510 (Section 6.6).
Up to 16 SDs may be addressed by the CR510. Unlike an enabled peripheral, the CR510 establishes communication with an addressed peripheral before data are transferred. During data transfer an addressed peripheral uses pin 7 as a handshake line with the CR510.
6-2
Page 73
Synchronously addressed peripherals include the CR10KD Keyboard Display, Storage Modules, SDC99 Synchronous Device Interface (SDC99), and RF95 RF Modem when configured as a synchronous device. The SDC99 interface is used to address peripherals which are normally pin enabled (Figure 6.2-1).

6.3 RING INTERRUPTS

There are three peripherals that can raise the CR510's ring line; modems, the CR10KD Keyboard Display, and the RF Modem configured for synchronous device for communication (RF-SDC). The RF-SDC is used when the CR510 is installed at a telephone to RF base station.
When the Ring line is raised, the processor is interrupted, and the CR510 determines which peripheral raised the Ring line through a process of elimination (Figure 6.3-1). The CR510 raises the CLK/HS line forcing all SDs to drop the ring line. If the ring line is still high the peripheral is a modem, and the ME line is raised. If the ring line is low the CR510 addresses the Keyboard Display and RF-SDC to determine which device to service. (Section 6.6)
After the CR510 has determined which peripheral raised the Ring line, the hierarchy is as follows:
A modem which raises the Ring line will interrupt and gain control of the CR510. A ring from a modem aborts data transfer to pin-enabled and addressed peripherals.
The CR10KD raises the ring line whenever a key is pressed. The CR10KD will not be serviced when the modem or RF-SDC is being serviced.
The ring from the CR10KD is blocked when the SDE line is high, preventing it from interrupting data transfer to a pin-enabled print device.
SECTION 6. 9-PIN SERIAL INPUT/OUTPUT
FIGURE 6.3-1. Servicing of Ring Interrupts

6.4 INTERRUPTS DURING DATA TRANSFER

Instruction 96 is used for on-line data transfer to peripherals (Section 4.1). Each peripheral connected to the CR510 requires an Instruction 96 with the appropriate parameter. If the CR510 is already communicating on the 9-pin connector when Instruction 96 is executed, the instruction puts the output request in a "queue" and program execution continues. As the 9-pin connector becomes available, each device in the queue will get its turn until the queue is empty.
Instruction 96 is aborted if a modem raises the Ring line. Data transfer to an addressed peripheral is aborted if the ring line is raised by a CR10KD or RF Modem configured as a synchronous device. Transfer of data is not resumed until the next time Instruction 96 is executed and the datalogger has exited telecommunications.
The 8 Mode is used to manually initiate data transfer from Final Storage to a peripheral. An abort flag is set if any key on the CR10KD or terminal is pressed during the transfer. Data transfer is stopped and the memory location displayed when the flag is set. During 8 data transfer the abort flag is checked as follows:
1. Comma separated ASCII - after every 32 characters.
2. Printable ASCII - after every line.
3. Binary - after every 256 Final Storage locations.
6-3
Page 74
SECTION 6. 9-PIN SERIAL INPUT/OUTPUT

6.5 MODEM/TERMINAL PERIPHERALS

The CR510 considers any device with an asynchronous serial communications port which raises the Ring line (and holds it high until the ME line is raised) to be a modem peripheral. Modem/terminals include Campbell Scientific phone modems, and most computers, terminals, and modems using the SC32A Optically Isolated RS232 Interface or the SC932 RS232 DCE Interface.
When a modem raises the Ring line, the CR510 responds by raising the ME line. The CR510 must then receive carriage returns until it can establish baud rate. When the baud rate has been set, the CR510 sends a carriage return, line feed, "∗".
The ME line is held high until the CR510 receives an "E" to exit telecommunications. The ME is also lowered if a character is not received after 40 seconds in the Telecommunications Command State (2 minutes in the Remote Keyboard State).
Some modems are quite noisy when not on line; it is possible for valid characters to appear in the noise pattern. For this reason, the CR510 counts all the invalid characters it receives from the time it answers a ring, and terminates communication (lowers the ME line and returns to the 0 Mode) after receiving 150 invalid characters.

6.6 SYNCHRONOUS DEVICE COMMUNICATION

The CR510 has the ability to address Synchronous Devices (SDs). SDs differ from enabled peripherals (Section 6.2.1) in that they
are not enabled solely by a hardware line. An SD is enabled by an address synchronously clocked from the CR510. Up to 16 SDs may be addressed by the CR510, requiring only three pins of the 9-pin connector.
Synchronous Device Communication (SDC) discussed here is for those peripherals which connect to the 9-pin serial port. (This should not be confused with Synchronous Device for Measurement (SDM) peripherals. Although the communication protocol for SDMs is very similar, their addressing is independent of SDC addresses and they do not have a ring line.)
SD STATES The CR510 and the SDs use a combination of
the Ring, Clock Handshake (CLK/HS) and Synchronous Device Enable (SDE) lines to establish communication. The CR510 can put the SDs into one of six states.
STATE 1, the SD Reset State The CR510 forces the SDs to the reset/request
state by lowering the SDE and CLK/HS lines. The SD cannot drive the CLK/HS or RXD lines in State 1, however, it can raise the Ring line if service is needed. The SD can never pull the Ring low if a Modem/Terminal is holding it high. Data on TXD is ignored by the SD.
STATE 2, the SD Addressing State The CR510 places the SDs in the addressing
state by raising CLK/HS followed by or simultaneously raising SDE (Figure 6.6-1). TXD must be low while SDE and CLK/HS are changing to the high state.
6-4
FIGURE 6.6-1. Addressing Sequence for the RF Modem
Page 75
SECTION 6. 9-PIN SERIAL INPUT/OUTPUT
State 2 requires all SDs to drop the Ring line and prepare for addressing. The CR510 then synchronously clocks 8 bits onto TXD using CLK/HS as a clock. The least significant bit is transmitted first and is always logic high. Each bit transmitted is stable on the rising edge of CLK/HS. The SDs shift in bits from TXD on the rising edge of CLK/HS provided by the CR510. The CR510 can only address one device per State 2 cycle. More than one SD may respond to the address, however. State 2 ends when the 8th bit is received by the SD.
SDs implemented with shift registers decode the 4 most significant bits (bits 4, 5, 6, and 7) for an address. Bit 0 is always logic high. Bits 1, 2, and 3 are optional function selectors or commands. Addresses established to date are shown in Table 6.6-1 and are decoded with respect to the TXD line.
TABLE 6.6-1. SD Addresses
B7 B6 B5 B4 B3 B2 B1 B0 SDC99 Printer 0000XXX1 Storage Module 0001XXX1
CR10KD Keyboard
CR10KD Display00101XX1 RF Modem 0011XXX1
STATE 3, the SD Active State The SD addressed by State 2, enters State 3.
All other SDs enter State 4. An active SD returns to State 1 by resetting itself, or by the CR510 forcing it to reset.
Active SDs have different acknowledgment and communication protocols. Once addressed, the SD is free to use the CLK/HS, TXD, and RXD lines according to its protocol with the CR510. The CR510 may also pulse the SDE line after addressing, as long as the CLK/HS and SDE are not low at the same time.
STATE 4, the SD Inactive State The SDs not addressed by State 2 enter State
4, if not able to reset themselves (e.g., SM192 Storage Module). Inactive SDs ignore data on the TXD line and are not allowed to use the CLK/HS or RXD lines. Inactive SDs may raise the Ring line to request service.
00100XX1
STATE 5
State 5 is a branch from State 1 when the SDE line is high and the CLK/HS line is low. The SDs must drop the Ring line in this state. This state is not used by SDs. The CR510 must force the SDs back to the reset state from State 5 before addressing SDs.
STATE 6
State 6 is a branch from State 1, like State 5, except the SDE line is low and the CLK/HS line is high. The SDs must drop the Ring line in this state.

6.7 MODEM/TERMINAL AND COMPUTER REQUIREMENTS

The CR510 considers any device with an asynchronous serial communications port which raises the Ring line (and holds it high until the ME line is raised) to be a modem peripheral. Modems include Campbell Scientific phone modems, and most computers, terminals, and modems using the SC32A Optically Isolated RS232 Interface.
6.7.1 SC32A INTERFACE TO COMPUTER
Most computers require the SC32A Optically Isolated RS232 Interface. The SC32A raises the CR510's ring line when it receives characters from a modem, and converts the CR510's logic levels (0 V logic low, 5V logic high) to RS232 logic levels.
The SC32A 25-pin port is configured as Data Communications Equipment (DCE) (see Table
6.7-1) for direct connection to Data Terminal Equipment (DTE), which includes most PCs and printers.
When the SC32A receives a character from the terminal/computer (pin 2), 5 V is applied to the datalogger Ring line (pin 3) for one second or until the Modem Enable line (ME) goes high. The CR510 waits approximately 40 seconds to receive carriage returns, which it uses to establish baud rate. After the baud rate has been set the CR510 transmits a carriage return, line feed, "", and enters the Telecommunica­tions Command State (Section 5). If the carriage returns are not received within the 40 seconds, the CR510 "hangs up".
6-5
Page 76
SECTION 6. 9-PIN SERIAL INPUT/OUTPUT
TABLE 6.7-1. SC32A Pin Description
PIN = Pin number O = Signal Out of the SC32A to a peripheral I = Signal Into the SC32A from peripheral
25-PIN FEMALE PORT: PIN #
1 GROUND 2ITX 3ORX 4 I RTS (POWER) 5OCTS 6ODSR 7 GROUND 8 O DCD 20 I DTR (POWER)
9-PIN MALE PORT: PIN #
1 +5V INPUT 2 GROUND 3RING 4RX 5ME 6SDE 9TX
NOTE: The SC32A has a jumper, which when used, passes data only when the ME line is high and the SDE line is low. The function of the jumper is to block data sent to SDs from being received by a computer/terminal used to initiate data transfer. Synchronous data will appear as garbage characters on a computer/terminal.
6.7.2 SC932 INTERFACE TO MODEMS
Most modems have an RS232 port configured as DCE. For connection to DCE devices such as modems and some computers, the SC932 9-pin to RS232 DCE Interface should be used.
6.7.3 COMPUTER/TERMINAL REQUIREMENTS
Computer/terminal peripherals are usually configured as Data Terminal Equipment (DTE). Pins 4 and 20 are used as handshake lines, which are set high when the serial port is enabled. Power for the SC32A RS232 section is taken from these pins. For equipment configured as DTE (see Table 6.7-2) a direct ribbon cable connects the computer/terminal to the SC32A. Clear to Send (CTS) pin 5, Data Set Ready (DSR) pin 6, and Data Carrier Detect (DCD) pin 8 are held high by the SC32A (when the RS232 section is powered) which should
I/O ABBREVIATION
ABBREVIATION
satisfy hardware handshake requirements of the computer/terminal.
Table 6.7-2 lists the most common RS232 configuration for Data Terminal Equipment.
TABLE 6.7-2. DTE Pin Configuration
PIN = 25-pin connector number ABR = Abbreviation for the function name O = Signal Out of terminal to another device I = Signal Into terminal from another device
PIN ABR
2 TD O Transmitted Data: Data
3 RD I Received Data: Data is
4 RTS O Request to Send: The
5 CTS I Clear to Send: The
20 DTR O Data Terminal Ready:
6 DSR I Data Set Ready: The
8 DCD I Data Carrier Detect: The
22 RI I Ring Indicator: The
7 SG Signal Ground: Voltages
I/O FUNCTION
is transmitted from the terminal on this line.
received by the terminal on this line.
terminal raises this line to ask a receiving device if the terminal can transmit data.
receiving device raises this line to let the terminal know that the receiving device is ready to accept data.
The terminal raises this line to tell the modem to connect itself to the telephone line.
modem raises this line to tell the terminal that the modem is connected to the phone line.
modem raises this line to tell the terminal that the modem is receiving a valid carrier signal from the phone line.
modem raises this line to tell the terminal that the phone is ringing.
are measured relative to this point.
6-6
Page 77
SECTION 6. 9-PIN SERIAL INPUT/OUTPUT
FIGURE 6.7-1. Transmitting the ASCII Character 1
6.7.3 COMMUNICATION PROTOCOL/TROUBLE SHOOTING
The ASCII standard defines an alphabet consisting of 128 different characters where each character corresponds to a number, letter, symbol, or control code.
An ASCII character is a binary digital code composed of a combination of seven "bits", each bit having a binary state of 1 (one) or 0 (zero). For example, the binary equivalent for the ASCII character "1" is 0110001 (decimal 49).
ASCII characters are transmitted one bit at a time, starting with the 1st (least significant) bit. During data transmission the marking condition is used to denote the binary state 1, and the spacing condition for the binary state 0. The signal is considered marking when the voltage is more negative than minus three volts with respect to ground, and spacing when the voltage is more positive than plus three volts.
Most computers use 8-bits (1 byte) for data communications. The 8th bit is sometimes used for a type of error checking called parity­checking. Even parity binary characters have an even number of 1's, odd-parity characters have an odd number of 1's. When parity checking is used, the 8th bit is set to either a 1 or a 0 to make the parity of the character correct. The CR510 ignores the 8th bit of a character that is received, and transmits the 8th bit as a binary 0. This method is generally described as "no parity".
To separate ASCII characters, a Start bit is sent before the 1st bit and a Stop bit is sent after the 8th bit. The start bit is always a space, and the stop bit is always a mark. Between characters the signal is in the marking condition.
Figure 6.7-1 shows how the ASCII character "1" is transmitted. When transmitted by the CR510 using the SC32A RS232 interface spacing and marking voltages are positive and negative, as
shown. Signal voltages at the CR510 I/O port are 5V in the spacing condition, and 0V in the marking condition.
BAUD RATE BAUD RATE is the number of bits transmitted
per second. The CR510 can communicate at 300, 1200, 9600, and 76,800 baud. In the Telecommunications State, the CR510 will set its baud rate to match the baud rate of the computer/terminal.
Typically the baud rate of the modem/computer/ terminal is set either with dip switches, or programmed from the keyboard. The instrument's instruction manual should explain how to set it.
DUPLEX Full duplex means that two devices can
communicate in both directions simultaneously. Half duplex means that the two devices must send and receive alternately. Full duplex should always be specified when communicating with Campbell Scientific peripherals and modems. However, communication between some Campbell Scientific modems (such as the RF95 RF modem) is carried out in a half duplex fashion. This can affect the way commands should be sent to and received from such a modem, especially when implemented by computer software.
To overcome the limitations of half duplex, some communications links expect a terminal sending data to also write the data to the screen. This saves the remote device having to echo that data back. If, when communicating with a Campbell Scientific device, characters are displayed twice (in pairs), it is likely that the terminal is set to half duplex rather than the correct setting of full duplex.
6-7
Page 78
SECTION 6. 9-PIN SERIAL INPUT/OUTPUT
IF NOTHING HAPPENS If the CR510 is connected to the SC32A RS232
interface and a modem/terminal, and an "" is not received after sending carriage returns:
1. Verify that the CR510 has power AT THE 12V AND GROUND INPUTS, and that the cables connecting the devices are securely connected.
2. Verify that the port of the modem/terminal is an asynchronous serial communications port configured as DTE (see Table 6.7-2). The most common problems occur when the user tries to use a parallel port, or doesn't know the port assignments, i.e. COM1 or COM2. IBM, and most compatibles come with a Diagnostic disk which can be used to identify ports, and their assignments. If the serial port is standard equipment, then the operators manual should give you this information.
3. Verify that there is 5 volts between the CR510 5V and G terminals. Call Campbell Scientific technical support if the voltage is less than 4.8 volts.
Some serial ports, e.g., the Super Serial Card for Apple computers, can be configured as DTE or DCE with a jumper block. Pin functions must match Table 6.7-2.
If you are using a computer to communicate with the datalogger, communication software must be used to enable the serial port and to make the computer function as a terminal. The port should be enabled for 300, 1200, or 9600 baud, 8 data bits, 1 stop bit, and no parity. Campbell Scientific's GraphTerm, PC208E, PC208W, and TCOM provide this function.
If you are not sure that your computer/terminal is sending or receiving characters, there is a simple way to verify it. Make sure that the duplex is set to full. Next, take a paper clip and connect one end to pin 2, and the other end to pin 3 of the serial port. Each character typed on the keyboard will be displayed only if transmitted from the terminal on pin 2, and received on pin 3 (if duplex is set to half, the character will be displayed once if it is not transmitted, or twice if it is transmitted).
IF GARBAGE APPEARS If garbage characters appear on the display,
check that the baud rate is supported by the CR510. If the baud rate is correct, verify that the computer/terminal is set for 8 data bits, and no parity. Garbage will appear if 7 data bits and no parity are used. If the computer/terminal is set to 8 data bits and even or odd parity, communication cannot be established.
6-8
Page 79

SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES

This section gives some examples of Input Programming for common sensors used with the CR510. These examples detail only the connections, Input, Program Control, and Processing Instructions necessary to perform measurements and store the data in engineering units in Input Storage. Output Processing Instructions are omitted (see Section 8 for some processing and program control examples). It is left to the user to program the necessary instructions to obtain the final data in the form desired. No output to final storage will take place without additional programming.
The examples given in this section would likely be only fragments of larger programs. In general, the examples are written with the measurements made by the lowest numbered channels, the instructions at the beginning of the program table, and low number Input Storage Locations used to store the data. It is unlikely that an application and CR510 configuration exactly duplicates that assumed in an example.
These examples are not meant to be used verbatim; sensor calibration, input channels, and input locations must be adjusted for the actual circumstances. Unless otherwise noted, all excitation channels are switched analog output.
7.1 SINGLE ENDED VOLTAGE
107 TEMPERATURE PROBE
Instruction 11 excites Campbell Scientific's 107 Thermistor Probe with a 2 VAC excitation, makes a single ended measurement and calculates temperature (°C) with a fifth order polynomial. In this example, the temperatures are obtained from three 107 probes. The measurements are made on single­ended channels 1-3 and the temperatures are stored in Input Locations 1-3.
CONNECTIONS The black leads from the probes go to
excitation channel 1, the purple leads go to analog ground (AG), the clear leads go to ground (G), and the red leads go to single­ended channels 1, 2, and 3 (channel 1H, channel 1L, and channel 2H, respectively).
PROGRAM
01: Temp (107) (P11)
1: 3 Reps 2: 1 SE Channel 3: 1 Excite all reps w/E1 4: 1 Loc [ 107_T_1 ] 5: 1 Mult 6: 0 Offset
7.2 DIFFERENTIAL VOLTAGE
MEASUREMENT
output is referenced to the sensor ground. The associated current drain usually requires a power source external to the CR510. A typical connection scheme where AC power is not available and both the CR510 and sensor are powered by an external battery is shown in Figure 7.2-1. Since a single-ended measurement is referenced to the CR510 ground, any voltage difference between the sensor ground and CR510 ground becomes a measurement error. A differential measurement avoids this error by measuring the signal between the 2 leads without reference to ground. This example analyzes the potential error on a differential CO CO
The wire used to supply power from the external battery is 18 AWG with an average resistance of
6.5 ohms/1000 ft. The power leads to the CR510 and LI-6262 are 2 ft and 10 ft, respectively. Typical current drain for the LI-6262 is 1000 mA. When making measurements, the CR510 draws about 35 mA. Since voltage is equal to current multiplied by resistance (V=IR), ground voltages at the LI-6262 and the CR510 relative to battery ground are:
O analyzer, model LI-6262.
2/H2
1A 6.5 ohms/1000 ft 10 ft = +0.065 V
measurement using a LI-COR
2
LI-6262 ground =
Some sensors either contain or require active signal conditioning circuitry to provide an easily measured analog voltage output. Generally, the
CR510 ground =
0.035A 6.5 ohms/1000 ft 2 ft = +0.0005 V
7-1
Page 80
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
CR510
FIGURE 7.2-1. Typical Connection for Active Sensor with External Battery
Ground at the LI-6262 is 0.065 V higher than ground at the CR510. The LI-6262 can be programmed to output a linear voltage (0 to 100 mV) that is proportional to differential CO scale, or 1 µmol/mol/mV. If the output is measured with a single-ended voltage measurement, it is
0.065 V or 65 µmol/mol high. If this offset remained
constant, it could be corrected in programming. However, it is better to use a differential voltage measurement which does not rely on the current drain remaining constant. The program that follows illustrates the use of Instruction 2 to make the measurement. A multiplier of 1 is used to convert the millivolt output into µmol/mol.
PROGRAM
01: Volt (Diff) (P2)
1: 1 Reps 2: 25 ±2500 mV 60 Hz Rejection
Range 3: 1 DIFF Channel 4: 1 Loc [ umol_mol ] 5: 1 Mult 6: 0 Offset
, 100 µmol/mol full
2

7.3 HMP45C TEMPERATURE AND RH PROBE

Instruction 11 (107 Probe) is used to measure the temperature portion of the HMP45C Probe. It makes a single ended voltage measurement, and calculates temperature with a fifth order polynomial. A multiplier of 1.0 and offset of 0.0 yields temperature in degrees Celsius.
Instruction 4 is used to measure relative humidity. It provides an excitation voltage to power the RH sensor. A 150 millisecond delay is allowed for warm-up before the single-ended measurement is made.
The probe has an output of 0 to 100 millivolts for the 0 to 100% RH range, a multiplier of 0.1 and an offset of 0.0 provides relative humidity in percent.
This example uses Control Port 1 to power the RH sensor.
CONNECTIONS The HMP45C probe is measured by two single-
ended analog input channels. The green (RH) and the orange (temperature) leads are connected to either a HI or LO input. The black thermistor excitation lead connects to any excitation channel. The yellow lead powers the RH sensor via control port 1. The white and purple leads connect to Analog Ground (AG). The clear lead is the shield which connects to Ground (G) on the CR510.
01: Temp (107) (P11)
1: 1 Reps 2: 1 SE Channel 3: 1 Excite all reps w/E1 4: 1 Loc [ air_temp ] 5: 1.0 Mult 6: 0.0 Offset
7-2
Page 81
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
02: Do (P86)
1: 41 Set Port 1 High
03: Excitation with Delay (P22)
1: 2 Ex Channel 2: 0 Delay w/Ex (units = 0.01 sec) 3: 15 Delay after Ex (units = 0.01
sec)
4: 0 mV Excitation
04: Volts (SE) (P1)
1: 1 Reps 2: 5 2500 mV Slow Range 3: 2 SE Channel 4: 2 Loc [ RH ] 5: .1 Mult 6: 0 Offset
05: Do (P86)
1: 51 Set Port 1 Low

7.4 ANEMOMETER WITH PHOTOCHOPPER OUTPUT

An anemometer with a photochopper transducer produces a pulse output which is measured by the CR510's Pulse Count Instruction. The Pulse Count Instruction with a Configuration Code of 20, measures "high frequency pulses", "discards data from excessive intervals", and "outputs the reading as a frequency" (Hz = pulses per second). The frequency output is the only output option that is independent of the scan rate.
The anemometer used in this example is the R. M. Young Model 12102D Cup Anemometer, with a 10
window chopper wheel. The photochopper circuitry is powered from the CR510 12 V supply; AC power or back-up batteries should be used to compensate for the increased current drain.
Wind speed is desired in meters per second (m/s). There is a pulse each time a window in the chopper wheel, which revolves with the cups, allows light to pass from the source to the photoreceptor. Because there are 10 windows in the chopper wheel, there are 10 pulses per revolution. Thus, 1 revolution per minute (rpm) is equal to 10 pulses per 60 seconds (1 minute) or 6 rpm = 1 pulse per second (Hz). The manufacturer's calibration for relating wind speed to rpm is:
Wind(m/s) =
(0.01632 m/s)/rpm Xrpm + 0.2 m/s
The result of the Pulse Count Instruction (Configuration Code = 20) is X pulses per sec. (Hz). The multiplier and offset to convert XHz to meters per second are: Wind (m/s) = (0.01632 m/s)/rpm x (6 rpm/Hz) x XHz + 0.2 m/s
Wind (m/s) =
(0.09792 m/s)/Hz x XHz + 0.2 m/s
PROGRAM
01: Pulse (P3)
1: 1 Reps 2: 1 Pulse Input Channel 3: 20 High Frequency, Output Hz 4: 10 Loc [ WS_mph ] 5: .09792 Mult 6: .2 Offset
CR510
FIGURE 7.4-1. Wiring Diagram for Anemometer
7-3
Page 82
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
CR510
FIGURE 7.5-1. Wiring Diagram for Rain Gage with Long Leads

7.5 TIPPING BUCKET RAIN GAGE WITH LONG LEADS

A tipping bucket rain gage is measured with the Pulse Count Instruction configured for Switch Closure. Counts from long intervals will be used, as the final output desired is total rainfall (obtained with Instruction 72, Totalize). If counts from long intervals were discarded, less rainfall would be recorded than was actually measured by the gage (assuming there were counts in the long intervals). Output is desired in millimeters of precipitation. The gage is calibrated for a 0.01 inch tip, therefore, a multiplier of 0.254 is used.
In a long cable there is appreciable capacitance between the lines. The capacitance is discharged across the switch when it closes. In addition to shortening switch life, a transient may be induced in other wires packaged with the rain gage leads each time the switch closes. The 100 ohm resistor protects the switch from arcing and the associated transient from occurring, and should be included any time leads longer than 100 feet are used with a switch closure.
NOTE: The TE525 and TE525MM raingages from CSI always have this resistor insta lled.
PROGRAM
01: Pulse (P3)
1: 1 Reps 2: 1 Pulse Input Channel 3: 2 Switch Closure, All Counts 4: 11 Loc [ Precip_mm ] 5: .254 Mult 6: 0 Offset

7.6 100 OHM PRT IN 4 WIRE HALF BRIDGE

Instruction 9 is the best choice for accuracy where the Platinum Resistance Thermometer (PRT) is separated from other bridge completion resistors by a lead length having more than a few thousandths of an ohm resistance. In this example, it is desired to measure a temperature in the range of -10 to 40°C. The length of the cable from the CR510 to the PRT is 500 feet.
Figure 7.6-1 shows the circuit used to measure the PRT. The 10 kohm resistor allows the use of a high excitation voltage and low voltage ranges on the measurements. This insures that noise in the excitation does not have an effect on signal noise. Because the fixed resistor (R and the PRT (R resistance, the differential measurement of the voltage drop across the PRT can be made on the same range as the differential measurement of the voltage drop across R
If the voltage drop across the PRT (V under 50 mV, self heating of the PRT should be less than 0.001°C in still air. The best resolution is obtained when the excitation voltage is large enough to cause the signal voltage to fill the measurement voltage range. The resolution of this measurement on the 25mV range is +0.04°C. The voltage drop across the PRT is equal to V ratio of R
s
greatest when R at 40°C). To find the maximum excitation voltage that can be used, we assume V to 25 mV and use Ohm's Law to solve for the resulting current, I.
) have approximately the same
s
.
f
2
multiplied by the
x
to the total resistance, and is
is greatest (Rs=115.54 ohms
s
) is kept
equal
2
)
f
7-4
I = 25 mV/R
= 25 mV/115.54 ohms = 0.216 mA
s
Page 83
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
Next solve for V
:
x
V
= I(R1+Rs+Rf) = 2.21 V
x
If the actual resistances were the nominal values, the CR510 would not over range with V = 2.2 V. To allow for the tolerances in the actual resistances, it is decided to set V
equal to 2.1
x
volts (e.g., if the 10 kohms resistor is 5% low, then R
/(R1+Rs+Rf)=115.54/9715.54, and V
s
x
must be 2.102 V to keep Vs less than 25 mV). The result of Instruction 9 when the first
differential measurement (V the 2.5 V range is equivalent to R
) is not made on
1
s/Rf
. Instruction 16 computes the temperature (°C) for a DIN 43760 standard PRT from the ratio of the PRT resistance at the temperature being measured to its resistance at 0°C (R Thus, a multiplier of R
is used in Instruction
f/R0
9 to obtain the desired intermediate, R
s/R0
s/R0
).
(=Rs/Rf x Rf/Ro). If Rs and R0 were each exactly 100 ohms, the multiplier would be 1. However, neither resistance is likely to be exact. The correct multiplier is found by connecting the PRT to the CR510 and entering Instruction 9 with a multiplier of 1. The PRT is then placed in an ice bath (@ 0°C; R
), and the result of
s=R0
the bridge measurement is read using the ∗6 Mode. The reading is R
since Rs=Ro. The correct value of the
R
o/Rf
multiplier, R
, is the reciprocal of this
f/R0
, which is equal to
s/Rf
reading. The initial reading assumed for this example was 0.9890. The correct multiplier is:
= 1/0.9890 = 1.0111.
R
f/R0
The fixed 100 ohm resistor must be thermally stable. Its precision is not important because the exact resistance is incorporated, along with that of the PRT, into the calibrated multiplier. The 10 ppm/°C temperature coefficient of the
x
fixed resistor will limit the error due to its change in resistance with temperature to less than
0.15°C over the specified temperature range. Because the measurement is ratiometric
), the properties of the 10 kohm resistor
(R
s/Rf
do not affect the result. A terminal input module (Model 4WPB100) can
be used to complete the circuit shown in Figure
7.8-1.
PROGRAM
01: Full Bridge w/mv Excit (P9)
1: 1 Reps 2: 23 ±25 mV 60 Hz Rejection
Ex Range
3: 23 ±25 mV 60 Hz Rejection
Br Range 4: 1 DIFF Channel 5: 1 Excite all reps w/Exchan 1 6:2100 mV Excitation 7: 1 Loc [ Rs_Ro ] 8: 1.0111 Mult 9: 0 Offset
02: Temperature RTD (P16)
1: 1 Reps 2: 1 R/Ro Loc [ Rs_Ro ] 3: 2 Loc [ Temp_C ] 4: 1 Mult 5: 0 Offset
CR510
FIGURE 7.6-1. Wiring Diagram for PRT in 4 Wire Half Bridge
7-5
Page 84
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES

7.7 100 OHM PRT IN 3 WIRE HALF BRIDGE

The temperature measurement requirements in this example are the same as in Section 7.8. In this case, a three wire half bridge, Instruction 7, is used to measure the resistance of the PRT. The diagram of the PRT circuit is shown in Fig.
7.7-1. As in the example in Section 7.8, the excitation
voltage is calculated to be the maximum possible, yet allow the +25 mV measurement range. The 10 kohm resistor has a tolerance of ±1%; thus, the lowest resistance to expect from it is 9.9 kohms. We calculate the maximum excitation voltage (V across the PRT less than 25 mV:
0.025V > V
The excitation voltage used is 2.1 V. The multiplier used in Instruction 7 is
determined in the same manner as in Section
7.8. In this example, the multiplier (R assumed to be 100.93.
) to keep the voltage drop
x
115.54/(9900+115.54);
x
< 2.17 V
V
x
f/R0
) is
resistance is 2%, but is more likely to be on the order of 1%. The resistance of R with Instruction 7, is actually R
calculated
s
plus the
s
difference in resistance of wires A and B. The average resistance of 22 AWG wire is 16.5 ohms per 1000 feet, which would give each 500 foot lead wire a nominal resistance of 8.3 ohms. Two percent of 8.3 ohms is 0.17 ohms. Assuming that the greater resistance is in wire B, the resistance measured for the PRT (R
=
0
100 ohms) in the ice bath would be 100.17 ohms, and the resistance at 40°C would be
115.71. The measured ratio R
is 1.1551;
s/R0
the actual ratio is 115.54/100 = 1.1554. The temperature computed by Instruction 16 from the measured ratio would be about 0.1°C lower than the actual temperature of the PRT. This source of error does not exist in the example in Section 7.8, where a 4 wire half bridge is used to measure PRT resistance.
The advantages of the 3 wire half bridge are that it only requires 3 lead wires going to the sensor and takes 2 single-ended input channels, whereas the 4 wire half bridge requires 4 wires and 2 differential channels.
A terminal input module (Model 3WHB10K) can be used to complete the circuit in Figure 7.7-1.
The 3 wire half bridge compensates for lead wire resistance by assuming that the resistance of wire A is the same as the resistance of wire B. The maximum difference expected in wire
CR510
FIGURE 7.7-1. 3 Wire Half Bridge Used to Measure 100 ohm PRT
7-6
Page 85
E1
CR510
H1
L1
AG
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
FIGURE 7.8-1. Full Bridge Schematic for 100 ohm PRT
PROGRAM
01: 3W Half Bridge (P7)
1: 1 Reps 2: 23 ±25 mV 60 Hz Rejection
Range 3: 1 SE Channel 4: 1 Excite all reps w/Exchan 1 5:2100 mV Excitation 6: 1 Loc [ Rs_Ro ] 7: 100.93 Mult 8: 0 Offset
02: Temperature RTD (P16)
1: 1 Reps 2: 1 R/Ro Loc [ Rs_Ro ] 3: 2 Loc [ Temp_C ] 4: 1 Mult 5: 0 Offset

7.8 100 OHM PRT IN 4 WIRE FULL BRIDGE

This example describes obtaining the temperature from a 100 ohm PRT in a 4 wire full bridge (Instruction 6). The temperature being measured is in a constant temperature bath and is to be used as the input for a control algorithm. The PRT in this case does not adhere to the DIN standard (alpha = 0.00385) used in the temperature calculating Instruction
16. Alpha is defined as ((R where R
and R0 are the resistances of the
100
PRT at 100°C and 0°C, respectively. In this PRT alpha is equal to 0.00392.
The result given by Instruction 6 (X) is 1000
(where Vs is the measured bridge output
V
s/Vx
voltage, and V
is the excitation voltage) which
x
is:
X = 1000 (R
/(Rs+R1)-R3/(R2+R3))
s
100/R0
)-1)/100,
The resistance of the PRT (R
) is calculated
s
with the Bridge Transform Instruction 59:
= R1 X'/(1-X')
R
s
Where
X' = X/1000 + R
Thus, to obtain the value R
/(R2+R3)
3
, (R0 = Rs @
s/R0
0°C) for the temperature calculating Instruction 16, the multiplier and offset used in Instruction 6 are 0.001 and R multiplier used in Instruction 59 to obtain R
/(R2+R3), respectively. The
3
s/R0
is R1/R0 (5000/100 = 50). It is desired to control the temperature bath at
50°C with as little variation as possible. High resolution is needed so that the control algorithm will be able to respond to minute changes in temperature. The highest resolution is obtained when the temperature range results in an output voltage (V
) range which fills the
s
measurement range selected in Instruction 6. The full bridge configuration allows the bridge to be balanced (V
= 0V) at or near the control
s
temperature. Thus, the output voltage can go both positive and negative as the bath temperature changes, allowing the full use of the measurement range.
The resistance of the PRT is approximately
119.7 ohms at 50°C. The 120 ohm fixed resistor balances the bridge at approximately 51°C. The output voltage is:
= Vx [Rs/(Rs+R1) - R3/(R2+R3)]
V
s
= Vx [R
/(Rs+5000) - 0.023438]
s
The temperature range to be covered is ±50 ±10°C. At 40°C R
is approximately 115.8
s
ohms, or:
= -8.0224x10-4 V
V
s
x
7-7
Page 86
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
Even with an excitation voltage (V mV, V
can be measured on the +2.5 mV scale
s
) equal to 2500
x
(40°C = 115.8 ohms = -2.006 mV, 60°C = 123.6 ohms = 1.714 mV). There is a change of approximately 2 mV from the output at 40°C to the output at 51°C, or 181 µV/°C. With a resolution of
0.33 µV on the 2.5 mV range, this means that the temperature resolution is 0.0018°C.
The 5 ppm per °C temperature coefficient of the fixed resistors was chosen so that their 0.01% accuracy tolerance would hold over the desired temperature range.
The relationship between temperature and PRT resistance is slightly nonlinear one. Instruction 16 computes this relationship for a DIN standard PRT where the nominal temperature coefficient is 0.00385/°C. The change in nonlinearity of a PRT with the temperature coefficient of 0.00392/°C is minute compared with the slope change. Entering a slope correction factor of 0.00385/0.00392 = 0.98214 as the multiplier in Instruction 16 results in a calculated temperature which is well within the accuracy specifications of the PRT.
PROGRAM
01: Full Bridge (P6)
1: 1 Reps 2: 21 ±2.5 mV 60 Hz Rejection
Range 3: 1 DIFF Channel 4: 1 Excite all reps w/Exchan 1 5:2500 mV Excitation 6: 11 Loc [ Rs_Ro ] 7: .001 Mult 8: .02344 Offset
02: BR Transform Rf[X/(1-X)] (P59)
1: 1 Reps 2: 11 Loc [ Rs_Ro ] 3: 50 Multiplier (Rf)
03: Temperature RTD (P16)
1: 1 Reps 2: 11 R/Ro Loc [ Rs_Ro ] 3: 12 Loc [ Temp_C ] 4: .98214 Mult 5: 0 Offset

7.9 PRESSURE TRANSDUCER - 4 WIRE FULL BRIDGE

This example describes a measurement made with a Druck PDCR 1230 depth measurement pressure transducer. The pressure transducer was ordered for use with 5 volt positive or negative excitation and has a range of 5 psi or about 3.5 meters of water. The transducer is used to measure the depth of water in a stilling well.
Instruction 6, 4 Wire Full Bridge, is used to measure the pressure transducer. The high output of the semiconductor strain gage necessitates the use of the 25 mV input range. The sensor is calibrated by connecting it to the CR510 and using Instruction 6, an excitation voltage of 2500 mV, a multiplier of 1 and an offset of 0, noting the readings (6 Mode) with 10 cm of water above the sensor and with 334.6 cm of water above the sensor. The output of Instruction 6 is 1000 V or millivolts per volt excitation. At 10 cm the reading is 0.19963 mV/V and at 334.6 cm the reading is 6.6485 mV/V. The multiplier to yield output in cm is:
(334.6 - 10)/(6.6485-.19963) =
50.334 cm/mV/V
The offset is determined after the pressure transducer is installed in the stilling well. The sensor is installed 65 cm below the water level at the time of installation. The depth of water at this time is determined to be 72.6 cm relative to the desired reference. When programmed with the multiplier determined above and an offset of 0, a reading of 65.12 is obtained. The offset for the actual measurements is thus determined to be 72.6 - 65.12 = 7.48 cm.
The lead length is approximately 10 feet, so there is no appreciable error due to lead wire resistance.
PROGRAM
01: Full Bridge (P6)
1: 1 Reps 2: 23 ±25 mV 60 Hz Rejection
Range 3: 1 DIFF Channel 4: 1 Excite all reps w/Exchan 1 5:2500 mV Excitation 6: 1 Loc [ HT_cm ] 7: 50.334 Mult 8: 7.48 Offset
s/Vx
7-8
Page 87
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
CR510
FIGURE 7.9-1. Wiring Diagram for Full Bridge Pressure Transducer
FIGURE 7.10-1. Lysimeter Weighing Mechanism

7.10 LYSIMETER - 6 WIRE FULL BRIDGE

When a long cable is required between a load cell and the CR510, the resistance of the wire can create a substantial error in the measurement if the 4 wire full bridge (Instruction 6) is used to excite and measure the load cell. This error arises because the excitation voltage is lower at the load cell than at the CR510 due to voltage drop in the cable. The 6 wire full bridge (Instruction 9) avoids this problem by measuring the excitation voltage at the load cell. This example shows the errors one would encounter if the actual excitation voltage was not measured and shows the use of a 6 wire full bridge to measure a load cell on a weighing lysimeter (a container buried in the ground, filled with plants and soil, used for measuring evapotranspiration).
The lysimeter is 2 meters in diameter and 1.5 meters deep. The total weight of the lysimeter with its container is approximately 8000 kg. The lysimeter has a mechanically adjustable counter­balance, and changes in weight are measured with a 250 pound (113.6 kg) capacity Sensotec
Model 41 tension/compression load cell. The load cell has a 4:1 mechanical advantage on the lysimeter (i.e., a change of 4 kg in the mass of the lysimeter will change the force on the load cell by 1 kg-force or 980 N).
2
The surface area of the lysimeter is 3.1416 m 31,416 cm
2
, so 1 cm of rainfall or evaporation
or
results in a 31.416 kg change in mass. The load cell can measure ±113.6 kg, a 227 kg range. This represents a maximum change of 909 kg (28 cm of water) in the lysimeter before the counterbalance would have to be readjusted.
There is 1000 feet of 22 AWG cable between the CR510 and the load cell. The output of the load cell is directly proportional to the excitation voltage. When Instruction 6 (4 wire half bridge) is used, the assumption is that the voltage drop in the connecting cable is negligible. The average resistance of 22 AWG wire is 16.5 ohms per 1000 feet. Thus, the resistance in the excitation lead going out to the load cell added to that in the lead coming back to ground is 33 ohms. The resistance
7-9
Page 88
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
of the bridge in the load cell is 350 ohms. The voltage drop across the load cell is equal to the voltage at the CR510 multiplied by the ratio of the load cell resistance, R
, to the total resistance, RT,
s
of the circuit. If Instruction 6 were used to measure the load cell, the excitation voltage actually applied to the load cell, V
V
= Vx Rs/RT = Vx 350/(350+33) = 0.91 V
1
, would be:
1
x
Where Vx is the excitation voltage. This means that the voltage output by the load cell would only be 91% of that expected. If recording of the lysimeter data was initiated with the load cell output at 0 volts, and 100 mm of evapotranspira­tion had occurred, calculation of the change with Instruction 6 would indicate that only 91 mm of water had been lost. Because the error is a fixed percentage of the output, the actual magnitude of the error increases with the force applied to the load cell. If the resistance of the wire was constant, one could correct for the voltage drop with a fixed multiplier. However, the resistance of copper changes 0.4% per degree C change in temperature. Assume that the cable between the load cell and the CR510 lays on the soil surface and undergoes a 25°C diurnal temperature fluctuation. If the resistance is 33 ohms at the maximum temperature, then at the minimum temperature, the resistance is:
(1-25x0.004)33 ohms = 29.7 ohms
The actual excitation voltage at the load cell is:
= 350/(350+29.7) Vx = .92 V
V
1
x
The excitation voltage has increased by 1%, relative to the voltage applied at the CR510. In
the case where we were recording a 91 mm change in water content, there would be a 1 mm diurnal change in the recorded water content that would actually be due to the change in temperature. Instruction 9 solves this problem by actually measuring the voltage drop across the load cell bridge. The drawbacks to using Instruction 9 are that it requires an extra differential channel and the added expense of a 6 wire cable. In this case, the benefits are worth the expense.
The load cell has a nominal full scale output of 3 millivolts per volt excitation. If the excitation is 2.5 volts, the full scale output is 7.5 millivolts; thus, the ±7.5 millivolt range is selected. The calibrated output of the load cell is 3.106 mV/V
at a load of
1
250 pounds. Output is desired in millimeters of water with respect to a fixed point. The "4" found in equation 7.12-1 is due to the mechanical advantage. The calibration in mV/V
3.106 mV/V
/250 lb x 2.2 lb/kg x
1
3.1416 kg/mm/4 = 0.02147 mV/V
/mm is :
1
/mm
1
The reciprocal of this gives the multiplier to convert mV/V
into millimeters. (The result of
1
Instruction 9 is the ratio of the output voltage to the actual excitation voltage multiplied by 1000, which is mV/V
1/0.02147 mV/V
):
1
/mm = 46.583 mm/mV/V
1
1
The output from the load cell is connected so that the voltage increases as the mass of the lysimeter increases. (If the actual mechanical linkage was as shown in Figure 7.10-1, the output voltage would be positive when the load cell was under tension.)
7-10
CR510
FIGURE 7.10-2. 6 Wire Full Bridge Connection for Load Ce ll
Page 89
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
When the experiment is started, the water content of the soil in the lysimeter is approximately 25% on a volume basis. It is decided to use this as the reference (i.e., 0.25 x 1500 mm = 375 mm). The experiment is started at the beginning of what is expected to be a period during which evapotranspiration exceeds precipitation. Instruction 9 is programmed with the correct multiplier and no offset. After hooking everything up, the counterbalance is adjusted so that the load cell is near the top of its range; this will allow a longer period before readjustment is necessary. The result of Instruction 9 (monitored with the ∗6 Mode) is 109. The offset needed to give the desired initial value of 375 mm is 266. However, it is decided to add this offset in a separate instruction so the result of Instruction 9 can be used as a ready reminder of the strain on the load cell (range = ±140 mm). When the strain on the load cell nears its rated limits, the counterbalance is readjusted and the offset recalculated to provide a continuous record of the water budget.
The program table has an execution interval of 10 seconds. The average value in millimeters is output to Final Storage (not shown in Table) every hour. The average is used, instead of a sample, in order to cancel out effects of wind loading on the lysimeter.
PROGRAM
01: Full Bridge w/mv Excit (P9)
1: 1 Reps 2: 25 ±2500 mV 60 Hz
Rejection Ex Range
3: 22 ±7.5 mV 60 Hz Rejection
Br Range 4: 1 DIFF Channel 5: 1 Excite all reps w/Exchan 1 6:2500 mV Excitation 7: 1 Loc [ Raw_mm ] 8: 46.583 Mult 9: 0 Offset
02: Z=X+F (P34)
1: 1 X Loc [ Raw_mm ] 2: 266 F 3: 2 Z Loc [ mm_H2O ]

7.11 227 GYPSUM SOIL MOISTURE BLOCK

Soil moisture is measured with a gypsum block by relating the change in moisture to the change in resistance of the block. An AC Half Bridge (Instruction 5) is used to determine the resistance of the gypsum block. Rapid reversal of the excitation voltage inhibits polarization of the sensor. Polarization creates an error in the output so the fast integration option is used. The output of Instruction 5 is the ratio of the output voltage to the excitation voltage; this output is converted to gypsum block resistance with Instruction 59, Bridge Transform.
The Campbell Scientific 227 Soil Moisture Block uses a Delmhorst gypsum block with a 1 kohm bridge completion resistor. Using data supplied by Delmhorst, Campbell Scientific has computed coefficients for a 5th order polynomial to convert block resistance to water potential in bars. There are two polynomials: one to optimize the range from
-0.1 to -2 bars, and one to cover the range from -0.1 to -10 bars (the minus sign is omitted in the output). The -0.1 to -2 bar polynomial requires a multiplier of 1 in the Bridge Transform Instruction (result in kohms) and the -0.1 to -10 bar polynomial requires a multiplier of 0.1 (result in 10,000s of ohms). The multiplier is a scaling factor to maintain the maximum number of significant digits in the polynomial coefficients.
In this example, we wish to make measurements on four gypsum blocks and output the final data in bars. The soil where the moisture measurements are to be made is quite wet at the time the data logging is initiated, but is expected to dry beyond the -2 bar limit of the wet range polynomial. The dry range polynomial is used, so a multiplier of 0.1 is entered in the bridge transform instruction.
When the water potential is computed, it is written over the resistance value. The potentials are stored in Input Locations 1-4 where they may be accessed for output to Final Storage. If it was desired to retain the resistance values, the potential measurements could be stored in Locations 5-8 by changing the value in Parameter 3 to 7 in Instruction 55.
7-11
Page 90
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
CR510
FIGURE 7.11-1. 6 227 Gypsum Blocks Connected to the CR510 PROGRAM
01: AC Half Bridge (P5)
1: 4 Reps 2: 15 ±2500 mV Fast Range 3: 1 SE Channel 4: 1 Ex Channel Option 5:2500 mV Excitation 6: 1 Loc [ H2O_bar_1 ] 7: 1 Mult 8: 0 Offset
02: BR Transform Rf[X/(1-X)] (P59)
1: 4 Reps 2: 1 Loc [ H2O_bar_1 ] 3: .1 Multiplier (Rf)
03: Polynomial (P55)
1: 4 Reps 2: 1 X Loc [ H2O_bar_1 ] 3: 1 F(X) Loc [ H2O_bar_1 ] 4: .15836 C0 5: 6.1445 C1 6: -8.4189 C2 7: 9.2493 C3 8: -3.1685 C4 9: .33392 C5

7.12 NONLINEAR THERMISTOR IN HALF BRIDGE

Instruction 11, 107 Thermistor Probe, automatically linearizes the output of a nonlinear thermistor, 107 Probe, by transforming the millivolt reading with a 5th order polynomial. Instruction 55, Polynomial, can be used to calculate temperature of any nonlinear thermistor, provided the correlation between temperature and probe output is known, and an appropriate polynomial fit has been determined. In this example, the CR510 is used to measure the
temperature of four 101 Probes (used with the CR21 but usually not the CR510). Instruction 4, Excite, Delay, and Measure, is used because the high source resistance of the probe requires a long input settling time (Section 10.3.1). The excitation voltage is 2000 mV, the same as used in the CR21. The signal voltage is then transformed to temperature using the Polynomial Instruction.
The manual for the 101 Probe gives the coefficients of the 5th order polynomial used to convert the output in millivolts to temperature (E denotes the power of 10 by which the mantissa is multiplied):
C0 -53.7842 C1 0.147974 C2 -2.18755E-4 C3 2.19046E-7 C4 -1.11341E-10 C5 2.33651E-14
The CR510 will only allow 5 significant digits to the right or left of the decimal point to be entered from the keyboard. The polynomial cannot be applied exactly as given in the 101 manual. The initial millivolt reading must be scaled if the coefficients of the higher order terms are to be entered with the maximum number of significant digits. If 0.001 is used as a multiplier on the millivolt output, the coefficients are divided by 0.001 raised to the appropriate power (i.e., C0=C0, C1=C1/0.001, C2=C2/.000001, etc.). With this adjustment, the coefficients entered in Parameters 4-9 of Instruction 55 become:
C0 -53.784 C1 147.97 C2 -218.76 C3 219.05 C4 -111.34 C5 23.365
7-12
Page 91
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
CR510
FIGURE 7.12-1. Nonlinear Thermistor Probes Connected to CR510
PROGRAM
01: Excite-Delay (SE) (P4)
1: 4 Reps 2: 25 ±2500 mV 60 Hz
Rejection Range 3: 1 SE Channel 4: 1 Excite all reps w/Exchan 1 5: 10 Delay (units 0.01 sec) 6:2000 mV Excitation 7: 1 Loc [ Temp_C_1 ] 8: .001 Mult 9: 0 Offset
02: Polynomial (P55)
1: 4 Reps 2: 1 X Loc [ Temp_C_1 ] 3: 1 F(X) Loc [ Temp_C_1 ] 4: -53.784 C0 5: 147.97 C1 6: -218.76 C2 7: 219.05 C3 8: -111.34 C4 9: 23.365 C5

7.13 WATER LEVEL - GEOKON'S VIBRATING WIRE PRESSURE SENSOR

The vibrating wire sensor utilizes a change in the frequency of a vibrating wire to sense pressure. Figure 7.13-1 illustrates how an increase in pressure on the diaphragm decreases the tension on the wire attached to the diaphragm. A decrease in the wire tension decreases the resonant frequency in the same way that loosening a guitar string decreases its frequency.
Vibrating Wire Measurement Instruction 28 excites the "plucking" and "pickup" coils shown in Figure 7.13-1 with a "swept" frequency. A "swept" frequency is a group of different frequencies that are sent one right after another starting with the lowest frequency and ending with the highest. The lowest and highest frequencies are entered by the user in units of hundreds of Hz. This swept frequency causes the wire to vibrate at each of the individual frequencies. Ideally, all of the frequencies except the one matching the resonant frequency of the wire will die out in a very short time. The wire will vibrate with the resonant frequency for a relatively long period of time, cutting the lines of flux in the "plucking" and "pickup" coils and inducing the same frequency on the lines to the CR510. Instruction 28 then accurately measures how much time it takes to receive a user specified number of cycles.
The vibrating wire requires temperature compensation. A nonlinear thermistor built into the probe is measured using Instruction 4, a single-ended half bridge measurement with excitation, and calculated with Instruction 55, a fifth order polynomial instruction.
Campbell Scientific's AVW1 Vibrating Wire Sensor Interface is required between the sensor to the datalogger. The purpose is twofold:
5 or 12 volts can be used as the potential in the swept frequency excitation, thus plucking the wire harder than the maximum
2.5 volt switched excitation. The result is a larger magnitude signal for a longer time.
A transformer strips off any DC noise on the signal, improving the ability to detect cycles.
7-13
Page 92
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
FIGURE 7.13-1. A Vibrating Wire Sensor
The following calculations are based on using a Geokon model 4500 Vibrating Wire sensor. An individual multiplier and offset must be calculated for each sensor used in a system.
MULTIPLIER The fundamental equation relating frequency to
pressure is
P = -F
G + B where
x
P = pressure, PSI G = the Gage Factor obtained from the
sensors calibration sheet in PSI/digit.
2
The units of a digit are Hz
(10-3).
B = offset
=f2Hz2(10-3), where f is frequency.
F
x
Instruction 28 measures period, T, of the vibrating wire in milliseconds (ms) and returns a measured value, X, of
X = 1/(T
2
(ms)2) = f2(10-6)Hz
2
A multiplier of -1000 in Instruction 28 converts the measurement to digits, as shown below.
= -X(-103) = -f2(10-3)Hz
-F
x
2
To calculate the multiplier, convert Geokon's gage factor, G, to the desired units (i.e., feet of water per digit) and multiply by -1000 digits/kHz
P
= P + C (t1 - t0), where
T
P
= Pressure corrected for temperature, °C
T
C = Temperature coefficient, PSI/°C
(from Geokon calibration sheet)
& t1= Initial and current temperatures, °C.
t
0
The temperature coefficient, C, must be converted to units compatible with the gage factor, G.
WELL MONITORING EXAMPLE In this example the vibrating wire sensor is used
to monitor water table height (Figure 7.13-2). The desired data is the distance from the lip of the well to the water surface. The sensor is vented to atmosphere to eliminate measurement errors due to changes in barometric pressure. The water level is expected to stay within 40 to 80 feet of the lip so the 50 psi pressure sensor is placed approximately 100 feet below the lip of the well. The calibration data from Geokon is provided in Table 7.13-1.
TABLE 7.13-1 Calibration Data for
Sensor 3998
Gage Factor Temp. Coeff.
(psi/digit) (psi/°C)
2
.
0.0151 -0.0698
TEMPERATURE CORRECTION The temperature correction is applied as
follows.
7-14
Page 93
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
The multiplier, m, is calculated to convert the reading to feet of water.
m = 0.0151 (psi/digit) 2.3067 (ft of water/psi)
-1000 digits/kHz
2
= -34.831 ft of water/kHz
2
After the probe reaches thermal equilibrium, the initial temperature, t
, is measured to be 24°C.
0
The water column above the sensor is referred to as the "Reading". The Reading decreases with increasing "Distance" from lip of well to water surface so the Distance is computed by subtracting the Reading from the Offset as shown in Figure 7.13-2.
CR510 & AVW1
The "Initial Distance" to the water surface is measured with a chalked line to be 47.23 feet below the lip. The first time the program is executed, the program calculates the offset (Offset = Distance + Reading) required to obtain a reading of 47.23 feet. The offset is stored in Location 4 and applied to subsequent measurements.
NOTE: Following program compilation in the 0 Mode, all input locations are set to zero. This fact is utilized to detect the first execution following a program compilation.
The example assumes the sensor has been connected as shown here.
FIGURE 7.13-2. Well Monitoring Example
7-15
Page 94
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
CR510
Ch E1
12 V or 5 V
FIGURE 7.13-3. Hook up to AVW1
PROGRAM
AVW1 & CR510 USED TO MEASURE 1 GEOKON VIBRATING WIRE SENSOR.
* Table 1 Program
01: 60 Execution Interval (seconds)
01: Excite-Delay (SE) (P4)
1: 1 Reps 2: 15 ±2500 mV Fast Range 3: 1 SE Channel 4: 1 Excite all reps w/Exchan 1 5: 1 Delay (units 0.01 sec) 6:2500 mV Excitation 7: 1 Loc [ Temp ] 8: .001 Mult 9: 0 Offset
02: Polynomial (P55)
1: 1 Reps 2: 1 X Loc [ Temp ] 3: 1 F(X) Loc [ Temp ] 4: -104.78 C0 5: 378.11 C1 6: -611.59 C2 7: 544.27 C3 8: -240.91 C4 9: 43.089 C5
03: Vibrating Wire (SE) (P28)
1: 1 Reps 2: 2 SE Channel 3: 1 Excite all reps w/Exchan 1 4: 24 Starting Freq. (units = 100 Hz) 5: 32 End Freq. (units = 100 Hz) 6: 500 No. of Cycles 7: 0 Rep Delay (units = 0.01 sec) 8: 2 Loc [ Pressure ] 9: -34.836 Mult 10: 0 Offset
7-16
Page 95
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
04: Z=X+F (P34)
1: 1 X Loc [ Temp ] 2: -24 F 3: 3 Z Loc [ Temp_Comp ]
05: Z=X*F (P37)
1: 3 X Loc [ Temp_Comp ] 2: -.0698 F 3: 3 Z Loc [ Temp_Comp ]
06: Z=X+Y (P33)
1: 3 X Loc [ Temp_Comp ] 2: 2 Y Loc [ Pressure ] 3: 2 Z Loc [ Pressure ]
07: IF (X<=>F) (P89)
1: 5 X Loc [ Cmpile_Ck ] 2: 1 = 3: 0 F 4: 30 Then Do
08: Z=X+F (P34)
1: 2 X Loc [ Pressure ] 2: 47.23 F 3: 4 Z Loc [ Offset ]
09: Z=F (P30)
1: 1 F 2: 0 Exponent of 10 3: 5 Z Loc [ Cmpile_Ck ]
(-40°C)] / [2000 mV - 400 mV] = 0.06875°C/mV. The offset is found by taking the linear relationship °C = mV Mult + Offset and solving for the Offset. At -40°C the voltage is 400 mV, thus the Offset = -40 - [400 mV
0.06875°C/mV] = -67.5°C.
CONNECTIONS The dew point sensor is measured with a differential voltage measurement on differential analog input 1. The CURS100 TIM and dew point sensor are wired to the CR510 terminal strip panel as shown in Figure 7.14-1.
PROGRAM
01: Volt (Diff) (P2)
1: 1 Reps 2: 25 ±2500 mV 60 Hz Rejection
Range 3: 1 DIFF Channel 4: 1 Loc [ Dew_Pnt_C ] 5: .06875 Mult 6: -67.5 Offset
INPUT LOCATIONS
1 Dew_Pnt_C
10: End (P95) 11: Z=X-Y (P35)
1: 4 X Loc [ Offset ] 2: 2 Y Loc [ Pressure ] 3: 6 Z Loc [ Distance ]

7.14 4 TO 20 MA SENSOR USING CURS100 TERMINAL INPUT MODULE

A dew point sensor has a 4 to 20 mA output over the dew point temperature range of -40° to +70°C. The dew point sensor output may be measured by the CR510 using the CUS100 Terminal Input Module (TIM). The CUS100 uses a 100 Ω, ± 0.01 % resistor to convert the 4 to 20 mA range to 400 to 2000 mV. The millivolt range was found using the relationship V = IR, where V is voltage, I is current, and R is resistance, e.g. the voltage at -40°C is given by V = 4 mA 100 = 400 mV. The dew point sensor is measured with Instruction 2 (Volt Diff). The multiplier for dew point temperature is found with the following relationship [70°C -
7-17
Page 96
SECTION 7. MEASUREMENT PROGRAMMING EXAMPLES
CR510
CR10X
H
4H
1H
1L
4L
AG
AG
100
0.01%
±
L
GND
CURS100
G
12V
G
4 to 20 mA
Sensor
FIGURE 7.14-1 Wiring Diagram for CURS100 Terminal Input Module and 4 to 20 mA Sensor.
7-18
Page 97

SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES

The following examples are intended to illustrate the use of Processing and Program Control Instructions, flags, dual Final Storage, and the capability to direct the results of Output Processing Instructions to Input Storage.
The specific examples may not be as important as some of the techniques employed, for example: Directing Output Processing to Input Storage is used in the Running Average and Rainfall Intensity
examples (8.1 and 8.2). Flag tests are used in the Running Average, Interrupt Subroutine, Converting Wind Direction, and
Saving Data Prior to Event examples (8.1, 8.5, 8.7 and 8.8). An algorithm for a down counter is used in the Saving Data Prior to Event example (8.8).
As in Section 7 these examples are not complete programs to be taken verbatim. They need to be altered to fit specific needs.

8.1 COMPUTATION OF RUNNING AVERAGE

It is sometimes necessary to compute a running average (i.e., the average covers a fixed number of samples and is continuously updated as new samples are taken). Because the output interval is shorter than the averaging period, Instruction 71 cannot be used; the algorithm for computing this average must be programmed by the user. The following example demonstrates a program for computing a running average.
In this example, each time a new measurement is made (in this case the CR510 internal temperature) an average is computed for the 10 most recent samples. This is done by saving all 10 temperatures in contiguous input locations and using the Spatial Average Instruction (51) to compute the average. The temperatures are stored in locations 2 through 11. Each time the table is executed, the new measurement is stored in location 11 and the average is stored in location 1. The Block Move Instruction (54) is then used to move the temperatures from locations 3 through 11 down by 1 location; the oldest measurement (in location 3) is lost when the temperature from location 4 is written over it.
PROGRAM
* Table 1 Program
01: 10.0 Execution Interval (seconds)
01: Internal Temperature (P17)
1: 11 Loc [ Temp_i ]
02: Spatial Average (P51)
1: 10 Swath 2: 2 First Loc [ Temp_i_9 ] 3: 1 Avg Loc [ Av_10smpl ]
03: Block Move (P54)
1: 9 No. of Values 2: 3 First Source Loc [ Temp_i_8 ] 3: 1 Source Step 4: 2 First Destination Loc [ Temp_i_9 ] 5: 1 Destination Step
04: Do (P86)
1: 10 Set Output Flag High
05: Sample (P70)
1: 1 Reps 2: 1 Loc [ Av_10smpl ]
INPUT LOCATIONS
1 Av_10smpl 7 Temp_i_4 2 Temp_i_#9 8 Temp_i_3 3 Temp_i_8 9 Temp_i_2 4 Temp_i_7 10 Temp_i_1 5 Temp_i_6 11 Temp_i 6 Temp_i_5
8-1
Page 98
SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES
In the above example, all samples for the average are stored in input locations. This is necessary when an average must be output with each new sample. In most cases, averages are desired less frequently than sampling. For example, it may be necessary to sample some parameter every 5 seconds and output every hour an average of the previous three hours' readings. If all samples were saved, this would require 2160 input locations. The same value can be obtained by computing an hourly average and averaging the hourly averages for the past three hours. To do this requires that hourly averages be stored in input locations.
Instruction 80 is used to send the 1 hour average to Input Storage and again to send the 3 hour average to Final Storage.
PROGRAM
* Table 1 Program
01: 5.0 Execution Interval (seconds)
01: Volt (Diff) (P2)
1: 1 Reps 2: 25 ±2500 mV 60 Hz
Rejection Range 3: 1 DIFF Channel 4: 5 Loc [ XX_mg_M3 ] 5: 10 Mult 6: 0 Offset
02: If time is (P92)
1: 0 Minutes (Seconds --) into a 2: 60 Interval (same units as
above) 3: 10 Set Output Flag High
03: Set Active Storage Area (P80)
1: 3 Input Storage Area 2: 3 Array ID or Loc [ avg_i ]
07: Real Time (P77)
1: 0110 Day,Hour/Minute
08: Sample (P70)
1: 1 Reps 2: 4 Loc [ 3_Hr_avg ]
09: If Flag/Port (P91)
1: 10 Do if Output Flag is High
(Flag 0)
2: 30 Then Do
10: Block Move (P54)
1: 2 No. of Values 2: 2 First Source Loc
[ avg_i_1 ] 3: 1 Source Step 4: 1 First Destination Loc
[ avg_i_2 ] 5: 1 Destination Step
11: End (P95)
INPUT LOCATIONS
1 avg_i_2 2 avg_i_1 3 avg_i 4 3_Hr_avg 5 XX_mg_M3

8.2 RAINFALL INTENSITY

In this example, the total rain for the last 15 minutes is output only if any rain has occurred. The program makes use of the capability to direct the output of Output Processing Instructions to Input Storage.
Every 15 minutes, the total rain is sent to Input Storage. If the total is not equal to 0, output is redirected to Final Storage Area 1, the time is output and the total is sampled.
04: Average (P71)
1: 1 Reps 2: 5 Loc [ XX_mg_M3 ]
05: Spatial Average (P51)
1: 3 Swath 2: 1 First Loc [ avg_i_2 ] 3: 4 Avg Loc [ 3_Hr_avg ]
06: Set Active Storage Area (P80)
1: 1 Final Storage Area 1 2: 25 Array ID or Loc [ _________ ]
8-2
PROGRAM
* Table 1 Program
01: 60.0 Execution Interval (seconds)
01: Pulse (P3)
1: 1 Reps 2: 1 Pulse Input Channel 3: 2 Switch Closure 4: 1 Loc [ Precip_mm ] 5: .254 Mult 6: 0 Offset
Page 99
SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES
02: If time is (P92)
1: 0 Minutes (Seconds --) into a 2: 15 Interval (same units as above) 3: 10 Set Output Flag High
03: Set Active Storage Area (P80)
1: 3 Input Storage Area 2: 2 Array ID or Loc [ 15min_tot ]
In this example a temperature (107 Temperature Probe) is measured every 0.5 seconds and the average output every 30 seconds.
PROGRAM
* Table 1 Program
01: 0.5 Execution Interval (seconds)
04: Totalize (P72)
1: 1 Reps 2: 1 Loc [ Precip_mm ]
05: IF (X<=>F) (P89)
1: 2 X Loc [ 15min_tot ] 2: 2 <> 3: 0 F 4: 30 Then Do
06: Set Active Storage Area (P80)
1: 1 Final Storage Area 1 2: 25 Array ID or Loc
[ _________ ]
07: Real Time (P77)
1: 0110 Day,Hour/Minute
08: Sample (P70)
1: 1 Reps 2: 2 Loc [ 15min_tot ]
09: End (P95)
INPUT LOCATIONS
1 Precip_mm 2 15min_tot

8.3 SUB 1 MINUTE OUTPUT INTERVAL SYNCHED TO REAL TIME

Output can be synchronized to seconds by pressing “-” or “C” whi le entering the first parameter in Instruction 92. If a counter, incremented within the program, was used to determine when to set the Output Flag, output would depend on the number of times the table was executed. The actual time of output would depend on when the program was actually compiled and started running. If the table overran its execution interval (Section 1.1.1), the output interval would not be the count multiplied by the execution interval, but some longer interval.
01: Temp (107) (P11)
1: 1 Reps 2: 1 SE Channel 3: 1 Excite all reps w/E1 4: 1 Loc [ Temp ] 5: 1.0 Mult 6: 0.0 Offset
02: If time is (P92)
1: 0-- Minutes (Seconds --) into a 2: 30 Interval (same units as above) 3: 10 Set Output Flag High
03: Average (P71)
1: 1 Reps 2: 2 Loc [ TC_Temp ]
INPUT LOCATIONS
1 Ref_Temp 2 TC_Temp

8.4 SWITCH CLOSURES ON CONTROL PORTS (RAIN GAGE)

Control port 2 can be used to measure switch closures up to 40 Hz. Instruction 3, pulse, is used to measure two rain gages on pulse input 1, and a rain gage with control port 2. This is done as a comparison. In a real application the pulse channel would be used for wind speed and a control port for a rain gage. The rain gage is connected as diagrammed below.
CR510
+5
C2/P3
FIGURE 8.4-1. Connections for Rain Gage
8-3
Page 100
SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES
PROGRAM
* Table 1 Program
01: 10.0 Execution Interval (seconds)
01: Pulse (P3)
1: 1 Reps 2: 1 Pulse Input Channel 3: 2 Switch Closure 4: 10 Loc [ Precip_1 ] 5: .254 Mult 6: 0 Offset
02: Pulse (P3)
1: 1 Reps 2: 3 Pulse Channel 3 3: 2 Switch Closure 4: 11 Loc [ Precip_2 ] 5: .254 Mult 6: 0 Offset
03: If time is (P92)
1: 0 Minutes (Seconds --) into a 2: 60 Interval (same units as above) 3: 10 Set Output Flag High
04: Real Time (P77)
1: 0110 Day,Hour/Minute
05: Totalize (P72)
1: 2 Reps 2: 10 Loc [ Precip_1 ]
INPUT LOCATIONS
10 Precip_1 11 Precip_2

8.5 CONVERTING 0-360 WIND DIRECTION OUTPUT TO 0-540 FOR STRIP CHART

If 0-360 degree wind direction is output to a strip chart the discontinuity at 0/360 will cause the pen to jump back and forth full scale when the winds are varying from the north. In the days of strip charts this was solved with a 0-540 degree pot on the wind vane (direction changes from 540 to 180 and from 0 to 360 so the pen only jumps once when the wind is out of the north or south).
When faced with the necessity of strip chart output, the following algorithm can be used to change a 0-360 degree input to 0-540. (If you have a 0-540 pot, it can be used with the CR510 since the Wind Vector Instruction, 69, will work with this output.)
To change 0-360 degrees to the 0-540 degrees, 360 degrees must sometimes be added to the reading when it is in the range of 0 to 180. The following algorithm does this by assuming that if the previous reading was less than 270, the vane has shifted through 180 degrees and does not need to be altered. If the previous 0-540 reading was greater than 270, 360 degrees is added.
This example is written as a subroutine which is used to output an analog voltage to a strip chart.
* Table 3 Subroutines 01: Beginning of Subroutine (P85)
1: 1 Subroutine 1
02: IF (X<=>F) (P89)
1: 10 X Loc [ 0_540_WD ] 2: 3 >= 3: 270 F 4: 30 Then Do
03: Do (P86)
1: 11 Set Flag 1 High 04: Else (P94) 05: Do (P86)
1: 21 Set Flag 1 Low 06: End (P95) 07: Z=X (P31)
1: 2 X Loc [ 0_360_WD ]
2: 10 Z Loc [ 0_540_WD ] 08: IF (X<=>F) (P89)
1: 10 X Loc [ 0_540_WD ]
2: 4 <
3: 180 F
4: 30 Then Do 09: If Flag/Port (P91)
1: 11 Do if Flag 1 is High
2: 30 Then Do 10: Z=X+F (P34)
1: 10 X Loc [ 0_540_WD ]
2: 360 F
3: 10 Z Loc [ 0_540_WD ] 11: Z=X (P31)
1: 10 X Loc [ 0_540_WD ]
2: 6 Z Loc [ 0_540_out ]
8-4
Loading...