Campbell CR9000 Instruction Manual - Ov4.  Specifications

Summary of CR9000

  • Page 1

    Instruction manual cr9000 measurement and control system revision: 5/05 c o p y r i g h t ( c ) 1 9 9 5 - 2 0 0 5 c a m p b e l l s c i e n t i f i c , i n c ..

  • Page 2: Warranty and Assistance

    Warranty and assistance the cr9000 measurement and control system is warranted by campbell scientific, inc. To be free from defects in materials and workmanship under normal use and service for thirty-six (36) months from date of shipment unless specified otherwise. Batteries have no warranty. Campb...

  • Page 3: Cr9000 Table of Contents

    I cr9000 table of contents overview..................................................................... Ov-1 ov1. Physical description ......................................................................Ov-1 ov1.1 basic system .........................................................................

  • Page 4

    Cr9000 table of contents ii 2.4 data format on computer..................................................................... 2-9 2.4.1 header information ..................................................................... 2-9 2.4.2 toa5 ascii file format ..............................................

  • Page 5

    Cr9000 table of contents iii 7. Measurement instructions .......................................7-1 7.1 voltage measurements ......................................................................... 7-3 7.2 thermocouple measurements............................................................... 7-3 ...

  • Page 6

    Cr9000 table of contents iv this is a blank page..

  • Page 7: Overview

    Ov-1 overview the cr9000 is a modular, multi-processor system that provides precision measurement capabilities in a rugged, battery-operated package. The system makes measurements at a rate of up to 100 k samples/second with 16-bit resolution. Higher sample rates and resolutions can be attained usin...

  • Page 8

    Cr9000 overview ov-2 9031 cpu fiber optic link in fiber optic link out tlink made in usa figure ov1-2. Cr9031 cr9041 a/d and amplifier module the cr9041 a/d and amplifier module provides signal conditioning and 16 bit, 100 khz a/d conversions. 9041 a d cr9000 measurement & control system logan, utah...

  • Page 9

    Cr9000 overview ov-3 9011 power supply power on off charge(9-18vdc) charge >2.0v 12vout power up made in usa figure ov1-4. Cr9011 ov1.2 measurement modules cr9050(e) analog input module the cr9050(e) analog input module has 14 differential or 28 single-ended inputs for measuring voltages up to ±5 v....

  • Page 10

    Cr9000 overview ov-4 over the cr9050e for applications where fault voltages beyond ±9 v could come in contact with the inputs, or when the cr9000 could be powered off while still connected to sensors that have power applied to them. Cr9051e fault made in usa cr9050ec 5v analog input connector for cr...

  • Page 11

    Cr9000 overview ov-5 cr9052iepe made in usa open ch 1 short open ch 2 short open ch 3 short open ch 4 short open ch 5 short open ch 6 short figure ov1-8. Cr9052iepe cr9058e isolation module the cr9058e is a 10 channel, differential input isolation module. Each channel has a 24 bit a/d converter whic...

  • Page 12

    Cr9000 overview ov-6 9055 50v analog input se dif 1 1 h 2 l 2 3 h 4 l 3 5 h 6 l 4 7 h 8 l 5 9 h 10 l 6 11 h 12 l 7 13 h 14 l 8 15 h 16 l 9 17 h 18 l 10 19 h 20 l 11 21 h 22 l 12 23 h 24 l 13 25 h 26 l 14 27 h 28 l made in usa figure ov1-10. Cr9055 cr9060 excitation module the cr9060 excitation modul...

  • Page 13

    Cr9000 overview ov-7 9070 counter & digital i o 1 2 digital i/o 4 5 7 8 9 10 12 13 15 16 1 2 3 4 5 6 7 8 9 10 11 12 made in usa 3 6 11 14 low level ac switch closurre figure ov1-12. Cr9070 cr9071e counter and digital i/o module features 12 channels capable of high-level (5 v square wave) pulse count...

  • Page 14: Tl925

    Cr9000 overview ov-8 9080 peripheral and memory csi serial i o a b status and control top of cards face up card a card b made in usa figure ov1-14. Cr9080 ov1.3 communication interfaces tl925 rs232-tlink interface the tl925 cr9000 to computer interface converts rs232 signals from the computer into a...

  • Page 15

    Cr9000 overview ov-9 pla100-l parallel link interface the pla100-l converts a parallel port on a computer to a tlink for communication with the cr9000. Co nnect to pc tb300 c pn : 5 0-1 00 30 0-0 01 sn : t b3 00 -23 8 figure 0v1-17. Pla100-l parallel link interface ov2. Memory and programming concep...

  • Page 16

    Cr9000 overview ov-10 the transputer directly controls the 9070/cr9071e counter and digital i/o module. The task sequencer is a combination of components that include memory, a xylinx programmable gate array (i.E., a csi customized chip), and the digital bus. When a program is compiled by the transp...

  • Page 17

    Cr9000 overview ov-11 ov3.1 hardware and software requirements the following computer resources are recommended: • ibm pc, portable or desktop • 64 meg of ram • vga monitor • windows 2000, windows xp, windows nt, or windows 4.0 • 60 meg of hard drive space for software • 400 meg of hard drive space ...

  • Page 18

    Cr9000 overview ov-12 realtime display & graphing file edit realtime analysis tools collect display windows help program generator open program file . . . Open wiring file . . . Open data table info file . . . Open data file . . . Convert binary to ascii file . . . Print . . . Printer setup . . . Do...

  • Page 19

    Cr9000 overview ov-13 file edit realtime analysis tools collect display windows help undo ctrl + z date & time select all cut ctrl + x copy ctrl + c paste ctrl + v delete wrap text ctrl + w go to line . . . Find ctrl + f replace ctrl + r colors . . . Fonts . . . Defaults . . . Tile horizontal . . . ...

  • Page 20: Ov4.  Specifications

    Cr9000 overview ov-14 analysis data graphing displays up to 16 fields simultaneously as strip charts or two multi-charts with up to 8 traces each. Includes 2d/3d bars, line, log/linear, area, and scatter. Line statistics available for max/min, best fit, mean, and standard deviation. Handles files of...

  • Page 21

    Cr9000 overview ov-15 cr9050(e) and cr9051e a n a l o g input module with rtd input channels per module: 14 differential or 28 single-ended. Range and resolution: max input resolution input sample range (1 a/d count) noise rates (mv) (µv) (µv rms) (khz) ±5000 158.0 105 100 ±1000 32.0 35 100 ±200 6.3...

  • Page 22

    Cr9000 overview ov-16 this is a blank page..

  • Page 23: Section 1.  Installation

    1-1 section 1. Installation 1.1 enclosure the cr9000 is equipped with either the –l option laboratory case or the –f option fiberglass case. The laboratory case can be used in a clean, dry, indoor environment or mounted in an enclosure. The fiberglass case provides a self- contained field enclosure....

  • Page 24

    Section 1. Installation 1-2 figure 1.1-1 cr9000 input terminals figure 1.1-2 quick connectors installed in cr9000 cover 1.1.3 junction boxes individual sensor leads (and multiconductor cables) may be routed directly from the sensor locations to the cr9000 or routed to a junction box and then to the ...

  • Page 25

    Section 1. Installation 1-3 1.2 system power requirements and options the standard cr9000 is equipped with sealed lead acid battery packs and charging circuitry for charging the batteries from a 9-18 volt dc input. The input can come from 120/240 vac line power via the universal ac power adapter (in...

  • Page 26

    Section 1. Installation 1-4 cr9000 figure 1.1-3 cr9000 battery pack.

  • Page 27

    Section 1. Installation 1-5 table 1.2-1. Cr9000 battery and charging circuitry specifications cr9000 with standard batteries (4): battery life, no supplemental charge 13 hours to 10.5 v (assuming 1a current) voltage at full discharge 10.5 volts recharge time (ac adapter input) 9 hours from 100% disc...

  • Page 28

    Section 1. Installation 1-6 all external charging devices must be disconnected from the cr9000 in order to measure the true voltage level of the internal batteries. This cr9000 current drain depends on the number and type of modules installed, the sensors excited, and the scan interval and measureme...

  • Page 29

    Section 1. Installation 1-7 because the charge input supplies power to charge the cr9000 batteries (up to two amps when discharged) as well as power the cr9000, the current drawn from the vehicle could be in excess of three amps. 1.2.3 solar panels in a remote installation, solar panels, in conjunct...

  • Page 30

    Section 1. Installation 1-8 1.2.5 safety precautions there are inherent hazards associated with the use of sealed lead acid batteries. Under normal operation, lead acid batteries generate a small amount of hydrogen gas. This gaseous by-product is generally insignificant because the hydrogen dissipat...

  • Page 31

    Section 1. Installation 1-9 allowed to escape slowly through a rubber tube which is routed along with the sensor leads through the conduit elbows into the cr9000 enclosure. Equipment required for this method of humidity control generally can be obtained from any local welding supply shop and include...

  • Page 32

    Section 1. Installation 1-10 sensors that have a floating output or are not referenced to ground through a separate connection may need to have one side of the differential input connected to ground to ensure the signal remains within the common mode range. Problems with exceeding common mode range ...

  • Page 33: 2.1  Data Storage In Cr9000

    2-1 section 2. Data storage and retrieval the cr9000 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. For simplicity, the pc9000 progra...

  • Page 34: 2.2  Internal Data Format

    Section 2. Data storage and retrieval 2-2 when the cr9000 compiles and runs a program that uses flash memory, it checks to see if the program is different from the last program it ran. If the program has changed (including any changes to comments), flash memory is erased and reset. If the program is...

  • Page 35: 2.3  Data Collection

    Section 2. Data storage and retrieval 2-3 table 2.2-1. Resolution and range limits of fp2 data zero minimum magnitude maximum magnitude 0.000 ± 0.001 ± 7999. The resolution of fp2 is reduced to 3 significant digits when the first (left most) digit is 8 or greater (table 2.2-2). Thus, it may be neces...

  • Page 36

    Section 2. Data storage and retrieval 2-4 2.3.1 the collect menu when retrieve data is selected in the collect menu, pc9000 displays the collect data dialog box (figure 2.3.1). The station name (may be entered by the user when a program is downloaded) is retrieved from the connected cr9000 and shown...

  • Page 37

    Section 2. Data storage and retrieval 2-5 2.3.1.2 collection method all records, create new file – collects the entire table stored in the cr9000. Pc9000 gets the current record number from the table in the cr9000 and then retrieves the oldest record in the table up to the current record number. The...

  • Page 38

    Section 2. Data storage and retrieval 2-6 2.3.1.4 file control the default naming for a file stored to disk is to use the data table name appended with a 2 digit number and the extension .Dat. If the table name is longer than 6 characters, it is truncated. For example, the table name events is store...

  • Page 39

    Section 2. Data storage and retrieval 2-7 file will be named main01.Dat and so on. It takes a little time to open the file so be sure it is opened in advance of the event you want to store. The file is written to every 1 second so it is important the table size be large enough to store sufficient da...

  • Page 40

    Section 2. Data storage and retrieval 2-8 2.3.4 via pcmcia pc card when the cr9000 is used without a computer in the field, or large data files are collected on a pc card, the pc card can be transported to the computer with the data on it. 2.3.4.1 removing card from cr9000 the 9080 pcmcia adapter mo...

  • Page 41

    Section 2. Data storage and retrieval 2-9 figure 2.3-3. File conversion dialog box 2.4 data format on computer the format of the file stored on disk can be either ascii or binary depending on the file type selected in the collect data dialog box. Files collected from a real time window are always st...

  • Page 42

    Section 2. Data storage and retrieval 2-10 station name the station name set in the logger that the data was collected from. Logger model the datalogger model that the data was collected from. Logger serial number the serial number of the logger that the data was collected from. This is the serial n...

  • Page 43

    Section 2. Data storage and retrieval 2-11 record number this field is the record number of this record. The number will increase up to 2e32 and then start over with zero. The record number will also start over at zero if the table is reset. Field data this is the data for each of the fields in the ...

  • Page 44

    Section 2. Data storage and retrieval 2-12 2.4.3 tob1 binary file format this is a sample of a file collected as binary with time stamps. Tob1,bob's9k,cr9000,1048575,1.00,expldat.Dld,4339,temp seconds,nanoseconds,record,reftemp_avg,tc_avg(1),tc_avg(2),tc_avg(3),tc_avg(4) seconds,nanoseconds,rn,degc,...

  • Page 45: Details

    3-1 section 3. Cr9000 measurement details 3.1 measurements using the cr9041 a/d the cr9050(e), cr9051e, and the cr9055(e) modules all use the a/d module to digitize their analog measurements. Section 3.1 documents measurement details for the measurements made using these modules. The filter module (...

  • Page 46

    Section 3. Cr9000 measurement details 3-2 there are four parameters in the measurement instructions that may vary the sequence and timing of the measurement. These are options to reverse the polarity of the excitation voltage (revex), reverse the high and low differential inputs (revdiff), to set th...

  • Page 47

    Section 3. Cr9000 measurement details 3-3 sets the excitation, delays, measures, reverses the excitation, delays, measures, reverses the excitation, reverses the inputs, delays, measures, reverses the excitation, delays, measures. Thus there are four delays per channel measured. 3.1.1.3 integration ...

  • Page 48

    Section 3. Cr9000 measurement details 3-4 in an error in the measurement. For example, if the measuring junction of a copper-constantan thermocouple, being used to measure soil temperature, is not insulated and the potential of earth ground is 1 mv greater at the sensor than at the point where the c...

  • Page 49

    Section 3. Cr9000 measurement details 3-5 may return the over range value not-a-number (nan) or a valid, but incorrect, number. To avoid misleading data, either be sure the signal is referenced to cr9000 ground or use the voltage range r option to check common mode range as described below. Sensors ...

  • Page 50

    Section 3. Cr9000 measurement details 3-6 sustained voltages in excess of ±20 v on the 9050 module inputs or ±150 v on the 9055 module inputs will damage the cr9000 circuitry. 3.1.3 signal settling time whenever an analog input is switched into the cr9000 measurement circuitry prior to making a meas...

  • Page 51

    Section 3. Cr9000 measurement details 3-7 3.1.4 thermocouple measurements a thermocouple consists of two wires, each of a different metal or alloy, which are joined together at each end. If the two junctions are at different temperatures, a voltage proportional to the difference in temperatures is i...

  • Page 52

    Section 3. Cr9000 measurement details 3-8 4 °c. The end of the enclosure with the cpu module will be warmer due to heat dissipated by the processor. For the best accuracy, use the temperature of each 9050 module as the reference temperature for any thermocouples attached to it. Given the above condi...

  • Page 53

    Section 3. Cr9000 measurement details 3-9 table 3.4-1. Limits of error for thermocouple wire (reference junction at 0 o c) limits of error thermocouple temperature (whichever is greater) type range o c standard special t -200 to 0 ± 1.0 o c or 1.5% 0 to 350 ± 1.0 o c or 0.75% ± 0.5 o c or 0.4% j 0 t...

  • Page 54

    Section 3. Cr9000 measurement details 3-10 for optimum resolution, the ±50 mv range is used for all but high temperature measurements (table 3.4-2). The input offset error dominates the voltage measurement error for environmental measurements. A temperature difference of 40 to 60 °c between the meas...

  • Page 55

    Section 3. Cr9000 measurement details 3-11 noise on voltage measurement the input noise on the ±50 mv range for a measurement with no integration is 4 µv rms. On a type t thermocouple (approximately 40 µv/ o c) this is 0.1 o c. Note that this is an rms value, some individual readings will vary by gr...

  • Page 56

    Section 3. Cr9000 measurement details 3-12 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 o...

  • Page 57

    Section 3. Cr9000 measurement details 3-13 table 3.4-5. Example of errors in thermocouple temperature source error: o c : % of total error single-ended or single differential reversing differential w:500 µs integration ansi tc error (1 o c) tc error 1% slope ansi tc error (1 o c) tc error 1% slope r...

  • Page 58

    Section 3. Cr9000 measurement details 3-14 cr9000 h l a' a b' b junction box tc figure 3.4-1. 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...

  • Page 59

    Section 3. Cr9000 measurement details 3-15 brhalf x = result w/mult = 1, offset = 0 x v v r r r x s s f = = + 1 ( ) r r x x r r x r s f f s s = − = − 1 1 brhalf3w x = result w/mult = 1, offset = 0 x v v v v r r x s f = − − = 2 2 1 1 r r x r r x s f f s = = / brhalf4w h l h l x = result w/mult = 1, o...

  • Page 60

    Section 3. Cr9000 measurement details 3-16 3.1.6 measurements requiring ac excitation some resistive sensors require ac excitation. These include electrolytic tilt sensors, soil moisture blocks, water conductivity sensors and wetness sensing grids. The use of dc excitation with these sensors can res...

  • Page 61

    Section 3. Cr9000 measurement details 3-17 ( ) v v r r r r r r x s s f s f g 1 = + + / [3.6-1] r s r f /r g is the source of error due to the ground loop. When r g is large the equation reduces to the ideal. The geometry of the electrodes has a great effect on the magnitude of this error. The delmho...

  • Page 62

    Section 3. Cr9000 measurement details 3-18 cr9050(e) are multiplexed sequentially through a single a to d converter. 3.2.1 cr9058e supported instructions the cr9058e currently supports three cr9000x measurement instructions: 1. Voltdiff (dest, reps, range, aslot, diffchan, revdiff, settle, integ, mu...

  • Page 63

    Section 3. Cr9000 measurement details 3-19 • the integ parameter in voltdiff and in tcdiff (not in moduletemp) can be set to –1, -2, -3, -4, or -5 and the cr9058e will set the corresponding synch filter of 1, 2, 3, 4, or 5. The integration time will be maximized for the given synch filter and scan i...

  • Page 64

    Section 3. Cr9000 measurement details 3-20 • the cr9058e does not directly support bridge measurements, but bridge type measurements can be performed through using the cr9060s caos or external excitation and adjusting the multiplier according to the excitation level. 3.2.2 cr9058e sampling, noise an...

  • Page 65

    Section 3. Cr9000 measurement details 3-21 c h a r t 3 .1 f r e q u e n c y r e s p o n s e o f s y n c f il t e r o r d e r s 1 - 5 0 .0 0 .2 0 .4 0 .6 0 .8 1 .0 1 .2 0 1 2 3 4 5 6 f r e q u e n c y n o r m a l iz e d t o (1 /in t e g r a t io n t im e ) rel response s y n c o r d e r 1 s y n c o r...

  • Page 66

    Section 3. Cr9000 measurement details 3-22 3.3 cr9052 filter module measurements each cr9052 module has six differential analog measurement channels with programmable input ranges from ±20 mv to ±5 v. Each channel has its own programmable-gain instrumentation amplifier, pre-sampling analog filter, a...

  • Page 67

    Section 3. Cr9000 measurement details 3-23 appropriate low-pass filter to anti-alias the input data for the user's desired measurement rate. If desired, users may load their own coefficients into the on-board dsp to tailor the fir filter's frequency response to their own needs (band pass, band rejec...

  • Page 68

    Section 3. Cr9000 measurement details 3-24 windowing the fft option allows radix-two (2 n , where n = 5, 6, …16) transform lengths ranging from 32 to 65,536 samples. Users can optionally apply a hanning, hamming, blackman-harris, or one from a selection of kaiser-bessel beta choices, window function...

  • Page 69

    Section 3. Cr9000 measurement details 3-25 spectral output the cr9052 offers a variety of spectrum normalizations, including real and imaginary, amplitude and phase, power, power spectral density (psd), and decibels (db). In addition, the cr9052 can combine adjacent spectral bins into a single bin t...

  • Page 70

    Section 3. Cr9000 measurement details 3-26 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., a pulse count in a 1 second scan has a frequency resolution of 1 hz, a 0.5 second scan ...

  • Page 71

    Section 3. Cr9000 measurement details 3-27 trigger must rise from below 1.5 volts to above 3.5 volts in order to trigger an output. Due to the attenuation caused by the filter on the front side of the schmitt circuit, a larger input voltage transition is required for higher frequencies. The transiti...

  • Page 72

    Section 3. Cr9000 measurement details 3-28 this is a blank page..

  • Page 73: Programming

    4-1 section 4. Crbasic – native language programming the cr9000 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 n...

  • Page 74: 4.2  Programming Sequence

    Section 4. Crbasic – native language programming 4-2 moduletemp is the keyword name of the instruction. There are four parameters associated with moduletemp are: destination, the name of the variable in which to put the temperature; repetitions, the number of sequential 9050 modules to measure the t...

  • Page 75: 4.3  Example Program

    Section 4. Crbasic – native language programming 4-3 program the program section defines the action of datalogging set scan interval the scan sets the interval for a series of measurements measurements enter the measurements to make processing enter any additional processing with the measurements ca...

  • Page 76

    Section 4. Crbasic – native language programming 4-4 4.3.1 data tables data storage follows a fixed structure in the cr9000 in order to optimize the time and space required. Data are stored in tables such as: toa4 stnname temp timestamp record reftemp_avg tc_avg(1) tc_avg(2) tc_avg(3) tc_avg(4) tc_a...

  • Page 77

    Section 4. Crbasic – native language programming 4-5 datainterval(tintoint, interval, units, lapses) datainterval(0,10,msec,10) datainterval is an instruction that modifies the conditions under which data are stored. The four parameters are the time into the interval, the interval on which data are ...

  • Page 78: 4.4  Numerical Entries

    Section 4. Crbasic – native language programming 4-6 beginprog scan(1,msec,0,0) moduletemp(reftemp,1,4,0) tcdiff(tc(),6,mv50,4,1,typet,reftemp,revdiff,del,integ,mult,offset) calltable temp nextscan endprog the scan instruction determines how frequently the measurements within the scan are made: scan...

  • Page 79

    Section 4. Crbasic – native language programming 4-7 4.5 logical expression evaluation 4.5.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 o...

  • Page 80: 4.6  Flags

    Section 4. Crbasic – native language programming 4-8 the cr9000 uses -1 rather than some other non-zero number because the and and or operators are the same for logical statements and binary bitwise comparisons (see and and or in section 8). The number -1 is expressed in binary with all bits equal t...

  • Page 81

    Section 4. Crbasic – native language programming 4-9 4.7.1 expressions in parameters many parameters allow the entry of expressions. If an expression is a comparison, it will return -1 if the comparison is true and 0 if it is false (section 4.5.3). An example of the use of this is in the datatable i...

  • Page 82

    Section 4. Crbasic – native language programming 4-10 in addition to accessing the data actually output in a table, there are some pseudo fields related to the data table that can be retrieved: tablename.Record(1,n) = the record number of the record output n records ago. Tablename.Tablesize(1,1) = t...

  • Page 83

    5-1 section 5. Program declarations alias used to assign a second name to a variable. Syntax alias variablea = variableb 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 ...

  • Page 84

    Section 5. Program declarations 5-2 const declaration example the example uses const to define the symbolic constant pi. Const pi = 3.141592654 'define constant. Dim area, circum, radius 'declare variables. Radius = volt( 1 ) 'get measurement. Circum = 2 * pi * radius 'calculate circumference. Area ...

  • Page 85

    Section 5. Program declarations 5-3 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 ) 'dim is optional public x( 3 ),y, z( 2, 3, 4 ) public w station name sets the station name. Syntax station...

  • Page 86

    Section 5. Program declarations 5-4 the sub statement has these parts: part description sub marks the beginning of a subroutine . Subname name of the subroutine. Because subroutine names are recognized by all procedures in all modules, subname cannot be the same as any other globally recognized name...

  • Page 87

    Section 5. Program declarations 5-5 subroutine example 'cr9000 ''declare variables used in program: public reft, tc(4),i 'data output in deg c: datatable (tempsc,1,-1) datainterval (0,5,min,10) average (1,reft,fp2,0) average (4,tc(),fp2,0) endtable 'same data output in f after conversion: datatable ...

  • Page 88

    Section 5. Program declarations 5-6 this is a blank page..

  • Page 89: 6.1  Data Table Declaration

    6-1 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, outpu...

  • Page 90: 6.2  Trigger Modifiers

    Section 6. Data table declarations and output processing instructions 6-2 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 ...

  • Page 91

    Section 6. Data table declarations and output processing instructions 6-3 parameter & data type enter datainterval parameters tintoint constant 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. Interval consta...

  • Page 92

    Section 6. Data table declarations and output processing instructions 6-4 const revdiff 1 'reverse input to cancel offsets const del 0 'use default delay const integ 0 'use default integration public reftemp 'declare the variable used for reference temperature public tc(5) 'declare the variable used...

  • Page 93

    Section 6. Data table declarations and output processing instructions 6-5 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 consis...

  • Page 94

    Section 6. Data table declarations and output processing instructions 6-6 worstcase (tablename, numcases, maxmin, change, rankvar) allows saving the most significant or “worst-case” events in separate data tables. A data table is created that is sized to hold one event. This table acts as the event ...

  • Page 95

    Section 6. Data table declarations and output processing instructions 6-7 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 eve...

  • Page 96

    Section 6. Data table declarations and output processing instructions 6-8 6.3 export data instructions dsp4 (flagvar, rate) send data to the dsp4. If this instruction appears inside a datatable, the dsp4 can display the fields of this table, otherwise, the public variables are used by the dsp4. The ...

  • Page 97

    Section 6. Data table declarations and output processing instructions 6-9 parameter & data type enter pamout parameters slot constant the number of the slot in the cr9000 card frame that holds the pam module. Card the card (a or b) in which to store the data on the pam module constant alpha code num...

  • Page 98

    Section 6. Data table declarations and output processing instructions 6-10 covariance (numvals, source, datatype, disablevar, numcov) calculates the covariance of values in an array over time. The covariance of x and y is calculated as: ( ) cov x y x y n x y n i i i n i i n i i n ( , ) = ⋅ − ⋅ = = =...

  • Page 99

    Section 6. Data table declarations and output processing instructions 6-11 parameter & data type enter fft parameters source variable the name of the variable array that contains the input data for the fft. Datatype a code to select the data storage format. Constant alpha code numeric code data form...

  • Page 100

    Section 6. Data table declarations and output processing instructions 6-12 notes: • power is independent of the sampling rate (1/tau) and of the number of samples (n). • the psd is proportional to the length of the sampling period (t=n*tau), since the “width” of each bin is 1/t. • the sum of the ac ...

  • Page 101

    Section 6. Data table declarations and output processing instructions 6-13 fft example const size_fft 16 const pi 3.141592654 const cyclespert 2 const amplitude 3 const dc 7 const opt_fft 0 const pi 3.141592654 dim i public x(size_fft),y(size_fft) datatable(amp,1,1) fft(x,fp2,size_fft,10 msec,1) end...

  • Page 102

    Section 6. Data table declarations and output processing instructions 6-14 fieldnames “list of fieldnames” the fieldnames instructions may be used to override the fieldnames that the cr9000 generates for results sent to the data table. Fieldnames must immediately follow the output instruction creati...

  • Page 103

    Section 6. Data table declarations and output processing instructions 6-15 histogram (binselect, datatype, disablevar, bins, form, wtval, lowlim, uplim) processes input data as either a standard histogram (frequency distribution) or a weighted value histogram. The standard histogram counts the time ...

  • Page 104

    Section 6. Data table declarations and output processing instructions 6-16 parameter & data type enter histogram parameters binselect variable or array the variable that is tested to determine which bin is selected. The histogram 4d instruction requires an array dimensioned with at least as many ele...

  • Page 105

    Section 6. Data table declarations and output processing instructions 6-17 histogram4d output example '\\\\\\\\\\\\\\\\\\\\ variables and constants //////////////////// public mamps public volts dim bin(2) units bin = percent '\\\\\\\\\\\\\\\\\\\\\\\\ output section //////////////////////// datatabl...

  • Page 106

    Section 6. Data table declarations and output processing instructions 6-18 levelcrossing (source, datatype, disablevar, numlevels, 2nddim, crossingarray, 2ndarray, hysteresis, option) parameter & data type enter levelcrossing parameters source variable or array the variable that is tested to determi...

  • Page 107

    Section 6. Data table declarations and output processing instructions 6-19 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 ...

  • Page 108

    Section 6. Data table declarations and output processing instructions 6-20 0 0.5 1 1.5 2 2.5 3 3.5 0 1 2 3 4 5 6 crossing levels crossing source 2nd dim boundary 2nddim source figure 6.4-2. Crossing data with second dimension value point crossing source 2nd dim source action 1 0.5 .7 first value, no...

  • Page 109

    Section 6. Data table declarations and output processing instructions 6-21 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. If you want the histogram to be “open” on both ends of th...

  • Page 110

    Section 6. Data table declarations and output processing instructions 6-22 disablevar constant, variable, or expression 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 chec...

  • Page 111

    Section 6. Data table declarations and output processing instructions 6-23 rainflow (source, datatype, disablevar, meanbins, ampbins, lowlimit, highlimit, minamp, form) parameter & data type enter rainflow parameters source variable the variable that is tested to determine which bin is selected data...

  • Page 112

    Section 6. Data table declarations and output processing instructions 6-24 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 ...

  • Page 113

    Section 6. Data table declarations and output processing instructions 6-25 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 enter sample parameters reps constant the number of values to samp...

  • Page 114

    Section 6. Data table declarations and output processing instructions 6-26 totalize (reps, source, datatype, disablevar) this instruction stores the total(s) of the values of the source(s) over the given output interval. Parameter & data type enter totalize parameters reps constant the number of tot...

  • Page 115

    7-1 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...

  • Page 116

    Section 7. Measurement instructions 7-2 7.8 digital i/o portset – sets digital ports on 9060 excitation module ........................... 7-21 pulsecount – pulse/frequency measurement on cr9070/cr9071e counter-timer digital i/o module.................................................... 7-22 pulseco...

  • Page 117: 7.1  Voltage Measurements

    Section 7. Measurement instructions 7-3 7.1 voltage measurements voltdiff (dest, reps, range, aslot, diffchan, revdiff, settlingtime, integ, mult, offset) sensor diff. Chanel h diff. Chanel l. This instruction measures the voltage difference between the hi and low inputs of a differential channel. B...

  • Page 118

    Section 7. Measurement instructions 7-4 tcse (dest, reps, range, aslot, sechan, tctype, tref, settlingtime, integ, mult, offset) s.E. Chanel ground thermocouple this instruction measures a thermocouple with a single-ended voltage measurement and calculates the thermocouple temperature ( °c) for the ...

  • Page 119

    Section 7. Measurement instructions 7-5 parameter enter voltdiff and tcdiff instruction parameters revdiff constant option to reverse inputs to cancel offsets. The sign corrected average of these measurements is used in the result. This technique cancels voltage offsets in the measurement circuitry ...

  • Page 120: 7.3  Half Bridges

    Section 7. Measurement instructions 7-6 parameter & data type enter voltse & tcse instruction parameters tctype the code for the thermocouple type. Constant alpha code numeric code thermocouple type typet 0 copper constantan typee 1 chromel constantan typek 2 chromel alumel typej 3 iron constantan t...

  • Page 121

    Section 7. Measurement instructions 7-7 this instruction applies an excitation voltage, delays a specified time and then makes a single ended voltage measurement. The result with a multiplier of 1 and an offset of 0 is the ratio of the measured voltage divided by the excitation voltage. Brhalf3w (de...

  • Page 122

    Section 7. Measurement instructions 7-8 parameter & data type enter brhalf, brhalf3w, brhalf4w parameters dest variable or array 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 t...

  • Page 123: 7.4  Full Bridges

    Section 7. Measurement instructions 7-9 parameter & data type enter brhalf, brhalf3w, brhalf4w parameters integ constant the integration time in microseconds for each of the channels measured (10 microseconds resolution). Mult, offset constant, variable, array, or expression a multiplier and offset ...

  • Page 124

    Section 7. Measurement instructions 7-10 the measurement of the voltage drop across the full bridge, and v2 is the measurement of the bridge output. 7.5 excitation/continuous analog output excite (exslot, exchan, exmv, settlingtime) this instruction sets the selected excitation output to a specific ...

  • Page 125: 7.6  Self Measurements

    Section 7. Measurement instructions 7-11 parameter & data type enter bridgefull, bridgefull6w, excite parameters settlingtime constant the time in microseconds to delay between setting up a measurement (switching to the channel, setting the excitation) and making the measurement (10 microsecond reso...

  • Page 126: 7.7  Peripheral Devices

    Section 7. Measurement instructions 7-12 calibrate measures offset and gain on all voltage ranges. This instruction is done automatically at user program compile time. The major factor affecting the calibration of the analog section is temperature. If calibration is not done as part of the program, ...

  • Page 127

    Section 7. Measurement instructions 7-13 parameter & data type enter am25t instruction parameters am25tchan constant the starting input channel on the multiplexer for the following measurement. If the following instruction needs to start measuring a am25t channel other than number 1, the channel is ...

  • Page 128

    Section 7. Measurement instructions 7-14 canbus (dest, sdmaddress, timequanta, tseg1, tseg2, id, datatype, startbit, numbits, numvals, multiplier, offset) the canbus instruction is used to measure and control the sdm-can interface. Multiple canbus instructions may be used within a program. The initi...

  • Page 129

    Section 7. Measurement instructions 7-15 parameter & data type enter canbus instruction parameters id constant each device on a can-bus network prefaces its data frames with an 11 or 29 bit identifier. The id parameter is used to set this address. The id is entered as a single decimal equivalent. En...

  • Page 130

    Section 7. Measurement instructions 7-16 parameter & data type enter canbus instruction parameters status description 0000 sdm-can involved in bus activities; error counters 0001 sdm-can involved in bus activities; one or more error counters is greater than or equal to 96. 0002 sdm-can is not involv...

  • Page 131

    Section 7. Measurement instructions 7-17 parameter & data type enter canbus instruction parameters 6 normal; self-test. The sdm-can will perform a successful transmission even if there is no acknowledgment from an external can node. Frames received correctly from an external node are acknowledged. 7...

  • Page 132

    Section 7. Measurement instructions 7-18 remarks this instruction allows the use of the sdm-int8, 8 channel interval timer, with the cr9000. The int8 is a (s)ynchronous (d)evice for the (m)easurement of intervals, counts between events, frequencies, periods, and/or time since an event. See the int8 ...

  • Page 133

    Section 7. Measurement instructions 7-19 parameter & data type enter int8 instruction parameters funct8_5 funct4_1 constants each of the 8 input channels can be independently programmed for one of eight different timing functions. Funct8_5 is a four digit code to program the timing functions of int8...

  • Page 134

    Section 7. Measurement instructions 7-20 parameter & data type enter int8 instruction parameters -nnnn instructs the int8 to capture all events until "nnnn" edges have occurred on channel 1, or until the logger addresses the int8 with the capturetrig argument true, or until 8000 (storage space limit...

  • Page 135: 7.8 Digital I/o

    Section 7. Measurement instructions 7-21 sio4 (dest, reps, address, mode, command, firstop, secop, valuesperrep, mult, offset) this instruction communicates with thesdm-sio4 serial input multiplexer. See the sdm-sio4 manual for details. Parameter & data type enter sio4 instruction parameters dest va...

  • Page 136

    Section 7. Measurement instructions 7-22 pulsecount (dest, reps, pslot, pchan, pconfig, poption, mult, offset) this instruction should not be placed in a conditional or in a slow sequence scan. Sets up pulse measurements using the twelve 16 bit counter channels on the cr9070 or the twelve 32 bit cou...

  • Page 137

    Section 7. Measurement instructions 7-23 parameter & data type enter pulsecount instruction pconfig a code specifying the type of pulse input to measure. Constant code pulse channels input configuration 0 1 - 12 high frequency 1 1 - 8 low level ac 1 9 - 12 switch closure poption constant a code that...

  • Page 138

    Section 7. Measurement instructions 7-24 binary format by preceding the number with "&b". For example if the mask is entered as &b100 (leading zeros can be omitted in binary format just as in decimal) and ports 3 and 1 are high as in the previous example, the result of the instruction will be 4 (dec...

  • Page 139

    Section 7. Measurement instructions 7-25 the second mode is to stay within the instruction until it has results for each measurement requested. In this mode, the resolution when using the i/o channels is approximately (10 microseconds + 15 microseconds * the number of results requested). The resolut...

  • Page 140

    Section 7. Measurement instructions 7-26 writeio (pslot, mask, source) writeio is used to set the status of selected digital i/o channels (ports) on the cr9070/cr9071e counter - timer / digital i/o module. (see portset for setting the output channels on the cr9060.) there are 16 ports on the cr9070/...

  • Page 141

    Section 7. Measurement instructions 7-27 scan interval scan rate 20 µs 50 khz 40 µs 25 khz 100 µs 10 khz 200 µs 5 khz 400 µs 2.5 khz 1 ms 1 khz 2 ms 500 hz 4 ms 250 hz 10 ms 100 hz 20 ms 50 hz 40 ms 25 hz 100 ms 10 hz 200 ms 5 hz voltfilt (dest, reps, range, fslot, chan, filtoption, excitation, mult...

  • Page 142

    Section 7. Measurement instructions 7-28 parameter & data type enter voltfilt parameters dest variable,array the variable 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 reps....

  • Page 143

    Section 7. Measurement instructions 7-29 the following example program measures 6 channels on the cr9052dc using the voltfilt instruction. ' cr9052 example program #1 ' ' measure six channels at 1 khz on +/- 5000 mv range with 5-volt excitation. ‘ sample ratio is 2.5: top of pass band is 1 khz / 2.5...

  • Page 144

    Section 7. Measurement instructions 7-30 the following program uses the subscan to combine 2.5 khz filtermodule measurements with 10 hz measurements on a 9050 card. ' cr9052 example program #2 ' ' measure 2 channels on the cr9050 at 10 hz on the +/- 5000 mv range. ' ' measure six channels on the cr9...

  • Page 145

    Section 7. Measurement instructions 7-31 bursting to cpu and pam memory the maximum continuous throughput rate for measurements made by the cr9052dc to be processed and stored by the cr9031 cpu is 2500 hz for 1 to 24 channels. The measurement rate can be increased by bursting data into cpu memory or...

  • Page 146

    Section 7. Measurement instructions 7-32 bursting to filter module memory each cr9052dc filter module includes an 8-msample (32-mbyte) burst memory buffer. Experimenters may use this memory to increase cr9052dc measurement rates to 50 ksamples/sec per channel, giving a sustained aggregate sample rat...

  • Page 147

    Section 7. Measurement instructions 7-33 voltfilt (flt_in(1), 6,mv5000, cr9052_slot, 1, 2, 1, 1.0, 0.0) if (flt_in(1) > 4000) then flag(1) = true endbursttrigger (flag(1), scans_after_trig) calltable filtdata next subscan next scan flag(1) = false ' turn flag 1 off to eliminate multiple manual trigg...

  • Page 148

    Section 7. Measurement instructions 7-34 parameter enter fftfilt parameters dest variable or array the variable in which to store the results of the instruction. Because fftfilt returns all or part of an entire spectrum (see ilow and ihigh) for each rep, dest usually must be an array. Reps constant ...

  • Page 149

    Section 7. Measurement instructions 7-35 parameter enter fftfilt parameters excitation constant the continuous, dc, output level for the excitation channel(s). If reps is greater than one, then the filter module drives the same excitation level on sequential excitation outputs. Numeric code alpha co...

  • Page 150

    Section 7. Measurement instructions 7-36 parameter & data type enter fftfilt instruction parameters tswindow constant tswindow designates whether the cr9052 should apply a window (also known as a taper, or apodization) function to the time series snapshot before performing the fft. Typical window fu...

  • Page 151

    Section 7. Measurement instructions 7-37 window function tswindow is a constant designating whether the cr9052 should apply a window (also known as taper, or apodization) function to the time series snapshot before performing the fft. Typical window functions give more weight to the middle of the ti...

  • Page 152

    Section 7. Measurement instructions 7-38 for ( ) 1 0 − ≤ ≤ n k where ( ) 0 i is the modified zero th order bessel function and where 5 ≥ β (integer) ≥ 16 spectral options the cr9052dc supports the following spectral options. The first five spectral options are the same as the cr9000 fft instruction....

  • Page 153

    Section 7. Measurement instructions 7-39 component is computed from ( ) 2 2 2 n i r + , and the nyquist component is computed from ( ) 2 2 2 2n i r + . The sum of all of the ac components of the power spectrum gives the variance of the original time series. The units of the power spectrum are ( ) 2 ...

  • Page 154

    Section 7. Measurement instructions 7-40 is equal to power, an equivalent normalization to db is ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ref p p 10 log 0 1 where p is the value from the power spectrum, and ref p is power reference level. The square of the inverse of the multiplier parameter (mult -2 ) gives ref p . The mul...

  • Page 155

    Section 7. Measurement instructions 7-41 in terms of frequency: to limit the lower end of the spectrum, select a minimum frequency of interest, low f , and then set ilow to: ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ low sr f f n round , where ( ) x round is x rounded to the nearest integer. To limit the upper end of the spectr...

  • Page 156

    Section 7. Measurement instructions 7-42 alaising is not a problem with filter option 1 because any signals in the transition band up to the stop frequency of 26.8 khz will be alaised to frequencies higher than the pass frequency of 23.2 khz. The pass frequency (f pass ) is the maximum frequency tha...

  • Page 157

    Section 7. Measurement instructions 7-43 for a given sample rate, sr f , if better frequency resolution is required (i.E., more bins, each covering a narrower frequency range) increase the number of points in the fft, n. If less resolution is required (i.E., fewer bins each covering a wider frequenc...

  • Page 158

    Section 7. Measurement instructions 7-44 (parameter fftlen), and bin s is the number of bins to combine (parameter sbin). The difference between the center frequencies of adjacent spectral components after linear spectral rebinning is bin sr s n f , and bandwidth of each spectral component (except t...

  • Page 159

    Section 7. Measurement instructions 7-45 fref), and bin s is the bins per octave in the final logarithmic spectrum (parameter sbin). In many acoustic applications, fref is set to 1 khz. The ratio (not the difference) between center frequencies of adjacent spectral components in the logarithmic spect...

  • Page 160

    Section 7. Measurement instructions 7-46 fftfilt programming. These values can then be entered into the program and used to calculate the size required for the destination array. To limit the lower end of the final spectrum by frequency, select a minimum frequency of interest, low f , and then calcu...

  • Page 161: Instructions

    8-1 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 absolute value returns the absolute value of a number. Syntax abs( number ) remarks the argument num...

  • Page 162

    Section 8. Processing and math instructions 8-2 and operator used to perform a bit-wise conjunction on two numbers. Syntax result = number1 and number2 the and operator performs a bit-wise comparison of identically positioned bits in two numbers and sets the corresponding bit in result according to ...

  • Page 163

    Section 8. Processing and math instructions 8-3 atn() returns the arctangent of a number. Syntax atn( number ) remarks the argument number can be any valid numeric expression. The atn function takes the ratio (number) of two sides of a right triangle and returns the corresponding angle. The ratio is...

  • Page 164

    Section 8. Processing and math instructions 8-4 average spatial output example this example uses avgspa to find the average value of the five elements temp(6) through temp(10) and store the result in the variable avgtemp. Avgspa(avgtemp, 5, temp(6)) running average calculates a running average of a ...

  • Page 165

    Section 8. Processing and math instructions 8-5 cosine returns the cosine of an angle. Syntax cos( angle ) remarks the argument angle can be any valid numeric expression measured in radians. The cos function takes an angle and returns the ratio of two sides of a right triangle. The ratio is the leng...

  • Page 166

    Section 8. Processing and math instructions 8-6 parameter & data type enter covspa parameters dest variable or array 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 di...

  • Page 167

    Section 8. Processing and math instructions 8-7 fftspa (dest, n, source, tau, units, option) the fftspa performs a fast fourier transform on a time series of measurements stored in an array and places the results in an array. It can also perform an inverse fft, generating a time series from the resu...

  • Page 168

    Section 8. Processing and math instructions 8-8 normalization details: complex fft result i, i = 1 .. N/2: ai*cos(wi*t) + bi*sin(wi*t). Wi = 2 π(i-1)/t. φi = atan2(bi,ai) (4 quadrant arctan) power(1) = (a1 2 + b1 2 )/n 2 (dc) power(i) = 2*( ai 2 + bi 2 )/n 2 (i = 2..N/2, ac) psd(i) = power(i) * t = ...

  • Page 169

    Section 8. Processing and math instructions 8-9 get record retrieves one record from a data table. Syntax getrecord ( dest, tablename, recsback ) remarks the getrecord instruction retrieves one entire record from a data table. The destination array must be dimensioned large enough to hold all the fi...

  • Page 170

    Section 8. Processing and math instructions 8-10 iftime will only return true once per interval. For example, a program with a 1 second scan that tests iftime(0,10, min) -- 0 minutes into a 10 minute interval – each scan will execute the instruction 60 times during the minute that it could be true. ...

  • Page 171

    Section 8. Processing and math instructions 8-11 int, fix functions return the integer portion of a number. Syntax int( number ) fix( number ) remarks the argument number can be any valid numeric expression. Both int and fix remove the fractional part of number and return the resulting integer value...

  • Page 172

    Section 8. Processing and math instructions 8-12 dim i, m 'declare variables. Beginprog m = exp(1) for i = 1 to 3 'do three times. M =log(exp(1) ^ i) next i endprog memory test stores the results of the most recent memory test in a variable. Syntax memorytest ( dest ) remarks the cr9000 tests cpu ra...

  • Page 173

    Section 8. Processing and math instructions 8-13 spatial minimum finds the minimum value in a swath of variables in an array. Syntax minspa( dest, swath, source ) remarks find the minimum value in the given array and place the result in the array named in dest. The source must be a particular elemen...

  • Page 174

    Section 8. Processing and math instructions 8-14 move moves a block or fills an array. Syntax move( dest, reps, source, reps ) remarks block move or fill array. Parameters: dest array, destination reps; source array or expression; source reps. If source reps is less than destination reps, the remain...

  • Page 175

    Section 8. Processing and math instructions 8-15 not (-1) = 0 not (0) = -1 not (nan) = nan (nan= not a number) or operator used to perform a bit-wise disjunction on two numbers. Syntax result = number1 or number2 the or operator performs a bit-wise comparison of identically positioned bits in two nu...

  • Page 176

    Section 8. Processing and math instructions 8-16 both have the same effect, x will be set to –1 if temp(1) is greater than 50 or temp(4) is less than 40. X will be set to 0 if both expressions are false. Peakvalley (destpv, destchange, reps, source, hysteresis) peakvalley is used to detect peaks and...

  • Page 177

    Section 8. Processing and math instructions 8-17 datatable(pvboth,change(3),500) sample(2,peakv(1),ieee4) endtable beginprog scan(500,msec,0,0) deg=deg+5 xy(1)=cos(deg*pi/180) ‘compute the cosine as input xy(1) xy(2)=sin(deg*pi/180) ‘compute the sine as input xy(2) peakvalley(peakv(1),change(1),2,xy...

  • Page 178

    Section 8. Processing and math instructions 8-18 randomize initializes the random-number generator. Syntax randomize [number] remarks the argument number can be any valid numeric expression. Number is used to initialize the random-number generator by giving it a new seed value. If you omit number, t...

  • Page 179

    Section 8. Processing and math instructions 8-19 rectpolar (dest, source) converts from rectangular to polar coordinates. Parameter & data type enter rectpolar parameters dest variable array variable array in which to store the 2 resultant values. The length of the vector is stored in the specified ...

  • Page 180

    Section 8. Processing and math instructions 8-20 spatial rms used to compute the rms value of an array. Syntax rmsspa( dest, swath, source ) remarks spatial rms, calculate the root mean square of values in an array. ( ) dest x i swath i j i j swath = = = + ∑ ( ) 2 where x(j) = source parameter & dat...

  • Page 181

    Section 8. Processing and math instructions 8-21 parameter & data type enter straincalc parameters dest variable to store strain in. Reps number of strains to calculate, destination, source, and zero variables must be dimensioned accordingly. Brconfig bridge configuration code for strain gages the b...

  • Page 182

    Section 8. Processing and math instructions 8-22 'program name: strain.Dld public count, zstrain, stmeas, strain, flag(8) ' declare all variables as public 'data table strains samples every measurement when user sets flag(1) high datatable(strains,flag(1),-1) datainterval(0,0,0,100) 'interval = scan...

  • Page 183

    Section 8. Processing and math instructions 8-23 value of number number returned the same number every time, as determined by number. > 0 the next random number in the sequence. = 0 the number most recently generated. Number omitted the next random number in the sequence. The same random-number sequ...

  • Page 184

    Section 8. Processing and math instructions 8-24 sine function returns the sine of an angle. Syntax sin( angle ) remarks the argument angle can be any valid numeric expression measured in radians. The sin function takes an angle and returns the ratio of two sides of a right triangle. The ratio is th...

  • Page 185

    Section 8. Processing and math instructions 8-25 spatial standard deviation used to find the standard deviation of an array. Syntax stddevspa( dest, swath, source ) remarks spatial standard deviation. Dest x i x i swath swath i j i j swath i j i j swath = − ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ = = + ...

  • Page 186

    Section 8. Processing and math instructions 8-26 xor the xor function is used to perform a binary logical exclusion on two numbers. Syntax result = number1 xor number2 the xor operator also performs a bit-wise comparison of identically positioned bits in two numbers (may be variables or the results ...

  • Page 187: Section 9.  Program Control

    9-1 section 9. Program control instructions beginprog, endprog used to mark the beginning and end of a program. Syntax beginprog ... ... Endprog marks the end of variable, datatable declarations and the beginning of the main program. Beginprog example this example uses beginprog and endprog to mark ...

  • Page 188

    Section 9. Program control instructions 9-2 syntax beginbursttrigger [statementblock] endbursttrigger(bursttrigger, scansaftertrigger) or beginbursttrigger [statementblock] endbursttriggersequence (scansbefore, starttrigger, stoptrigger, scansaftertrigger, fillandstop ) the beginbursttrigger... Endb...

  • Page 189

    Section 9. Program control instructions 9-3 normally skipped when the processing for the rest of the scan takes place after the burst is completed. This processing includes converting the raw measurement result and storing it in the destination variable.) endbursttrigger the endbursttrigger instruct...

  • Page 190

    Section 9. Program control instructions 9-4 parameter & data type enter process empty or 1 this is an optional parameter on the beginbursttrigger instruction. If set to 1 the measurements or calculations within beginbursttrigger … endburst… will be available to output when the burst is complete. If ...

  • Page 191

    Section 9. Program control instructions 9-5 '\\\\\\\\\\\\\\\\\\\\\\\ timing constants /////////////////////// const rate = 100 'scan interval number const runits = 0 'scan interval units (usecs) '\\\\\\\\\\\\\\\\\\\\\\\ bridge constants /////////////////////// '________________________ bridge block ...

  • Page 192

    Section 9. Program control instructions 9-6 call the call statement is used to transfer program control from the main program to a subroutine. Syntax call name(list of variables) remarks use of the call keyword when calling a subroutine is optional. The call statement has these parts: part descripti...

  • Page 193

    Section 9. Program control instructions 9-7 data, read, restore used to mark the beginning of a data list. Syntax data list of constants read [varexpr] restore remarks data function: a list of floating point constants that can be read (using read) into an array variable. Parameter: a list of floatin...

  • Page 194

    Section 9. Program control instructions 9-8 delay used to delay the program. Syntax delay( delay, units ) remarks delay processing the specified time before continuing. Parameter & data type enter delay constant the time to delay before continuing with the next measurement. Units the units for the d...

  • Page 195

    Section 9. Program control instructions 9-9 condition numeric expression that evaluates true (nonzero) or false (0 or null). Statementblock program lines between the do and loop statements that are repeated while or until condition is true. Exit do only used within a do...Loop control structure to p...

  • Page 196

    Section 9. Program control instructions 9-10 remarks filemanage is a function that allows a running dld program to manipulate files that are stored in the cr9000. "d:filename" is the device and name of the file that must have previously been stored in the cr9000. The device must be cpu: or a possibl...

  • Page 197

    Section 9. Program control instructions 9-11 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. The variable cannot be an array element or a ...

  • Page 198

    Section 9. Program control instructions 9-12 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 s...

  • Page 200

    Section 9. Program control instructions 9-14 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...

  • Page 201

    Section 9. Program control instructions 9-15 outlink (source, reps, link) used to synchronize scans and to send data to another cr9000 connected via either the tlink or the fiber optic link. Waitlinktrig is used in the receiving cr9000 to input the data. When outlink is executed, it sends the data o...

  • Page 202

    Section 9. Program control instructions 9-16 the units for the interval are days, hours, minutes, or seconds. Power off can also be used in conjunction with the digital inputs on the 9011 power supply board to set up the cr9000 to power up in response to external trigger, make a series of measuremen...

  • Page 203

    Section 9. Program control instructions 9-17 resettable example the example program line uses resettable to reset table main when flag(2) is high. If flag(2) then resettable( main ) 'resets table main rundldfile used to run one dld file from another. Syntax rundldfile( "d:filename", attribute ) rema...

  • Page 204

    Section 9. Program control instructions 9-18 reset table used to reset a data table under program control. Syntax resettable( tablename ) remarks resettable is a function that allows a running dld program to reset a data table. Tablename is the name of the table to reset. Resettable example the exam...

  • Page 205

    Section 9. Program control instructions 9-19 remarks the measurements, processing, and calls to output tables bracketed by the scan and nextscan instructions determine the sequence and timing of the datalogging. The scan instruction determines how frequently the measurements within the scan are made...

  • Page 206

    Section 9. Program control instructions 9-20 clause, only the statements following the first match are executed. Case sets apart a group of crbasic statements to be executed if an expression in expressionlist matches testexpression. Expressionlist the expressionlist consists of a comma-delimited lis...

  • Page 207

    Section 9. Program control instructions 9-21 dim x, y 'declare variables. If not x = y then 'are they equal if x > y then select case x 'what is x. Case 0 to 9 'must be less than 10. . . . . 'run some code. . . . . 'run some code. Case 10 to 99 'must be less than 100. . . . . 'run some code. . . . ....

  • Page 208

    Section 9. Program control instructions 9-22 the slowsequence scan, the measurements that go into that integration may not occur sequentially, but may be broken up into multiple integration segments that are separated by the time that the primary scan measurements require. If settling time is used f...

  • Page 209

    Section 9. Program control instructions 9-23 timer example the example uses timer. Wait digital trigger used to wait for a digital trigger before making measurements. Syntax waitdigtrig( pslot, mask, word ) remarks measurement sequencer will wait until the digital inputs on the cr9071e counter - tim...

  • Page 210

    Section 9. Program control instructions 9-24 waitlinktrig (dest, reps, link) waitlinktrig is used to trigger cr9000 scans by a message sent over a communication link from another cr9000 sent using the outlink instruction. Waitlinktrig is placed immediately after the scan instruction and pauses the s...

  • Page 211: Constants

    A-1 appendix a. Keywords and predefined constants the following is a list of keywords and predefined constants in crbasic. These keywords are not case sensitive and must not be used as variable names. It is possible to use a keyword as part of a variable name if there are additional letters precedin...

  • Page 212

    Appendix a. Keywords and predefined constants a-2 long =20, predefined constant loop program control lowpriority program control maximum output processing maxspa processing memorytest calibration min =3, predefined constant minimum output processing minspa processing mod operator moduletemp measurem...

  • Page 213: Cr9000 Index

    Index-1 cr9000 index a abs, absolute value instruction, 8-1 ac excitation, 3-17 alias, 4-4, 4-8, 5-1 am25t instruction, 7-12 and operator, 8-2 anti-aliasing, 3-23 anti-logarithm, 8-7 argument rules, 4-8 arrays, 4-9 atn, arctangent instruction, 8-3 average output instruction, 6-9 avgrun, spatial aver...

  • Page 214

    Cr9000 index index-2 dsp4 instruction, 6-8 e editor, ov-12 else, 9-13 elseif, 9-13 enclosure, 1-1 end sub, 5-3 endbursttrigger, 9-1 endbursttriggersequence, 9-1 endif, 9-13 endprog, 9-1 endselect, 9-20 endtable, 6-1 excitation, 7-10 excitation, reversal, 3-2 excite instruction, 7-10 exit do, 9-9 exi...

  • Page 215

    Cr9000 index index-3 maximum output instruction, 6-21 maximum, local, 8-17 maxspa, spatial maximum instruction, 8-13 measurements analog voltage sequence, 3-1 common mode check (r option), 3-5 common mode range, 3-4 delay, 3-2 integration, 3-3 multiplexed through cr9041, 3-1 open sensor detect, 3-5 ...

  • Page 216

    Cr9000 index index-4 select case, 9-20 serial input/output, 7-21 sgn function - sign of number, 8-25 sin, sine function, 8-26 single ended voltage measurement, 7-3 sio4 instruction, 7-21 slowsequence instruction, 9-22 spatial average, 8-3 spatial covariance, 8-6 spatial maximum function, 8-13 spatia...

  • Page 217

    This is a blank page..

  • Page 218

    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 sales@csafrica.Co.Za campbell scientif...