Commands

Discussion in 'Scripting and Programming' started by jack canton, May 26, 2017.

  1. jack canton

    jack canton Standard User

    Joined:
    May 26, 2017
    Messages:
    2
    Does anyone know the commands to write to the Boltwood cloud sensor II to read the information getting sent back? eg. What command could I send through the COM port to read temperature?
     
  2. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    3,258
    Cloud Sensor II Application messages 20080708
    ------------------------------------


    1. Declarations
    ===============

    The following declarations are used below:

    'Sky condition codes.

    Public Enum CloudCond
    cloudUnknown = 0 'at startup, when rained or wet recently
    'Below are based upon thresholds set in the setup window.
    cloudClear = 1
    cloudCloudy = 2
    cloudVeryCloudy = 3
    End Enum

    Public Enum WindCond
    windUnknown = 0 'at startup, if still heating up, if wet or
    'rain recently, if the A/D from the wind
    'probe is bad, if the probe is not heating
    'Below are based upon thresholds set in the setup window.
    windCalm = 1
    windWindy = 2
    windVeryWindy = 3
    End Enum

    Public Enum RainCond
    rainUnknown = 0 'at startup, or perhaps abnormal situation
    'in the future (object on sensor?)
    'Below are based upon thresholds set in the setup window.
    rainDry = 1
    rainWet = 2 'sensor has water on it
    rainRain = 3 'falling rain drops detected
    End Enum

    Public Enum DayCond
    dayUnknown = 0 'at startup or no daylight sensor installed
    'Below are based upon thresholds set in the setup window.
    dayDark = 1
    dayLight = 2
    dayVeryLight = 3
    End Enum



    2. Application Message Sequencing
    =================================

    All temperatures are in Celsius and speeds are km/hr.

    After a sensor head CPU reset, one I record is sent. Then
    D records are sent from the sensor head every ~2.09 seconds.
    After every 50 D records, one set of T, K, W, and C records are sent.



    3. Application Message Record Formats
    =====================================

    I RECORD FORMAT

    A heading line and then a sample line:
    I Ser# Firmw MCUC Cra Lcyc Serrs
    I 00501 00057 0x00 000 0x80 00000

    I record type
    Ser# serial number
    Firmw firmware version number
    MCUC Atmel ATMEGA32 CPU's MCUCSRV register and the
    reason for reset (written by the bootloader STARTUP.ASM):
    bit 7 JTAG Interface Disable
    When this bit is zero, the JTAG interface is enabled
    if the JTAGEN Fuse is programmed.
    If this bit is one, the JTAG interface is disabled.
    In order to avoid unintentional disabling
    or enabling of the JTAG interface, a timed sequence
    must be followed when changing
    this bit: The application software must write this
    bit to the desired value twice within four
    cycles to change its value.
    If the JTAG interface is left unconnected to other
    JTAG circuitry, the JTD bit should be
    set to one. The reason for this is to avoid static
    current at the TDO pin in the JTAG interface.
    6 ISC2: Interrupt Sense Control 2
    The Asynchronous External Interrupt 2 is activated
    by the external pin INT2 if the SREG
    I-bit and the corresponding interrupt mask in GICR
    are set. If ISC2 is written to zero, a
    falling edge on INT2 activates the interrupt. If
    ISC2 is written to one, a rising edge on
    INT2 activates the interrupt.

    bits 4 to 0 are =0 if we have had a jmp to 0 instead
    of a reset.
    4 JTRF JTAG caused reset
    3 WDRF watch dog or Crash call (when crashcode is non-zero)
    2 BORF brown out
    1 EXTRF external reset
    0 PORF power on
    Cra crashcode, reason for Crash call (left behind by Crash):
    zeroed on startup after any RAM dump. This being
    zero shows that Crash was not called by the firmware.
    Codes 2 to 21 are for unused interrupts
    22 is for too many retries in void timer0_ovf_isr
    23 is for a too long message for the frame buffer
    in SendMsg
    24 is for a deliberate crash from the 'x' command
    30 to 59 are for RAMSCAN macro calls
    Lcyc last argument to Cyc call
    Serrs sending error count



    D RECORD FORMAT

    A heading line and then a sample line:
    D E C W R 1 c SKY AMB WIND w r HUM DEW CASE HEA BLKT H PWR WNDTD WDROP WAVG WDRY RHT AHT ASKY ACSE APSV ABLK AWND AVNE DKMPH VNE RWOSC D ADAY
    D 0 1 1 1 1 0 -39.1 0.8 2.5 N N 79 -2.4 8.7 0 -99.9 0 24.3 20.0 2 4 0 000 170 0200 0705 0955 1023 0385 0916 0.0 322 13649 1 0056

    D record type
    E SHT15 humidistat and ambient temperature sensor error code:
    For firmware versions < 54:
    0 = OK,
    1 = write failure for humidity,
    2 = measurement never finished for humidity.
    3 = write failure for ambient,
    4 = measurement never finished for ambient.

    For firmware versions >= 54:
    0 = OK,
    1 = write failure for humidity,
    2 = measurement never finished for humidity,
    3 = write failure for ambient,
    4 = measurement never finished for ambient,
    5 = data line was not high for humidity,
    6 = data line was not high for ambient.
    C CloudCond value
    W WindCond value
    R RainCond value
    1 SkyCond value for Cloud Sensor I programs
    c =0 normally, =1 if roof close was requested on this cycle
    SKY sky-ambient temperature, 999.9 saturated hot, -999.9 saturated cold, or -998.0 for wet
    AMB ambient temperature
    WIND wind speed or:
    For firmware versions < 56:
    -1. if still heating up,
    -2. if wet,
    -3. if the A/D from the wind probe is bad,
    -4. if the probe is not heating.

    For firmware versions >= 56:
    -1. if still heating up,
    -2. if wet,
    -3. no longer used,
    -4. if the probe is not heating,
    -5. if the A/D from the wind probe is low (shorted or connector reversed),
    -6. if the A/D from the wind probe is high (no probe).
    w 'N' when dry, 'W' when wet now, 'w' when wet in last minute
    r 'N' when no rain, 'R' when rain drops hit on this cycle, 'r' for drops in last minute
    HUM relative humidity in %
    DEW dew point temperature
    CASE thermopile case temperature, 999.9 saturated hot, -99.9 saturated cold
    HEA rain heater PWM percentage of ON time
    BLKT calibration black body temperature (factory only), 999.9 saturated hot,
    -99.9 saturated cold
    H rain heater control state when directly controlled:
    =0 if too hot,
    =1 if at or nearly at requested temp.,
    =2 to 5 if too cold,
    =6 if cannot control due to a saturated case temperature (causes shutdown).
    =7 is used by tmain to indicate that normal control is being used instead
    of direct use of this
    PWR voltage actually on the +24V at the sensor head
    WNDTD anemometer tip temperature difference from ambient, limited by reducing
    anemometer heater power when 25C is reached
    WDROP maximum drop in wetness oscillator counts this cycle due to rain drops
    WAVG wetness oscillator count difference from base dry value
    WDRY wetness oscillator count difference for current dry from base dry value
    RHT rain heater PWM value
    AHT anemometer heater PWM value
    ASKY thermopile raw A/D output
    ACSE thermopile case thermistor raw A/D output
    APSV power supply voltage monitor raw A/D output
    ABLK calibration block thermistor raw A/D output
    AWND anemometer tip thermistor raw A/D output
    AVNE Davis vane raw A/D output (only for factory calibration)
    DKMPH external anemometer used (only for factory calibration)
    VNE external anemometer wind direction (only for factory calibration)
    RWOSC raw counts from the wetness oscillator
    D DayCond value
    ADAY daylight photodiode raw A/D output



    T RECORD FORMAT

    A heading line and then a sample line:
    T Ser# Firmw Serrs Cldy VCldy Windy VWindy Rain Wet DC Day Vday Ty SNBot SNTop EV WCC
    T 00501 00057 00000 -25.0 -10.0 10.0 25.0 12 100 0 12 20 3 1 576 2 0

    T record type
    Ser# serial number
    Firmw firmware version
    Serrs sending error count
    Cldy clear/cloudy threshold
    VCldy cloudy/very cloudy threshold
    Windy calm/windy threshold
    VWindy windy/very windy threshold
    Rain rain threshold
    Wet wet threshold
    DC daylight code, daylight hardware is not present if == 0xff,
    present at X1 gain if == 0, X11 gain if == 1
    Day dark/bright threshold
    Vday bright/very bright threshold
    Ty type of CS II (eepxx file type number) or 0xff if not set
    SNBot lowest serial number that the eep file used applies for,
    or 0xffff if not set
    SNTop highest serial number that the eep file used applies for,
    or 0xffff if not set
    EV eepxx file version number or 0xff if not set
    WCC wetness sensor calibration curve type. =0xff
    for not set, =0 for DLP05LC type, =1 for BAV99 type.



    K RECORD FORMAT

    A heading line and then a sample line:
    K V Factr Rawav Case Ambt Nomos Oscdry Minwav Dif
    K 1 1.023 13534 27.1 22.9 13230 176 32767

    K record type
    V =1 if wetness oscillator is calibrated, =0 if not
    Factr wetoscfactor is computed during calibration when the rain sensor is dry and
    at room temperature. wetoscfactor = rawwetavg/NominalOsc. This compensates
    for the variation in frequency due to the construction of an individual rain sensor
    Rawav rawwetavg, wetoscfactor = rawwetavg/NominalOsc. This compensates
    for the variation in frequency due to the construction of an individual rain sensor
    Case thermopile case temperature at wetness oscillator calibration
    Ambt ambient temperature at wetness oscillator calibration
    Nomos NominalOsc returns the expected wetness oscillator count for a nominal wetness
    sensor that is dry and at the current temperatures
    Oscdry wetoscdry is the best estimate we can do of wetavg when the rain sensor is dry. It
    should be close to zero and it represents the residual error after we have
    handled all of the computable error sources
    Minwav lowest (dryest) wetavg in this 2 hour interval
    Dif dif = minwetavg - ewetoscdry
    Type 'U' if this is a normal wetness update, 'M' if a full wetness recalibrate,
    binary zero if a normal periodic log report



    W RECORD FORMAT

    A heading line and then a sample line:
    W Case Ambt Wavgw Wavgc Nomos Rawwt Wetav
    W 0.0 0.0 0 0 0 13312 32767

    W record type, data for the last NominalOsc+ computation.
    Case thermopile case temperature
    Ambt ambient temperature
    Wavgw wavgwarm curve fit result
    Wavgc wavgcold curve fit result
    Nomos expected wetness oscillator count for a nominal wetness
    sensor that is dry
    Rawwt rawwetavg, wetavg = NominalOsc - (rawwetavg/wetoscfactor)
    Wetav wetavg = NominalOsc - (rawwetavg/wetoscfactor)



    C RECORD FORMAT

    A heading line and then a sample line:
    C V K d offs
    C 1 -3.437e-7 0.280 -2.00

    C record type, thermopile calibration data
    V =1 if the thermopile is calibrated, =0 if not
    K bestK
    d bestd
    offs bestoffs
     

Share This Page