Part Number Hot Search : 
P2600SDL 1C5567M0 BCY58 U1B11 M12542PD VISHAY 12S12 FSL234D3
Product Description
Full Text Search
 

To Download CS120 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  CS120 visibility sensor user guide issued: 15.1.13 copyright ? 2010-2013 campbell scientific ltd. csl 880

guarantee this equipment is guarant eed against defects in materials and workmanship. this guarantee applies for twelve mont hs from date of delivery. we will repair or replace products which prove to be defective dur ing the guarantee period provided they are returned to us prepaid. the guarantee will not apply to: ? equipment which has been modified or altered in any way without the written permission of campbell scientific ? batteries ? any product which has been subjected to misuse, neglect, acts of god or damage in transit. campbell scientific will return guaran teed equipment by surface carrier prepaid. campbell scientific will not re imburse the claimant for costs incurred in removing and/or reinstalling equipment. this guarantee and the company?s obligation thereunder is in lieu of all ot her guarantees, expressed or implied, including those of suitability and fitne ss for a particular purpose. campbell scientific is not liable for consequential damage. please inform us before returning equi pment and obtain a repair reference number whether the repair is under guarant ee 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. qu otations for repairs can be given on request. it is the policy of campbell scie ntific to protect the health of its employees and provide a safe working e nvironment, in support of this policy a ?declaration of hazardous material and decontamination? form will be issued for completion. when returning equipment, the repair reference number must be clearly marked on the outside of the package. complete the ?declaration of hazardous material and decontamination? form and ensure a completed copy is returned with your goods. please note your repair may not be processed if you do not include a copy of this form and campbell scientific ltd reserves the right to return goods at the customers? expense. note that goods sent air freight are s ubject to customs clearance fees which campbell scientific will charge to custom ers. in many cases, these charges are greater than the cost of the repair. campbell scientific ltd, campbell park, 80 hathern road, shepshed, loughborough, le12 9gx, uk tel: +44 (0) 1509 601141 fax: +44 (0) 1509 601091 email: support@campbellsci.co.uk www.campbellsci.co.uk

please read first about this manual some useful conversion factors: area: 1 in 2 (square inch) = 645 mm 2 length: 1 in. (inch) = 25.4 mm 1 ft (foot) = 304.8 mm 1 yard = 0.914 m 1 mile = 1.609 km mass: 1 oz. (ounce) = 28.35 g 1 lb (pound weight) = 0.454 kg pressure: 1 psi (lb/in 2 ) = 68.95 mb volume: 1 uk pint = 568.3 ml 1 uk gallon = 4.546 litres 1 us gallon = 3.785 litres recycling information at the end of this product?s life it should not be put in commercial or domestic refuse but sent for recycling. any batteries contained within the product or used during the products life should be removed from the product and also be sent to an appropriate recycling facility. campbell scientific ltd can advise on the recycling of the equipment and in some cases arrange collection and the correct disposal of it, although charges may apply for some items or territories. for further advice or support, please contact campbell scientific ltd, or your local agent. campbell scientific ltd, ca mpbell park, 80 hathern road, shepshed, loughborough, le12 9gx, uk tel: +44 (0) 1509 601141 fax: +44 (0) 1509 601091 email: support@campbellsci.co.uk www.campbellsci.co.uk

i contents pdf viewers note: these page numbers refer to the printed version of this document. use the adobe acrobat? bookmarks tab for links to specific sections. 1. introduction .................................................................. 1 1.1 version information ................................................................................. 1 1.2 general safety .......................................................................................... 2 1.3 sensor unit safety .................................................................................... 2 2. technical specification ............................................... 3 3. electrical specification ................................................ 3 4. supported data rates for rs232 and rs485 .............. 4 5. environmental specifications ..................................... 5 6. physical specification ................................................. 5 7. installation procedure ................................................. 5 7.1 equipment grounding ............................................................................... 7 7.2 mounting the CS120 ................................................................................. 7 7.3 optional campbell scientific mount ........................................................ 9 8. CS120 internal connectors? description .................. 11 8.1 CS120 recommended wiring using campbell scientific cables ............. 13 9. functions of the internal switches ........................... 16 10. message formats: a breakdown of the different default outputs of the CS120 ? basic/partial/full .................................................... 17 10.1 example CS120 message outputs ......................................................... 20 11. interface methods ? device configuration utility/command line/menu ................................. 20 11.1 configuring a pc fo r talking to the CS120 .......................................... 21
ii 12. definition of the variables that can be set by the user on the CS120 .......................................... 21 13. command line mode ................................................ 23 13.1 the set command............................................................................... 23 13.1.1 example of a set command ................................................... 24 13.2 the setnc command ........................................................................ 25 13.2.1 example of a setnc command ............................................. 25 13.3 the get command .............................................................................. 25 13.4 the poll command ? polling the CS120 .......................................... 27 14. entering the CS120 menu system .......................... 28 15. calibrating the CS120 .............................................. 33 16. performing a firmware update ................................ 36 17. cleaning .................................................................... 37 18. lubricating the enclosure screws .......................... 38 19. desiccant .................................................................. 38 appendix a. CS120 block diagram .............................................. a-1 b. example c code of the ccitt crc ....................... b-1 c. example crbasic programs .................................. c-1
1 CS120 visibility sensor 1. introduction the CS120 is an infrared forward scatter visibility sensor for automatic weather stations including road, marine and airport based stations. the CS120 uses the well established forward scatter system for visibility measurement, utilising a 42o scatter angle. the CS120 uses high speed sampling to reduce missed events such as rain and hail and improves response to other suddenly changing conditions. 1.1 version information manual version revisions 1.0 none 2.0 updated for o/s version 4 3.0 updated for o/s version 5 4.0 updated for o/s version 6
CS120 visibility sensor 2 1.2 general safety this manual provides important safety considerations for the installation, operation and maintenance of the CS120. these safety considerations are classified into three levels: warnings alert the installer or user to serious hazards. ignoring these warnings could result in injury or death and/or irrevocable damage to the sensor unit. cautions warn of potential hazards. ignoring these cautions could result in the sensor being damaged and data being lost. notes highlight useful information in the installation, use and maintenance of this product. these should be followed carefully in order to gain the maximum benefit from the use of this product. 1.3 sensor unit safety the CS120 sensor has been checked for safety before leaving the factory and contains no internally replaceable or modifiable parts. do not modify the CS120 unit . such modifications will lead to damage of the unit and could expose users to dangerous light levels and voltages. in unusual failure modes and environmental conditions the sensor hood could become hot. in normal operation they will be at ambient temperature or slightly above. ensure that the correct voltag e supply is provided to the sensor. warning caution note warning warning caution
user guide 3 2. technical specification minimum value nominal value maximum value visibility characteristics reported visibility (metric) 12 metres - 32,000 metres reported visibility (imperial) 39 feet - 104,985 feet visibility accuracy up to 10,000m - +/-10% - visibility accuracy up to 20,000m - +/-20% - optical characteristics led centre wavelength - 850nm - led spectral bandwidth - +/-35nm - pulse characteristics light pulse rate - 1khz - 3. electrical specification minimum value nominal value maximum value main power supply for dsp and dew heaters power supply, +12v connection (dc only) 7v 12v 30v current consumption sampling continuously with dew heaters active (at 12v dc) - 180ma 228ma current consumption sampling continuously with dew heaters disabled (at 12v dc) - 100ma 150ma current consumption without any sampling occurring and dew heaters disabled (at 12v dc) - 8ma 12ma active power consumption with dew heaters and rs232 communications interface active (5) (at 12v dc) - 184ma 232ma hood heater power supply hood heater voltage (ac or dc) - 24v (1) 30v (1) hood heater wattage (at 24v ac or dc) (6) - 60w (2) - rs232 communications rs232 input threshold low 0.8v 1.5v - rs232 input threshold high - 2.0v 2.4v rs232 input absolute maximum -15v - +15v rs232 input resistance 12k - - rs232 output voltage low - - 0.4v
CS120 visibility sensor 4 rs232 output voltage high (into 3k ) 4.4v - - rs485 communications rs485 input threshold voltage -0.2v - +0.2v rs485 output (unloaded) - - 5v rs485 output (load 50 ) 2v - - maximum voltage at any terminal (4) -7v - +7v user alarm outputs user output high level (at 85oc) 3.8v - - user output high level (at 25oc ) 4.13v - - user output low (all temperatures) 0.25v - 0.55v user output current - - 32ma (1) it is recommended that the hood heaters are run at 24v ac/dc. it?s possible to run the heaters at any voltage below 24v but the heaters will generate proportionally less heat reducing their ability to prevent ice build-up. (2) each hood takes 30w, 60w is the total for both hoods on the sensor together. (3) the ground of the CS120 and the earth of any rs485 equipment cannot be further apart than this voltage. a 100 resistor can be used to connect the CS120 rs485 earth to other equipment. this will reduce any parasitic currents and bring the two earths closer together if a direct connection cannot be made. (4) the rs232 communications interface will automatically turn itself off when not transmitting. (5) if hood heaters are not being used ensure `hood heater override? (details in section 13) is set to off. 4. supported data rates for rs232 and rs485 serial setting 8n1 supported data rates ? 1200 bps ? 2400 bps ? 9600 bps ? 19200 bps ? 38400 bps - default ? 57600 bps ? 115200 bps
user guide 5 supported formats ? rs232 (full duplex only), default ? rs485 (half duplex) ? 8 bit data bytes ? 1 stop bit ? parity checking is not supported as most communication protocols used by the CS120 have built in checksums as well as checks that communications have been understood 5. environmental specifications minimum value nominal value maximum value sensor temperature ranges operating temperature -25 - +60 extended operating temperature -40 - +70 (1) storage temperature -40 - +85 sensor humidity ranges operating humidity range 0% - 100% sensor heater thresholds dew heater turn on - <35c - dew heater turn off - >40c - hood heater turn on - <5c - hood heater turn off - >15c - (1) extended temperature ranges are only guaranteed if the sensor has been tested by campbell scientific and verified within this temperature range. some degradation of absolute accuracy can be expected at the extremes of the extended ranges. 6. physical specification main body including base mount height: 447 mm width: 640 mm depth: 245 mm sensor weight: 3 kg sensor mounting: mounts on vertical pole 32-52.5 mm diameter shipping weight: 6 kg (including packing box) 7. installation procedure the CS120 measures environmental variables and is designed to be located in harsh weather conditions. however there are a few considerations to take into account if accurate and representative data from a site are to be obtained.
CS120 visibility sensor 6 the descriptions in this section are not exhaustive. please refer to meteorological publications for further information on locating weather instruments the CS120 should be sited in a position representative of local weather conditions and not of a specific microclimate (unless the analysis of microclimate weather is being sought). avoid locations where the transmitter is pointing at a light scattering or reflecting surface. if possible the receiver should point north in the northern hemisphere and south in the southern hemisphere. to give non-microclimatic measurements the CS120 should be sited away from possible physical obstructions that could affect the fall of precipitation. the CS120 should also be positioned away from sources of heat, electrical interference and in such a position as to not have direct light on the sensor lenses. whenever possible, the CS120 should be located away from windbreaks. several zones have been identified upwind and downwind of a windbreak in which the airflow is unrepresentative of the general speed and direction. eddies are generated in the lee of the windbreak and air is displaced upwind of it. the height and depth of these affected zones varies with the height and to some extent the density of the obstacle. generally, a structure disturbs the airflow in an upwind direction for a distance of about twice the height of the structure, and in a downwind direction for a distance of about six times the height. the airflow is also affected to a vertical distance of about twice the height of the structure. ideally, therefore, the CS120 should be located outside this zone of influence in order to obtain representative values for the region. in order to reduce the service frequency with the unit, the CS120 should be placed away from sources of contamination, in the case of roadside monitoring; larger mounting poles can be used. more regular maintenance will be required when the instrument is placed in areas where contamination is unavoidable or where measurements may be safety critical. the wmo recommend a sample volume height of 1.5 m. however, for applications such as aviation or road visibility other heights may be appropriate. note receive r transmitte r
user guide 7 if operating a CS120 indoors it is likely that there will be sources of light and/or reflections that will create false readings and erratic results. if carrying out simple checks, blocking a lens or the sample volume will simulate an increase in visibility not a decrease. 7.1 equipment grounding the CS120 must be properly grounded by taking a ground wire with a minimum cross sectional area of 6 mm 2 and maximum length of 5 m from the brass grounding lug in the lower face of the electronics enclosure to an adequate grounding point. the pole and foundations of a pole mounted installation will provide some basic lightning protection and protection against radio frequency interference and should also be correctly grounded. 7.2 mounting the CS120 a pole mounting kit is supplied with the CS120. this kit includes a dsp plate, two brackets and suitable bolts for clamping the pole between the dsp plate and brackets. to mount the CS120 onto a pole: 1. check the pole diameter and select the correct bolts. if the pole is between 32 mm od and 46.5 mm od use the m8 x 75 mm bolts. if the pole is between 46.5 mm od and 52.5 mm od use the m8 x 90 mm bolts. 2. slide the bolts into the brackets with the v cut out as shown in figure 3-10. 3. the dsp plate is supplied ready fixed to the CS120 on the dsp enclosure. offer up the dsp plate to the pole and present the brackets and bolts from the other side of the pole to fit into the matching holes of the dsp plate. note note ea r th
CS120 visibility sensor 8 4. clamp the pole between the dsp plate and brackets by tightening using the nuts provided. 5. if a power supply enclosure has been supplied with the sensor it can be mounted on the pole, near its base using the brackets supplied with the enclosure. alternatively the power supply can be mounted elsewhere, e.g. on a wall at some distance from the sensor. the power supply enclosure should be mounted away from the sensor head to avoid wind flow disturbance or rain drops bouncing back up into the sensor?s sensing volume. take care not to overtighten the nuts on the bolts, as it may be possible to distort and/or damage the brackets or dsp plate by doing so, and/or the nuts may seize up. only tighten the nuts to a degree necessary to hold the CS120 firmly in place. where the CS120 is to be mounted onto another type of mast, please refer to the manual for that mast for mounting details. ensure that the CS120 is mounted according to figure below. do not reposition, once fixings are tightened, by forcing the arms of the unit as this can damage the unit. slots are provided to allow band clamps to be used with larger diameter masts. caution caution
user guide 9 7.3 optional ca mpbell scientific mount a campbell scientific `optical sensor mount?, part number 009354, is available. this will put the sample volume at about 1.5 m in compliance with the wmo `guide to meteorological instruments and methods of observation?, 7 th edition, section 9.3.4. if one is to be used, follow the installation instructions below. the mount should be installed on a concrete foundation. if one does not already exist then a concrete foundation should be constructed at least 600 mm square and 600 mm deep. ensure the ground consistency is not too loose and will be able to support the mount and concrete foundation.
CS120 visibility sensor 10 drill four 12 mm diameter holes using the mount base as a template or following the drawing below to a depth of 77 mm. clean the holes of all debris. place washers and nuts on the ends of the wedge anchors supplied (to protect the threads during installation). hammer the wedge anchors into the holes until the start of the threads are below the surface. tighten the nuts until about 25 mm of thread protrudes above the surface. remove the washers and nuts from the protruding length screw. then lower the mount into place. finally secure the mount with the washers and nuts. if the surface is not level and flat it may be necessary to add washers under the base on one or more of the foundation screws.
user guide 11 8. CS120 internal connectors? description the CS120 has two standard ip66 rated glands for connecting to external equipment. the first gland is by default used by the power/communications line. this comprises of the +12v/24v for the main electronics, and the serial communications wires. the CS120 is supplied with 5 m cable already connected. the second gland is used for the 24 v feeds for the hood heaters fitted with a 10 m cable. if the power cable is incorrectly wired to the CS120 then irrevocable damage can be done to the unit. 10 m is the longest length of the cable type supplied recommended. in particular, additional rs485 communication should be twisted pair. please contact campbell scientific if you wish to use a longer length of cable. a configuration cable, part number 010817, is available from campbell scientific that plugs directly into connector b, in place of the normal connector and cable. the configuration cable is fitted with a 9-way d connector for use with a pc serial port or usb to serial adaptor. warning caution connector a connector b connector c gland 1 communications and power by default gland 2 hood heaters by default 1 2 3 4 5 1 2 3 1 2 3 4
CS120 visibility sensor 12 connector a five way connector pin number description notes pin 1 +12v main electronics 12v supply input (also supports 24v dc) pin 2 0v auxiliary electronics 0v. common with the main electronics 0v. pin 3 hood low hood heater ?v input, this input is totally separate to the main electronics 0v within the sensor so can be connected to a separate power supply. however, this pin should not be more than 5v different from the main electronics 0v. pin 4 0v auxiliary electronics 0v. common with the main electronics 0v. pin 5 hood high hood heater +v input (normally 24v) connector b three way connector pin number description notes pin 1 0v 0v connection for serial communications. this connection is common with the main electronics 0v (connector a, pin 2). pin 2 receive rs232 receive line. also, acts as the y transmit line in rs485 half duplex mode and the a receive line pin 3 transmit rs232 transmit line. also, acts as the z transmit line in rs485 half duplex mode and the b receive line connector c ? user alarms four way connector pin number description notes pin 1 0v 0v connection for user alarms. this connection is common with the main electronics 0v (connector a, pin 2). pin 2 user 2 output for user alarm 2 pin 3 0v 0v connection for user alarms. this connection is common with the main electronics 0v (connector a, pin 2). pin 4 user 1 output for user alarm 1 to use these connections it is necessary to either use the cable gland taking the hood heater power or, if the hood heater is also required, to use different cables to those supplied. please contact campbell scientific if you need any advice on choice of cable. note
user guide 13 8.1 CS120 recommended wiring usin g campbell scie ntific cables (this cable is supplied already connected as standard) the CS120 is provided pre-wired with a default 5 m power and communications cable which is terminated at one end with a 9 pin d-connector (db9). the d- connector can be connected directly to a pc or to a datalogger such as the campbell scienific cr1000 using a suitable interconnecting cable such as the sc110. if another type of connection is required then the d-connector should be removed.
CS120 visibility sensor 14
user guide 15
CS120 visibility sensor 16 9. functions of the internal switches the CS120 is equipped with four switches located within the main enclosure. these switches perform certain functions at power up, their functions are detailed below. the switches are only read during the power up sequence of the CS120. this means that if the switches are pressed whilst the CS120 is running nothing will happen, the sensor will need to be power cycled leaving at least 10 seconds with the sensor off for any of their functions to be performed. switch 4 switch 3 switch 2 switch 1 internal switch functions switch number function 4 reserved for future use 3 when switched to the on position this switch temporarily sets the CS120 communications port to a default rs232 communication state (38400 bps). this is useful during field tests or maintenance when the CS120 has been remotely configured for rs485 mode or a baud rate your pc does not support. this change is temporary and will not be stored to flash. however, if the menu system is accessed and a ?save and exit? command is performed these new data rate settings will be committed to flash. once this switch is returned to its off position and the CS120 is power cycled the CS120 will return to its previous communications settings. 2 reserved for future use, set to off. 1 when switched to the on position this switch will reset the CS120 to its factory default values. this reset will affect all communication setting and will replace the user calibration settings with the factory defaults. this will take immediate effect upon power up. important
user guide 17 10. message formats: a breakdown of the different default outputs of the CS120 ? basic/partial/full the CS120 has three different standard message formats available to the user. these three outputs are named basic, partial and full. all three standard outputs parameters are space delimited with a unique start and end character allowing easy storage into any logger (see section 15 on how to set default outputs). the full format message is the default message. stx and etx are hexadecimal command characters. refer to appendix b for the checksum algorithm. basic format stx message id sensor id system status visibility distance visibility units checksum (ccitt) etx carriage return line feed 0x02 0 m or f xxxx 0x03 0x0d 0x0a partial format stx message id sensor id system status message interval visibility distance visibility units user alarms checksum (ccitt) etx carriage return line feed 0x02 1 m or f 0 0 xxxx 0x03 0x0d 0x0a full format stx message id sensor id system status message interval visibility distance visibility units averaging duration user alarms system alarms checksum (ccitt) etx carriage return line feed 0x02 2 m or f 0 0 0 0 0? xxxx 0x03 0x0d 0x0a note note
CS120 visibility sensor 18 message id break down id definition 0 basic format. contains only distance and system information 1 partial format. contains user alarm outputs 2 full format. contains all system alarms codes sensor id break down id definition 0-9 unit number defined by the user to aid identification of data. zero by default. useful for rs485 networks. operates as an address in rs485 mode system status break down (1) status level definition 0 no fault 1 possible degraded performance 2 degraded performance 3 maintenance required (1) system status break down reflects the highest level of severity of any active alarm. message interval time definition 1-3600 the amount of time, in seconds, between outputs in continuous mode visibility distance break down id definition 0-32,000 metres current visibility distance being detected by the sensor visibility units break down id definition m metres f feet averaging duration break down id definition 1 one minute average 10 ten minute average in accordance with wmo requirements the CS120 produces measurement that are either one or ten minute rolling averages that are updated at the chosen output interval or when the sensor is polled. those averages are not direct averages of mor measurements but are averages of extinction coefficient and that average is then used to calculate the mor for that period. as the relationship between extinction coefficient and mor is not linear it is possible to see quite rapid changes in mor that might not be expected if the result was a rolling average of mor. please consider this, especially when testing the sensor with artificial obscurants or using the calibration disc. user alarms alarm range definition 1 0-1 visibility either less or greater than a user specified threshold 2 0-1 visibility either less or greater than a user specified threshold
user guide 19 system alarms break down alarm range severity (2) definition emitter failure 0-2 (1) 3 the emitter hoods main led output power level. 0 = everything is within normal parameters 1 = light output level too low 2 = light output level too high emitter lens dirty 0-3 1 0 = ok. the reported attenuation is below 10%. 1 = reported window signal value is too low (possible sensor fault) 2 = slight dirt build up (10% signal attenuation or higher) 3 = high level of dirt build up (the hood could be blocked) emitter temperature 0-3 1 or 2 0 = temperature is within operating conditions 1 = too low. less than -40c. 2 = too high. over 80c. 3 = sensor fault (no sensor detected or below -54c) (severity 2) detector lens dirty 0-3 1 0 = ok. the reported attenuation is below 10%. 1 = reported window signal value is too low (possible sensor fault) 2 = slight dirt build up (10% signal attenuation or higher) 3 = high level of dirt build up (the hood could be blocked) detector temperature 0-3 1 or 2 0 = temperature is within operating conditions. 1 = too low. less than -40c. 2 = too high. over 80c. 3 = sensor fault (no sensor detected or below -54c) (severity 2) detector dc saturation level 0-1 1 the amount of background light as seen by the detector hood. 0 = within limits 1 = saturated. the CS120 no longer has enough head room to perform visibility readings in most circumstances. hood temperature 0-3 1 or 2 0 = temperature is within operating conditions. 1 = too low. less than -40c. 2 = too high. over 80c. 3 = sensor fault (no sensor detected or below -56c) (severity 2) signature error 0-1 3 0 = signature of entire flash was checked and matches the stored version 1 = signature does not match previous readings flash read error 0-1 3 0 = no errors 1 = one or more errors reading user variables from flash occurred flash write error 0-1 3 0 = no errors 1 = one or more errors writing user variables to flash occurred (1) the emitter power level reporting too high will cause the CS120 to shutdown and go into low power mode. (2) the severity of the alarm. the higher the number the more serious the error is considered to be.
CS120 visibility sensor 20 10.1 example CS120 message outputs example outputs from the CS120. basic output partial output full output 11. interface methods ? device configuration utility/command line/menu the CS120 can be setup and controlled in one of three ways. the first method is by using campbell scientifics device configuration utility software (devconfig) which is included with each delivery on the manuals/ resource disk. this software allows an easy menu driven interface for configuring the CS120 on any microsoft? based personal computer. all settings can be accessed using this program. the program includes online help instructions that describe its general use with the CS120 and also how to load an operating system. the device configurator can also be used as a terminal emulator to use the built- in menu system of the CS120 and to access its calibration menu. the second method is by using the command line interface where discrete commands are sent without response from the sensor. this would be the preferred method of setting up a CS120 if it was connected to a logger for instance. the configuration setting commands can be sent via a logger to the CS120 removing the need for a local pc to set up the unit. the third method is by using the simple menu interface built into the CS120 communicating via rs232 or rs485, using a terminal emulator program. this menu system gives access to the more common settings. all three of these methods use the CS120s serial port a to communicate with the sensor. configuration cable part number 010817, described in section 8.1 can be used. 0 1 0 12345 m xxxx 1 1 0 60 12345 m 0 0 xxxx 2 1 0 60 12345 m 1 0 0 0 0 0 0 0 0 0 0 0 0 xxxx
user guide 21 11.1 configuring a pc fo r talking to the CS120 described below is the procedure for setting up communications using a terminal emulator program. the terminal emulators built into many campbell scientific software products can also be used. the following settings should then be used by default: bits per second: 38400 data bits: 8 parity: none stop bits: 1 flow control: none ensure that if the baud rate of the unit has been adjusted and then the corresponding bits per second value is entered in the port settings of the terminal emulator. the CS120 should now be ready to accept commands. it is possible to set the CS120 into the default communication state via one of the internal switches on the CS120 main board. see section 9. 12. definition of the variables that can be set by the user on the CS120 both devconfig and the command line interface can access all the user configurable variables within the CS120. the acceptable range and the identification number for these variables are listed below along with a short description. id name range description factory default 1 sensor id 0-9 separate id used as an extra identifier for a particular CS120 on a network. 0 2 user alarm 1 enabled 0-1 user alarm one activation state 0=alarm one disabled 1=alarm one enabled 0 3 user alarm 1 active 0-1 0=check if distance is less than ?user alarm 1 distance? 1=check if distance is greater than ?user alarm 1 distance? 0 4 user alarm 1 distance 0- 60000 distance value that alarm one will trigger against. this value will correspond to metres or feet depending upon which is selected in ?visibility unit? 10000 5 user alarm 2 enabled 0-1 user alarm two activation state 0=alarm two disabled 1=alarm two enabled 0
CS120 visibility sensor 22 6 user alarm 2 active 0-1 0=check if distance is less than ?user alarm 2 distance? 1=check if distance is greater than ?user alarm 2 distance? 0 7 user alarm 2 distance 0-60000 distance value that alarm one will trigger against. this value will correspond to metres or feet depending upon which is selected in ?visibility unit? 10000 8 baud rate 0-6 baud rate for the main rs232/rs485 interface 0 = 115200 bps 1 = 57600 bps 2 = 38400 bps 3 = 19200 bps 4 = 9600 bps 5 = 2400 bps 6 = 1200 bps 2 9 serial number 0-32000 internal serial number for the CS120. ( read only) - 10 visibility unit m or f unit the visibility value will be presented as. m = metres f = feet m 11 message interval 1-3600 interval in seconds between outputs in continuous mode. this value has no effect if polled mode has been selected in ?measurement mode? 60 12 measurement mode 0-1 selects polled or continuous modes. in continuous mode the sensor will output a string in the format as set by ?m essage format? at regular intervals as defined by ?continuous interval?. 0 = continuous mode 1 = polled mode 0 13 message format 0-2 level of detail outputted by polled or continuous modes 0 = basic 1 = partial 2 = full 2 14 serial port protocol 0-1 selects the physical serial interface 0 = rs232 mode 1 = rs485 mode 0 15 averaging period 1 or 10 the period of time that the visibility value should be averaged over. either one minute or ten. 1 16 sample timing 1-60 used to define the time interval between sampling the volume. it is recommended that this value is left at one except when very low power demands are needed. 1 = sample every second 10 = sample one second in every ten 60 = sample one second in every sixty 1 17 dew heater override 0-1 0=allow the CS120 to automatically control the dew heaters 1=turn the dew heaters off 0 18 hood heater override (1) 0-1 0=allow the CS120 to automatically control the hood heaters 1=turn the hood heaters off 0 19 dirty window compensation 0-1 0 = no compensation applied 1 = compensation for dirt on lenses applied. the CS120 will compensate for up to 10% signal loss due to dirt per lens. 0
user guide 23 20 use crc 0-1 0 = disable command line crc checking (2) 1 = enable command line crc checking note: this does not affect communications via devconfig or terminal emulator. 0 21 sensor power down voltage (3) 7-30 psu input voltage level below which the CS120 will enter low power mode. this is usually used to protect batteries. 7.0 (1) hood heater override needs to be set to `1? (off) when either no hood heaters are installed or the hood heaters have no power connected to them. this will save power as the relay is not enabled at low temperatures in this mode. (2) if disabled the sensor does not check the validity of received data against the checksum sent. it is, however, recommended that checksum checking is enabled to remove any chance of the CS120 being configured incorrectly by accident. (3) only available if the sensor is running firmware version 4 or later and only functional for sensors with serial number greater than e1029. 13. command line mode the command line interface is broken down into three major commands. these are get, set and poll. the get command is used to request all current user settable values from the CS120. the set commands sets user settable values and the poll command is used to request the current visibility and/or alarm conditions from the sensor. the CS120 can be configured to expect any commands sent to it to include a valid checksum. for simple commands, e.g. get and poll, fixed value checksums can be used (see the example programs). for more complex set commands the checksum needs to be calculated (see appendix b). the use of the checksum is disabled by default. it is recommended that the checksum functionality is enabled where possible, especially when long cable runs are used, or in electronically noisy environments. 13.1 the set command the set command is used to configure the CS120 via the command line. the set command is a single space delimited string that can be sent from any data logger or pc equipped with an rs232 or rs485 port. the set command and the ?device configuration utility? software access identical settings within the CS120, please refer to the ?device configuration utility? section of this document for a more detailed breakdown of the setting available here. this command is used to change the default power up state of the sensor. see section 14.2 if a setting is going to be changed on a regular basis e.g. heater controls. see section 12 for more information on the values used by the `set? command.
CS120 visibility sensor 24 set transmitted data example description 0x02 (1) stx ^b (2) : delimiting character set set : delimiting character 0 address based on sensor id : delimiting character sensor id user alarm 1 set user alarm 1 active user alarm 1 distance user alarm 2 set user alarm 2 active user alarm 2 distance serial baud rate sensor serial number (read only) visibility units message interval polling or continuous modes message format (basic/partial/full) rs232 or rs485 serial communications enabled averaging period sample timing dew heater override hood heater override dirty window compensation crc checking on received commands sensor power down voltage : delimiting character xxxx checksum (use the valid ccitt checksum) : delimiting character 0x03 (1) etx ^c (2) 0x0d (1) carriage return (1) these values are shown in hexadecimal format not ascii. (2) as entered on a keypad. 13.1.1 example of a set command ? set:0:0 1 1 1000 1 0 15000 2 0 m 60 1 2 0 1 1 0 0 0 1 7 :68a3: ?
user guide 25 13.2 the se tnc command the format of the setnc command is nearly exactly the same as the set command. the only functional difference is that the setnc command does not commit the values set into flash memory. this means that the next time the CS120 is power cycled it will revert back to its previous settings. this command should be used when a setting in the sensor is changed regularly, e.g. heater functions, as this command avoids the risk of wearing out the flash storage memory. note: this includes communication data rates as well. 13.2.1 example of a setnc command 13.3 the get command the get command retrieves settings data from the CS120, including message format data and user alarm settings amongst others. this command does not retrieve visibility or environmental information from the CS120. to retrieve visibility data refer to the poll command. the get request get transmitted data example description 0x02 (1) stx (^b) (2) get get : delimiting character 0 address based on sensor id : delimiting character 0 reserved for future use, zero default : delimiting character xxxx checksum : delimiting character 0x03 (1) etx (^c) (2) 0x0d (1) carriage return (1) these values are shown in hexadecimal format not ascii. (2) as entered on a keypad example of a get request example data returned by the get command ? see section 12 for more information on values returned by the `get? command get returned data example description 0x02 (1) stx sensor id ? setnc:0:0 1 1 1000 1 0 15000 2 0 m 60 1 2 0 1 1 0 0 0 1 7 :d82d: ? get:0:0:xxxx:
CS120 visibility sensor 26 user alarm 1 set user alarm 1 active user alarm 1 distance user alarm 2 set user alarm 2 active user alarm 2 distance serial baud rate sensor serial number (read only) visibility units message interval polling or continuous modes message format (basic/partial/full) rs232 or rs485 serial communications enabled averaging period sample timing dew heater override hood heater override dirty window compensation crc checking on received commands sensor power down voltage 7.0 : delimiting character xxxx checksum : delimiting character 0x04 (1) eot 0x0d (1) carriage return 0x0a line feed (1) these values are shown in hexadecimal format not ascii. example of a get returned data 0 0 0 10000 0 0 10000 2 1009 m 30 0 2 1 1 1 0 0 0 1 11.5 d4fd explanation: - sensor id = 0 user alarm 1 not set user alarm 1 not active user alarm 1 distance = 10000 metres user alarm 2 not set user alarm 2 not active user alarm 2 distance = 10000 metres serial baud rate 2 (=38400bd) serial number = 1009 visibility units = m
user guide 27 continuous mode output interval = 30 seconds polling mode = 0 (continuous mode) message format = 2 (full message) rs232 or rs485 serial communications = 1 ( rs485) averaging period = 1 minute sample timing = 1 sample per second dew heater override = 0 (CS120 will automatically control the dew heaters) hood heater override = 0 (CS120 will automatically control the hood heaters) dirty window compensation = 0 (dirty window compensation off) crc checking on received commands = 1 (crc checking enabled) sensor power down voltage = 11.5v checksum = d4fd 13.4 the poll comma nd ? polling the CS120 the poll command requests the current visibility and/or alarm conditions from the CS120. the output format of this command depends on how the CS120 is configured using the set command or the menu interfaces. the poll request poll transmitted data example description 0x02 (1) stx, ^b (2) poll poll : delimiting character 0 address based on sensor id : delimiting character 0 reserved for future use, zero default : delimiting character xxxx checksum (3) : delimiting character 0x03 (1) etx, ^c (2) 0x0d (1) carriage return (1) these values are shown in hexadecimal format not ascii. (2) as entered on a keypad. (3) not case sensitive. example of a poll request poll:0:0:xxxx:
CS120 visibility sensor 28 the maximum response time to a poll command is 100 ms. if the setting to check the checksum on received commands is enabled the checksum varies with the sensor id value. 14. entering the CS120 menu system the user can enter the menu system by typing ?open 0? into their terminal program then pressing the return key on their keyboard. the ?0? in ?open 0? corresponds to the sensor id number. the sensor id number can be in the range of 0 to 9. when first purchased or when the sensor is reset to factory defaults the sensor id will be set to 0. the ?open 0? command is not normally echoed. the terminal menu only gives access to more common settings. the following text should now be displayed: the displayed options are accessed simply by typing the corresponding number then pressing return. no changes will take effect until you `save and exit?. the exception to this is the calibration menu, but you will be informed before any changes are made. note note welcome to the campbell scientific ltd CS120 setup menu id 0 s/n 9999 (1) message output menu (2) user alarm menu (3) calibrate CS120 (4) system information (5) communications setup (9) exit and save (0) exit and don't save - >
user guide 29 menu 1: the message output menu the message menu contains settings relating to the CS120s default visibility outputs such as modes of operation and output formats. menu 1: the message output menu. sub menu 1: continuous mode operation (option 4) menu 1: the message output menu. sub menu 2: sample timing (option 6) CS120 message - sub 2 set sample timing for this sensor in seconds. current value 1. (valid range is 1-60) or, type '0' to return without changes. ->
CS120 visibility sensor 30 menu 2: the user alarm menu menu 2: the user alarm menu. sub menu 2: alarm two activation level (option 6) menu 2: the user alarm menu. sub menu 2: alarm two activation level (option 6) menu 3: the calibration menu consult the ?calibration? section of this manual for information on how to calibrate the CS120 visibility sensor. once a calibration is finished changes are immediate, but factory calibrations can be restored if needed from here. note CS120 alarm - menu 2 id 0 s/n 9999 (1) toggle user alarm one: disabled (2) toggle alarm one threshold: less than (3) set new user alarm one activation point: 10000 m (4) toggle user alarm two: disabled (5) toggle alarm two threshold: less than (6) set new user alarm two activation point: 10000 m (9) refresh (0) return to main menu -> CS120 alarm - sub menu 2 select new alarm trigger level between 10 and 60000 inclusive. current value 10000. or, type '0' to return without changes. -> CS120 calibration - menu 3 id 0 s/n 9999 (1) perform calibration (2) restore the factory calibration (9) refresh (0) return to main menu ->
user guide 31 menu 4: the system information menu the systems information menu contains useful information such as temperature and system alarms. if either of the dirty window alarms are set it is recommended you follow the cleaning section of this manual (section 18). if there is a flash error or signature error it is recommended that you contact campbell scientific. the sensor power down voltage shown before the supply voltage is only available if the sensor is running firmware version 4 or later and only functional for sensors with serial number greater than e1029.
CS120 visibility sensor 32 menu 5: the communication menu the communications menu is used to set baud rates and the mode of operation (rs232/rs485). no change will take effect until you `exit and save?. menu 5: the communication menu. sub menu 1: sensor id (option 1) menu 5: the communication menu. sub menu 2: serial data rate selection (option 2) note CS120 communications - sub 2 set the new serial baud rate. changes will take effect when 'exit and save' is selected. current baud rate is 38400bps. use the numbers 0-6 to set the baud rate. 0 - 115200 1 - 57600 2 - 38400 3 - 19200 4 - 9600 5 - 2400 6 - 1200 or, type any other number to exit. -> CS120 communications - menu 5 id 0 s/n 9999 (1) set sensor id (2) set rs232/rs485 baud rate:38400 (3) toggle rs232/rs485 modes:rs232 (9) refresh (0) return to main menu -> CS120 communications - sub 1 set the new id the sensor is to use - range: 0-9. current value 0. or, type anything except 0-9 to exit without changes. ->
user guide 33 menu 9 and 0: exiting the menu system 15. calibrating the CS120 the CS120 can be checked and adjusted using the optional CS120 calibrator part number 010816. the calibration must be run using the onboard menu system. if you have campbell scientific?s device configuration program a terminal emulation screen is provided in the CS120 screens to let you access this function. to perform the calibration you will need a CS120 calibrator disk and a computer with a standard serial port compatible with the CS120. if your CS120 is not currently configured for rs232 communications you can set the internal switch, switch three, to temporarily set the sensor to rs232 mode 38400bps. if the sensor is already set in rs232 mode it should not be necessary to change any internal switches. (see section 10 for more information on the CS120 internal switches.) the test should ideally be performed in the following conditions: ? ambient temperature should be 20oc +/-10oc ? the local visibility should be approximately 10,000 metres or higher. the system is self-regulating. however, it is recommended that the CS120 is calibrated every two years. the calibration is performed from menu item 3 on the main terminal screen. please refer to the menu section (section 13) of this manual for further information on how to access this menu. once you have selected menu item 3 you should be presented with the following screen. select option 1 to start the calibration. you will then be asked to confirm that you would like to perform a calibration. please note, once you have entered yes at this point you will not be able to exit until the test is complete. however, power cycling the unit at this point will have no adverse effect on the sensor. CS120 calibration - menu 3 id 0 s/n 9999 (1) perform calibration (2) restore the factory calibration (9) refresh (0) return to main menu -> do you want to perform a calibration y/n? campbell scientific ltd CS120 menu exited.
CS120 visibility sensor 34 once you have started the tests you will be asked for the CS120 calibrator serial number and coefficient with a confirmation at each step giving you the chance to correct typing mistakes. when asked for confirmation you do not need to press return after you type ?y?. CS120 calibrator serial number and coefficients will be within this area. when you have entered the calibrator information the sensor will wait for you to place the foam bungs into the sensor hoods. the bungs are designed to block all light from the outside reaching inside the head. place one bung into each hood. if either of the bungs are damaged or appear to have any gaps around the edge please contact campbell scientific. note starting calibration. input the CS120 calibrator serial number ->12345 is 12345 correct? (y/n)? input the CS120 calibrator constant ->10000 is 10000 correct? (y/n)? place one calibration bung into each hood, then press any key.
user guide 35 emitter detector this part of the test will take approximately two minutes. every ten seconds a dot should appear indicating that the test is progressing as normal. remove the bungs once the sensor instructs you to. place the CS120 calibrator into the volume by fastening it to the central mounting point. at this stage it is advisable to clean the lenses. refer to section 18 `cleaning? for more information. a simple visual check may be enough to confirm the lenses are clean. note starting dark level calibration. this test will take approximately two minutes dark level test complete. please remove the bungs. now place the CS120 calibrator into the sampling volume. press any key once this is done.
CS120 visibility sensor 36 this part of the test will take approximately two minutes. every ten seconds a dot should appear indicating that the test is progressing as normal. once the second stage of the test has been completed the new calibration constants will be saved automatically. all calibration constants including both the user and the factory setting can be viewed from menu item 4 from the main menu once the test is completed. 16. performing a firmware update firmware updates for the CS120 visibility sensor are performed using campbell scientifics device configuration utility (devconfig) software. please refer to the help built into the devconfig software for full instructions on how to update the CS120 firmware. starting light level calibration. this test will take approximately two minutes. calibration is now complete. saving user settings press any key to exit.
user guide 37 17. cleaning the CS120 visibility sensor is a robust instrument that will provide years of uninterrupted weather monitoring. calibration of the instrument is carried out at the factory and can be redone easily on site with the optional CS120 calibrator or carried out by campbell scientific if required. only general cleaning of the lenses is required to keep the sensor working efficiently. cleaning of the CS120 will be required from time to time to ensure that the lenses are free from contaminants. the frequency of required cleaning depends on the exposure of the instrument to such contaminants. this will vary depending on the site location. the CS120 is capable of self diagnosing dirty lenses and will indicate in its output when the lenses are contaminated to such a degree that its visibility measurements may be affected. a lower level of contamination than is detected by the dirty window alarms, can affect the visibility measurements. the sensor will attempt to make a correction for contamination although the accuracy of that correction depends on the `type of dirt?. in any case we suggest 6 monthly intervals for locations not prone to contaminants and monthly intervals for those prone to contamination (roadside or airport use). in some cases more frequent cleaning may be required where there are high levels of contaminants and high dependency on the instrument output. if the lenses require cleaning, it is very important that only a proper lens cloth or lens tissue be used. the use of inappropriate materials to clean the lenses can permanently damage or reduce the effectiveness of the lenses leading to errors in measurement of precipitation and visibility. it is advisable to use an air duster to blow any loose dust and dirt from the lenses as a first step. using a lint free lens cloth or lens tissue impregnated with a small amount of isopropyl alcohol solvent clean the lens surface by dragging the cloth across the lens surface being careful not to apply excessive pressure. excessive pressure may lead to some types of contaminant scratching the lens surface. over time such scratches ca n lead to reduced sensor accuracy. spiders webs and certain `fluffy? seeds which get lodged in the optical path can lead to the sensor permanently giving low readings as they can emulate precipitation. cleaning the contamination away with a duster will return the sensor to normal operation. if spiders are a persistent problem, using some carefully applied insecticide can deter them. note caution note
CS120 visibility sensor 38 18. lubricating the enclosure screws the CS120 enclosure screws should be lubricated with a suitable anti-seize grease (often copper loaded) to protect the threads from corrosion. this should be reapplied when resealing the enclosure at regular intervals, normally after replacing the desiccant. this is of particular importance if using the sensor in corrosive or salt laden atmospheres. 19. desiccant two bags of desiccant are supplied. one is inside the enclosure, the other is separate and sealed in a plastic bag. desiccant use depends on your application but for use in typical temperature conditions one bag is sufficient for a twelve month period. the desiccant should be placed inside the enclosure taking care that it is not trapped between the lid and the enclosure when the lid is replaced. the second bag of desiccant should be kept in the plastic shipping bag as a replacement for when the initial bag needs to be dried out. the bags can be rotated in this way many times. desiccant bags can be dried out by the following method: 1. arrange the bags on a wire tray in a single layer to allow for adequate air flow around the bags during the drying process. the oven?s inside temperature should be room or ambient temperature (25c - 30c). a convection, circulating, forced air type oven is recommended for this regeneration process. seal failures may occur if any other type of heating unit or appliance is used. 2. when placed in a forced air, circulating air, or convection oven, allow a minimum of 4 to 5 cm of air space between the top of the bags and the next metal tray above the bags. if placed in a radiating exposed infrared element type oven, shield the bags from direct exposure to the heating element, giving the closest bags a minimum of 40 cm clearance from the heat shield. excessive surface film temperature due to infrared radiation will cause the tyvek material to melt and/or the seals to fail. seal failure may also occur if the temperature is allowed to increase rapidly. this is due to the fact that the water vapour is not given sufficient time to diffuse through the tyvek material, thus creating internal pressure within the bag, resulting in a seal rupture. temperature should not increase faster than 0.1c to 0.3c per minute. 3. set the temperature of the oven to 118c, and allow the bags of desiccant to reach equilibrium temperature. tyvek has a melting temperature of 121c - 127c. (non mil-d-3464e activation or reactivation of both silica gel and bentonite clay can be achieved at temperatures of 104c). 4. desiccant bags should be allowed to remain in the oven at the assigned temperature for 24 hours. at the end of this period, the bags should be immediately removed and placed in a desiccators jar or dry (0% relative humidity) air tight container for cooling. if this procedure is not followed precisely, any water vapour driven off during reactivation may be re-adsorbed during cooling and/or handling. 5. after the bags of desiccant have been allowed to cool in an airtight desiccator, they may be removed and placed in either an appropriate type polyliner tightly sealed to prevent moisture adsorption, or a container that prevents caution
user guide 39 moisture from coming into contact with the regenerated desiccant. some care should be taken when re-activating desiccant bags. if heated in an oven which is too hot, the bags may burst. if in any doubt, we recommend purchasing new desiccant packs instead of oven drying. failure to use or exchange the desiccant may lead to condensation inside the enclosure. not only will this lead to corrupted data but, in the long term, can also cause corrosion which is expensive to repair.
CS120 visibility sensor 40
a-1 appendix a. CS120 block diagram 850nm emitter photo- detector transimpedance amplifier power level + driver circuitry emitter power feedback dirty window detector dirty window detector amplifier and filter amplifier and filter second stage amplifiers and filters 14-bit analogue to digital converter mcu (micro controller unit) hood heater drive low noise psu two 5v user alarm outputs rs232 or rs485 serial communications 24v ac/dc 12v dc hood temperature
CS120 visibility sensor a-2
b-1 appendix b. example c code of the ccitt crc the code below is provided as an example for programmers implementing their own code to communicate with the sensor. users using campbell loggers can use the checksum command in crbasic to generate a ccitt checksum. command: checksum/chksumstring,1,0). the checksum includes all characters excluding the sot, eot and the checksum itself. the set and setnc commands also exclude the two delimiting `:? characters, one on each side of the checksum itself. //---------------------------------------------------------------------------- // creates a ccitt crc16 checksum seeded with 0x0000 (xmodem style) using a // fast non table based algorithm. // pass in the data to convert into a crc in the form of a null terminated // character array (a string). // returns the crc in the form of an unsigned 16 bit integer value // note: this algorithm has only been tested on a native 16-bit processor with // a hardware barrel shifter // all integers are 16-bits long //---------------------------------------------------------------------------- unsigned int crc_ccitt(char lineofdata[]){ unsigned int crc; // returned crc value unsigned int i; // counter crc = 0x0000; // create a check sum for the incoming data for(i=0;i < strlen(lineofdata); i++){ unsigned crc_new = (unsigned char)(crc >> 8) | (crc << 8); crc_new ^= lineofdata[i]; crc_new ^= (unsigned char)(crc_new & 0xff) >> 4; crc_new ^= crc_new << 12; crc_new ^= (crc_new & 0xff) << 5; crc = crc_new; } return(crc); }
CS120 visibility sensor b-2
c-1 appendix c. example crbasic programs c.1 crbasic read program 'cr1000 'demonstration program to read data from a CS120 set to continuous output 'with the full message being transmitted 'note: the sensor should be preconfigured, it is not setup by this program 'declare variables public visibility 'these variables could be defined as dim in a final program public instring as string * 60 'incoming string public serialindest(20) as string, nbytesreturned public checksumok as boolean ? 'define the aliases for the full message alias serialindest(1)=message_id '0..2 alias serialindest(2)=sensor_id '0..9 alias serialindest(3)=system_status '0..3 alias serialindest(4)=interval_time '1..3600 alias serialindest(5)=visibilitystr '0..32000 metres alias serialindest(6)= visibilityunits 'm or f for metres or feet alias serialindest(7)=averaging_duration '1 or 10 minutes alias serialindest(8)=user_alarm_1 '0..1 - visibility compared to threshold one alias serialindest(9)=user_alarm_2 '0..1 - visibility compared to threshold two alias serialindest(10)=emitter_failure '0..2 - emitter failure alias serialindest(11)=emitter_lens_dirty '0..3 - emitter lens dirty alias serialindest(12)=emitter_temp_error '0..3 - emitter temperature alias serialindest(13)=detector_lens_dirty '0..3 - detector lens dirty alias serialindest(14)=detector_temp_error '0..3 - detector temperature alias serialindest(15)=detector_saturated '0..1 - detector dc saturation level alias serialindest(16)=hood_temp_error '0..3 - hood temperature alias serialindest(17)=signature_error '0..1 - signature error alias serialindest(18)=flash_read_error '0..1 - flash read error alias serialindest(19)=flash_write_error '0..1 - flash write error alias serialindest(20) = checksumrx 'ccitt checksum 'define the serial port to which the CS120 is connected - ammend as needed const CS120_comport = com2 ? 'main program beginprog 'open the logger serial port to which the CS120 is connected serialopen (CS120_comport,38400,3,0,1000) 'scan at 10 sec - the sensor must be set to output quicker than the scan rate, 'e.g. 5 sec in this case to guarantee some data is available scan(10,sec,1,0) 'read the newest data in the buffer, return nan if there is no data or 'the last parameter can be set to 00 if you are calling this instruction faster 'than the sensor outputs and you are happy to see the last data received serialinrecord(CS120_comport,instring,02,0,03,nbytesreturned,01)
CS120 visibility sensor c-2 split out the data into strings splitstr (serialindest(),instring," ",20,5) 'check the received checksum is valid checksumok = ( hextodec(checksumrx) = checksum(instring,1,instr (1,instring,checksumrx,2)-2)) 'check if the checksum does not match set the vis to nan. ???? 'copy the string into a float so can be manipulated and stored efficiently 'do likewise for other variables if used 'in critical applications the visibility can be set to nan if the system status 'is degraded or a critical error flag is set. if checksumok then visibility = visibilitystr else visibility =nan 'call data storage commands here nextscan endprog c.2 crbasic poll program 'cr1000 'demonstration program to read data from a CS120 set to polled mode 'with the full message being transmitted. 'note: the sensor should be preconfigured, it is not setup by this program 'declare variables public visibility 'these variables could be defined as dim in a final program public instring as string * 60 'incoming string public serialindest(20) as string, nbytesreturned public checksumok as boolean 'define the aliases for the full message alias serialindest(1)=message_id '0..2 alias serialindest(2)=sensor_id '0..9 alias serialindest(3)=system_status '0..3 alias serialindest(4)=interval_time '1..3600 alias serialindest(5)=visibilitystr '0..32000 metres alias serialindest(6)= visibilityunits 'm or f for metres or feet alias serialindest(7)=averaging_duration '1 or 10 minutes alias serialindest(8)=user_alarm_1 '0..1 - visibility compared to threshold one alias serialindest(9)=user_alarm_2 '0..1 - visibility compared to threshold two alias serialindest(10)=emitter_failure '0..2 - emitter failure alias serialindest(11)=emitter_lens_dirty '0..3 - emitter lens dirty alias serialindest(12)=emitter_temp_error '0..3 - emitter temperature alias serialindest(13)=detector_lens_dirty '0..3 - detector lens dirty alias serialindest(14)=detector_temp_error '0..3 - detector temperature alias serialindest(15)=detector_saturated '0..1 - detector dc saturation level alias serialindest(16)=hood_temp_error '0..3 - hood temperature alias serialindest(17)=signature_error '0..1 - signature error alias serialindest(18)=flash_read_error '0..1 - flash read error alias serialindest(19)=flash_write_error '0..1 - flash write error alias serialindest(20) = checksumrx 'ccitt checksum 'define the serial port to which the CS120 is connected - ammend as needed const CS120_comport = com1 'preload the poll command for a sensor for address 0, in this example 'if the sensor has a different address uncomment the relevant line const CS120_poll = chr(2)&"poll:0:0:3a3b:"&chr(3)&chr(13) 'address 0 'const CS120_poll = chr(2)&"poll:1:0:0d0b:"&chr(3)&chr(13) 'address 1 'const CS120_poll = chr(2)&"poll:2:0:545b:"&chr(3)&chr(13) 'address 2 'const CS120_poll = chr(2)&"poll:3:0:636b:"&chr(3)&chr(13) 'address 3
appendix c. example crbasic programs c-3 'const CS120_poll = chr(2)&"poll:4:0:e6fb:"&chr(3)&chr(13) 'address 4 'const CS120_poll = chr(2)&"poll:5:0:d1cb:"&chr(3)&chr(13) 'address 5 'const CS120_poll = chr(2)&"poll:6:0:889b:"&chr(3)&chr(13) 'address 6 'const CS120_poll = chr(2)&"poll:7:0:bfab:"&chr(3)&chr(13) 'address 7 'const CS120_poll = chr(2)&"poll:8:0:939a:"&chr(3)&chr(13) 'address 8 'const CS120_poll = chr(2)&"poll:9:0:a4aa:"&chr(3)&chr(13) 'address 9 'main program beginprog 'open the logger serial port to which the CS120 is connected serialopen (CS120_comport,38400,3,0,1000) 'scan at 10 sec, in this case scan(10,sec,1,0) 'send the poll command, delay then read data out of the buffer 'note the type of delay used in combination with these specific serial 'instructions allows this to work in pipeline and sequentialmode programs serialoutblock(CS120_comport,CS120_poll,17) delay(2,100,msec) 'wait 100 ms for sensor to respond serialinrecord(CS120_comport,instring,02,0,03,nbytesreturned,01) 'split out the data into strings splitstr (serialindest(),instring," ",20,5) 'check the received checksum is valid checksumok = ( hextodec(checksumrx) = checksum(instring,1,instr (1,instring,checksumrx,2)-2)) 'check if the checksum does not match set the vis to nan. 'copy the string into a float so can be manipulated and stored efficiently 'do likewise for other variables if used 'in critical applications the visibility can be set to nan if the system status 'is degraded or a critical error flag is set. if checksumok then visibility = visibilitystr else visibility =nan 'call data storage commands here nextscan endprog
CS120 visibility sensor c-4 c.3 example crbasic set program '------------------------------------------------------------------------------- ' CS120 visibility ' ' program to test the set command part of the command line interface on the CS120 ' do not run this script for extended periods of time (days!) as it writes ' to flash over and over and will eventually wear the flash out ' logger:cr1000 '------------------------------------------------------------------------------- public instring as string * 200 public tempstring as string *100 ' variables for the set command subroutine dim CS120carray(21) as string * 6 ' CS120 command array '------------------------------------------------------- ' this function creates a set command string for the ' CS120 visibility sensor. including all delimiting ' characters and checksums ' then returns the string in "CS120commandstring" ' array variable order is as follows: ' 1. sensor id ' 2. user alarm 1 set ' 3. user alarm 1 active ' 4. user alarm 1 distance ' 5. user alarm 2 ' 6. user alarm 2 active ' 7. user alarm 2 distance ' 8. serial baudrate ' 9. serial number (read only so not used) ' 10. visibility units ' 11. continuous mode output interval ' 12. polling or continuous modes ' 13. message format (basic/partial/full) ' 14. rs232 or rs485 serial communications enabled ' 15. averaging period ' 16. sample timing ' 17. dew heater override ' 18. hood heater override ' 19. dirty window compensation ' 20. use crc checking ' 21. psu input voltage shutdown level function CS120_setcommand as string *100 dim tempstringfunc as string * 100 dim CS120commandstring as string * 100 dim i as long dim checkval as long ' create a string containing the values going out to the CS120 tempstringfunc = "set:0:" for i = 1 to 21 tempstringfunc = tempstringfunc + CS120carray(i) + " " next ' create a check sum of the values going out
appendix c. example crbasic programs c-5 checkval = checksum (tempstringfunc,1,0) ' use the ccitt crc16 checksum ' create final string going out to CS120 including start characters and end characters CS120commandstring = chr(2) + tempstringfunc + ":" + formatlong (checkval,"%04x") + ":" + chr(3) + chr(13) + chr(10) 'CS120commandstring = chr(2) + tempstringfunc + chr(3) + chr(13) + chr(10) ' use this line if no checksum is desired return(CS120commandstring) endfunction '------------------------------------------------------- 'main program beginprog ' open port to the visibility sensor using com1 serialopen (com1,38400,3,0,10000) ' note: change the following array variable to suit your own application ' load example/dummy values into the array CS120carray(1) = 0 ' set id to 0 CS120carray(2) = 1 ' enable alarm 1 CS120carray(3) = 1 ' set alarm 1 to if greater than CS120carray(4) = 1000 ' set alarm 1 trigger distance to 1000 CS120carray(5) = 1 ' enable alarm 2 CS120carray(6) = 0 ' set alarm 2 to if less than CS120carray(7) = 15000 ' set alarm 2 trigger distance to 15000 CS120carray(8) = 2 ' set serial baud rate to 38400bps CS120carray(9) = 0 ' read only so dummy value added here, but not needed CS120carray(10) = "m" ' set unit type to metres (use upper case) CS120carray(11) = 60 ' set output period to 60 seconds CS120carray(12) = 1 ' polling mode CS120carray(13) = 2 ' set full output message format CS120carray(14) = 0 ' set rs232 serial mode CS120carray(15) = 1 ' set averaging over one minute CS120carray(16) = 1 ' set sample timing to one second CS120carray(17) = 0 ' set dew heaters to automatic CS120carray(18) = 0 ' set hood heaters to automatic CS120carray(19) = 0 ' don't use dirty window compensation CS120carray(20) = 1 ' use crc checking on incoming command line data CS120carray(21) = 7.0 ' set low voltage battery shutdown to a very low value so it doesn't trigger ' send information once every 10 seconds scan (10,sec,0,0) tempstring = CS120_setcommand() ' create the outgoing string serialout (com1,tempstring,"",0,100) ' send set command to the CS120 delay (1,1,sec) serialin (instring,com1,100,0,1000) ' grab retuned data from the CS120 ' returned data is identical to the ' data a get command would return nextscan endprog
CS120 visibility sensor c-6 c.4 example crbasic setnc command '------------------------------------------------------------------------------- ' CS120 visibility ' ' program to test the setnc command part of the command line interface on the CS120 ' this command does not commit the settings to flash so settings will be lost if ' the sensor is power cycled ' this example uses a cs215 temperature and humidity probe to determine dew point. ' the CS120s hood heaters are then turned on only when needed, this is to save power. ' logger:cr1000 '------------------------------------------------------------------------------- 'declare public variables public instringsetnc as string * 200 public instringget as string * 200 public trhdata(2) public outstring as string * 40, checkval dim CS120carray(21) as string * 6 ' CS120 command array dim tempdewpoint dim statusdewheater dim tempstring as string * 100 alias trhdata(1)=airtc alias trhdata(2)=rh '------------------------------------------------------- ' this function creates a setnc command string for the ' CS120 visibility sensor. including all delimiting ' characters and checksums then returns the string ' in "CS120commandstring" ' array variable order is as follows: ' 1. sensor id ' 2. user alarm 1 set ' 3. user alarm 1 active ' 4. user alarm 1 distance ' 5. user alarm 2 ' 6. user alarm 2 active ' 7. user alarm 2 distance ' 8. serial baudrate ' 9. serial number (read only so not used) ' 10. visibility units ' 11. continuous mode output interval ' 12. polling or continuous modes ' 13. message format (basic/partial/full) ' 14. rs232 or rs485 serial communications enabled ' 15. averaging period ' 16. sample timing ' 17. dew heater override ' 18. hood heater override ' 19. dirty window compensation ' 20. use crc checking ' 21. psu input voltage shutdown level function CS120_setnccommand as string *100 dim tempstringfunc as string * 100
appendix c. example crbasic programs c-7 dim CS120commandstring as string * 100 dim i as long dim checkval as long ' create a string containing the values going out to the CS120 tempstringfunc = "setnc:0:" for i = 1 to 21 tempstringfunc = tempstringfunc + CS120carray(i) + " " next ' create a check sum of the values going out checkval = checksum (tempstringfunc,1,0) ' use the ccitt crc16 checksum ' create final string going out to CS120 including start characters and end characters CS120commandstring = chr(2) + tempstringfunc + ":" + formatlong (checkval,"%04x") + ":" + chr(3) + chr(13) + chr(10) 'CS120commandstring = chr(2) + tempstringfunc + chr(3) + chr(13) + chr(10) ' use this line if no checksum is desired return(CS120commandstring) endfunction '------------------------------------------------------- 'main program beginprog ' open port to the visibility sensor using com1 serialopen (com1,115200,3,0,10000) ' note: change the following array variable to suit your own application ' load example/dummy values into the array ' loading the array is not strictly necessary, but is done as a fail safe in ' case the get command does not return data CS120carray(1) = 0 ' set id to 0 CS120carray(2) = 0 ' disable alarm 1 CS120carray(3) = 1 ' set alarm 1 to if greater than CS120carray(4) = 10000 ' set alarm 1 trigger distance to 10000 CS120carray(5) = 0 ' disable alarm 2 CS120carray(6) = 0 ' set alarm 2 to if less than CS120carray(7) = 10000 ' set alarm 2 trigger distance to 10000 CS120carray(8) = 0 ' set serial baud rate to 115200bps CS120carray(9) = 0 ' read only so dummy value added here, but not needed CS120carray(10) = "m" ' set unit type to metres (use upper case) CS120carray(11) = 60 ' set output period to 60 seconds CS120carray(12) = 1 ' polling mode CS120carray(13) = 2 ' set full output message format CS120carray(14) = 0 ' set rs232 serial mode CS120carray(15) = 1 ' set averaging over one minute CS120carray(16) = 1 ' set sample timing to one second CS120carray(17) = 0 ' set dew heaters to automatic CS120carray(18) = 0 ' set hood heaters to automatic CS120carray(19) = 0 ' don't use dirty window compensation CS120carray(20) = 1 ' use crc checking on incoming command line data CS120carray(21) = 7.0 ' set low voltage battery shutdown to a very low value so it doesn't trigger statusdewheater=false scan (10,sec,0,0)
CS120 visibility sensor c-8 'cs215 temperature & relative humidity sensor measurements airtc and rh sdi12recorder(trhdata(),5,"0","m!",1,0) 'calculate dewpoint dewpoint(tempdewpoint,airtc,rh) ' gather the current settings from the CS120 serialflush (com1) tempstring = "get:0:0" checkval = checksum (tempstring,1,0) ' use the ccitt crc16 checksum outstring = chr(2) + tempstring + ":" + formatlong (checkval,"%04x") + ":" + chr(3) + chr(13) + chr(10) serialout (com1,outstring,"",0,100) ' send get command to the CS120 delay (1,1,sec) serialin (instringget,com1,100,0,200) ' save the data returned from the get command if len(instringget) > 1 then ' check data was returned splitstr (CS120carray(1),instringget, " ",21,5) ' strip the settings from the returned data string CS120carray(1) = right (CS120carray(1),1)' trim the sot from the first data point endif 'enable dew heaters if airtc < dewpoint if airtc <= tempdewpoint and statusdewheater=false then CS120carray(17)=0 serialflush (com1) tempstring = CS120_setnccommand() serialout (com1,tempstring,"",0,100) delay (1,1,sec) serialin (instringsetnc,com1,100,0,1000) statusdewheater=true endif 'disable dew heaters if airtc > dewpoint+3 if airtc > tempdewpoint+3 and statusdewheater=true then CS120carray(17)=1 serialflush (com1) tempstring = CS120_setnccommand() serialout (com1,tempstring,"",0,100) delay (1,1,sec) serialin (instringsetnc,com1,100,0,1000) statusdewheater=false endif nextscan endprog
appendix c. example crbasic programs c-9 c.5 example crbasic get program '------------------------------------------------------------------------------- ' CS120 visibility ' ' program to test the get command part of the command line interface on the CS120 ' connecting to serial port one on a cr1000 logger ' logger:cr1000 ' ' example outputs including checksums (varies with sensor id) ' get:0:0:2c67: ' get:1:0:1b57: ' get:2:0:4207: ' get:3:0:7537: ' get:4:0:f0a7: ' get:5:0:c797: ' get:6:0:9ec7: ' get:7:0:a9f7: ' get:8:0:85c6: ' get:9:0:b2f6: '------------------------------------------------------------------------------- public outstring as string * 40 ' outgoing string dim checkval as long ' checksum value public instring as string * 200 ' incomming string dim tempstring as string * 16 'main program beginprog serialopen (com1,38400,3,0,10000) ' open port to the visibility sensor ' send a request for information once every 10 seconds scan (10,sec,0,0) ' create the basic get string for the CS120 tempstring = "get:0:0" checkval = checksum (tempstring,1,0) ' use the ccitt crc16 checksum outstring = chr(2) + tempstring + ":" + formatlong (checkval,"%04x") + ":" + chr(3) + chr(13) + chr(10) serialout (com1,outstring,"",0,100) ' send get command to the CS120 delay (1,1,sec) serialin (instring,com1,100,0,200) ' save the data returned from the get command nextscan endprog
campbell scientific companies campbell scientific, inc. (csi) 815 west 1800 north logan, utah 84321 united states www.campbellsci.com ? info@campbellsci.com campbell scientific afri ca pty. ltd. (csaf) po box 2450 somerset west 7129 south africa www.csafrica.co.za ? sales@csafrica.co.za campbell scientific australia pty. ltd. (csa) po box 8108 garbutt post shop qld 4814 australia www.campbellsci.com.au ? info@campbellsci.com.au campbell scientific do brazil ltda. (csb) rua luisa crapsi orsi, 15 butant? cep: 005543-000 s?o paulo sp brazil www.campbellsci.com.br ? suporte@campbellsci.com.br campbell scientific canada corp. (csc) 11564 - 149th street nw edmonton, alberta t5m 1w7 canada www.campbellsci.ca ? dataloggers@campbellsci.ca campbell scientific cent ro caribe s.a. (cscc) 300n cementerio, edificio breller santo domingo, heredia 40305 costa rica www.campbellsci.cc ? info@campbellsci.cc campbell scientific ltd. (csl) campbell park 80 hathern road shepshed, loughborough le12 9gx united kingdom www.campbellsci.co.uk ? sales@campbellsci.co.uk campbell scientific ltd. (france) 3 avenue de la division leclerc 92160 antony france www.campbellsci.fr ? info@campbellsci.fr campbell scientific spain, s. l. avda. pompeu fabra 7-9 local 1 - 08024 barcelona spain www.campbellsci.es ? info@campbellsci.es campbell scientific ltd. (germany) fahrenheitstrasse13, d-28359 bremen germany www.campbellsci.de ? info@campbellsci.de please visit www.campbellsci.com to obtain contact information for your local us or international representative.


▲Up To Search▲   

 
Price & Availability of CS120

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X