background image

Appendix B.  Example Program 

B-3

  

Average

 (1,PTemp,FP2,0) 

EndTable

 

DataTable

 (One_Minute,1,-1) 

 

DataInterval

 (0,60,Sec,10) 

  

Sample

 (NumTempSensors,TempC(),IEEE4) 

EndTable

 

'Define Subroutines 

'***************************************************************************** 
'*  ------------------------- ConvertSDI12addr() --------------------------  * 
'*  Convert SDI-12 character address (0->9, A->Z, and a->z) to number value  * 
'*  (0->61).                                                                 * 
'***************************************************************************** 

Function

 ConvertSDI12addr(address 

As

 

Long

As

 

String

 * 1 

 

Select

 

Case

 address 

 

Case

 0 

To

 9  

'ASCII Code 48->57 = 0->9

 

 

Return

(

CHR

(a 48)) 

 

Case

 10 

To

 35  

'ASCII Code 65->90 = A->Z = 10->35

 

 

Return

(

CHR

(a 55)) 

 

Case

 36 

To

 61  

'ASCII Code 97->122 = a->z = 36->61

 

 

Return

(

CHR

(a 61)) 

 

EndSelect

 

  

Return

("") 

EndFunction

  

'ConvertSDI12addr()

 

'EndSub 

'Main Program 

BeginProg

 

 

Scan

 (5,Sec,0,0) 

 

PanelTemp

 (PTemp,250) 

 

Battery

 (batt_volt) 

 

CallTable

 Daily 

 

CallTable

 Hourly 

 

NextScan

 

 'Poll CS230/CS231 in Slow Sequence every minute 

 

SlowSequence

 

 

Scan

 (60,Sec,3,0) 

 'Read the current temperature value 

 

For

 i=1 

To

 NumTempSensors 

   

SDI12Recorder

 (TempC(i),SDI12_Port,ConvertSDI12addr(i),"R0!",1.0,0) 

 

Next

 

 

CallTable

 One_Minute 

 

NextScan

 

EndProg

 

B.3  CR1000X Program to Read Metadata of 15

Temperature Sensors 

In this example, a CS230/CS231 is on control terminal 1 of a CR1000X. The 

CS230/CS231 includes 15 sensors with SDI-12 addresses 1 through 9 and A 

through F. Each temperature sensor is polled on power up and daily with the 

aR1!

 command to determine metadata, which is stored in a daily data table. 

Содержание CS230

Страница 1: ...CS230 CS231 Temperature Profilers Revision 1 19 Copyright 2016 2019 Campbell Scientific...

Страница 2: ......

Страница 3: ...under guarantee or not Please state the faults as clearly as possible and if the product is out of the guarantee period it should be accompanied by a purchase order Quotations for repairs can be give...

Страница 4: ......

Страница 5: ...digital cell phones and aerials may also not be applicable according to your locality Some brackets shields and enclosure options including wiring are not sold as standard items in the European marke...

Страница 6: ......

Страница 7: ...beginning work Wear a hardhat and eye protection and take other appropriate safety precautions while working on or around tripods and towers Do not climb tripods or towers at any time and prohibit cl...

Страница 8: ......

Страница 9: ...uction 8 7 4 2 Slow Sequence Program Instructions 8 8 Operation 8 8 1 Sensor Measurements 8 8 1 1 SDI 12 Addressing 9 8 1 2 Metadata 11 8 2 Long Cables 11 8 3 Power Conservation 11 9 Maintenance Calib...

Страница 10: ...3 Line Surge Protector Mounting and Wiring D 1 Figures 7 1 CS231 installation example with three external sensors and five internal sensors 6 7 2 Internal sensor label 6 D 1 SGB3 3 line surge protecto...

Страница 11: ...r its resistance to temperature extremes moisture and UV degradation However this jacket will support combustion in air It is rated as slow burning when tested according to U L 94 H B and will pass FM...

Страница 12: ...sor in the Sensors Temperature folder Double click CS230 CS231 SDI 12 Temperature Profiler Type the correct Starting SDI 12 Address for the first external probe or the top temperature point in the rig...

Страница 13: ...ta logger check the output of the sensor in data display in LoggerNet PC400 RTDAQ or PC200W to make sure it is making reasonable measurements 5 Overview The CS231 offers the same precise temperature p...

Страница 14: ...Specifications Features Accurate and stable measurements Each sensor is individually addressed and referenced to its depth Low power consumption Digital SDI 12 output Compatible with the following da...

Страница 15: ...ent it is important that consistent contact be made between the temperature profiler and the medium The location of the temperature profiler should be representative of the intended application Typica...

Страница 16: ...and five internal sensors FIGURE 7 1 is an example configuration with three external sensors and five internal sensors Each profiler is custom built to the user s specific requirements FIGURE 7 2 sho...

Страница 17: ...the CS230 serial number is less than 1162 TABLE 7 1 Wire Colour Function and Data Logger Connections Wire Colour Function Data Logger Connection Terminal Red Power 12V Green SDI 12 Signal C or U1 term...

Страница 18: ...tonTimeout are optional parameters refer to CRBasic Help for more information 7 4 2 Slow Sequence Program Instructions Use the slow sequence program instructions when the CS230 CS231 measurements will...

Страница 19: ...floating point C aR6 Read and reset user resettable min temperature Min temperature floating point C This value constitutes the minimum of all 1 second measurements taken since the previous aR6 comma...

Страница 20: ...tiple sensors the same SDI 12 address will prevent the sensors from communicating Use the aA command where a is the affected address to reset the affected sensors to their factory configured address v...

Страница 21: ...een the temperature profiler and data logger digitally there are no offset errors incurred with increasing cable length as seen with analogue sensors However with long enough cable lengths the digital...

Страница 22: ...non switched for test purposes Symptom Sensor won t respond to command 1 Expected address not used or has been changed a Confirm all addresses in use with the aI command to determine the individual ad...

Страница 23: ...Cut program following the procedure in Section 4 QuickStart p 1 Finish the program On the Advanced tab click the CRBasic Editor button The program opens in CRBasic with the name noname CR_ Provide a n...

Страница 24: ......

Страница 25: ...in the probe will need to be adjusted to fit specific application Const NumTempSensors 15 Uses the control terminal C1 on the CR1000X Const SDI12_Port C1 Public TempC NumTempSensors As Float Dim i As...

Страница 26: ...terval Other common station data is measured every 5 seconds and stored to a daily and hourly data tables CRBasic Example B 2 CR1000X Program Using Slow Sequence to Read CS230 CS231 with 20 Sensors CR...

Страница 27: ...tion ConvertSDI12addr EndSub Main Program BeginProg Scan 5 Sec 0 0 PanelTemp PTemp 250 Battery batt_volt CallTable Daily CallTable Hourly NextScan Poll CS230 CS231 in Slow Sequence every minute SlowSe...

Страница 28: ...ables DataTable MetaData 1 1 DataInterval 0 1 Day 10 Sample MetaData_pts Meta FP2 EndTable Define Subroutines ConvertSDI12addr Convert SDI 12 character address 0 9 A Z and a z to number value 0 61 Fun...

Страница 29: ...minimum and maximum are recorded every 5 minutes and Metadata is collected daily Declare Public Variables Public PTemp batt_volt Enter the number of temperature sensors that are in the probe will need...

Страница 30: ...order Meta i 1 SDI12_Port ConvertSDI12addr i R1 1 0 0 Next EndIf Read the current Temperature Min and Max Values Every 5 minutes and Reset the Value If TimeIntoInterval 0 5 Min Then For i 1 To NumTemp...

Страница 31: ...s C 2 SDI 12 Command Basics SDI 12 commands have three components Sensor address a a single character and the first character of the command Use the default address of zero 0 unless multiple sensors a...

Страница 32: ...ber or other sensor specific information may also be included aI allccccccccmmmmmmvvvxxx xx CR LF a Sensor SDI 12 address ll SDI 12 version number indicates compatibility cccccccc 8 character vendor i...

Страница 33: ...ated with the M command The response to each command has the form atttn CR LF where a sensor address ttt time in seconds until measurement data is available When the data is ready the sensor notifies...

Страница 34: ...rs of data in response to a D command that follows an M command Command aD0 aD1 aD9 Response a values CR LF or a values CRC CR LF where a the sensor address values values returned with a polarity sign...

Страница 35: ...ect All Caps Mode 6 Press Enter until the data logger responds with the CR1000 prompt 7 Type SDI12 and press Enter 8 At the Select SDI12 Port prompt type the number corresponding to the control termin...

Страница 36: ......

Страница 37: ...Vac L1 L2 L3 with respect to G terminals Maximum Current 2 A per terminal 4 A total requires both ground terminals for return current Maximum Rated Surge 1200 A 8 20 us D 2 SGB3 3 Line Surge Protector...

Страница 38: ...logger using the 2 ft cable shipped with the CS230 2 U terminals are automatically configured by the measurement instruction If multiple SDI 12 sensors are connected to a data logger Campbell Scienti...

Страница 39: ......

Страница 40: ...Asia Location Bangkok Thailand Email info campbellsci asia Website www campbellsci asia China Location Beijing P R China Email info campbellsci com cn Website www campbellsci com cn Spain Location Ba...

Отзывы: