CR3000 Micrologger Revision: 9/07 C o p y r i g h t © 2 0 0 0 - 2 0 0 7 C a m p b e l l S c i e n t i f i c , I n c .
Warranty and Assistance The CR3000 MICROLOGGER is warranted by CAMPBELL SCIENTIFIC, INC. to be free from defects in materials and workmanship under normal use and service for thirty-six (36) months from date of shipment unless specified otherwise. Batteries have no warranty. CAMPBELL SCIENTIFIC, INC.'s obligation under this warranty is limited to repairing or replacing (at CAMPBELL SCIENTIFIC, INC.'s option) defective products.
CR3000 Table of Contents PDF viewers note: These page numbers refer to the printed version of this document. Use the Adobe Acrobat® bookmarks tab for links to specific sections. CR3000 Overview....................................................... OV-1 OV1. Physical Description ......................................................................OV-2 OV1.1 Measurement Inputs ..............................................................OV-3 OV1.1.1 Analog Inputs (SE 1-28, DIFF 1-14) .....................
CR3000 Table of Contents OV4.1.1 Options for Creating CR3000 Programs ................................ OV-24 OV4.2 Connections to the CR3000 ................................................ OV-24 OV4.3 Setting the CR3000 PakBus Address.................................. OV-24 OV4.4 PC200W Software .............................................................. OV-24 OV4.4.1 Creating a CR3000 Program using Short Cut ........... OV-25 OV4.4.2 Configuring the Setup Tab ........................................
CR3000 Table of Contents 2. Data Storage and Retrieval ......................................2-1 2.1 Data Storage in CR3000 ....................................................................... 2-1 2.1.1 Internal SRAM............................................................................ 2-1 2.1.2 CFM100 or NL115...................................................................... 2-1 2.2 Internal Data Format............................................................................. 2-2 2.
CR3000 Table of Contents 4.5 Numerical Entries ................................................................................. 4-9 4.6 Logical Expression Evaluation............................................................ 4-10 4.6.1 What is True? ............................................................................ 4-10 4.6.2 Expression Evaluation............................................................... 4-10 4.6.3 Numeric Results of Expression Evaluation ...............................
CR3000 Table of Contents 12. Serial Input and Output Functions ......................12-1 13. PakBus Communication Instructions .................13-1 Appendix A. CR3000 Status Table............................................... A-1 Figures OV1-1. CR3000 Measurement and Control System................................OV-1 OV1-2. CR3000 Wiring Panel and Associated Instructions ....................OV-2 1.2-1. CR3000 Battery Pack and Panel....................................................... 1-3 1.3-1.
CR3000 Table of Contents Tables OV1-2. Computer RS-232 Pin-Out......................................................... OV-6 OV2-1. Typical Data Table................................................................... OV-10 1.3-1. Typical Alkaline Battery Service and Temperature.......................... 1-5 1.3-2. CR3000 Rechargeable Battery and AC Transformer Specifications 1-6 1.3-3. PS100, Battery, and AC Transformer Specifications........................ 1-9 1.8-1. Current Sourcing Limits ............
CR3000 Overview The CR3000 provides precision measurement capabilities with processing and control capability in a rugged, battery-operated package. The CR3000 includes CPU and analog and digital inputs and outputs. The on-board, BASIC-like programming language includes data processing and analysis routines. PC200, PC400, or LoggerNet software provides program generation and editing, data retrieval, and realtime monitoring. Campbell Scientific, Inc.
CR3000 Overview OV1. Physical Description Figure OV1-2 shows the CR3000 panel and the associated program instructions. The details of the measurement instructions can be found in Section 7.
CR3000 Overview OV1.1 Measurement Inputs OV1.1.1 Analog Inputs (SE 1-28, DIFF 1-14) There are 14 differential or 28 single-ended inputs for measuring voltages up to ±5 V. A thermistor installed in the wiring panel can be used to measure the reference temperature for thermocouple measurements, and a heavy copper grounding bar and connectors combine with the case design to reduce temperature gradients for accurate thermocouple measurements. Resolution on the most sensitive range is 0.67 µV OV1.1.
CR3000 Overview OV1.1.7 12 Volt Outputs The 12V terminals provide a constant unregulated 12 volts for powering external devices such as multiplexers and SDM modules. The 12V is common with pin 8 on the CS I/O pin connector. OV1.1.8 5V Output The 5 V (±4.0%) output is commonly used to power peripherals such as the QD1 Incremental Encoder Interface, AVW1 or AVW4 Vibrating Wire Interface. The 5 V output is common with pin 1 on the CS I/O 9 pin connector; 200 mA is the maximum combined current output. OV1.1.
CR3000 Overview OV1.2 Communication and Data Storage OV1.2.1 Peripheral Port The peripheral port is for attaching data storage or communication peripherals. Both the CFM100 and NL115 modules plug onto the peripheral port and have a slot for a Type I or Type II CompactFlash® card (Section 2.1.2). The NL115 also supports Ethernet communications. CAUTION Removing a card from the CFM100 or NL115 while the card is active can cause garbled data and can actually damage the card.
CR3000 Overview CS IO) COMPUTER RS232 (TRANSFORMER ISOLATED) Pin 5 Pin 1 Pin 9 Pin 6 FIGURE OV1-3. Serial Communication Interfaces OV1.2.3 Computer RS-232 The CR3000 has an isolated RS-232 port. Direct connection of the CR3000 to a PC is most conveniently done through the "Computer RS232" port (Figure OV1-3). Table OV1-2 gives a brief description of each "Computer RS232" pin. The Computer RS-232 port is a DCE device when connected to a PC with a serial cable.
CR3000 Overview OV1.3 Power Supply and AC Adapter The CR3000 should be powered by any clean, battery backed 12 VDC power supply. For internal power supplies, a 10 Ahr alkaline battery base and a 7 Ahr rechargeable battery base are available. If internal batteries are not used, an external power supply such as the PS100 power supply should be used. The PS100 has a 7 amp hour battery with built in charging regulator. Optional adapters for AC power are available.
CR3000 Overview ShortCut is included with PC200, PC400 and LoggerNet and is available for free from the Campbell Scientific web site. The CRBasic Editor is included in PC400 and LoggerNet. OV2.3 Instruction Execution within the Datalogger The execution of instructions within the datalogger is accomplished using three separate task types: measurement, SDM, and processing.
CR3000 Overview OV2.3.2 Sequential Mode In sequential mode the instructions are executed in the sequence they appear in the program. Sequential mode can be slower than pipeline mode since it does only one step of the program at a time. After a measurement is made the result is converted to a value determined by the processing included in the instruction, and then the datalogger proceeds to the next instruction.
CR3000 Overview When running in sequential mode, the datalogger uses a queuing system for processing tasks similar to the one used in the pipeline mode. The main difference when running a program in sequential mode is that there is no prescheduled timing of measurements; instead, all of the instructions are run in the order they occur in the program. A priority scheme is used to avoid conflicting use of measurement hardware.
CR3000 Overview to the CS I/O port) can be routed through that datalogger to the other datalogger. • Datalogger to datalogger communications – Special PakBus instructions simplify transferring data between dataloggers for distributed decision making or control. All devices that send or receive messages in a PakBus network must have a unique PakBus Address. The CR3000 default PakBus address is 1. In a PakBus Network each datalogger must be set to a unique address before it is installed in the network.
CR3000 Overview • Some devices may not support the configuration protocol in DevConfig, but do allow configurations to be edited through the terminal emulation screen. • Help for DevConfig is shown as prompts and explanations on its main screen. Help for the appropriate settings for a particular device can also be found in the user’s manual for that device. • Updates to DevConfig are available from Campbell Scientific's web site. These may be installed over top of older versions.
CR3000 Overview OV3.2 Deployment Tab The Deployment Tab allows the user to configure the datalogger prior to deploying it. OV3.2.1 Datalogger Serial Number displays the CR3000 serial number. This setting is set at the factory and cannot be edited. OS Version displays the operating system version that is in the CR3000. Station Name displays the name that is set for this station. PakBus Address allows you to set the PakBus address of the datalogger. The allowable range is between 1 and 4094.
CR3000 Overview Security Password 1 When this level is set, collecting data, setting the clock, and setting variables in the Public table are unrestricted, requiring no security code. If the user enters the Security1 code, the datalogger program can be changed or retrieved or variables can be set in the Status table. Security Password 2 When this level is set, data collection is unrestricted, requiring no security code.
CR3000 Overview Neighbors List, or perhaps more appropriately thought of as the “expected neighbors list”, displays the list of addresses that this datalogger expects to find as neighbors on the port specified by Selected Port. As you select items in this list, the values of the Begin and End range controls will change to reflect the selected range. You can add multiple lists of neighbors on the same port.
CR3000 Overview OV3.2.3 TCP/IP The TCP/IP tab is used to configure the CR3000 to communicate via Ethernet or PPP on any serial COM port. The Ethernet connection is provided by the NL115 parallel port module. The PPP protocol on a serial port requires no additional hardware but rather a device such as an IP modem or a computer that is set up to talk PPP on its serial port.
CR3000 Overview OV3.2.4 Advanced Is Router allows you to control whether the datalogger will act as a PakBus router. PakBus Nodes Allocation Specifies the amount of memory that the CR3000 allocates for maintaining PakBus Routing information. This value represents roughly the maximum number of PakBus Nodes that the CR3000 will be able to track in its routing tables.
CR3000 Overview OV3.3 Logger Control Tab The clock in the PC and the datalogger will be checked every second and the difference displayed. The System Clock Setting allows you to configure what offset, if any, should be used with respect to standard time (Local Daylight Time or UTC, Greenwich mean time). The value selected for this control will be remembered between sessions. Clicking the Set Clock Button will synchronize the station clock to the current computer system time.
CR3000 Overview OV3.4 Data Monitor Tab The Data Monitor tab shows the latest record in the tables stored in the CR3000. OV3.5 Send OS Tab - Downloading an Operating System DevConfig can send operating systems to all Campbell Scientific devices with flash replaceable operating systems. Current operating systems are available from the Campbell Scientific Inc. website, www.campbellsci.com.
CR3000 Overview The text at right gives the instructions for downloading the OS. Follow these instructions. When you click the Start button, DevConfig offers a file open dialog box to prompt you for the operating system file (*.obj file).
CR3000 Overview The information in the dialog helps to corroborate the signature of the operating system sent. For devices such as the CR10X (especially those with extended memory) that can take a long time to reset following an OS download, text warns you against interrupting the memory test. OV3.6 Settings Editor Tab The CR3000 has a number of properties, referred to as “settings”, some of which are specific to the PakBus protocol.
CR3000 Overview The top of the Settings Editor is a grid that allows the user to view and edit the settings for the device. The grid is divided into two columns with the setting name appearing in the left hand column and the setting value appearing in the right hand column. You can change the currently selected cell with the mouse or by using the up arrow and down arrow keys as well as the Page Up and Page Down keys.
CR3000 Overview Clicking the Factory Defaults button on the Settings Editor will send a command to the device to revert to its factory default settings. The reverted values will not take effect until the final changes have been applied. This button will remain disabled if the device does not support the DevConfig protocol messages.
CR3000 Overview LoggerNet Datalogger Support Software (full-featured software) supports combined telecommunication options, data display, and scheduled data collection. The software includes Short Cut and CRBasic for creating CR3000 programs, and tools for configuring, trouble-shooting, and managing datalogger networks. CR3000 support was added to LoggerNet in Version 3.2. OV4.1.1 Options for Creating CR3000 Programs 1.
CR3000 Overview When PC200W is first started, the EZSetup Wizard is launched. Click the Next button and follow the prompts to select the CR3000, the COM port on the computer that will be used for communications, 115200 baud, and Pakbus Address 1. When prompted with the option to Test Communications click the Finish button. To change a setting in the datalogger setup, select that datalogger from the main window, and click the Edit button.
CR3000 Overview Click on the Short Cut button to display the Home screen, as shown below. Each of the four steps has a button with a ? for accessing Help. Use the Help in conjunction with the steps outlined below: Step 1: Create a New File Step 1 is to open a new or existing file. From the Home page, click the New Program button. Use the drop-down list box to select the CR3000 and click on OK. Enter a 1 second in the Scan Interval window and click OK to complete Step 1.
CR3000 Overview Double click on the Type T thermocouple, change the number to 1 and click OK. On the next screen, make sure Ptemp_C is selected for the Reference Temperature Measurement, and click OK to accept the Temp_C label. Click on the Wiring Diagram link to view the sensor wiring diagram, as shown below. Wire the Type T Thermocouple (provided) to the CR3000 as shown on the diagram.
CR3000 Overview Step 3: Output Processing Step 3 is to define the output processing for the sensor measurements. Click the Outputs link in the Progress menu at the left. The Outputs screen has a list of Selected Sensors on the left, and Output Tables on the right. The default is for two Tables, Table1 and Table2. Both Tables have a Store Every field and the drop-down list box that are used to set the interval at which data will be stored.
CR3000 Overview Step 4: Finish Click the Finish link in the Progress menu on the left side to complete the program. Type in QuickStart for the file name. Any errors the compiler may have detected are displayed, along with the names of the files that were created. The file QuickStart.CR3 is the program file that will be sent to the CR3000, QuickStart.def is a summary of the sensor wiring and measurement labels (click the Summary tab or Print buttons to view or print the file).
CR3000 Overview OV4.4.2 Configuring the Setup Tab From the Setup/Connect screen, click on the Connect button to establish communications with the CR3000. When communications have been established, the text on the button will change to Disconnect. Connect Button OV4.4.3 Synchronize the Clocks Click the Set Clock button to synchronize the datalogger’s clock with the computer’s clock. OV4.4.4 Send the Program Click the Select and Send Program button.
CR3000 Overview OV4.4.6 Collect Data Click on the Collect Data tab. From the Collect Data window you can choose what data to collect, and where to store the retrieved data. Click on the OneMin Table, with the Option New data from datalogger selected. Click the Collect button and a dialog box appears, prompting for a file name. Click the Save button to use the default file name CR3000_OneMin.dat. A progress bar, followed by the message Collection Complete is displayed.
CR3000 Overview OV4.4.7 View Data To view the collected data, click on the View button (located in the upper right hand corner of the main screen). Options are accessed by using the menus or by selecting the toolbar icons. If you move and hold the mouse over a toolbar icon for a few seconds, a brief description of that icon's function will appear. To open a data file, click the Open file icon, and double click on the file CR3000_OneMin.dat in the PC200W folder.
CR3000 Overview OV4.5 Programming using the CRBasic Program Editor Those users who are moving from the Edlog Program Editor to the CRBasic Program Editor may find Short Cut to be an excellent way to learn CRBasic. First create a program using Short Cut, then open the file with CRBasic to see how Short Cut created the program. The program file listed below is the Short Cut file QuickStart.CR3 from the tutorial after being imported into the CRBasic editor.
CR3000 Overview OV5. Keyboard Display The CR3000 has an onboard keyboard display. This section illustrates the use of the keyboard display. The CR3000KD has a few keys that have special functions which are listed below. OV-34 Key Usage [2] and [8] [4] and [6] [Enter] [Esc] To navigate up and down through the menu list one line at a time To navigate left and right through a line.
CR3000 Overview Power Up Screen CAMPBELL SCIENTIFIC CR3000 Datalogger 10/18/2005, 13:21:45 CPU: QuickStart.CR3 Running. Press any key for Main Menu (except <, >, ^.
CR3000 Overview OV5.1 Data Display Data Run/Stop Program File PCCard Ports and Status Configure, Settings Move the cursor to Data and press Enter Real Time Tables Real Time Custom Final Storage Data Reset Data Tables Graph Setup List of Data Tables created by active program List of Data Tables created by active program List of Data Tables created by active program All Tables List of Data Tables created by active program Graph Type Roll Scaler Manual Upper: 0.000000 Lower: 0.
CR3000 Overview OV5.1.1 Real Time Tables List of Data Tables created by active program. For Example, Public Table1 Temps Move the cursor to desired table and press Enter Tref TCTemp(1) TCTemp(2) TCTemp(3) Flag(1) Flag(2) Flag(3) Flag(4) : 23.0234 : 19.6243 : 19.3429 : 21.2003 : -1.0000 : 0.00000 : 0.00000 : 0.00000 Public Table values can be changed. Move the cursor to value and press Enter to edit value. Press Graph for graph of selected field Edit field: Num TCTemp(3) Current Value: 21.
CR3000 Overview OV5.1.2 Real Time Custom The first time you navigate to Real Time Custom you will need to set up the display. The CR3000 will keep the setup as long as the same program is running. List of Data Tables created by active program.
CR3000 Overview OV5.1.3 Final Storage Tables List of Data Tables created by active program.
CR3000 Overview OV5.2 Run/Stop Program Data Run/Stop Program File PCCard Ports and Status Configure, Settings Move the cursor to run/stop program and press Enter. If program is running CPU: ProgramName.CR1 Is Running >* Run on Power Up Stop, Retain Data Stop, Delete Data Restart, Retain Data Restart, Delete Data Execute } Select 1 (press Enter) and move the cursor to Execute. Press Enter to execute. Press escape to cancel or get list of available programs. If program is stopped CPU: ProgramName.
CR3000 Overview OV5.3 File Display Data Run/Stop Program File PCCard Ports and Status Configure, Settings New File Name: CPU: .CR3 CRD: .CR3 Move the cursor to File and press Enter New Edit Copy Delete Run Options Directory Format CPU: CRD: Copy From To Execute List of files on CPU or Card.
CR3000 Overview OV5.3.1 File: Edit The CRBasic Program Editor is recommended for writing and editing datalogger programs. Changes in the field can be made with the keyboard display. List of Program files on CPU: or CRD: For Example: CPU: TCTEMP.CR3 RACE.CR3 0 0 Save Changes? Yes No ESC Move the cursor to desired Program and press Enter INSERT Instruction Function Blank Line Block Insert Off CR3000 ' TCTemp.
CR3000 Overview OV5.4 PCCard Display Data Run/Stop Program File PCCard Ports and Status Configure, Settings Move the cursor to PCCard and press Enter PCCard is only in menu if CFM100 or NL115 is attached and a CF card is inserted.
CR3000 Overview OV5.5 Ports and Status Ports Status Table PortStatus (1): PortStatus (2): PortStatus (3): PortStatus (4): PortStatus (5): PortStatus (6): PortStatus (7): PortStatus (8): OFF OFF OFF OFF OFF OFF OFF OFF Move the cursor to the desired port and press Enter to toggle OFF/ON. The port must be configured as an output to be toggled.
CR3000 Overview OV5.6 Settings 05/24/2000, 15:10:40 Year 2000 Month 5 Day 24 Hour 15 Minute 10 Set Cancel Routes StationName PakBusAddress Security(1) Security(2) Security(3) IsRouter PakBusNodes Set Time/Date Settings Display : : : : : : : : xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Turn Off Display Back Light Contrast Adjust Display Timeout: Yes Timeout (min): 4 Move the cursor to time element and press Enter to change OV5.6.
CR3000 Overview OV5.6.
CR3000 Overview OV6. Specifications Electrical specifications are valid over a -25° to +50°C range unless otherwise specified; non-condensing environment required. To maintain electrical specifications, Campbell Scientific recommends recalibrating dataloggers every two years. ANALOG INPUTS (SE1-SE28 or DIF1-DIF14) 14 differential (DF) or 28 single-ended (SE) voltage measurements individually configured.
CR3000 Overview OV-48
Section 1. Installation and Maintenance 1.1 Protection from the Environment The normal environmental variables of concern are temperature and moisture. The standard CR3000 is designed to operate reliably from -25°C to +50°C (40°C to +85°C, optional) in noncondensing humidity. When humidity tolerances are exceeded, damage to IC chips, microprocessor failure, and/or measurement inaccuracies due to condensation on the PC board may result. Effective humidity control is the responsibility of the user.
Section 1. Installation and Maintenance 1.2 Power Requirements The CR3000 operates at a nominal 12 VDC. Below 10 V or above 16 volts the CR3000 does not operate properly. The CR3000 is diode protected against accidental reversal of the positive and ground leads from the battery. Input voltages in excess of 18 V may damage the CR3000 and/or power supply. A transzorb provides transient protection by limiting voltage at approximately 20 V.
Section 1. Installation and Maintenance FIGURE 1.2-1. CR3000 Battery Pack and Panel 1.3 Campbell Scientific Power Supplies The CR3000 is available with either alkaline or lead acid battery options. It may also be purchased without a battery option for connection to an external 12V power supply. Each of the power supplies has a thermal fuse in the power circuit that limits source current. If excessive current is drawn, the fuse gets hot, increases in resistance, and limits current.
Section 1. Installation and Maintenance 10 D-TYPE ALKALINE BATTERIES FIGURE 1.3-1. Alkaline Battery Orientation While the CR3000 has a wide operating temperature range (-40 TO +80°C), the battery bases have more limited operating ranges. Exceeding this range will degrade battery capacity and lifetime and could also cause permanent damage. 1.3.1 CR3000 Alkaline Battery Base (Part Number 10519) Install alkaline batteries as shown in Figure 1.3-1. Suggested temperature range: -25° to +50°C (Table 1.3-1).
Section 1. Installation and Maintenance TABLE 1.3-1. Typical Alkaline Battery Service and Temperature Temperature (oC) 20 - 50 15 10 5 0 -10 -20 -30 NOTE % of 20oC Service 100 98 94 90 86 70 50 30 This data is based on one "D" cell under conditions of 50 mA current drain with a 30 ohm load. As the current drain decreases, the percent service improves for a given temperature. 1.3.2 CR3000 Lead Acid Battery Base (Part Number 10518) Temperature range: -40° to +60°C (Table 1.3-2).
Section 1. Installation and Maintenance LEAD ACID BATTERY REPLACEMENT 6V 7AH LEAD ACID BATTERY + + 6V 7AH LEAD ACID BATTERY RED WHITE BLACK - - FIGURE 1.3-2. Lead Acid Battery Wiring Monitor the power supply using CRBasic keyword Battery (Section 7.6). Users are strongly advised to incorporate this instruction into their data acquisition programs to keep track of the state of the power supply.
Section 1. Installation and Maintenance 1. A CR3000 equipped with standard lead acid batteries should NEVER be used in applications requiring INTRINSICALLY SAFE equipment. 2. A lead acid battery should not be housed in a gas-tight enclosure. 1.3.3 CR3000 Low Profile Base (Part Number 10695) The low profile CR3000 option is not supplied with a battery base.
Section 1. Installation and Maintenance 1.3.3.2 PS100 Lead Acid Power Supply The PS100 power supply includes a 12 V, 7.0 amp-hour lead acid battery, an AC transformer (18 V), and a temperature compensated charging circuit with a charge indicating diode. An AC transformer or solar panel should be connected to the PS100 at all times. The charging source powers the CR3000 while float charging the lead acid batteries. The internal lead acid battery powers the datalogger if the charging source is interrupted.
Section 1. Installation and Maintenance TABLE 1.3-3. PS100, Battery, and AC Transformer Specifications Input Voltage (CHG terminals) Battery Connections Charging Output Voltage: Temperature Compensation Range: Charging Current Limit: Power Out (+12 terminals) Voltage: Current Limited w / 3 A Thermal Fuse: 15 to 28 VDC or 18 VAC RMS Temperature compensated float charge for 12 V Battery -40 to +60ºC 1.2 Amps typical Unregulated 12 V from Battery > 3 A @ < 20°C 3 A @ 20°C 2.1A @ 50°C 1.
Section 1. Installation and Maintenance 1.3.3.4 A100 Null Modem Adapter The A100 Null Modem Adapter is used when 5 volts is needed to power external modems with the PS100 or CH100. The A100 supplies 5 volts to pin 1 of the 9 pin null modem ports. A common use for the A100 is in radiotelemetry networks. The maximum current drain on the 5-volt supply of the A100 is 150 milliamps. 1.4 Solar Panels Auxiliary photovoltaic power sources may be used to maintain charge on lead acid batteries.
Section 1. Installation and Maintenance 1.6 Vehicle Power Supply Connections If a CR3000 is powered from the 12 Volts of a motor vehicle, a second 12 V supply is required. When the starting motor of a vehicle with a 12 V electrical system is engaged, the voltage drops considerably below 11 V, which would cause the CR3000 to stop measurement every time the vehicle is started. The second 12 V supply prevents this malfunction. Figure 1.6-3 shows connecting the two supplies to a CR3000.
Section 1. Installation and Maintenance Tie analog signal shields and returns to grounds ( ) located in analog input terminal strips. Star Ground at Ground Lug Tie pulse-counter returns into grounds ( ) in pulse-counter terminal strip. Large excitation return currents may also be tied into this ground in order to minimize induced single-ended offset voltages in half bridge measurements. External Power Input Tie 5 V, SW-12, 12 V and C1-C8 returns into power grounds (G). FIGURE 1.7-1.
Section 1. Installation and Maintenance A good earth (chassis) ground will minimize damage to the datalogger and sensors by providing a low resistance path around the system to a point of low potential. Campbell Scientific recommends that all dataloggers be earth (chassis) grounded. All components of the system (dataloggers, sensors, external power supplies, mounts, housings, etc.) should be referenced to one common earth (chassis) ground.
Section 1. Installation and Maintenance 1.7.3 Effect of Grounding on Single-Ended Measurements Low-level single-ended voltage measurements can be problematic because of ground potential fluctuations. The grounding scheme in the CR3000 has been designed to eliminate ground potential fluctuations due to changing return currents from 12 V, SW-12, 5 V, and the control ports. This is accomplished by utilizing separate signal grounds ( ) and power grounds (G).
Section 1. Installation and Maintenance TABLE 1.8-1. Current Sourcing Limits Terminals Current Source Limit SW12 < 900 mA @ 20°C < 729 mA @ 40°C < 630 mA @ 50°C < 567 mA @ 60°C < 400 mA @ 80°C 12V + SW12 < 1.85 A @ 20°C < 1.50 A @ 40°C < 1.30 A @ 50°C < 1.17 A @ 60°C < 0.85 A @ 80°C 5V + CSI/O < 200 mA Make certain that the primary source of power for the CR3000 can sustain the current drain for the period of time required.
Section 1. Installation and Maintenance 1.9.1 Use of Digital I/O Ports for Switching Relays Each of the eight digital I/O ports (C1 - C8) can be configured as an output port and set low or high (0 V low, 5 V high) using the PortSet or WriteIO instructions. A digital output port is normally used to operate an external relay driver circuit because the port itself has a limited drive capability (2.0 mA minimum at 3.5 V). Figure 1.
Section 1. Installation and Maintenance FIGURE 1.9-2. Power Switching without Relay 1.10 Maintenance The CR3000 power supplies require a minimum of routine maintenance. When not in use, the rechargeable supply should be stored in a cool, dry environment with the AC charger active. The alkaline supply should not drop below 11.0 V before replacement. When not in use, remove the ten cells to eliminate potential corrosion of contact points and store in a cool dry place. 1.10.
Section 1. Installation and Maintenance years (less at temperature extremes). Where the CR3000 is powered most or all of the time the lithium cell should last much longer. While powered from an external source, the CR3000 measures the voltage of the lithium battery daily. This voltage is displayed in the status table (Appendix A) A new battery will have approximately 3.6 volts. The CR3000 Status Table has a “Lithium Battery” field indicating the current value of the lithium battery.
Section 1. Installation and Maintenance FIGURE 1.10-1. CR3000 with wiring panel. FIGURE 1.10-2. Loosen thumbscrews to remove CR3000 wiring panel from base.
Section 1. Installation and Maintenance FIGURE 1.10-3. Disconnect internal battery from wiring panel (BPALK and Sealed Rechargeable base only). FIGURE 1.10-4. Remove plate to expose lithium battery.
Section 1. Installation and Maintenance FIGURE 1.10-5. Remove battery cover and replace battery.
Section 1. Installation and Maintenance This is a blank page.
Section 2. Data Storage and Retrieval The CR3000 can store individual measurements or it may use its extensive processing capabilities to calculate averages, maxima, minima, histograms, FFTs, etc., on periodic or conditional intervals. Data are stored in tables. The number of tables and the values to output in each table are selected when running Short Cut (Overview) or when writing a datalogger program directly (Sections 4 – 9). 2.
Section 2. Data Storage and Retrieval Campbell Scientific offers and recommends CF cards manufactured by Silicon Systems. Silicon Systems’ CF cards are industrial-grade and have passed our ESD testing. Only industrial-grade CF cards with a storage capacity of 2 Gbytes or less should be used with our products. Refer to the PC/CF Card Information Application Note for more information. NOTE To install or remove the CFM100 or NL115 module, turn the CR3000 power off.
Section 2. Data Storage and Retrieval 2.2 Internal Data Format TABLE 2.2-1 CR3000 DATA TYPES Data Type LONG IEEE4 FP2 Boolean String Size 4 bytes 4 bytes 2 bytes 4 bytes 1 byte per character + 1 byte, 16 byte minimum Range -2,147,483,648 to +2,147,483,647 1.8 E -38 to 1.7 E 38 -7999 to +7999 True/False — Resolution 1 bit (1) 24 bits (about 7 digits) 13 bits (about 4 digits) — — Data are stored internally in a binary format.
Section 2. Data Storage and Retrieval When the CR3000 is used without a computer in the field, or large data files are collected on a CF card, the CF card can be transported to the computer with the data on it. The format of the data files on the CF card is different than the data file formats created when data are collected via a communications link. Data files read directly from the CF card generally need to be converted into another format to be used. 2.3.
Section 2. Data Storage and Retrieval 2.3.2.2 Removing Card from CR3000 To remove a card, press the button on the CFM100 or NL115 . The CR3000 will store any buffered data to the card and then power if off. The Status LED will turn green when it is OK remove the card. Remove the card. The card will be reactivated after 20 seconds if it is not removed. The CF card Status LED just above the CF card door is red when the card is being written to.
Section 2. Data Storage and Retrieval "File Format","Station","Logger","Serial No.","OS Ver","DLD File","DLD Sig","Table Name" "TIMESTAMP","RECORD","Field Name","Field Name","Field Name" "TS","RN","Field Units","Field Units","Field Units" "","","Processing","Processing","Processing" "Field Data Type","Field Data Type","Field Data Type","Field Data Type","Field Data Type" timestamp,record number,field data,field data,field data, FIGURE 2.4.1 Header Information File Format The format of the file on disk.
Section 2. Data Storage and Retrieval Field Data Type This header line is only in TOB1 binary format and identifies the data type for each of the fields in the data table. UINT4 = Unsigned 4 byte integer IEEE4 = 4 byte floating point Time Stamp This field is the date and time stamp for this record. It indicates the time, according to the logger clock, that each record was stored. Record Number This field is the record number of this record. The number will increase up to 2E32 and then start over with zero.
Section 2. Data Storage and Retrieval 2.4.4 TOB3 Binary File Format The TOB3 binary format has a header similar to the other formats. TOB3 data is stored in fixed size “frames” that generally contain a number of records. The size of the frames is a function of the record size. The frames are time stamped, allowing the calculation of time stamps for their records.
Section 3. CR3000 Measurement Details 3.1 Analog Voltage Measurement Sequence The CR3000 measures analog voltages with either an integrate and hold or analog to digital (A/D) conversion. The A/D conversion is made with a 16-bit successive approximation technique which resolves the signal voltage to approximately one part in 60,000 of the full scale range.
Section 3. CR3000 Measurement Details made with the 250 µs integration on the ±5000 mV range. The second measurement is made on the appropriate range using the integration specified in the instruction. Both measurements use the settling time programmed in the instruction. AutoRange optimizes resolution but takes longer than a measurement on a fixed range, because of the two measurements required.
Section 3. CR3000 Measurement Details 3.1.2 Reversing Excitation or the Differential Input Reversing the excitation polarity or the differential input are techniques to cancel voltage offsets that are not part of the signal. For example, if there is a +5 µV offset in the measurement circuitry, a 5 mV signal will be measured as 5.005 mV. When the input is reversed, the measurement will be -4.995 mV. Subtracting the second measurement from the first and dividing by 2 gives the correct answer: 5.005-(-4.
Section 3. CR3000 Measurement Details When the CR3000 reverses the differential input or the excitation polarity it delays the same settling time after the reversal as it does before the first measurement. Thus there are two delays per channel when either RevDiff or RevEx is used. If both RevDiff and RevEx are selected, there are four measurement segments, positive and negative excitations with the inputs one way and positive and negative excitations with the inputs reversed.
Section 3. CR3000 Measurement Details NOTE There are two sets of channel numbers on the analog channels. Differential channels (1-14) have two inputs: high (H) and low (L). Either the high or low side of a differential channel can be used for a single ended measurement. The single-ended channels are numbered 1-28. Because a single ended measurement is referenced to CR3000 ground, any difference in ground potential between the sensor and the CR3000 will result in an error in the measurement.
Section 3. CR3000 Measurement Details A differential measurement has the option of reversing the inputs to cancel offsets as described above. NOTE Sustained voltages in excess of ±16 V will damage the CR3000 circuitry. 3.3 Signal Settling Time Whenever an analog input is switched into the CR3000 measurement circuitry prior to making a measurement, a finite amount of time is required for the signal to stabilize at it's correct value.
Section 3. CR3000 Measurement Details 3.3.2 Measuring the Necessary Settling Time The CR3000 can measure the time required for a particular sensor/cable configuration to settle. This is done by making a number of measurements with different settling times. Looking at the series of measurements it is possible to see the settling of the sensor signal. The following example demonstrates measuring the settling time for a differential voltage measurement.
Section 3. CR3000 Measurement Details The program was run on a Druck water level pressure transducer with 200 feet of cable. The first six measurements are shown in Table 3.3-1. All 20 values are plotted in Figure 3.3-1. The reading has settled by the fourteenth measurement, PT(14), thus a settling time of 1400 µs is adequate. Table 3.3-1.
Section 3. CR3000 Measurement Details junction, which becomes the reference junction, is formed where the other ends of the wires are connected to the measuring device. (With the connectors at the same temperature, the chemical dissimilarity between the thermocouple wire and the connector does not induce any voltage.
Section 3. CR3000 Measurement Details Panel Temperature error summary 0.8 Sum of Worst Case Errors 0.7 Thermistor Tolorance CR1000 Measurement Completion Resistor Error 0.6 S&H Err 0.5 0.4 0.3 0.2 0.1 0 -55 -35 -15 5 25 45 65 85 -0.1 FIGURE 3.4-1. Panel Temperature Errors With an external driving gradient, the temperature gradients on the input panel can be much worse. For example, the CR3000 was placed in a controlled temperature chamber.
Section 3. CR3000 Measurement Details 0 85 -3 55 Chan 1 Chan 2 Chan 3 Chan 4 Chan 6 Chan 7 RefTemp_Avg Chamber Temp -6 -9 25 -5 -12 Chamber and RefTemp deg C Measured - Actual deg C Reference Temperature Errors Due to Panel Gradient Chamber Changed from -65 to + 70 deg C -35 -15 -65 0 10 20 30 40 50 60 70 80 90 Time Minutes FIGURE 3.4-2.
Section 3. CR3000 Measurement Details Thermocouple Limits of Error The standard reference which lists thermocouple output voltage as a function of temperature (reference junction at 0oC) is the National Institute of Standards and Technology Monograph 175 (1993). The American National Standards Institute has established limits of error on thermocouple wire which is accepted as an industry standard (ANSI MC 96.1, 1975). Table 3.
Section 3. CR3000 Measurement Details Accuracy of the Thermocouple Voltage Measurement The -25 to 50 °C accuracy of a CR3000 differential voltage measurement is specified as ± (0.07% of the measured voltage plus the input offset error of 3 times the basic resolution of the range being used to make the measurement plus 2 µV). The input offset error reduces to 1.5* the basic resolution +1 µV if the differential measurement is made utilizing the option to reverse the differential input.
Section 3. CR3000 Measurement Details When the thermocouple measurement junction is in electrical contact with the object being measured (or has the possibility of making contact) a differential measurement should be made. Noise on Voltage Measurement The typical input noise on the ±20 mV range for a differential measurement with 250 µs integration and input reversal is 0.4 µV RMS. On a type T thermocouple (approximately 40 µV/oC) this is 0.01 oC.
Section 3. CR3000 Measurement Details ranges. Temperature difference measurements made outside of the reference temperature range should be made by obtaining the actual temperatures referenced to a junction within the reference temperature range and subtracting one temperature from the other. Table 3.4-3 gives the reference temperature ranges covered and the limits of error in the linearizations within these ranges. Two sources of error arise when the reference temperature is out of range.
Section 3. CR3000 Measurement Details TABLE 3.4-5. Example of Errors in Thermocouple Temperature Source Reference Temp. TC Output Voltage Measurement Noise Reference Linearization Output Linearization Total Error Error: oC : % of Total Error Single Differential Reversing Differential 250 µs Integration 50/60 Hz Rejection Integration ANSI TC Error TC Error 1% ANSI TC TC Error 1% (1oC) Slope Error (1oC) Slope 0.15o:11.7% 0.15o:31.1% 0.15o:12.4% 0.15o:36.4% o o o 1.0 :78% 0.2 :41.5% 1.0 :82.5% 0.2o:48.
Section 3. CR3000 Measurement Details CR9000 CR3000 Junction BoxBox Junction A' A B' B TC H L FIGURE 3.4-4. Diagram of Junction Box An external reference junction box must be constructed so that the entire terminal area is very close to the same temperature. This is necessary so that a valid reference temperature can be measured and to avoid a thermoelectric offset voltage which will be induced if the terminals at which the thermocouple leads are connected (points A and B in Figure 3.
Section 3.
Section 3. CR3000 Measurement Details X = result w/mult = 1, offset = 0 Resistance used to measure full bridge X= = H L ⎛ R3 R2 ⎞ V1 ⎟ = Rbridge ⎜ − Ix ⎝ R3 + R4 R1 + R2 ⎠ R3 ( R1 + R2 ) − R2 ( R3 + R4 ) R1 + R2 + R3 + R4 R1 = − R2 R4 − X ( R2 + R3 + R4 ) X − R3 R2 = R1 R3 − X ( R1 + R3 + R4 ) X + R4 R3 = − R2 R4 − X ( R1 + R2 + R4 ) X − R1 R4 = R1 R3 − X ( R1 + R2 + R3 ) X + R2 IXR FIGURE 3.5-1. Circuits Used with Bridge Measurement Instructions 3.
Section 3. CR3000 Measurement Details FIGURE 3.6-1. Model of Resistive Sensor with Ground Loop In Figure 3.6-1, Vx is the excitation voltage, Rf is a fixed resistor, Rs is the sensor resistance, and RG is the resistance between the excited electrode and CR3000 earth ground. With RG in the network, the measured signal is: V1 = Vx Rs ( Rs + Rf ) + RsRf / RG [3.6-1] RsRf/RG is the source of error due to the ground loop. When RG is large the equation reduces to the ideal.
Section 3. CR3000 Measurement Details synchronized with real time and restarted. The CR3000 actually measures the elapsed time since the last time the counters were read when determining frequency so in the case of an overrun, the correct frequency will still be output. The resolution of the pulse counters is one count. The resolution of the calculated frequency depends on the scan interval: frequency resolution = 1/scan interval (e.g.
Section 3. CR3000 Measurement Details 2. System background calibration. This automatically takes place in the background while the user program is running. Multiple measurements are not averaged, but a filter is applied to the new gain/offset values obtained. The filter is used so that the calibration values change slowly. The filter combines the newly measured value multiplied by 0.1 with the previous calibration value by 0.9 to arrive at the new calibration value.
Section 3. CR3000 Measurement Details used ± (0.X% of Full-Scale Range) to specify measurement accuracy for a given range, which results in a fixed number for each input range. While the ± (0.X% of Full-Scale Range) method is simple to test and utilize in accuracy estimates, it overestimates errors for inputs much less than full-scale. This is because typical measurement instrumentation has measurement errors composed of two major components; a gain error and an offset error as illustrated in Figure 3.9-1.
Section 3. CR3000 Measurement Details 3 2 Voltage Measurement Error (mV) CR10X 1 CR1000 0 -3000 -2000 -1000 0 1000 2000 3000 -1 -2 -3 Input Voltage (mV) FIGURE 3.9-2. Comparison of the CR10X ± (0.X% of Full-Scale Range) and CR1000 ± (0.X% of reading + Offset) voltage measurement accuracy specifications for the (0 to 40)°C temperature range. The CR10X accuracy specification for the ±2500 mV input range over the (0 to 40)°C temperature range is ± (0.05% of Full-Scale Range) = ±2.
Section 4. CRBasic - Native Language Programming The CR3000 is programmed in a language that has some similarities to a structured basic. There are special instructions for making measurements and for creating tables of output data. The results of all measurements are assigned variables (given names). Mathematical operations are written out much as they would be algebraically. This section describes a program, its syntax, structure, and sequence. 4.1 Format Introduction 4.1.
Section 4. CRBasic - Native Language Programming PanelTemp is the keyword name of the instruction. The two parameters associated with PanelTemp are: Destination, the name of the variable in which to put the temperature; and Integration, the length of time to integrate the measurement.
Section 4. CRBasic - Native Language Programming Processing of Data Define Subroutines Program Set scan interval What data are to be output (current value, average, maximum, minimum, etc.) If there is a process or series of calculations that need to be repeated several times in the program, it can be packaged in a subroutine and called when needed rather than repeating all the code each time.
Section 4. CRBasic - Native Language Programming 4.3 Example Program Const RevDiff=1 Const Del=0 'default Const Integ=250 Const Mult=1 Const Offset=0 Declare constants Public RefTemp Public TC(6) Units RefTemp=degC Units TC=DegC Declare public variables, dimension array, and declare units.
Section 4. CRBasic - Native Language Programming The data table header also has a row that lists units for the output values. The units must be declared for the CR3000 to fill this row out (e.g., Units RefTemp = degC). The units are strictly for the user's documentation; the CR3000 makes no checks on their accuracy.
Section 4. CRBasic - Native Language Programming Average is an output processing instruction that will output the average of a variable over the output interval. The parameters are repetitions - the number of elements in an array to calculate averages for, the Source variable or array to average, the data format to store the result in (Table 4.3-1), and a disable variable that allows excluding readings from the average if conditions are not met.
Section 4. CRBasic - Native Language Programming means to continue looping forever (or until ExitScan). In the example the scan is 1 second, three scans are buffered, and the measurements and output continue indefinitely. 4.4 Variable Data Types The declaration of variables (via the DIM or the PUBLIC statement) allow an optional type descriptor AS that specifies the data type. The default data type, without a descriptor, is IEEE4 floating point (FLOAT). The data types are FLOAT, LONG, BOOLEAN, and STRING.
Section 4. CRBasic - Native Language Programming Strings can be dimensioned only up to 2 dimensions instead of the 3 allowed for other data types. (This is because the least significant dimension is actually used as the size of the string.) Public FirstName AS STRING ‘Creates string of 16 characters Public LastName AS STRING * 20 ‘Creates string of 20 characters 4.4.
Section 4. CRBasic - Native Language Programming Expressions are evaluated as integers for as long as possible Public X, I AS Long BeginProg I = 126 X = (I+3) * 3.4 ‘I+3 is evaluated as an integer, ‘then converted to FLOAT before ‘it is multiplied by 3.4 EndProg Constants will be converted to Longs and/or Floats at compilation If a constant (either entered as a number or declared with CONST) can be expressed correctly as an integer, the compiler will use the type that is most efficient in each expression.
Section 4. CRBasic - Native Language Programming port 1. This is much easier to visualize than entering 72, the decimal equivalent. 4.6 Logical Expression Evaluation 4.6.1 What is True? Several different words get used to describe a condition or the result of a test. The expression, X>5, is either true or false. However, when describing the state of a port or flag, on or off or high or low sounds better.
Section 4. CRBasic - Native Language Programming If 0 then Y=0 is always false, Y will never be set to 0 by this conditional statement. The CR3000 expression evaluator evaluates the expression, X>=5, and returns -1, if the expression is true, and 0, if the expression is false. W=(X>Y) will set W equal to -1 if X>Y or will set W equal to 0 if X<=Y.
Section 4. CRBasic - Native Language Programming TABLE 4.8-1. Rules for Names Name for Maximum Length (number of characters) Allowed characters Variable or Array 16 Letters A-Z, upper or lower. Constant 16 case, underscore “_”, and Alias 16 numbers 0-9. The name must Data Table Name 8 start with a letter. CRBasic is Field name 16 not case sensitive 4.8.1 Expressions in Parameters Many parameters allow the entry of expressions.
Section 4. CRBasic - Native Language Programming Public Pressure(3), Mult(3), Offset(3) DataTable (AvgPress,1,-1) DataInterval (0,60,Min,10) Average (3,Pressure(),IEEE4,0) EndTable BeginProg 'Calibration Factors: Mult(1)=0.123 : Offset(1)=0.23 Mult(1)=0.115 : Offset(1)=0.234 Mult(1)=0.114 : Offset(1)=0.224 Scan (1,Sec,10,0) 'VoltSe instruction using array of multipliers and offsets: VoltSe (Pressure(),3,mV5000,1,True,0,_60Hz,Mult(),Offset()) CallTable AvgPress NextScan EndProg 4.
Section 4. CRBasic - Native Language Programming Tablename.timestamp(m,n) = element m of the timestamp output n records ago where: timestamp(1,n) = microseconds since 1990 timestamp(2,n) = microseconds into the current year timestamp(3,n) = microseconds into the current month timestamp(4,n) = microseconds into the current day timestamp(5,n) = microseconds into the current hour timestamp(6,n) = microseconds into the current minute timestamp(7,n) = microseconds into the current second Tablename.
Section 5. Program Declarations Alias Used to assign a second name to a variable. Syntax Alias VariableA = AliasName Remarks Alias allows assigning a second name to a variable. Within the datalogger program, either name can be used. Only the alias is available for Public variables. The alias is also used as the root name for data table fieldnames. With aliases the program can have the efficiency of arrays for measurement and processing yet still have individually named measurements.
Section 5. Program Declarations AS type The declaration of variables (via the DIM or the PUBLIC statement) allow an optional type descriptor AS that specifies the data type. The default data type, without a descriptor, is IEEE4 floating point (FLOAT). The data types are FLOAT, LONG, BOOLEAN, and STRING. AS FLOAT specifies the default IEEE4 data type. If no data type is explicitly specified with the AS statement, then FLOAT is assumed.
Section 5. Program Declarations Const Declares symbolic constants for use in place of numeric entries. Syntax Const constantname = expression Remarks The Const statement has these parts: Part constantname expression Description Name of the constant. Expression assigned to the constant. It can consist of literals (such as 1.0), other constants, or any of the arithmetic or logical operators. Tip Constants can make your programs easier to modify.
Section 5. Program Declarations ' Create the variable array A with 8 elements Dim A( 8) The maximum number of array dimensions allowed in a Dim statement is 3. If a program uses a subscript that is greater than the dimensioned value, a subscript out of bounds error is recorded. When variables are initialized, they are set to 0. Tip Put Dim statements at the beginning of the program. FormatFloat Converts a floating point value into a string.
Section 5. Program Declarations FormatFloat Example The following program shows the use of the FormatFloat instruction. Using the software's numeric monitor, enter a value into FloatVal that should be converted into a string value. Public FloatVal as Float Public StringVal as String * 20 BeginProg Scan (1,Sec,3,0) StringVal = FormatFloat (FloatVal,"%f") NextScan EndProg INTDV Performs an integer division of two numbers.
Section 5. Program Declarations Public Dimensions a variable as public and available in the Public table of the CR3000. Syntax Public(list of [dimensioned] variables that make up the Public Table) Remarks More than one Public statement can be made. Public Declaration Example The example shows the use of the Public declaration. Dim x( 3 ), y, z( 2, 3, 4 ) Public x, y, z Public Dim x( 3 ), y, z( 2, 3, 4 ) Public x( 3 ),y, z( 2, 3, 4 ) Public w 'Dim is optional PWR Performs an exponentiation on a variable.
Section 5. Program Declarations StationName Sets the station name. Syntax StationName StaName Remarks StationName is used to set the datalogger station name with the program. The station name is displayed in the Status table and stored in the data table headers (Section 2.4). Sub, ExitSub, EndSub Declares the name, variables, and code that form a Subroutine.
Section 5. Program Declarations constants (i.e., do not contain a variable) into some of the variables. If a constant is passed, the “variable” it is passed to becomes a constant and cannot be changed by the subroutine. If constants will be passed, the subroutine should be written to not try to change the value of the “variables” they will be passed into. statementblock Any group of statements that are executed within the body of the Subroutine. Exit Sub Causes an immediate exit from a Subroutine.
Section 5. Program Declarations 'Subroutine to convert temperature in degrees C to degrees F Sub ConvertCtoF (TmpC, TmpF) TmpF = TmpC*1.8 +32 EndSub BeginProg Scan (1,Sec,3,0) 'Measure Temperatures (panel and 4 thermocouples) in deg C PanelTemp (RefT,250) TCDiff (TC_C(),4,mV2_5C,1,TypeT,RefT,True ,0,250,1.0,0) 'Call Output Table for C CallTable TempsC 'Convert Temperatures to F using Subroutine: 'Subroutine call using Call statement, 'RefT is used for both source and destination.
Section 5. Program Declarations This is a blank page.
Section 6. Data Table Declarations and Output Processing Instructions 6.1 Data Table Declaration DataTable (Name, TrigVar, Size) output trigger modifier export data destinations output processing instructions EndTable DataTable is used to declare/define a data table. The name of the table, output trigger and size of the table in RAM are set with DataTable. The Table declaration must be at the beginning of the code prior to BeginProg. The table declaration starts with DataTable and ends with EndTable.
Section 6. Data Table Declarations and Output Processing Instructions 6.2 Trigger Modifiers DataInterval (TintoInt, Interval, Units, Lapses) Used to set the time interval for an output table. DataInterval is inserted into a data table declaration following the DataTable instruction to establish a fixed interval table. The fixed interval table requires less memory than a conditional table because time is not stored with each record.
Section 6. Data Table Declarations and Output Processing Instructions Parameter & Data Type TintoInt Constant Interval Constant Units Constant Lapses Constant Enter The time into the interval (offset to the interval) at which the table is to be output. The units for time are the same as for the interval. Enter the time interval on which the data in the table is to be recorded. The interval may be in µs, ms, s, or minutes, whichever is selected with the Units parameter.
Section 6.
Section 6. Data Table Declarations and Output Processing Instructions DataEvent Example: In this example, 5 type T thermocouples are measured. The trigger for the start of an event is when TCTemp(1) exceeds 30 degrees C. The stop trigger is when TCTemp(1) less than 29 degrees C. The event consists of 20 records prior to the start trigger and continues to store data until 10 records following the stop trigger.
Section 6. Data Table Declarations and Output Processing Instructions WorstCase (TableName, NumCases, MaxMin, Change, RankVar) Allows saving the most significant or “worst-case” events in separate data tables. To use WorstCase, a DataTable sized to hold one data storage event must be created to act as the event buffer. Data can be stored to the table using the DataEvent instruction or some other trigger condition. The user must create an algorithm in the program by which to test the WorstCase event.
Section 6. Data Table Declarations and Output Processing Instructions WorstCase Example This program demonstrates the Worst Case Instruction. Five type T thermocouples are measured. The event is similar to that in the example for the DataEvent instruction; the trigger for the start of a data event is when TC(1) exceeds 30 degrees C. However in this example, the stop trigger is set immediately true. This is done to set a fixed size for the event which can be duplicated in the worst case tables.
Section 6. Data Table Declarations and Output Processing Instructions 6.3 Export Data Instructions CardOut (StopRing, Size) Used to send output data to a Compact Flash card. This instruction creates a data table on the CF card. CardOut must be entered within each data table declaration that is to store data on a CF card. The data is saved to the card with a name consisting of the datalogger's StationName (if one is assigned), the DataTable name, and a .DAT extension (stationname.tablename.dat).
Section 6. Data Table Declarations and Output Processing Instructions DSP4 Example DSP4 (Flag( ), 200) Use Flag( ) to work with the buttons, update the DSP4 display every 200 msec. (5 times a second). GOESData (Dest, Table, TableOption, BufferControl, DataFormat) The GOESData instruction is used to transmit data to the SAT HDR GOES satellite data transmitter. The GOESData instruction is not inserted within the Data Table declaration, it is inserted within the program, typically within the scan.
Section 6. Data Table Declarations and Output Processing Instructions Parameter & Data Type Enter BufferControl The BufferControl parameter specifies which buffer should be used (random or self-timed) and whether data should be overwritten or appended to the existing data. Data stored in the self-timed buffer is transmitted only during a predetermined time frame. Data is erased from the transmitter's buffer after each transmission.
Section 6. Data Table Declarations and Output Processing Instructions Remarks The GOESGPS instruction returns two arrays. The first array, which must be dimensioned to 6, holds a result code indicating the success of the instruction, followed by global positioning information.
Section 6. Data Table Declarations and Output Processing Instructions GOESStatus (ResultCode, StatusCommand) The GOESStatus instruction is used to request status and diagnostic information from the SAT HDR GOES satellite transmitter. NOTE When the datalogger sends a command, further processing tasks will be performed only after a response has been received from the HDR GOES Transmitter.
Section 6. Data Table Declarations and Output Processing Instructions Parameter & Data Type DataType Constant DisableVar Constant, Variable, or Expression Enter A code to select the data storage format. Code Data Format IEEE4 IEEE 4 byte floating point FP2 Campbell Scientific 2 byte floating point A non-zero value will disable intermediate processing. Normally 0 is entered so all inputs are processed.
Section 6. Data Table Declarations and Output Processing Instructions FFT (SecArray, DataType, N, SampleInterval, Units, Option) The FFT performs a Fast Fourier Transform on a time series of measurements stored in an array. It can also perform an inverse FFT, generating a time series from the results of an FFT. Depending on the output option chosen, the output can be: 0) The real and imaginary parts of the FFT; 1) Amplitude spectrum.
Section 6. Data Table Declarations and Output Processing Instructions T = N*SampleInterval: the length, in seconds, of the time series. Processing field: “FFT,N,SampleInterval,option”. Tick marks on the x axis are 1/(N*SampleInterval) Hertz. N/2 values, or pairs of values, are output, depending upon the option code. Normalization details: Complex FFT result i, i = 1 .. N/2: ai*cos(wi*t) + bi*sin(wi*t). wi = 2π(i-1)/T.
Section 6.
Section 6. Data Table Declarations and Output Processing Instructions including quotation marks, spaces, and other characters. As an example, the processing description and fieldname description for a Sample instruction might look like the following: Smp,:This is a sample air temp" Smp,: and the opening and closing quotation marks use 7 characters; therefore, there are 58 remaining for the fieldname description.
Section 6. Data Table Declarations and Output Processing Instructions dividing the accumulated total in each bin by the total number of scans. This form of output is also referred to as a frequency distribution. The weighted value histogram does not add a constant to the bin but instead adds the current value of a variable. That variable name is entered as the weighted value. Each time the instruction is executed, the weighted value is added to a bin.
Section 6. Data Table Declarations and Output Processing Instructions Parameter & Data Type BinSelect Variable or Array DataType Constant DisableVar Constant, Variable, or Expression Bins Constant Form Enter The variable that is tested to determine which bin is selected. The Histogram4D instruction requires an array dimensioned with at least as many elements as histogram dimensions. A code to select the data storage format.
Section 6. Data Table Declarations and Output Processing Instructions Histogram4D Output Example 'The example program below is an example of using the Histogram4D 'instruction to calculate a 2 dimensional histogram of RPM distribution vs Gear '\\\\\\\\\\\\\\\\\\\\ VARIABLES and CONSTANTS //////////////////// Public RPM, Gear, Port(4) Dim Bin(2) '\\\\\\\\\\\\\\\\\\\\\\\\ OUTPUT SECTION //////////////////////// DataTable (RPMvsG,1,100) DataInterval(0,60,Min,100) Histogram4D(Bin(), FP2, 0,4,8, 0, 0,000,1,0.
Section 6. Data Table Declarations and Output Processing Instructions LevelCrossing (Source, DataType, DisableVar, NumLevels, SecondDim, CrossingArray, 2ndArray, Hysteresis, Option) Parameter & Data Type Source Variable or Array DataType Constant DisableVar Constant, Variable, or Expression NumLevels Constant SecondDim Constant Crossing Array Array SecondArray Array Hysteresis Enter The variable that is tested to determine if it crosses the specified levels.
Section 6. Data Table Declarations and Output Processing Instructions NumLevels*SecondDim. For a one dimensional level crossing histogram, enter 1 for SecondDim. The source value may be the result of a measurement or calculation. Each time the data table with the Level Crossing instruction is called, the source is checked to see if its value has changed from the previous value and if in any change it has crossed any of the specified crossing levels.
Section 6. Data Table Declarations and Output Processing Instructions The second dimension, when greater than 1, is determined by the value of the element in the source array following the element checked for the crossing. It is the value of this variable at the time the crossings are detected that determines the second dimension. 3.5 3 2.5 2 1.5 1 Crossing Levels Crossing Source 2nd Dim Boundary 2ndDim Source 0.5 0 0 1 2 3 4 5 6 FIGURE 6.4-2.
Section 6. Data Table Declarations and Output Processing Instructions Histogram: Cross 1 Cross 1.5 Cross 3 2D < 1.25 0 0 0 1.25<2D<2.25 1 0 0 2.25<2D<3.25 1 1 1 Note that the first bin of the second dimension is always “open”. Any value less than the specified boundary is included in this bin. The last bin of the second dimension is always “closed”. It only includes values that are less than its upper boundary and greater than or equal to the upper boundary of the previous bin.
Section 6. Data Table Declarations and Output Processing Instructions Parameter & Data Type Reps Constant Source Enter The number of maximum values to determine. When repetitions are greater than 1, the source must be an array. The name of the Variable that is the input for the instruction. Variable DataType Constant DisableVar Constant, Variable, or Expression Time Constant A code to select the data storage format.
Section 6. Data Table Declarations and Output Processing Instructions RainFlow (Source, DataType, DisableVar, MeanBins, AmpBins, LoLim, PuLim, MinAmp, Form) Parameter & Data Type Source Variable DataType Constant DisableVar Constant, Variable, or Expression MeanBins Constant AmpBins Constant LoLim Enter The variable that is tested to determine which bin is selected A code to select the data storage format.
Section 6. Data Table Declarations and Output Processing Instructions that were associated with that bin (i.e., number of cycles in bin divided by total number of cycles counted). The user enters the number of mean bins, the number of amplitude bins, and the upper and lower limits of the input data. The values for the amplitude bins are determined by the difference between the upper and lower limits on the input data and by the number of bins.
Section 6. Data Table Declarations and Output Processing Instructions Sample (Reps, Source, DataType) This instruction stores the current value(s) at the time of output from the specified variable or array. Parameter & Data Type Reps Constant Source Enter The number of values to sample. When repetitions are greater than 1, the source must be an array. The name of the Variable to sample. Variable DataType Constant A code to select the data storage format.
Section 6.
Section 6. Data Table Declarations and Output Processing Instructions Parameter & Data Type DataType Constant DisableVar Constant, Variable, or Expression Enter A code to select the data storage format. Alpha Code Data Format IEEE4 IEEE 4 byte floating point FP2 Campbell Scientific 2 byte floating point A non-zero value will disable intermediate processing. Normally 0 is entered so all inputs are processed. For example, when the disable variable is ≠0 the current input is not included in the total.
Section 6. Data Table Declarations and Output Processing Instructions Parameter & Data Type OutputOpt Constant Enter Value 0 1 2 Outputs (for each rep) 1. Mean horizontal wind speed, S. 2. Unit vector mean wind direction, Θ1. 3. Standard deviation of wind direction, σ(Θ1). Standard deviation is calculated using the Yamartino algorithm. This option complies with EPA guidelines for use with straightline Gaussian dispersion models to model plume transport. 1. Mean horizontal wind speed, S. 2.
Section 6. Data Table Declarations and Output Processing Instructions A sub-interval is specified as a number of scans. The number of scans for a sub-interval is given by: Desired sub-interval (secs) / scan rate (secs) For example if the scan rate is 1 second and the data interval is 60 minutes, the standard deviation is calculated from all 3600 scans when the sub-interval is 0. With a sub-interval of 900 scans (15 minutes) the standard deviation is the average of the four sub-interval standard deviations.
Section 6. Data Table Declarations and Output Processing Instructions Unit vector mean wind direction, Θ1: Θ1=Arctan (Ux/Uy) where Ux=(Σsin Θi)/N Uy=(Σcos Θi)/N or, in the case of orthogonal sensors Ux=(Σ(Uei/Ui))/N Uy=(Σ(Uni/Ui))/N where Ui=(Uei2+Uni2)1/2 Standard deviation of wind direction, σ(Θ1), using Yamartino algorithm: σ(Θ1)=arc sin(ε)[1+0.1547 ε3] where, ε=[1-((Ux)2+(Uy)2)]1/2 and Ux and Uy are as defined above. Resultant mean horizontal wind speed, U : 2 U =(Ue Un +Un2)1/2 U Ue FIGURE 6.4-4.
Section 6. Data Table Declarations and Output Processing Instructions The algorithm for σ(θu) is developed by noting (Figure 6.4-4) that Cos (Θi ') = Ui / si ; where Θi ' = Θi − Θu U Ui Θu Θ'i si FIGURE 6.4-5. Standard Deviation of Direction The Taylor Series for the Cosine function, truncated after 2 terms is: Cos (Θi ') ≅ 1 − (Θi ') 2 / 2 For deviations less than 40 degrees, the error in this approximation is less than 1%. At deviations of 60 degrees, the error is 10%.
Section 6. Data Table Declarations and Output Processing Instructions The term, ∑ ((Θ ' ) i 2 si ' ) / NS , is 0 if the deviations in speed are not correlated with the deviation in direction. This assumption has been verified in tests on wind data by CSI; the Air Resources Laboratory, NOAA, Idaho Falls, ID; and MERDI, Butte, MT. In these tests, the maximum differences in σ (Θu) = ( ∑ (Θ i ' ) 2 / N )1/ 2 and σ (Θu) = ( 2(1 − U / S ))1/ 2 have never been greater than a few degrees.
Section 6. Data Table Declarations and Output Processing Instructions This is a blank page.
Section 7. Measurement Instructions 7.1 Voltage Measurements VoltDiff – Differential Voltage Measurement............................................. 7-3 VoltSE – Single-ended Voltage Measurement ............................................ 7-3 7.2 Thermocouple Measurements Measure the Output of Thermocouples and Convert to Temperature. TCDiff – Differential Voltage Measurement of Thermocouple .................. 7-3 TCSE – Single-ended Voltage Measurement of Thermocouple..................
Section 7. Measurement Instructions PortGet - Reads the status of one of the eight control ports....................... 7-19 PortSet – Sets Digital Ports........................................................................ 7-20 PulseCount – Pulse/Frequency Measurement............................................ 7-20 PulseCountReset - Resets Pulse Counters and Running Averages Used in Pulse Count Instruction ........................................................ 7-23 PulsePort .........................
Section 7. Measurement Instructions 7.1 Voltage Measurements VoltDiff (Dest, Reps, Range, DiffChan, RevDiff, SettlingTime, Integ, Mult, Offset) Diff. Channel H Sensor Diff. Channel L. This instruction measures the voltage difference between the high and low inputs of a differential channel. Both the high and low inputs must be within ± 5V of the datalogger's ground (See Common Mode Range, Section 3.2).
Section 7. Measurement Instructions to reference voltages prior to making the voltage measurement to insure that it is within the common mode range and to test for an open thermocouple. TCSE (Dest, Reps, Range, SEChan, TCType, TRef, MeasOff, SettlingTime, Integ, Mult, Offset) S.E. Channel Ground Thermocouple This instruction measures a thermocouple with a single-ended voltage measurement and calculates the thermocouple temperature (°C) for the thermocouple type selected.
Section 7. Measurement Instructions Parameter & Data Type Enter TRef The name of the variable that is the reference temperature for the thermocouple measurements. Code Value Result (Reversing requires twice as much time to complete) Signal is measured with the high side referenced to the low False 0 A second measurement is made after reversing the inputs to cancel True ≠0 offsets Code Value Result the Ground offset voltage is subtracted from single ended measurements.
Section 7. Measurement Instructions BrHalf3W (Dest, Reps, Range, SEChan, ExChan, MeasPEx, ExmV, RevEx, SettlingTime, Integ, Mult, Offset) X = result w/mult = 1, offset = 0 X= 2V2 − V1 R s = Vx − V1 Rf This Instruction is used to determine the ratio of the sensor resistance to a known resistance using a separate voltage sensing wire from the sensor to compensate for lead wire resistance.
Section 7. Measurement Instructions Half Bridge Parameters Parameter & Data Type Dest Variable or Array Reps Enter The Variable in which to store the results of the instruction. When Reps are used the results are stored in an array with the variable name. An array must be dimensioned to have elements for all the Reps. The number of repetitions for the measurement or instruction.
Section 7. Measurement Instructions Parameter & Data Type Integ Constant Mult, Offset Enter The time spent on integration in microseconds for each of the channels measured. Integration Entry 250 µS 250 16,667 µS (reject 60 Hz noise) _60Hz or 16667 20,000 µS (reject 50 Hz noise) _50 Hz or 20000 A multiplier and offset by which to scale the raw results of the measurement. Constant, Variable, Array, or Expression 7.
Section 7. Measurement Instructions This Instruction applies an excitation voltage and makes two differential voltage measurements. The measurements are made on sequential channels. The result is the voltage measured on the second channel (V2) divided by the voltage measured on the first (V1). The result is 1000 times V2 / V1 or millivolts output per volt of excitation.
Section 7. Measurement Instructions Parameter & Data Type SettlingTime Constant Integ Constant Mult, Offset Enter The time in microseconds to delay between setting up a measurement (switching to the channel, setting the excitation) and making the measurement. (1 microsecond resolution) Voltage Range Integration Settling Time Entry All 250 µS 450 µS (default) 0 All _50Hz, _60 Hz 3 mS (default) 0 All All µS entered >=100 The time spent on integration in microseconds for each of the channels measured.
Section 7. Measurement Instructions ExciteI ( IxChan, IxuA, Delay ) This instruction sets the specified switched current excitation channel to the current specified. Parameter & Data Type IxChan Constant Ixu Constant Delay Constant Variable or Expression NOTE Enter Enter the current excitation channel to use for the first measurement. If the Reps parameter is greater than 1, the excitation channel used for subsequent measurements will be incremented with each measurement based on the MeasPEx parameter.
Section 7. Measurement Instructions SW12 (SW12Channel, State) The SW12 instruction is used to set a Switched 12-volt supply high or low. The datalogger has two switched 12-volt outputs, each with two terminals. This switched 12 volts is used to provide a continuous 12-volt supply to external peripherals. At room temperature the switched 12-volt supply can source 900 mA between the SW-12 terminal and Ground. The State parameter indicates whether the switched 12 volts is High (non-zero) or low (0).
Section 7. Measurement Instructions Parameter & Data Type Dest Array Range Enter If present the array must contain at least 60 elements (more if excitation is used in the program. With no parameters no data are returned. Option to calibrate ranges not being used.
Section 7. Measurement Instructions The Calibration instruction can occur in a fast scan or in a slow sequence scan. In a fast scan the entire calibration is completed at once. In a slow sequence scan the calibration measurements are separated into sections that can be spliced on to the end of fast sequence scans. If it is necessary to update the calibration more rapidly than is done by the background calibration, try running the Calibrate instruction in the fast scan with the measurements.
Section 7.
Section 7. Measurement Instructions Note that the execution time for an instruction may vary. For instance, it will take longer to execute instructions when the datalogger is communicating with another device. PanelTemp (Dest, Integ) This instruction measures the datalogger’s panel temperature, giving the result in °C. Parameter & Data Type Dest Variable Integ Constant NOTE Enter The Variable in which to store the results of the instruction.
Section 7. Measurement Instructions Parameter & Data Type Dest Variable or Array Reps Enter The Variable in which to store the results of the instruction. When Reps are used the results are stored in an array with the variable name. An array must be dimensioned to have elements for all the Reps. The number of repetitions for the instruction on adjacent channels.
Section 7. Measurement Instructions The minimum pulse width requirements increase (maximum frequency decreases) with increasing gain as shown in range parameter. Signals larger than the specified maximum for a range will saturate the gain stages and prevent operation up to the maximum specified frequency. Back-to-back diodes, Figure 7.7-1, are recommended to limit large amplitude signals to within the input signal ranges.
Section 7. Measurement Instructions these back-to-back diodes. A current limiting resistor may be desirable to minimize these currents in some situations. The current flow through these clipping diodes may also induce single-ended offset voltages if it returns into the ground terminals. Single-ended offset voltages of up to 2 µV/mA of current that flows into the ground terminals can be induced across the front panel.
Section 7. Measurement Instructions PortSet (Port, State) This Instruction will set the specified digital I/O port or switched 12V channel high or low.
Section 7. Measurement Instructions Parameter & Data Type Dest Variable or Array Reps Constant PChan Constant PConfig Constant POption Constant Mult, Offset Constant, Variable, Array, or Expression NOTE Enter The Variable in which to store the results of the instruction. When Reps are used the results are stored in an array with the variable name. An array must be dimensioned to have elements for all the Reps. The number of repetitions for the measurement or instruction.
Section 7. Measurement Instructions CR23X CR3000 20k Pi FIGURE 7.7-2. Conditioning Large Voltage Pulses The maximum input voltage on a pulse channel is ±20 V. Refer to Figure 7.7-2 if reducing input voltage is required. • Pulse Channels Maximum Input Voltage: ±20 V High Frequency Input • Pulse Channels Minimum Pulse Width: 1.2 microsecond Maximum Frequency: 250 kHz (50% Duty Cycle) Lower Threshold: 0.9 V* Upper Threshold: 2.
Section 7. Measurement Instructions Switch Closure • Pulse Channels A switch closure is connected between P1..P4 and analog ground. When the switch is open, the CR3000 pulls the pulse channel to 5 V through a 100 kOhm impedance. When the switch is closed, the pulse channel is pulled to ground. The count is incremented when the switch opens.
Section 7. Measurement Instructions port (the mask is "anded" with the port status; the "and" operation returns a 1 for a digit if the mask digit and the port status are both 1 and a 0 if either or both is 0). CRBasic allows the entry of numbers in binary format by preceding the number with "&B".
Section 7. Measurement Instructions RC! R0! - R9! V! X! Continuous measurement (with checksum) Continuous measurement commands Initiate verify sequence Extended commands (destination variable must be formatted as a string) Values from the public table can be sent to the sensor using the following command: "XD%variable_name%!" Multiple values from an array can be sent by preceding the array name with the number of values to send (e.g.
Section 7. Measurement Instructions Parameter & Data Type SEChan ExChan StartFreq EndFreq TSweep Steps DelMeas NumCycles DelReps Mult, Offset Enter The SEChan argument is the number of the single-ended channel on which to make the first measurement. If the Reps parameter is greater than 1, the additional measurements will be made on sequential channels. If the SEChan number is entered as a negative value, all Reps will be performed on the same channel.
Section 7. Measurement Instructions the mask is entered as &B110 (leading zeros can be omitted in binary format just as in decimal) and the source is 5 decimal (binary 101) port 3 will be set high and port 2 will be set low. The mask indicates that only 3 and 2 should be set. While the value of the source also has a 1 for port 1, it is ignored because the mask indicates 1 should not be changed. Example WriteIO (&B100, &B100) Parameter & Data Type Mask Constant Source Constant Variable ' Set port 3 high.
Section 7. Measurement Instructions Parameter & Data Type MeasPerPort Mult, Offset Enter The MeasPerPort parameter is the number of control ports to be used to control the CS616 sensor(s). If Reps is set to 4, MeasPerPort = 4 will result in the same port being used for all measurements. MeasPerPort = 1 will result in four sequential ports being used for the measurements.
Section 7. Measurement Instructions SlowAntenna See CS110 manual. Therm107 (Dest, Reps, SEChan, ExChan, SettlingTime, Integ, Mult, Offset) Therm108 (Dest, Reps, SEChan, ExChan, SettlingTime, Integ, Mult, Offset) Therm109 (Dest, Reps, SEChan, ExChan, SettlingTime, Integ, Mult, Offset) The Therm107, Therm108, and Therm109 instructions are used to measure the 107, 108, and109 thermistors, respectively. The syntax for all three instructions is the same.
Section 7. Measurement Instructions 7.9 Peripheral Devices AM25T (Dest, Reps, Range, AM25TChan, DiffChan, TCType, Tref, ClkPort, ResPort, ExChan, RevDiff, SettlingTime, Integ, Mult, Offset) This Instruction controls the AM25T Multiplexer. Parameter & Data Type Dest Variable or Array Reps Range Constant Am25TChan Constant DiffChan Constant TCType Constant Tref Variable ClkPort Constant ResPort Constant ExChan Constant Enter The Variable in which to store the results of the instruction.
Section 7.
Section 7. Measurement Instructions Parameter & Data Type CS7500Cmd Enter The CS7500Cmd parameter requests the data to be retrieved from the sensor. The command is sent first to the device specified by the SDMAddress parameter. If the Reps parameter is greater than 1, subsequent CS7500s will be issued the command with each rep. The results for the command will be returned in the array specified by the Dest parameter.
Section 7. Measurement Instructions Parameter & Data Type CSAT3Cmd CSAT3Opt Enter Commands 90 - 92 send a measurement trigger to the CSAT3 with the SDM address specified by the SDMAddress argument. The CSAT3 also sends data to the datalogger. Options 97 - 99 get data after a group trigger, SDMTrigger(), from the CSAT3 specified by the SDMAddress parameter without triggering a new CSAT3 measurements. The CSAT() instruction must be preceded by the SDMTrigger() instruction in order to used Options 97 - 99.
Section 7. Measurement Instructions Parameter & Data Type Enter SDMAddress Constant The SDMAddress parameter defines the address of the SDM-AO4 to which a voltage should be applied. Valid SDM addresses are 0 through 14. Address 15 is reserved for the SDMTrigger instruction. The SDM address is entered as a base 10 number, unlike older, jumpersettable SDM instruments that used base 4.
Section 7. Measurement Instructions Parameter & Data Type TimeQuanta Integer Enter Three time segments are used to set the bit rate and other timing parameters for the CAN-bus network, TimeQuanta, TSEG1, and TSEG2. These parameters are entered as integer numbers. The relationship between the three time segments is defined as: t bit = t q + t TSEG1 + t TSEG 2 The first time segment, the synchronization segment (S-SG), is defined by the TimeQuanta parameter.
Section 7.
Section 7. Measurement Instructions Parameter & Data Type Enter 27 28 29 30 31 32 Read Transmit, Receive, Overrun, and Watchdog errors. The errors are placed consecutively in the array specified by the Dest parameter. Read Transmit, Receive, Overrun, and Watchdog errors. The errors are placed consecutively in the array specified by the Dest parameter. Reset error counters to 0 after reading. Read SDM-CAN status; result is placed into the array specified in the Dest parameter.
Section 7. Measurement Instructions Parameter & Data Type Enter 2 StartBit 7-38 Self-reception. A frame transmitted from the SDM-CAN that was acknowledged by an external node will also be received by the SDM-CAN but no retransmission will occur in the event of loss of arbitration or error. Frames received correctly from an external node are acknowledged. 3 Normal, retransmission will occur in the event of loss of arbitration or error. Frames received correctly from an external node are acknowledged.
Section 7. Measurement Instructions Parameter & Data Type NumBits Enter The NumBits parameter is used to specify the number of bits that will be used in a transaction. The number can range from 1 to 64 (there are 64 bits in a CAN data frame). The SDM-CAN can be configured to notify the datalogger when new data is available by setting a control port high. This allows data to be stored in the datalogger tables faster than the program execution interval.
Section 7.
Section 7. Measurement Instructions Parameter & Data Type Dest Variable or Array SDMAddress Constant Config8_5 Config4_1 Constants Funct8_5 Funct4_1 Constants Enter The array where the results of the instruction are stored. For all output options except Capture All Events, the Dest argument should be a one-dimensional array with as many elements as there are programmed INT8 channels. If the "Capture All Events" OutputOption is selected, then the Dest array must be two dimensional.
Section 7. Measurement Instructions Parameter & Data Type OutputOpt Enter Code to select one of the five different output options. The Output Option that is selected will be applied to the data collection for all of the INT8 channels. The numeric code for each option is listed below with a brief explanation of each. See the INT8 manual for detailed explanations of each option.
Section 7. Measurement Instructions SDMIO16 (Dest, Status, Address, Command, Mode Ports 16-13, Mode Ports 12-9, Mode Ports 8-5, Mode Ports 4-1, Mult, Offset) The SDMIO16 instruction is used to set up and measure an SDM-IO16 control port expansion device. The ports on the SDM-IO16 can be configured for either input or output. When configured as input, the SDM-IO16 can measure the logical state of each port, count pulses, and measure the frequency of and determine the duty cycle of applied signals.
Section 7.
Section 7.
Section 7. Measurement Instructions Parameter & Data Type Enter 90 91 Mode Constant or Variable Mult, Offset 7-46 Set port 16-1 from Mode parameters Read state of ports 1-16 into one variable (Dest). The result is a 16 bit decimal representation from 0-65535. 92 Read state of ports 1-16 into 16 separate variables (Dest must be dimensioned to 16). Dest(1) holds the state of port 1, Dest(2) port 2, etc. State is represented by 0 or 1. 93 Set state of ports 1-16 from a single variable (Dest).
Section 7. Measurement Instructions SDMSIO4 (Dest, Reps, SDMAddress, Mode, Command, Param1, Param2, ValuesPerRep, Multiplier, Offset) The SDMSIO4 instruction is used to control and transmit/retrieve data from a Campbell Scientific SDM-SIO4 Interface (4 Channel Serial Input/Output device). See the SDM-SIO4 Serial Input Interface manual for operation details. For instructions used for serial input and output without the SDM-SIO4, see Section 12.
Section 7. Measurement Instructions Parameter & Data Type Param1 Param2 ValuesPerRep Mult, Offset Enter 9 Flush converted data buffer. 66 Send single-byte data to datalogger. 67 Get return code. 320 Send byte data to SDM-SIO4. 321 Execute command line command. 1024 Send string to SIO4. 1025 Transmit a byte. 1026 Serial port status. 1027 Manual handshake mode. 2049 Communication parameters. 2054 Set up receive filter. 2304 Transmit string and/or data to device (formatter/filter). 2305 Transmit bytes.
Section 7. Measurement Instructions Parameter & Data Type Dest Variable or Array Reps Constant SDMAddress Constant FunctOp Constant StartChan Constant Mult, Offset Constant, Variable, Array, or Expression Enter The variable in which to store the results of the SW8A measurement. The variable array for this parameter must be dimensioned to the number of Reps. The number of channels that will be read on the SW8A.
Section 7. Measurement Instructions SDMX50 (SDMAddress, Channel) SDMX50 allows individual multiplexer switches to be activated independently of the TDR100 Instruction. SDMX50 is useful for selecting a particular probe to troubleshoot or to determine the apparent cable length.
Section 7. Measurement Instructions Parameter & Data Type Option Constant or Variable Mux/ ProbeSelect WaveAvg Constant Vp Constant Points Constant or Variable CableLength Constant or Variable Enter The Option parameter determines the output of the instruction. Code Description 0 Measure La/L (ratio of apparent to physical probe rod length) 1 Collect Waveform values - Outputs reflection waveform values as an array of floating point numbers with a range of -1 to 1.
Section 7. Measurement Instructions Parameter & Data Type WindowLength Constant or Variable ProbeLength Constant or Variable ProbeOffset Constant or Variable Mult, Offset 7-52 Enter The WindowLength parameter specifies the length, in meters, of the waveform to collect or analyze. The waveform begins at the CableLength and ends at the CableLength + WindowLength. This is an apparent length because the value set for Vp may not be the actual propagation velocity.
Section 8. Processing and Math Instructions Operators ^ * / + = <> > < >= <= Raise to Power Multiply Divide Add Subtract Equals Not Equal Greater Than Less Than Greater Than or Equal Less Than or Equal ABS (Number) Returns the absolute value of a number. Syntax x = ABS (number) Remarks Number can be any valid numeric expression. The absolute value of a number is its unsigned magnitude. For example, ABS(-1) and ABS(1) both return 1.
Section 8. Processing and Math Instructions EndIf Loop 'X is now the cube root of Volt1 NextScan EndProg ACOS (Number) The ACOS function returns the arc cosine of a number. Syntax x = ACOS (Number) Remarks The number can be any valid numeric expression that has a value between -1 and 1 inclusive. The ACOS function takes the ratio of two sides of a right triangle and returns the corresponding angle. The ratio is the length of the side adjacent to the angle divided by the length of the hypotenuse.
Section 8. Processing and Math Instructions X The X variable is the value that will be added to the PrecisionVariable. It may or may not be a high precision variable, depending upon whether it has been declared as such in a previous AddPrecise or MovePrecise instruction. AND Used to perform a logical conjunction on two expressions. Syntax result = expr1 And expr2 Remarks If, and only if, both expressions evaluate True, result is True. If either expression evaluates False, result is False.
Section 8. Processing and Math Instructions ASIN (Number) The ASIN function returns the arc sine of a number. Syntax x = ASIN (number) Remarks Number can be any valid numeric expression that has a value between -1 and 1 inclusive. The ASIN function takes the ratio of two sides of a right triangle and returns the corresponding angle. The ratio is the length of the side opposite to the angle divided by the length of the hypotenuse. The result is expressed in radians and is in the range -π/2 to π/2 radians.
Section 8. Processing and Math Instructions ATN FunctionExample The example uses ATN to calculate π. By definition, a full circle is 2π radians. ATN(1) is π/4 radians (45 degrees). Dim Pi Pi = 4 * Atn(1) 'Declare variables. 'Calculate Pi. ATN2(Y, X) The ATN2 function returns the arc tangent of y/x.
Section 8. Processing and Math Instructions AvgRun (Dest, Reps, Source, Number) Calculates a running average of a measurement or calculated value. Syntax AvgRun (Dest, Reps, Source, Number) Remarks AvgRun is used to create a running average. A running average is the average of the last N values where N is the number of values. ∑ Dest = i= N i =1 Xi N Where X N is the most recent value of the source variable and X N −1 is the previous value ( X 1 is the oldest value included in the average, i.e.
Section 8. Processing and Math Instructions Remarks Find the average of the values in the given array and place the result in the variable named in Dest. The Source must be a particular element in an array (e.g., Temp(1)); it is the first element in the array to include in the average. The Swath is the number of elements to include in the average.
Section 8. Processing and Math Instructions COSH (Expression) The COSH function returns the hyperbolic cosine of an expression or value. Syntax x = COSH (expression) Remarks The COSH function takes a value and returns the hyperbolic cosine [COSH(x) = 0.5(ex + e-x)] for that value. COSH Function Example The example uses COSH to calculate the hyperbolic cosine of a voltage input and store the result in the Ans variable. Public Volt1, Ans 'Declare variables.
Section 8. Processing and Math Instructions Parameter & Data Type Dest Variable or Array NumOfCov Constant SizeOfSets Constant CoreSet Array DataSets Array Enter The Variable in which to store the results of the instruction. When multiple covariances are calculated, the results are stored in an array with the variable name. An array must be dimensioned to at least the value of NumOfCov. The number of covariances to be calculated.
Section 8. Processing and Math Instructions Dew point temperature is calculated as follows: 1. The saturation vapor pressure (Svp; units kPa) is calculated using Lowe’s equation (see SatVP). 2. The vapor pressure (Vp; units kPa) is calculated from Vp = RH ∗ Svp / 100). 3. The dew point (Td; units °C) is calculated from the inverse of a version of Tetens’ equation, optimized for dewpoints in the range -35 to 50°C: Td = (C3 ∗ ln(Vp / C1)) / (C2 . ln(Vp / C1)) where: C1 = 0.61078 C2 = 17.558 C3 = 241.
Section 8. Processing and Math Instructions FIGURE 8-1. Dew Point Temperature over the RH Range for Selected Air Temperatures FIGURE 8-2. Effect of RH Errors on Calculated Dew Point (±5 RH Unit Error at Three Air Temperatures) EXP Returns e (the base of natural logarithms) raised to a power. Syntax x = EXP (number) Remarks If the value of the number argument exceeds 709.782712893, an overflow error occurs. The constant e is approximately 2.718282.
Section 8. Processing and Math Instructions NOTE The EXP function complements the action of the Log function and is sometimes referred to as the antilogarithm. Exp FunctionExample The example uses Exp to calculate the value of e. Exp(1) is e raised to the power of 1. 'Exp(x) is ex so Exp(1) is e1 or e. Dim ValueOfE BeginProg ValueOfE = Exp(1) EndProg 'Declare variables. 'Calculate value of e.
Section 8. Processing and Math Instructions Parameter & Data Type Options Constant Enter A code to indicate what values to calculate and output. Code Result 0 FFT. The output is N/2 complex data points, i.e., the real and imaginary parts of the FFT. The first pair is the DC component and the Niquist component. This first pair is an exception because the DC and Niquist components have no imaginary part. 1 Amplitude spectrum. The output is N/2 magnitudes. With Acos(wt); A is magnitude.
Section 8. Processing and Math Instructions • The sum of the AC bins (excluding DC) of the Power Spectrum is the Variance (AC Power) of the time series. • The factor of 2 in the Power(i) calculation is due to the power series being mirrored about the Niquist frequency N/(2*T); only half the power is represented in the FFT bins below N/2, with the exception of DC. Hence, DC does not have the factor of 2. • The Inverse FFT option assumes that the data array input is the transform of a real time series.
Section 8. Processing and Math Instructions IfTime The IfTime instruction is used to return a number indicating True (-1) or False (0) based on the datalogger's real-time clock. See also TimeIntoInterval. Syntax IfTime (TintoInt, Interval, Units) The IfTime function returns True (-1) or False (0) based on the scan clock. Time is kept internally by the datalogger as the elapsed time since January 1, 1990, at 00:00:00 hours. The interval is synchronized with this elapsed time (i.e.
Section 8. Processing and Math Instructions IIF (Expression, TrueValue, FalseValue) Evaluates a variable or expression and returns one of two results based on the outcome of that evaluation. Syntax Result = IIF(Expression, TrueValue, FalseValue) Parameter & Data Type Expression Expression or Variable TrueValue Constant Variable or Expression FalseValue Constant Variable or Expression Enter The Variable or expression to test.
Section 8. Processing and Math Instructions INT, FIX Returns the integer portion of a number. Syntax x = INT (Number) x = FIX (Number) Remarks The source can be any valid numeric expression. Both INT and FIX remove the fractional part of source and return the resulting integer value. If the numeric expression results in a Not-a-Number, INT and FIX return a Not-a-Number (NAN).
Section 8. Processing and Math Instructions The following example illustrates a procedure that calculates base-10 logarithms: Log10 = Log(X) / Log(10) Log Function Example The example calculates the value of e, then uses the Log function to calculate the natural logarithm of e to the first, second, and third powers. Dim I, M BeginProg M = Exp(1) For I = 1 To 3 M =Log(Exp(1) ^ I) Next I EndProg 'Declare variables. 'Do three times. LOG10 (number) The LOG10 function returns the base 10 logarithm of a number.
Section 8. Processing and Math Instructions Remarks Finds the maximum value in the given array and places the result in the variable named in Dest. The Source must be a particular element in an array (e.g., Temp(1)); it is the first element in the array Parameter & Data Type Dest Variable Swath Constant Source Array Enter The variable in which to store the maximum. The number of values of the source array in which to search for the maximum.
Section 8. Processing and Math Instructions Mod Divides two numbers and returns only the remainder. Syntax result = operand1 Mod operand2 Remarks The modulus, or remainder, operator divides operand1 by operand2 (rounding floating-point numbers to integers) and returns only the remainder as result. For example, in the expression A = 19 Mod 6.7, A (which is result) equals 5.6. The operands can be any numeric expression.
Section 8. Processing and Math Instructions Move Function Example The example uses the Move function. Move(x, 20, y, 20) Move(x, 20, 0.0, 1) 'move array y into array x 'fill x with 0.0. MovePrecise (PrecisionVariable, X) Moves a high precision variable into another input location. Syntax MovePrecise ( PrecisionVariable, X ) Remarks In this function, the variable X is moved into the PrecisionVariable as a high precision value.
Section 8. Processing and Math Instructions The NOT operator also inverts the bit values of any variable and sets the corresponding bit in result according to the following truth table: If bit in expr1 is The result is 0 1 1 0 NOT Operator Example The example sets the value of the variable Msg depending on the state of Flag(1). Dim A, B, C, Flag(8) Public Msg If NOT Flag(1) Then Msg = 10 Else Msg = 100. End If 'Declare variables. 'Evaluate expressions.
Section 8. Processing and Math Instructions OR Operator Example The example sets Msg that depends on the value of variables A, B, and C, assuming that no variable is a Null. If A = 10, B = 8, and C = 11, the left expression is True and the right expression is False. Because at least one comparison expression is True, the OR expression evaluates True Dim A, B, C A = 10: B = 8: C = 11 If A > B OR B > C Then Msg = True Else Msg = False. End If 'Declare variables. 'Assign values. 'Evaluate expressions.
Section 8. Processing and Math Instructions Public Dim XY(2) Public Change(3), Deg, PeakV(2) Const Pi=4*ATN(1) DataTable(PV1,Change(1),500) Sample(1,PeakV(1),IEEE4) ‘Define Pi for converting degrees to radians ‘Peaks and valleys for first signal, triggered when ‘Change(1) is not 0. ‘DataTable PV1 holds the peaks and valleys for XY(1) EndTable DataTable(PV2,Change(2),500) Sample(1,PeakV(2),IEEE4) ‘Peaks and valleys for second signal, triggered when ‘Change(2) is not 0.
Section 8. Processing and Math Instructions PRT (Dest, Reps, Source, Mult, Offset) Calculates temperature from the resistance of an RTD. Syntax PRT (Dest, Reps, Source, Mult, Offset) Remarks This instruction uses the result of a previous RTD bridge measurement to calculate the temperature. The input (Source) must be the ratio Rs/R0, where Rs is the RTD resistance and R0 the resistance of the RTD at 0° C.
Section 8. Processing and Math Instructions RealTime Used to pick out year, month, day, hour, minute, second, usecond, day of week, and day of year from the CR3000 clock. Syntax RealTime(Dest) Remarks The destination array must be dimensioned to 9. RealTime Example This example uses RealTime to place all time segments in the Destination array. If the remark (‘) is removed from the first 8 Sample statements and the last Sample statement is remarked, the results will be exactly the same.
Section 8. Processing and Math Instructions RectPolar (Dest, Source) Converts from rectangular to polar coordinates. Parameter & Data Type Dest Variable array Source Variable Array Enter Variable array in which to store the 2 resultant values. The length of the vector is stored in the specified destination element and the angle, in radians(± π), in the next element of the array The variable array containing the X and Y coordinates to convert to Polar coordinates.
Section 8. Processing and Math Instructions RMSSpa (Dest, Swath, Source) Used to compute the root mean square (RMS) value of an array. Syntax RMSSpa(Dest, Swath, Source) Remarks Spatial RMS, Calculate the root mean square of values in an array. i = j + swath Dest = ∑ ( X (i)) 2 i= j swath Where X(j) = Source Parameter & Data Type Dest Variable Swath Constant Source Array Enter The variable in which to store the RMS value. The number of values of the array to include in the RMS calculation.
Section 8. Processing and Math Instructions SatVP (Dest, Temp) Calculates saturation vapor pressure over water (Svpw) in kilopascals from the air temperature (°C) and places it in the destination variable. The algorithm for obtaining Svpw from air temperature (°C) is taken from: Lowe, Paul R.: 1977, “An approximating polynomial for computation of saturation vapor pressure,” J. Appl. Meteor, 16, 100-103.
Section 8. Processing and Math Instructions If X = 0, then Sgn(X) = 0. If X < 0, then Sgn(X) = -1. SGN Function Example The example uses SGN to determine the sign of a number. Dim Msg, Number, Volt BeginProg Number = Volt(1) Select Case Sgn(Number) Case 0 'Zero. Msg = 0 Case 1 'Positive. Msg = 1 Case -1 'Negative. Msg = -1 EndSelect EndProg 'Declare variables. 'Get user input. 'Evaluate Number. SIN (Angle) Returns the sine of an angle.
Section 8. Processing and Math Instructions SINH (NumericExpression) The SINH function returns the hyperbolic sine of an expression or value. Syntax x = SINH (NumericExpression) Remarks The SINH function returns the hyperbolic sine [ SINH(x) = 0.5( ex - e-x ) ] for the value contained in the NumericExpression argument. The example uses SINH to calculate the hyperbolic sine of a voltage input. Public Volt1, Ans 'Declare variables.
Section 8. Processing and Math Instructions StdDevSpa (Dest, Swath, Source) Used to find the standard deviation of an array. Syntax StdDevSpa(Dest, Swath, Source) Remarks The spatial standard deviation is calculated as 1 2 ⎞2 ⎛⎛i = j + swath ⎞ ⎛i = j + swath ⎞ 2 Dest = ⎜⎜ ∑ X (i ) − ⎜ ∑ X (i ) ⎟ / swath ⎟ / swath ⎟ ⎝ i= j ⎠ ⎠ ⎠ ⎝⎝ i = j Where X(j) = Source Parameter & Data Type Dest Variable or Array Swath Constant Source Array Enter The variable in which to store the results of the instruction.
Section 8. Processing and Math Instructions Parameter & Data Type BrZero Variable BrConfig Constant Enter The variable array that holds the unstrained reading(s) in millivolts out per volt in. This value will be subtracted from subsequent strain readings so that the strain output values will be relative to the zero condition. Bridge configuration code for strain gages The bridge configuration code can be entered as a positive or negative number: + code: Vr = 0.
Section 8. Processing and Math Instructions StrainCalc Example This example uses StrainCalc to find the microstrain value of a bridge output. ' Program name: STRAIN.
Section 8. Processing and Math Instructions TAN (Angle) Returns the tangent of an angle. Syntax x = TAN (Angle) Remarks The angle argument can be any valid numeric expression measured in radians. TAN takes an angle and returns the ratio of two sides of a right triangle. The ratio is the length of the side opposite an angle divided by the length of the side adjacent to the angle. To convert degrees to radians, multiply degrees by π/180. To convert radians to degrees, multiply radians by 180/π.
Section 8. Processing and Math Instructions TimeIntoInterval (TintoInt, Interval, Units) The TimeIntoInterval (or IfTime) instruction is used to return a logic level of True or False based on the datalogger's real-time clock. See also IfTime.
Section 8. Processing and Math Instructions VaporPressure (Dest, Temp, RH) The VaporPressure instruction calculates the ambient vapor pressure (Vp) from previously measured values for air temperature and RH. The instruction first calculates saturation vapor pressure from air temperature using Lowe’s equation (see SatVP).
Section 8. Processing and Math Instructions Parameter & Data Type Pressure Variable or Constant Enter The variable containing atmospheric pressure (kPa). XOR Performs a logical exclusion on two expressions. Syntax result = expr1 XOR expr2 Remarks If only one of the expressions evaluates True, result is True. If either expression is a Null, result is also a Null.
Section 8. Processing and Math Instructions XOR Operator Example The example sets the variable Msg based on the value of variables A, B, and C, assuming that no variable is a Null. If A = 10, B = 8, and C = 11, the left expression is True and the right expression is False. Because only one comparison expression is True, the XOR expression evaluates True. Dim A, B, C A = 10: B = 8: C = 11 If A > B XOR B > C Then Msg = True Else Msg = False. End If 'Declare variables. 'Assign values. 'Evaluate expressions.
Section 8. Processing and Math Instructions This is a blank page.
Section 9. Program Control Instructions BeginProg … EndProg The BeginProg instruction is used to mark the beginning of a program. EndProg marks the end of a program. Syntax BeginProg ... ... EndProg Remarks All of the instructions for the main program fall between the BeginProg and EndProg statements. Program Variables, DataTables, and Subroutines must be defined before the main program.
Section 9. Program Control Instructions 'Main program - Read datalogger real-time clock 'Measure 2 pulse count channels and Call DataTable BeginProg Scan (1,Sec,3,0) RealTime (TIME) PulseCount (WINDSP,1,1 ,1,1,1.0,0) PulseCount (RAIN,1,2,2,0,1.0,0) CallTable METDATA NextScan EndProg Call The Call statement is used to transfer program control from the main program to a subroutine. Syntax Call Name(Arguments) Remarks Use of the Call keyword when calling a subroutine is optional.
Section 9. Program Control Instructions CallTable Used to call a data table. Syntax CallTable Name Remarks CallTable is used in the main program to call a DataTable. DataTables are listed in the declaration section of the program prior to BeginProg. When the DataTable is called, it will process data as programmed and check the output condition. CallTable Example This example uses CallTable to call the ACCEL table. CallTable ACCEL Data … Read … Restore Used to mark the beginning of a data list.
Section 9. Program Control Instructions This next example uses Restore to read 1, 2, 3, 4 into both X( ) and Y( ) variables. Data 1, 2, 3, 4 For I = 1 To 4 Read X( I ) Next I Restore For I = 1 To 4 Read Y( I ) Next I ClockSet (Source) Sets the CR3000 clock from the values in an array. The most likely use for this is where the CR3000 can input the time from a more accurate clock than its own (e.g., a GPS receiver).
Section 9. Program Control Instructions Parameter & Data Type DelayOption Constant Delay Constant Units Constant Enter Code 0 Result Delay will affect the measurement task sequence. Processing will continue to take place as needed in the background. When this option is chosen, the Delay instruction must not be placed in a conditional statement. 1 Delay will affect processing. Measurements will continue as called for by the task sequencer. The numeric value for the time delay. The units for the delay.
Section 9. Program Control Instructions Often used with the evaluation of some condition (for example, If...Then), Exit Do transfers control to the statement immediately following the Loop. When Do...Loop statements are nested, control is transferred to the Do...Loop that is one nested level above the loop in which the Exit Do occurs. Loop Ends a Do...Loop. Do...Loop Statement Example The example creates an infinite Do...Loop that can be exited only if Volt(1) is within a range.
Section 9. Program Control Instructions The FileManage instruction has the following parameters: Parameter & Data Type Device; Filename Text Attribute Constant Enter The "Device:Filename" argument is the file that should be manipulated. The Device on which the file is stored must be specified and the entire string must be enclosed in quotation marks. Device = CPU, the file is stored in datalogger memory. Device = CRD, the file is stored on a PCMCIA card. A device of USR can also be specified.
Section 9. Program Control Instructions For ... Next Repeats a group of instructions a specified number of times. Syntax For counter = start To end [ Step increment ] [statementblock] [Exit For] [statementblock] Next [counter [, counter][, ...]] The For...Next statement has these parts: Part Description For Begins a For...Next loop control structure. Must appear before any other part of the structure. counter Numeric variable used as the loop counter.
Section 9. Program Control Instructions For I = 1 To 10 For J = 1 To 10 For K = 1 To 10 ... Next K Next J Next I Note If you omit the variable in a Next statement, the value of Step increment is added to the variable associated with the most recent For statement. If a Next statement is encountered before its corresponding For statement, an error occurs. For...Next Statement Example The example runs one For..Next loop inside another. Dim I, J 'Declare variables.
Section 9. Program Control Instructions Then Identifies actions to be taken if condition is satisfied. thenpart Statements or branches performed when condition is true. Else Identifies actions taken if condition is not satisfied. If the Else clause is not present, control passes to the next statement in the program. elsepart Statements or branches performed when condition is false.
Section 9. Program Control Instructions statements following Then or Else, the program continues with the statement following EndIf. The Else and ElseIf clauses are both optional. You can have as many ElseIf clauses as you like in a block If, but none can appear after an Else clause. Any of the statement blocks can contain nested block If statements. CRBasic looks at what appears after the Then keyword to determine whether or not an If statement is a block If.
Section 9. Program Control Instructions "Device:FileName" The "Device:Filename" argument is the file that should be executed. The Device on which the file is stored must be specified and the entire string must be enclosed in quotation marks. Device = CPU, the file is stored in datalogger memory. Device = CRD, the file is stored on a PCMCIA card. A device of USR can also be specified.
Section 9. Program Control Instructions Scan … NextScan Used to establish the program scan rate. Syntax Scan(Interval, Units, BufferOption, Count) ... ...[Exit Scan] ... Next Scan The measurements, processing, and calls to output tables bracketed by the Scan…NextScan instructions determine the sequence and timing of the datalogger program.
Section 9. Program Control Instructions Count Integer though Scan is used to signify the start of a scan in a slow sequence. In SlowSequence, the measurements are stored in a single buffer. Processing of this buffer is completed before the NextScan measurements are made. The number of times to execute the Scan/NextScan loop. Enter 0 for infinite looping. SelectCase … EndSelect Executes one of several statement blocks depending on the value of an expression.
Section 9. Program Control Instructions the Case clauses matches testexpression, program execution continues at the statement following EndSelect. EndSelect Ends the Select Case. Must appear after all other statements in the Select Case control structure. The argument expressionlist has these parts: Part Description expression Any numeric expression. To Keyword used to specify a range of values. If you use the To keyword to indicate a range of values, the smaller value must precede To.
Section 9. Program Control Instructions SetSecurity (security1, security2, security3) Used to implement up to three levels of security in the datalogger. The SetSecurity instruction is executed only at compile time. Up to three levels of security can be set in the datalogger. Level 1 must be set before Level 2 can be set, and Level 2 must be set before Level 3 can be set. If a level is set to 0, any level greater than it will also be set to 0 (e.g., if Level 2 is 0, Level 3 is 0).
Section 9. Program Control Instructions FieldName MaxProcTime Messages SkippedScan SkippedSlowScan SkippedRecord StationName VarOutOfBound WatchdogErrors Description The maximum amount of time that it has taken to execute the program. A field that can be used to hold a string value in the datalogger's Status table. The string must be enclosed in quotes. An error counter indicating the number of times a Scan has been missed because the datalogger was busy with another task (such as the previous scan).
Section 9. Program Control Instructions measurements, followed by background calibration (which is automatically run in a slow sequence), then the first slow sequence, the second slow sequence, and so on. Refer to section OV 2.3 for additional information on the priority of sequences in the datalogger. Slow sequences are typically run at a slower rate than the main program. They can be run at a faster rate if there are no measurement instructions in the slow sequence.
Section 9. Program Control Instructions 'Second Slow Sequence Scans every 30 minutes and stores daily average and min.
Section 9. Program Control Instructions Timer (TimNo, TUnits, TOption) Used to return the value of a timer. Remarks Timer is a function that returns the value of a timer. TOption is used to start, stop, reset and start, stop and reset, or read without altering the state (running or stopped). Multiple timers, each identified by a different number (TimNo), may be active at the same time.
Section 9. Program Control Instructions BeginProg Scan (1,Sec,3,0) Timer (1,uSec,2) PanelTemp (Ptemp,250) TCDiff(TCTemp,1,mV20,1,TypeT,PTemp,True,0,250,1.0,0) Elapsed = Timer (1,uSec,4) calltable (Test) NextScan EndProg WaitDigTrig (Port, Edge) The WaitDigTrig instruction can be executed within a Scan/NextScan sequence or it can be executed outside a scan (most commonly in a SlowSequence).
Section 9. Program Control Instructions Remarks While…Wend loops can be nested. The While...Wend statement has the following parameters: NOTE While The While statement begins the While...Wend loop control structure. Condition The Condition is any expression that can be evaluated True (nonzero) or False (0 and Null). If Condition is true, all statements in StatementBlock are executed until the Wend statement is encountered. Control then returns to the While statement and Condition is again checked.
Section 10. Custom Keyboard Display Menus CRBasic has the capability of creating a custom keyboard display menu for a datalogger program. The custom menu can either appear as submenu of the standard CR3000 menu or it can take the place of the standard menu and contain the standard menu as a submenu. An item in the custom menu may do one of four things: 1) display the value of a variable or a field in a data table. 2) display the value of a variable/flag and allow the user to change that value.
Section 10. Custom Keyboard Display Menus 'Define Custom Menu: DisplayMenu ("Example Custom Menu",1) SubMenu("Current Temperatures") DisplayValue("Panel Temp",Tpnl) DisplayValue("TC 1",Ttc(1)) DisplayValue("TC 2",Ttc(2)) EndSubMenu SubMenu("Last 1 Min. Averages") DisplayValue("Panel Temp",Temp.Tpnl_Avg(1,1)) DisplayValue("TC 1",Temp.Ttc_Avg(1,1)) DisplayValue("TC 2",Temp.
Section 10. Custom Keyboard Display Menus Parameter & Data Type MenuName Text AddtoSystem Constant Enter The text that will be shown as the heading for the custom menu. The string is limited to 20 characters, and it should be enclosed in quotation marks. This constant determines if the custom menu is a sub menu or replaces the standard menu.. Value Result 0 Upon power up, a starting window is displayed. When a key is pressed, the system menu will be displayed.
Section 10. Custom Keyboard Display Menus The Variable parameter is the variable name of the value to be displayed. Values displayed using MenuItem can be edited, either by typing in a value directly or by creating a pick list of values using MenuPick. Note: Use DisplayValue to display variable values without allowing them to be changed. Parameter & Data Type MenuItemName Text Variable Variable Enter The text that will be shown as the heading for the custom menu.
Section 11. String Functions 11.1 Expressions with Strings 11.1.1 Constant Strings Fixed (constant) strings can be used in expressions using quotation marks “”. For example, FirstName = “Mike” causes the string variable FirstName to be assigned “Mike”. 11.1.2 Add Strings Strings can be concatenated using the ‘+’ operator. For example, FullName = FirstName + “ “ + MiddleName + “ “ + LastName (The “ “ puts a space between the names.) 11.1.
Section 11. String Functions 11.1.5 String Comparison Operators The comparison operators =, >,<,<>, >= and <= operate on strings. The equality operators perform the string subtraction operation noted above and apply the appropriate rule to return either TRUE or FALSE. Example Find the name “Mike” in the array of Names For ID = 1 to 10 If Names(ID) = “Mike” …. 11.1.
Section 11. String Functions Parameter & Data Type Float Variable or Constant FormatString Constant Enter The variable or constant that holds the floating point value to be converted. Determines how the floating point value will be represented in the converted string. Note that the format string must be enclosed in quotes. The options are (m = mantissa; d = decimal; x = exponent): %f Decimal notation in the form of +mmm.
Section 11. String Functions Parameter & Data Type Start Integer SearchString String or Variable FilterString String or Variable SearchOption Constant Enter An integer that specifies where in the SearchString to start looking for the FilterString. A 1 indicates the first character in the string. The string to evaluate for the FilterString. The string to look for in the SearchString.. A code used to help define the method of searching.
Section 11. String Functions Remarks The Start and Length parameters are used to determine which part of the SearchString is returned. Regardless of the value of the Length parameter, the returned string will be no longer than the original string. Parameter & Data Type SearchString String or Variable Start Integer Length Integer Enter The string to evaluate for the FilterString. An integer that specifies where in the SearchString to begin the operation. A 1 indicates the first character in the string...
Section 11. String Functions SplitStr Example In the following example, a string is split into 5 different arrays using the SplitStr instruction. The "," is used to split the search string.
Section 12. Serial Input and Output Functions This set of instructions and functions are meant to be used with (non-PakBus) serial sensors and controllers and for purposes of dialing and paging through generic text based devices. They cover the functionality of the traditional Edlog dataloggers’ P15 and P97 instructions with additional flexibility. DialModem (ComPort, BaudRate, DialString, ResponseString) Used to send a modem dial string out one of the datalogger's ports.
Section 12. Serial Input and Output Functions Parameter & Data Type BaudRate Enter DialString Telephone number and access codes ResponseString String Used to set the rate, in bps, for communication. The options are 300, 1200, 4800, 9600, 19200, 38400, 57600, and 115200. Selecting one of these options fixes the baud rate at that rate of communication.
Section 12. Serial Input and Output Functions Each instruction has one parameter: Parameter & Data Type PakBusAddr Integer Enter DialSuccess Variable A variable that holds the results of the communications attempt. A -1 indicates communication was successful; 0 indicates a failure. If the communication attempt fails, the communication link will be closed. A variable holding the result of DialModem can be used for this parameter.
Section 12. Serial Input and Output Functions Parameter & Data Type ResultCode Variable ComPort Constant BaudRate ModBusAddr Integer or Constant ResponseString String Function Integer or Constant 12-4 Enter A variable that holds the results of the communication attempt. ResultCode is set to 0 if communication is successful; it increments by 1 with each failure. Specifies the communication port and mode that will be used when sending the dial string. If a negative code is entered for the ComPort (e.g.
Section 12. Serial Input and Output Functions Parameter & Data Type Variable Variable Start Integer or constant Length Integer or constant Tries Integer or constant TimeOut Constant or variable Enter The variable array that is used as the source of data to send to the ModBusSlave, or the variable array that is used as the destination for data received from the ModBusSlave. The first coil or register that will be acted upon with this instruction.
Section 12. Serial Input and Output Functions Parameter & Data Type BaudRate Enter ModBusAddr Integer or Constant ModBusVariable Variable Used to set the rate, in bps, for communication. The options are 300, 1200, 4800, 9600, 19200, 38400, 57600, and 115200. Selecting one of these options fixes the baud rate at that rate of communication.
Section 12. Serial Input and Output Functions if the datalogger is allowed to go into its low power sleep mode between infrequent ModBus queries. Some ModBus devices (e.g., some RTUs made by Bailey Controls that use less common CPUs) require reverse word order (MSW/LSW) in the floating point format. The datalogger currently does not support this less common word order. (There are experimental versions of some datalogger operating systems that have used the reverse word order.
Section 12. Serial Input and Output Functions The ComPort parameter specifies the communication port that should be closed. This instruction runs sequentially from the processing task sequencer, regardless of whether the datalogger is in pipeline or sequential mode. SerialFlush (ComPort) The SerialFlush instruction is used to clear any characters in the serial input buffer. Syntax SerialFlush ( ComPort ) Remarks This instruction clears the buffer and leaves the port open.
Section 12. Serial Input and Output Functions Syntax SerialInBlock ( ComPort, Dest, MaxNumberBytes ) Remarks Incoming serial data, up to the value defined in MaxNumberBytes, will be stored in the Dest parameter. SerialInBlock will not wait for the return of characters. If no new characters are received since the last execution of the instruction, 0 will be returned by the instruction. This instruction can be used as the expression for the NumberBytes parameter in the SerialOutBlock instruction.
Section 12. Serial Input and Output Functions Syntax SerialOut ( ComPort, OutString, WaitString, NumberTries, TimeOut ) If this instruction is set equal to a variable, the number of characters output is returned. If a delay is needed before outputting the string, it should be entered in the TXDelay parameter of the SerialOpen instruction. If the OutString and WaitString variables are not formatted as a string, they will be converted to a string by the datalogger.
Section 13. PakBus Communication Instructions This set of instructions is used to communicate with other PakBus devices. In general they specify a COM port and a PakBus address. If the route to the device is not yet known, it will try a direct route through the COM port. If the route is through a neighbor that must first be dialed, then it will first try to dial using the user specified DialSequence. The PakBus Address parameter is a varia+ble, so it can be used in a For/Next loop, for example.
Section 13. PakBus Communication Instructions TABLE 13.1-2. ResultCode Error Codes 1 Read Only or Permission denied 2 Out of Space in the remote 3 Syntax Error 16 Invalid Table Name or Field Name 17 Data type conversion not supported 18 Memory bounds violation 19 20 Out of memory in the host 21 Cannot route to remote (communication not attempted) The Timeout parameter in these instructions is in units of .01 seconds.
Section 13. PakBus Communication Instructions Parameter & Data Type ComPort Constant NeighborAddr Constant PakBusAddr Integer(14094) NOTE Enter The communications port that will be used to communicate with the destination device. Enter a numeric or alphanumeric code listed in table 12.1-1. A static route to the destination datalogger. If 0 is entered, the destination device is assumed to be a neighbor The Pakbus address of the destination datalogger with which the host datalogger is trying to communicate.
Section 13. PakBus Communication Instructions Parameter & Data Type ResultCode Variable ComPort Constant NeighborAddr Constant PakBusAddr Integer(1-4094) Security Integer TimeOut Constant or Variable “TableName” String “FieldName” String Variable Variable or Variable Array Swath Constant or Expression NOTE Enter The variable in which a response code for the transmission will be stored. A negative value indicates that communication was achieved but the command failed. See table 13.
Section 13. PakBus Communication Instructions Network (ResultCode, Reps, BeginAddr, TimeIntoInterval, Interval, Gap, GetSwath, GetVariable, SendSwath, SendVariable ) Used in conjunction with the SendGetVariables instruction to configure destination dataloggers in a PakBus network to send data to (and receive data from) the host.
Section 13. PakBus Communication Instructions Parameter & Data Type GetVariables Variable or Variable Array SendSwath Constant or Variable SendVariables Variable or Variable Array Enter The variable or variable array in which values retrieved from the destination datalogger will be stored. If multiple values are being returned by multiple destination devices, this variable must be a multi-dimensional array large enough to accommodate the values returned.
Section 13.
Section 13. PakBus Communication Instructions Routes (Dest) The Routes instruction returns a list of known dynamic routes for a PakBus datalogger. Syntax Routes ( Dest ) Remarks This instruction stores four values for each known route into the Dest parameter. The four values for each route are: ComPort used for communication, neighbor PakBus address, destination PakBus address, and expected response time (in milliseconds). The list of routes is terminated with a -1.
Section 13. PakBus Communication Instructions NOTE By default, LoggerNet uses PakBus address 4094 and PC400 uses 4093. SendData Example Program The following example program uses the SendData instruction to send the most recent record from Table1 to PakBus ID 4094 once per minute. If the PakBus ID 4094 device is the LoggerNet server, the data will be stored in a data file on the PC.
Section 13. PakBus Communication Instructions Parameter & Data Type ResultCode Variable ComPort Constant NeighborAddr Constant PakBusAddr Integer(1-4094) Security Integer TimeOut Constant or Variable SendVariables Variable or Variable Array SendSwath Constant or Variable GetVariables Variable or Variable Array GetSwath Constant or Variable Enter The variable in which a response code for the transmission will be stored. A negative value indicates that communication was achieved but the command failed.
Section 13.
Section 13. PakBus Communication Instructions SendTableDef Example Program The following example program sends the table definitions from Table1 to PakBus device ID 4094 every hour.
Section 13. PakBus Communication Instructions Parameter & Data Type Security Integer TimeOut Constant or Variable TableName Name FieldName Constant or Variable Variable Variable or Variable Array Swath Constant or Variable NOTES Enter The security code of the datalogger to which variables will be sent. 0 is entered for this parameter if no security is set in the destination datalogger. The amount of time, in 0.
Section 13. PakBus Communication Instructions SetSettings (ResultCode, ComPort, NeighborAddr, PakBusAddr, Security, TimeOut, Settings) The SetSettings instruction is used to set one or more settings in a remote datalogger. Syntax SetSettings ( ResultCode, ComPort, NeighborAddr, PakBusAddr, Security, TimeOut, Settings ) Remarks This instruction can be used to set one or more existing PakBus settings or user-created settings in the datalogger.
Section 13. PakBus Communication Instructions Public Flag(1), SetResult BeginProg Scan (1,Sec,3,0) If Flag(1) Then SetSettings (SetResult,ComSDC7,0,10,0000,0,"PortStatus(1)=True") EndIf NextScan EndProg TimeUntilTransmit The TimeUntilTransmit instruction returns the time remaining, in seconds, before communication with the host datalogger. Syntax TimeUntilTransmit Remarks The TimeUntilTransmit value is derived from the time slot information that is sent by the host datalogger.
Section 13.
Appendix A. CR3000 Status Table The CR3000 status table contains current system operating status information that can be accessed from the running CR3000 program or monitored by PC software. There is also a way to view the status information from the keyboard. Table 1 shows the variables in the status table and a brief explanation of each follows.
Appendix A. CR3000 Status Table Status Fieldname Low12VCount5 Low5VCount CompileResults StartUpCode6 ProgErrors VarOutOfBound7 SkippedScan SkippedSlowScan8 SkippedRecord9 ErrorCalib8 MemorySize MemoryFree A-2 Description Variable Default Normal Type Range Keeps a running count of the number of Integer 0 0 occurrences of the 12VLow signal being asserted.
Appendix A. CR3000 Status Table Status Fieldname Description ProgMemFree Amount of free space in the CPU ramdisk that is used to store program files. Number of bytes available in the USR Integer Drive Array of two values. First value is bytes Integer free, the second value is the number of array of small blocks available. 2 A value of 98765 written to this Integer location will do a full memory reset.
Appendix A. CR3000 Status Table Status Fieldname Description LastSlowScan The last time that this slow scan executed. If the user has slow scans then this variable becomes an array with a value for the system slow scan and each of the users scans. The time in microseconds required to process the current slow scan. If the user has slow scans then this variable becomes an array with a value for the system slow scan and each of the users scans.
Appendix A. CR3000 Status Table Status Fieldname Description Variable Default Normal User can Info Type Range change? Type Array of baudrates for comms. Aliased Integer RS232= 1200, Yes, can Config Baudrate15 to: BaudrateRS232, BaudrateME, array of 2400, also use BaudrateCOM310, BaudrateSDC7, 9 115200 4800, SerialOut BaudrateSDC8, BaudrateCOM1, ME9600, instructio BaudrateCOM2, BaudrateCOM3, SDC8 = 19.2k, n to setup. BaudrateCOM4 115200 38.4k, 57.6k, COM1- 115.
Appendix A. CR3000 Status Table Status Fieldname CalSeOffSet17 CalDiffOffset17 1xResistor CAOOffset A-6 Description Variable Default Normal Type Range Calibration table of single ended offset Integer _ close to 0 values. Each integration / range array of combination has a single ended offset 15 associated with it. These numbers are updated by the background slow sequence if needed in the program. Calibration table of differential offset Integer _ close to 0 values.
Appendix A. CR3000 Status Table accessing an array with a variable index such as arr(index) = arr(index-1), where index is a variable). 8 The self calibration is run automatically in a slow scan (Section 3.8.) 9 The order of tables is the order in which they are declared. 10 Card bytes free is shown = -1 when no card is present. 11 displays large number until a SlowScan runs. 12 MaxSlowProcTime displays 0 until a SlowScan runs.
Appendix A. CR3000 Status Table This is a blank page.
This is a blank page.
Campbell Scientific Companies Campbell Scientific, Inc. (CSI) 815 West 1800 North Logan, Utah 84321 UNITED STATES www.campbellsci.com info@campbellsci.com Campbell Scientific Africa Pty. Ltd. (CSAf) PO Box 2450 Somerset West 7129 SOUTH AFRICA www.csafrica.co.za cleroux@csafrica.co.za Campbell Scientific Australia Pty. Ltd. (CSA) PO Box 444 Thuringowa Central QLD 4812 AUSTRALIA www.campbellsci.com.au info@campbellsci.com.au Campbell Scientific do Brazil Ltda.